agent-dealer 1.4.4 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/server/dist/adapters/muse-capability.js +81 -8
- package/bundle/server/dist/adapters/muse-capability.test.js +89 -1
- package/bundle/server/dist/coordinator/commands.js +2 -1
- package/bundle/server/package.json +2 -2
- package/bundle/server/static-ui/assets/index-2IuALSbV.js +64 -0
- package/bundle/server/static-ui/assets/index-MgimDoh2.css +1 -0
- package/bundle/server/static-ui/index.html +2 -2
- package/bundle/shared/package.json +1 -1
- package/dist/bin.js +0 -0
- package/package.json +2 -3
- package/bundle/server/dist/adapters/authority-lifecycle.js +0 -289
- package/bundle/server/dist/adapters/execution-authority.js +0 -103
- package/bundle/server/dist/adapters/execution-authority.test.js +0 -166
- package/bundle/server/dist/adapters/external.js +0 -20
- package/bundle/server/dist/coordinator/authority-recovery.integration.test.js +0 -661
- package/bundle/server/dist/coordinator/dispatcher.js +0 -58
- package/bundle/server/dist/coordinator/dispatcher.test.js +0 -81
- package/bundle/server/dist/coordinator/intent-forecast.js +0 -13
- package/bundle/server/dist/coordinator/intent-forecast.test.js +0 -34
- package/bundle/server/dist/coordinator/session-lifecycle.integration.test.js +0 -127
- package/bundle/server/dist/coordinator/session-lifecycle.js +0 -280
- package/bundle/server/dist/coordinator/session-lifecycle.test.js +0 -121
- package/bundle/server/dist/db/authority-attempts-stale-at-migration.test.js +0 -65
- package/bundle/server/dist/intake/agent-routing.js +0 -32
- package/bundle/server/dist/queue/answers.test.js +0 -117
- package/bundle/server/dist/queue/dispatcher-recovery.test.js +0 -37
- package/bundle/server/dist/queue/dispatcher.js +0 -597
- package/bundle/server/dist/queue/plan-delegation.js +0 -27
- package/bundle/server/dist/queue/plan-delegation.test.js +0 -61
- package/bundle/server/dist/queue/plan-gate.test.js +0 -55
- package/bundle/server/dist/queue/result-qa.js +0 -66
- package/bundle/server/dist/queue/result-qa.test.js +0 -146
- package/bundle/server/dist/repository/authority-attempts.js +0 -189
- package/bundle/server/dist/repository/result-qa.js +0 -37
- package/bundle/server/dist/runners/codex-args.js +0 -59
- package/bundle/server/dist/runners/codex-args.test.js +0 -72
- package/bundle/server/dist/runners/codex-resume.test.js +0 -19
- package/bundle/server/dist/runners/codex.js +0 -46
- package/bundle/server/dist/runners/muse-code-settings.js +0 -23
- package/bundle/server/dist/runners/muse-code-settings.test.js +0 -18
- package/bundle/server/dist/runners/persist.js +0 -142
- package/bundle/server/dist/runners/qa.js +0 -54
- package/bundle/server/dist/runners/run-context.js +0 -183
- package/bundle/server/dist/runners/stream-json.test.js +0 -95
- package/bundle/server/dist/trace-summary.js +0 -93
- package/bundle/server/dist/usage-summary.js +0 -61
- package/bundle/server/dist/usage-summary.test.js +0 -33
- package/bundle/server/static-ui/assets/index-CHCiztRI.css +0 -1
- package/bundle/server/static-ui/assets/index-CrLQFFpw.js +0 -64
- package/bundle/server/static-ui/fonts/Monaco.ttf +0 -0
- package/bundle/shared/dist/cursor-auth-health.d.ts +0 -12
- package/bundle/shared/dist/cursor-auth-health.js +0 -36
- package/bundle/shared/dist/cursor-auth-health.test.d.ts +0 -1
- package/bundle/shared/dist/cursor-auth-health.test.js +0 -40
- package/bundle/shared/dist/plan-triage.d.ts +0 -317
- package/bundle/shared/dist/plan-triage.js +0 -65
- package/bundle/shared/dist/plan-triage.test.d.ts +0 -1
- package/bundle/shared/dist/plan-triage.test.js +0 -66
- package/bundle/shared/dist/result-qa.d.ts +0 -45
- package/bundle/shared/dist/result-qa.js +0 -25
- package/bundle/shared/dist/result-qa.test.d.ts +0 -1
- package/bundle/shared/dist/result-qa.test.js +0 -60
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function s(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=s(d);fetch(d.href,f)}})();var td={exports:{}},Rs={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ix;function W0(){if(ix)return Rs;ix=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(u,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var x in d)x!=="key"&&(f[x]=d[x])}else f=d;return d=f.ref,{$$typeof:a,type:u,key:m,ref:d!==void 0?d:null,props:f}}return Rs.Fragment=l,Rs.jsx=s,Rs.jsxs=s,Rs}var sx;function P0(){return sx||(sx=1,td.exports=W0()),td.exports}var r=P0(),ad={exports:{}},ve={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var rx;function eb(){if(rx)return ve;rx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),D=Symbol.iterator;function X(N){return N===null||typeof N!="object"?null:(N=D&&N[D]||N["@@iterator"],typeof N=="function"?N:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,L={};function H(N,Z,W){this.props=N,this.context=Z,this.refs=L,this.updater=W||R}H.prototype.isReactComponent={},H.prototype.setState=function(N,Z){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,Z,"setState")},H.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function F(){}F.prototype=H.prototype;function P(N,Z,W){this.props=N,this.context=Z,this.refs=L,this.updater=W||R}var le=P.prototype=new F;le.constructor=P,$(le,H.prototype),le.isPureReactComponent=!0;var V=Array.isArray;function Ne(){}var I={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function De(N,Z,W){var ae=W.ref;return{$$typeof:a,type:N,key:Z,ref:ae!==void 0?ae:null,props:W}}function yt(N,Z){return De(N.type,Z,N.props)}function Nt(N){return typeof N=="object"&&N!==null&&N.$$typeof===a}function st(N){var Z={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(W){return Z[W]})}var ht=/\/+/g;function nt(N,Z){return typeof N=="object"&&N!==null&&N.key!=null?st(""+N.key):Z.toString(36)}function Ze(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(Ne,Ne):(N.status="pending",N.then(function(Z){N.status==="pending"&&(N.status="fulfilled",N.value=Z)},function(Z){N.status==="pending"&&(N.status="rejected",N.reason=Z)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function U(N,Z,W,ae,se){var B=typeof N;(B==="undefined"||B==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(B){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case a:case l:de=!0;break;case w:return de=N._init,U(de(N._payload),Z,W,ae,se)}}if(de)return se=se(N),de=ae===""?"."+nt(N,0):ae,V(se)?(W="",de!=null&&(W=de.replace(ht,"$&/")+"/"),U(se,Z,W,"",function(Ut){return Ut})):se!=null&&(Nt(se)&&(se=yt(se,W+(se.key==null||N&&N.key===se.key?"":(""+se.key).replace(ht,"$&/")+"/")+de)),Z.push(se)),1;de=0;var Ge=ae===""?".":ae+":";if(V(N))for(var Ue=0;Ue<N.length;Ue++)ae=N[Ue],B=Ge+nt(ae,Ue),de+=U(ae,Z,W,B,se);else if(Ue=X(N),typeof Ue=="function")for(N=Ue.call(N),Ue=0;!(ae=N.next()).done;)ae=ae.value,B=Ge+nt(ae,Ue++),de+=U(ae,Z,W,B,se);else if(B==="object"){if(typeof N.then=="function")return U(Ze(N),Z,W,ae,se);throw Z=String(N),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return de}function J(N,Z,W){if(N==null)return N;var ae=[],se=0;return U(N,ae,"","",function(B){return Z.call(W,B,se++)}),ae}function ue(N){if(N._status===-1){var Z=N._result;Z=Z(),Z.then(function(W){(N._status===0||N._status===-1)&&(N._status=1,N._result=W)},function(W){(N._status===0||N._status===-1)&&(N._status=2,N._result=W)}),N._status===-1&&(N._status=0,N._result=Z)}if(N._status===1)return N._result.default;throw N._result}var Ae=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Me={map:J,forEach:function(N,Z,W){J(N,function(){Z.apply(this,arguments)},W)},count:function(N){var Z=0;return J(N,function(){Z++}),Z},toArray:function(N){return J(N,function(Z){return Z})||[]},only:function(N){if(!Nt(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ve.Activity=j,ve.Children=Me,ve.Component=H,ve.Fragment=s,ve.Profiler=d,ve.PureComponent=P,ve.StrictMode=u,ve.Suspense=y,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ve.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},ve.cache=function(N){return function(){return N.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(N,Z,W){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=$({},N.props),se=N.key;if(Z!=null)for(B in Z.key!==void 0&&(se=""+Z.key),Z)!ye.call(Z,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&Z.ref===void 0||(ae[B]=Z[B]);var B=arguments.length-2;if(B===1)ae.children=W;else if(1<B){for(var de=Array(B),Ge=0;Ge<B;Ge++)de[Ge]=arguments[Ge+2];ae.children=de}return De(N.type,se,ae)},ve.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},ve.createElement=function(N,Z,W){var ae,se={},B=null;if(Z!=null)for(ae in Z.key!==void 0&&(B=""+Z.key),Z)ye.call(Z,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(se[ae]=Z[ae]);var de=arguments.length-2;if(de===1)se.children=W;else if(1<de){for(var Ge=Array(de),Ue=0;Ue<de;Ue++)Ge[Ue]=arguments[Ue+2];se.children=Ge}if(N&&N.defaultProps)for(ae in de=N.defaultProps,de)se[ae]===void 0&&(se[ae]=de[ae]);return De(N,B,se)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(N){return{$$typeof:x,render:N}},ve.isValidElement=Nt,ve.lazy=function(N){return{$$typeof:w,_payload:{_status:-1,_result:N},_init:ue}},ve.memo=function(N,Z){return{$$typeof:v,type:N,compare:Z===void 0?null:Z}},ve.startTransition=function(N){var Z=I.T,W={};I.T=W;try{var ae=N(),se=I.S;se!==null&&se(W,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(Ne,Ae)}catch(B){Ae(B)}finally{Z!==null&&W.types!==null&&(Z.types=W.types),I.T=Z}},ve.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ve.use=function(N){return I.H.use(N)},ve.useActionState=function(N,Z,W){return I.H.useActionState(N,Z,W)},ve.useCallback=function(N,Z){return I.H.useCallback(N,Z)},ve.useContext=function(N){return I.H.useContext(N)},ve.useDebugValue=function(){},ve.useDeferredValue=function(N,Z){return I.H.useDeferredValue(N,Z)},ve.useEffect=function(N,Z){return I.H.useEffect(N,Z)},ve.useEffectEvent=function(N){return I.H.useEffectEvent(N)},ve.useId=function(){return I.H.useId()},ve.useImperativeHandle=function(N,Z,W){return I.H.useImperativeHandle(N,Z,W)},ve.useInsertionEffect=function(N,Z){return I.H.useInsertionEffect(N,Z)},ve.useLayoutEffect=function(N,Z){return I.H.useLayoutEffect(N,Z)},ve.useMemo=function(N,Z){return I.H.useMemo(N,Z)},ve.useOptimistic=function(N,Z){return I.H.useOptimistic(N,Z)},ve.useReducer=function(N,Z,W){return I.H.useReducer(N,Z,W)},ve.useRef=function(N){return I.H.useRef(N)},ve.useState=function(N){return I.H.useState(N)},ve.useSyncExternalStore=function(N,Z,W){return I.H.useSyncExternalStore(N,Z,W)},ve.useTransition=function(){return I.H.useTransition()},ve.version="19.2.7",ve}var ux;function Xd(){return ux||(ux=1,ad.exports=eb()),ad.exports}var b=Xd(),nd={exports:{}},Cs={},ld={exports:{}},id={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var ox;function tb(){return ox||(ox=1,(function(a){function l(U,J){var ue=U.length;U.push(J);e:for(;0<ue;){var Ae=ue-1>>>1,Me=U[Ae];if(0<d(Me,J))U[Ae]=J,U[ue]=Me,ue=Ae;else break e}}function s(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var J=U[0],ue=U.pop();if(ue!==J){U[0]=ue;e:for(var Ae=0,Me=U.length,N=Me>>>1;Ae<N;){var Z=2*(Ae+1)-1,W=U[Z],ae=Z+1,se=U[ae];if(0>d(W,ue))ae<Me&&0>d(se,W)?(U[Ae]=se,U[ae]=ue,Ae=ae):(U[Ae]=W,U[Z]=ue,Ae=Z);else if(ae<Me&&0>d(se,ue))U[Ae]=se,U[ae]=ue,Ae=ae;else break e}}return J}function d(U,J){var ue=U.sortIndex-J.sortIndex;return ue!==0?ue:U.id-J.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,x=m.now();a.unstable_now=function(){return m.now()-x}}var y=[],v=[],w=1,j=null,D=3,X=!1,R=!1,$=!1,L=!1,H=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function le(U){for(var J=s(v);J!==null;){if(J.callback===null)u(v);else if(J.startTime<=U)u(v),J.sortIndex=J.expirationTime,l(y,J);else break;J=s(v)}}function V(U){if($=!1,le(U),!R)if(s(y)!==null)R=!0,Ne||(Ne=!0,st());else{var J=s(v);J!==null&&Ze(V,J.startTime-U)}}var Ne=!1,I=-1,ye=5,De=-1;function yt(){return L?!0:!(a.unstable_now()-De<ye)}function Nt(){if(L=!1,Ne){var U=a.unstable_now();De=U;var J=!0;try{e:{R=!1,$&&($=!1,F(I),I=-1),X=!0;var ue=D;try{t:{for(le(U),j=s(y);j!==null&&!(j.expirationTime>U&&yt());){var Ae=j.callback;if(typeof Ae=="function"){j.callback=null,D=j.priorityLevel;var Me=Ae(j.expirationTime<=U);if(U=a.unstable_now(),typeof Me=="function"){j.callback=Me,le(U),J=!0;break t}j===s(y)&&u(y),le(U)}else u(y);j=s(y)}if(j!==null)J=!0;else{var N=s(v);N!==null&&Ze(V,N.startTime-U),J=!1}}break e}finally{j=null,D=ue,X=!1}J=void 0}}finally{J?st():Ne=!1}}}var st;if(typeof P=="function")st=function(){P(Nt)};else if(typeof MessageChannel<"u"){var ht=new MessageChannel,nt=ht.port2;ht.port1.onmessage=Nt,st=function(){nt.postMessage(null)}}else st=function(){H(Nt,0)};function Ze(U,J){I=H(function(){U(a.unstable_now())},J)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ye=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return D},a.unstable_next=function(U){switch(D){case 1:case 2:case 3:var J=3;break;default:J=D}var ue=D;D=J;try{return U()}finally{D=ue}},a.unstable_requestPaint=function(){L=!0},a.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ue=D;D=U;try{return J()}finally{D=ue}},a.unstable_scheduleCallback=function(U,J,ue){var Ae=a.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Ae+ue:Ae):ue=Ae,U){case 1:var Me=-1;break;case 2:Me=250;break;case 5:Me=1073741823;break;case 4:Me=1e4;break;default:Me=5e3}return Me=ue+Me,U={id:w++,callback:J,priorityLevel:U,startTime:ue,expirationTime:Me,sortIndex:-1},ue>Ae?(U.sortIndex=ue,l(v,U),s(y)===null&&U===s(v)&&($?(F(I),I=-1):$=!0,Ze(V,ue-Ae))):(U.sortIndex=Me,l(y,U),R||X||(R=!0,Ne||(Ne=!0,st()))),U},a.unstable_shouldYield=yt,a.unstable_wrapCallback=function(U){var J=D;return function(){var ue=D;D=J;try{return U.apply(this,arguments)}finally{D=ue}}}})(id)),id}var cx;function ab(){return cx||(cx=1,ld.exports=tb()),ld.exports}var sd={exports:{}},Dt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var dx;function nb(){if(dx)return Dt;dx=1;var a=Xd();function l(y){var v="https://react.dev/errors/"+y;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)v+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var u={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(y,v,w){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:y,containerInfo:v,implementation:w}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,v){if(y==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Dt.createPortal=function(y,v){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(l(299));return f(y,v,null,w)},Dt.flushSync=function(y){var v=m.T,w=u.p;try{if(m.T=null,u.p=2,y)return y()}finally{m.T=v,u.p=w,u.d.f()}},Dt.preconnect=function(y,v){typeof y=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(y,v))},Dt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},Dt.preinit=function(y,v){if(typeof y=="string"&&v&&typeof v.as=="string"){var w=v.as,j=x(w,v.crossOrigin),D=typeof v.integrity=="string"?v.integrity:void 0,X=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;w==="style"?u.d.S(y,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:j,integrity:D,fetchPriority:X}):w==="script"&&u.d.X(y,{crossOrigin:j,integrity:D,fetchPriority:X,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Dt.preinitModule=function(y,v){if(typeof y=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var w=x(v.as,v.crossOrigin);u.d.M(y,{crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&u.d.M(y)},Dt.preload=function(y,v){if(typeof y=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var w=v.as,j=x(w,v.crossOrigin);u.d.L(y,w,{crossOrigin:j,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},Dt.preloadModule=function(y,v){if(typeof y=="string")if(v){var w=x(v.as,v.crossOrigin);u.d.m(y,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else u.d.m(y)},Dt.requestFormReset=function(y){u.d.r(y)},Dt.unstable_batchedUpdates=function(y,v){return y(v)},Dt.useFormState=function(y,v,w){return m.H.useFormState(y,v,w)},Dt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Dt.version="19.2.7",Dt}var fx;function lb(){if(fx)return sd.exports;fx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),sd.exports=nb(),sd.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var hx;function ib(){if(hx)return Cs;hx=1;var a=ab(),l=Xd(),s=lb();function u(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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(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 m(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 x(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(f(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,i=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(i=o.return,i!==null){n=i;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return y(o),e;if(c===i)return y(o),t;c=c.sibling}throw Error(u(188))}if(n.return!==i.return)n=o,i=c;else{for(var h=!1,g=o.child;g;){if(g===n){h=!0,n=o,i=c;break}if(g===i){h=!0,i=o,n=c;break}g=g.sibling}if(!h){for(g=c.child;g;){if(g===n){h=!0,n=c,i=o;break}if(g===i){h=!0,i=c,n=o;break}g=g.sibling}if(!h)throw Error(u(189))}}if(n.alternate!==i)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,D=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),P=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),Ne=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),De=Symbol.for("react.activity"),yt=Symbol.for("react.memo_cache_sentinel"),Nt=Symbol.iterator;function st(e){return e===null||typeof e!="object"?null:(e=Nt&&e[Nt]||e["@@iterator"],typeof e=="function"?e:null)}var ht=Symbol.for("react.client.reference");function nt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ht?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case H:return"Profiler";case L:return"StrictMode";case V:return"Suspense";case Ne:return"SuspenseList";case De:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case P:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:nt(e.type)||"Memo";case ye:t=e._payload,e=e._init;try{return nt(e(t))}catch{}}return null}var Ze=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},Ae=[],Me=-1;function N(e){return{current:e}}function Z(e){0>Me||(e.current=Ae[Me],Ae[Me]=null,Me--)}function W(e,t){Me++,Ae[Me]=e.current,e.current=t}var ae=N(null),se=N(null),B=N(null),de=N(null);function Ge(e,t){switch(W(B,t),W(se,e),W(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ep(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ep(t),e=Rp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z(ae),W(ae,e)}function Ue(){Z(ae),Z(se),Z(B)}function Ut(e){e.memoizedState!==null&&W(de,e);var t=ae.current,n=Rp(t,e.type);t!==n&&(W(se,e),W(ae,n))}function Ra(e){se.current===e&&(Z(ae),Z(se)),de.current===e&&(Z(de),_s._currentValue=ue)}var ua,$a;function Be(e){if(ua===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ua=t&&t[1]||"",$a=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ua+e+$a}var Va=!1;function ot(e,t){if(!e||Va)return"";Va=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(M){var O=M}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(M){O=M}e.call(Q.prototype)}}else{try{throw Error()}catch(M){O=M}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(M){if(M&&O&&typeof M.stack=="string")return[M.stack,O.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),h=c[0],g=c[1];if(h&&g){var S=h.split(`
|
|
44
|
+
`),T=g.split(`
|
|
45
|
+
`);for(o=i=0;i<S.length&&!S[i].includes("DetermineComponentFrameRoot");)i++;for(;o<T.length&&!T[o].includes("DetermineComponentFrameRoot");)o++;if(i===S.length||o===T.length)for(i=S.length-1,o=T.length-1;1<=i&&0<=o&&S[i]!==T[o];)o--;for(;1<=i&&0<=o;i--,o--)if(S[i]!==T[o]){if(i!==1||o!==1)do if(i--,o--,0>o||S[i]!==T[o]){var q=`
|
|
46
|
+
`+S[i].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=i&&0<=o);break}}}finally{Va=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Be(n):""}function vt(e,t){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be("Lazy");case 13:return e.child!==t&&t!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return ot(e.type,!1);case 11:return ot(e.type.render,!1);case 1:return ot(e.type,!0);case 31:return Be("Activity");default:return""}}function Tn(e){try{var t="",n=null;do t+=vt(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var $e=Object.prototype.hasOwnProperty,Ya=a.unstable_scheduleCallback,On=a.unstable_cancelCallback,tn=a.unstable_shouldYield,an=a.unstable_requestPaint,tt=a.unstable_now,Vl=a.unstable_getCurrentPriorityLevel,Ca=a.unstable_ImmediatePriority,Ln=a.unstable_UserBlockingPriority,nn=a.unstable_NormalPriority,Mn=a.unstable_LowPriority,Ht=a.unstable_IdlePriority,Yl=a.log,qi=a.unstable_setDisableYieldValue,Za=null,at=null;function Mt(e){if(typeof Yl=="function"&&qi(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Za,e)}catch{}}var mt=Math.clz32?Math.clz32:Dn,oa=Math.log,We=Math.LN2;function Dn(e){return e>>>=0,e===0?32:31-(oa(e)/We|0)|0}var Ga=256,Ta=262144,Qa=4194304;function ca(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 Un(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var g=i&134217727;return g!==0?(i=g&~c,i!==0?o=ca(i):(h&=g,h!==0?o=ca(h):n||(n=g&~e,n!==0&&(o=ca(n))))):(g=i&~c,g!==0?o=ca(g):h!==0?o=ca(h):n||(n=i&~e,n!==0&&(o=ca(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 ln(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Rt(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 Zl(){var e=Qa;return Qa<<=1,(Qa&62914560)===0&&(Qa=4194304),e}function hl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hi(e,t,n,i,o,c){var h=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 g=e.entanglements,S=e.expirationTimes,T=e.hiddenUpdates;for(n=h&~n;0<n;){var q=31-mt(n),Q=1<<q;g[q]=0,S[q]=-1;var O=T[q];if(O!==null)for(T[q]=null,q=0;q<O.length;q++){var M=O[q];M!==null&&(M.lane&=-536870913)}n&=~Q}i!==0&&Gl(e,i,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Gl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-mt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function Ql(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-mt(n),o=1<<i;o&t|e[i]&t&&(e[i]|=t),n&=~o}}function ml(e,t){var n=t&-t;return n=(n&42)!==0?1:zn(n),(n&(e.suspendedLanes|t))!==0?0:n}function zn(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 pl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xl(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Wp(e.type))}function rn(e,t){var n=J.p;try{return J.p=e,t()}finally{J.p=n}}var $t=Math.random().toString(36).slice(2),ct="__reactFiber$"+$t,_t="__reactProps$"+$t,Oa="__reactContainer$"+$t,Y="__reactEvents$"+$t,je="__reactListeners$"+$t,E="__reactHandles$"+$t,ee="__reactResources$"+$t,Te="__reactMarker$"+$t;function Pe(e){delete e[ct],delete e[_t],delete e[Y],delete e[je],delete e[E]}function Vt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Oa]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Up(e);e!==null;){if(n=e[ct])return n;e=Up(e)}return t}e=n,n=e.parentNode}return null}function Il(e){if(e=e[ct]||e[Oa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $i(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Kl(e){var t=e[ee];return t||(t=e[ee]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[Te]=!0}var xf=new Set,yf={};function xl(e,t){Jl(e,t),Jl(e+"Capture",t)}function Jl(e,t){for(yf[e]=t,e=0;e<t.length;e++)xf.add(t[e])}var Yv=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]*$"),vf={},gf={};function Zv(e){return $e.call(gf,e)?!0:$e.call(vf,e)?!1:Yv.test(e)?gf[e]=!0:(vf[e]=!0,!1)}function Xs(e,t,n){if(Zv(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Is(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 un(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gv(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var o=i.get,c=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xu(e){if(!e._valueTracker){var t=bf(e)?"checked":"value";e._valueTracker=Gv(e,t,""+e[t])}}function wf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=bf(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Ks(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 Qv=/[\n"\\]/g;function fa(e){return e.replace(Qv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Iu(e,t,n,i,o,c,h,g){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Ku(e,h,da(t)):n!=null?Ku(e,h,da(n)):i!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+da(g):e.removeAttribute("name")}function Sf(e,t,n,i,o,c,h,g){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)){Xu(e);return}n=n!=null?""+da(n):"",t=t!=null?""+da(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}i=i??o,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=g?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Xu(e)}function Ku(e,t,n){t==="number"&&Ks(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Fl(e,t,n,i){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&&i&&(e[n].defaultSelected=!0)}else{for(n=""+da(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,i&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function jf(e,t,n){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+da(n):""}function Nf(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(u(92));if(Ze(i)){if(1<i.length)throw Error(u(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=da(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Xu(e)}function Wl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xv=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 _f(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||Xv.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function kf(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var o in t)i=t[o],t.hasOwnProperty(o)&&n[o]!==i&&_f(e,o,i)}else for(var c in t)t.hasOwnProperty(c)&&_f(e,c,t[c])}function Ju(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 Iv=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"]]),Kv=/^[\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 Js(e){return Kv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function on(){}var Fu=null;function Wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pl=null,ei=null;function Af(e){var t=Il(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Iu(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="'+fa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var o=i[_t]||null;if(!o)throw Error(u(90));Iu(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&wf(i)}break e;case"textarea":jf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Fl(e,!!n.multiple,t,!1)}}}var Pu=!1;function Ef(e,t,n){if(Pu)return e(t,n);Pu=!0;try{var i=e(t);return i}finally{if(Pu=!1,(Pl!==null||ei!==null)&&(zr(),Pl&&(t=Pl,e=ei,ei=Pl=null,Af(t),e)))for(t=0;t<e.length;t++)Af(e[t])}}function Vi(e,t){var n=e.stateNode;if(n===null)return null;var i=n[_t]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eo=!1;if(cn)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){eo=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{eo=!1}var Bn=null,to=null,Fs=null;function Rf(){if(Fs)return Fs;var e,t=to,n=t.length,i,o="value"in Bn?Bn.value:Bn.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var h=n-e;for(i=1;i<=h&&t[n-i]===o[c-i];i++);return Fs=o.slice(e,1<i?1-i:void 0)}function Ws(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 Ps(){return!0}function Cf(){return!1}function Yt(e){function t(n,i,o,c,h){this._reactName=n,this._targetInst=o,this.type=i,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(c):c[g]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ps:Cf,this.isPropagationStopped=Cf,this}return j(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=Ps)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ps)},persist:function(){},isPersistent:Ps}),t}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},er=Yt(yl),Zi=j({},yl,{view:0,detail:0}),Jv=Yt(Zi),ao,no,Gi,tr=j({},Zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:io,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!==Gi&&(Gi&&e.type==="mousemove"?(ao=e.screenX-Gi.screenX,no=e.screenY-Gi.screenY):no=ao=0,Gi=e),ao)},movementY:function(e){return"movementY"in e?e.movementY:no}}),Tf=Yt(tr),Fv=j({},tr,{dataTransfer:0}),Wv=Yt(Fv),Pv=j({},Zi,{relatedTarget:0}),lo=Yt(Pv),eg=j({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),tg=Yt(eg),ag=j({},yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ng=Yt(ag),lg=j({},yl,{data:0}),Of=Yt(lg),ig={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sg={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"},rg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ug(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rg[e])?!!t[e]:!1}function io(){return ug}var og=j({},Zi,{key:function(e){if(e.key){var t=ig[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ws(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:io,charCode:function(e){return e.type==="keypress"?Ws(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ws(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),cg=Yt(og),dg=j({},tr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lf=Yt(dg),fg=j({},Zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:io}),hg=Yt(fg),mg=j({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),pg=Yt(mg),xg=j({},tr,{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}),yg=Yt(xg),vg=j({},yl,{newState:0,oldState:0}),gg=Yt(vg),bg=[9,13,27,32],so=cn&&"CompositionEvent"in window,Qi=null;cn&&"documentMode"in document&&(Qi=document.documentMode);var wg=cn&&"TextEvent"in window&&!Qi,Mf=cn&&(!so||Qi&&8<Qi&&11>=Qi),Df=" ",Uf=!1;function zf(e,t){switch(e){case"keyup":return bg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ti=!1;function Sg(e,t){switch(e){case"compositionend":return Bf(t);case"keypress":return t.which!==32?null:(Uf=!0,Df);case"textInput":return e=t.data,e===Df&&Uf?null:e;default:return null}}function jg(e,t){if(ti)return e==="compositionend"||!so&&zf(e,t)?(e=Rf(),Fs=to=Bn=null,ti=!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 Mf&&t.locale!=="ko"?null:t.data;default:return null}}var Ng={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 qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ng[e.type]:t==="textarea"}function Hf(e,t,n,i){Pl?ei?ei.push(i):ei=[i]:Pl=i,t=Zr(t,"onChange"),0<t.length&&(n=new er("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Xi=null,Ii=null;function _g(e){Sp(e,0)}function ar(e){var t=$i(e);if(wf(t))return e}function $f(e,t){if(e==="change")return t}var Vf=!1;if(cn){var ro;if(cn){var uo="oninput"in document;if(!uo){var Yf=document.createElement("div");Yf.setAttribute("oninput","return;"),uo=typeof Yf.oninput=="function"}ro=uo}else ro=!1;Vf=ro&&(!document.documentMode||9<document.documentMode)}function Zf(){Xi&&(Xi.detachEvent("onpropertychange",Gf),Ii=Xi=null)}function Gf(e){if(e.propertyName==="value"&&ar(Ii)){var t=[];Hf(t,Ii,e,Wu(e)),Ef(_g,t)}}function kg(e,t,n){e==="focusin"?(Zf(),Xi=t,Ii=n,Xi.attachEvent("onpropertychange",Gf)):e==="focusout"&&Zf()}function Ag(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ar(Ii)}function Eg(e,t){if(e==="click")return ar(t)}function Rg(e,t){if(e==="input"||e==="change")return ar(t)}function Cg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:Cg;function Ki(e,t){if(Ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var o=n[i];if(!$e.call(t,o)||!Ft(e[o],t[o]))return!1}return!0}function Qf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xf(e,t){var n=Qf(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qf(n)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ks(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=Ks(e.document)}return t}function oo(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 Tg=cn&&"documentMode"in document&&11>=document.documentMode,ai=null,co=null,Ji=null,fo=!1;function Jf(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fo||ai==null||ai!==Ks(i)||(i=ai,"selectionStart"in i&&oo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ji&&Ki(Ji,i)||(Ji=i,i=Zr(co,"onSelect"),0<i.length&&(t=new er("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ai)))}function vl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ni={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionrun:vl("Transition","TransitionRun"),transitionstart:vl("Transition","TransitionStart"),transitioncancel:vl("Transition","TransitionCancel"),transitionend:vl("Transition","TransitionEnd")},ho={},Ff={};cn&&(Ff=document.createElement("div").style,"AnimationEvent"in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),"TransitionEvent"in window||delete ni.transitionend.transition);function gl(e){if(ho[e])return ho[e];if(!ni[e])return e;var t=ni[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ff)return ho[e]=t[n];return e}var Wf=gl("animationend"),Pf=gl("animationiteration"),eh=gl("animationstart"),Og=gl("transitionrun"),Lg=gl("transitionstart"),Mg=gl("transitioncancel"),th=gl("transitionend"),ah=new Map,mo="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(" ");mo.push("scrollEnd");function La(e,t){ah.set(e,t),xl(t,[e])}var nr=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)},ha=[],li=0,po=0;function lr(){for(var e=li,t=po=li=0;t<e;){var n=ha[t];ha[t++]=null;var i=ha[t];ha[t++]=null;var o=ha[t];ha[t++]=null;var c=ha[t];if(ha[t++]=null,i!==null&&o!==null){var h=i.pending;h===null?o.next=o:(o.next=h.next,h.next=o),i.pending=o}c!==0&&nh(n,o,c)}}function ir(e,t,n,i){ha[li++]=e,ha[li++]=t,ha[li++]=n,ha[li++]=i,po|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function xo(e,t,n,i){return ir(e,t,n,i),sr(e)}function bl(e,t){return ir(e,null,null,t),sr(e)}function nh(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var o=!1,c=e.return;c!==null;)c.childLanes|=n,i=c.alternate,i!==null&&(i.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-mt(n),e=c.hiddenUpdates,i=e[o],i===null?e[o]=[t]:i.push(t),t.lane=n|536870912),c):null}function sr(e){if(50<vs)throw vs=0,_c=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ii={};function Dg(e,t,n,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,n,i){return new Dg(e,t,n,i)}function yo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dn(e,t){var n=e.alternate;return n===null?(n=Wt(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 lh(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 rr(e,t,n,i,o,c){var h=0;if(i=e,typeof e=="function")yo(e)&&(h=1);else if(typeof e=="string")h=H0(e,n,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case De:return e=Wt(31,n,t,o),e.elementType=De,e.lanes=c,e;case $:return wl(n.children,o,c,t);case L:h=8,o|=24;break;case H:return e=Wt(12,n,t,o|2),e.elementType=H,e.lanes=c,e;case V:return e=Wt(13,n,t,o),e.elementType=V,e.lanes=c,e;case Ne:return e=Wt(19,n,t,o),e.elementType=Ne,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:h=10;break e;case F:h=9;break e;case le:h=11;break e;case I:h=14;break e;case ye:h=16,i=null;break e}h=29,n=Error(u(130,e===null?"null":typeof e,"")),i=null}return t=Wt(h,n,t,o),t.elementType=e,t.type=i,t.lanes=c,t}function wl(e,t,n,i){return e=Wt(7,e,i,t),e.lanes=n,e}function vo(e,t,n){return e=Wt(6,e,null,t),e.lanes=n,e}function ih(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function go(e,t,n){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var sh=new WeakMap;function ma(e,t){if(typeof e=="object"&&e!==null){var n=sh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Tn(t)},sh.set(e,t),t)}return{value:e,source:t,stack:Tn(t)}}var si=[],ri=0,ur=null,Fi=0,pa=[],xa=0,qn=null,Xa=1,Ia="";function fn(e,t){si[ri++]=Fi,si[ri++]=ur,ur=e,Fi=t}function rh(e,t,n){pa[xa++]=Xa,pa[xa++]=Ia,pa[xa++]=qn,qn=e;var i=Xa;e=Ia;var o=32-mt(i)-1;i&=~(1<<o),n+=1;var c=32-mt(t)+o;if(30<c){var h=o-o%5;c=(i&(1<<h)-1).toString(32),i>>=h,o-=h,Xa=1<<32-mt(t)+o|n<<o|i,Ia=c+e}else Xa=1<<c|n<<o|i,Ia=e}function bo(e){e.return!==null&&(fn(e,1),rh(e,1,0))}function wo(e){for(;e===ur;)ur=si[--ri],si[ri]=null,Fi=si[--ri],si[ri]=null;for(;e===qn;)qn=pa[--xa],pa[xa]=null,Ia=pa[--xa],pa[xa]=null,Xa=pa[--xa],pa[xa]=null}function uh(e,t){pa[xa++]=Xa,pa[xa++]=Ia,pa[xa++]=qn,Xa=t.id,Ia=t.overflow,qn=e}var Ct=null,lt=null,Oe=!1,Hn=null,ya=!1,So=Error(u(519));function $n(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wi(ma(t,e)),So}function oh(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[ct]=e,t[_t]=i,n){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(n=0;n<bs.length;n++)ke(bs[n],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),Sf(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),Nf(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||kp(t.textContent,n)?(i.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),i.onScroll!=null&&ke("scroll",t),i.onScrollEnd!=null&&ke("scrollend",t),i.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||$n(e,!0)}function ch(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:ya=!1;return;case 27:case 3:ya=!0;return;default:Ct=Ct.return}}function ui(e){if(e!==Ct)return!1;if(!Oe)return ch(e),Oe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Hc(e.type,e.memoizedProps)),n=!n),n&<&&$n(e),ch(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));lt=Dp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));lt=Dp(e)}else t===27?(t=lt,tl(e.type)?(e=Gc,Gc=null,lt=e):lt=t):lt=Ct?ga(e.stateNode.nextSibling):null;return!0}function Sl(){lt=Ct=null,Oe=!1}function jo(){var e=Hn;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Hn=null),e}function Wi(e){Hn===null?Hn=[e]:Hn.push(e)}var No=N(null),jl=null,hn=null;function Vn(e,t,n){W(No,t._currentValue),t._currentValue=n}function mn(e){e._currentValue=No.current,Z(No)}function _o(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function ko(e,t,n,i){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var h=o.child;c=c.firstContext;e:for(;c!==null;){var g=c;c=o;for(var S=0;S<t.length;S++)if(g.context===t[S]){c.lanes|=n,g=c.alternate,g!==null&&(g.lanes|=n),_o(c.return,n,e),i||(h=null);break e}c=g.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(u(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),_o(h,n,e),h=null}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===e){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}}function oi(e,t,n,i){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 h=o.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var g=o.type;Ft(o.pendingProps.value,h.value)||(e!==null?e.push(g):e=[g])}}else if(o===de.current){if(h=o.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}o=o.return}e!==null&&ko(t,e,n,i),t.flags|=262144}function or(e){for(e=e.firstContext;e!==null;){if(!Ft(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Nl(e){jl=e,hn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return dh(jl,e)}function cr(e,t){return jl===null&&Nl(e),dh(e,t)}function dh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},hn===null){if(e===null)throw Error(u(308));hn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else hn=hn.next=t;return n}var Ug=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},zg=a.unstable_scheduleCallback,Bg=a.unstable_NormalPriority,gt={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ao(){return{controller:new Ug,data:new Map,refCount:0}}function Pi(e){e.refCount--,e.refCount===0&&zg(Bg,function(){e.controller.abort()})}var es=null,Eo=0,ci=0,di=null;function qg(e,t){if(es===null){var n=es=[];Eo=0,ci=Tc(),di={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Eo++,t.then(fh,fh),t}function fh(){if(--Eo===0&&es!==null){di!==null&&(di.status="fulfilled");var e=es;es=null,ci=0,di=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Hg(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(i.status="rejected",i.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),i}var hh=U.S;U.S=function(e,t){Jm=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qg(e,t),hh!==null&&hh(e,t)};var _l=N(null);function Ro(){var e=_l.current;return e!==null?e:et.pooledCache}function dr(e,t){t===null?W(_l,_l.current):W(_l,t.pool)}function mh(){var e=Ro();return e===null?null:{parent:gt._currentValue,pool:e}}var fi=Error(u(460)),Co=Error(u(474)),fr=Error(u(542)),hr={then:function(){}};function ph(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vh(e),e;default:if(typeof t.status=="string")t.then(on,on);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=i}},function(i){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vh(e),e}throw Al=t,fi}}function kl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Al=n,fi):n}}var Al=null;function yh(){if(Al===null)throw Error(u(459));var e=Al;return Al=null,e}function vh(e){if(e===fi||e===fr)throw Error(u(483))}var hi=null,ts=0;function mr(e){var t=ts;return ts+=1,hi===null&&(hi=[]),xh(hi,e,t)}function as(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function pr(e,t){throw t.$$typeof===D?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gh(e){function t(k,_){if(e){var C=k.deletions;C===null?(k.deletions=[_],k.flags|=16):C.push(_)}}function n(k,_){if(!e)return null;for(;_!==null;)t(k,_),_=_.sibling;return null}function i(k){for(var _=new Map;k!==null;)k.key!==null?_.set(k.key,k):_.set(k.index,k),k=k.sibling;return _}function o(k,_){return k=dn(k,_),k.index=0,k.sibling=null,k}function c(k,_,C){return k.index=C,e?(C=k.alternate,C!==null?(C=C.index,C<_?(k.flags|=67108866,_):C):(k.flags|=67108866,_)):(k.flags|=1048576,_)}function h(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function g(k,_,C,G){return _===null||_.tag!==6?(_=vo(C,k.mode,G),_.return=k,_):(_=o(_,C),_.return=k,_)}function S(k,_,C,G){var fe=C.type;return fe===$?q(k,_,C.props.children,G,C.key):_!==null&&(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&kl(fe)===_.type)?(_=o(_,C.props),as(_,C),_.return=k,_):(_=rr(C.type,C.key,C.props,null,k.mode,G),as(_,C),_.return=k,_)}function T(k,_,C,G){return _===null||_.tag!==4||_.stateNode.containerInfo!==C.containerInfo||_.stateNode.implementation!==C.implementation?(_=go(C,k.mode,G),_.return=k,_):(_=o(_,C.children||[]),_.return=k,_)}function q(k,_,C,G,fe){return _===null||_.tag!==7?(_=wl(C,k.mode,G,fe),_.return=k,_):(_=o(_,C),_.return=k,_)}function Q(k,_,C){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=vo(""+_,k.mode,C),_.return=k,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case X:return C=rr(_.type,_.key,_.props,null,k.mode,C),as(C,_),C.return=k,C;case R:return _=go(_,k.mode,C),_.return=k,_;case ye:return _=kl(_),Q(k,_,C)}if(Ze(_)||st(_))return _=wl(_,k.mode,C,null),_.return=k,_;if(typeof _.then=="function")return Q(k,mr(_),C);if(_.$$typeof===P)return Q(k,cr(k,_),C);pr(k,_)}return null}function O(k,_,C,G){var fe=_!==null?_.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return fe!==null?null:g(k,_,""+C,G);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case X:return C.key===fe?S(k,_,C,G):null;case R:return C.key===fe?T(k,_,C,G):null;case ye:return C=kl(C),O(k,_,C,G)}if(Ze(C)||st(C))return fe!==null?null:q(k,_,C,G,null);if(typeof C.then=="function")return O(k,_,mr(C),G);if(C.$$typeof===P)return O(k,_,cr(k,C),G);pr(k,C)}return null}function M(k,_,C,G,fe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return k=k.get(C)||null,g(_,k,""+G,fe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case X:return k=k.get(G.key===null?C:G.key)||null,S(_,k,G,fe);case R:return k=k.get(G.key===null?C:G.key)||null,T(_,k,G,fe);case ye:return G=kl(G),M(k,_,C,G,fe)}if(Ze(G)||st(G))return k=k.get(C)||null,q(_,k,G,fe,null);if(typeof G.then=="function")return M(k,_,C,mr(G),fe);if(G.$$typeof===P)return M(k,_,C,cr(_,G),fe);pr(_,G)}return null}function re(k,_,C,G){for(var fe=null,qe=null,oe=_,we=_=0,Re=null;oe!==null&&we<C.length;we++){oe.index>we?(Re=oe,oe=null):Re=oe.sibling;var He=O(k,oe,C[we],G);if(He===null){oe===null&&(oe=Re);break}e&&oe&&He.alternate===null&&t(k,oe),_=c(He,_,we),qe===null?fe=He:qe.sibling=He,qe=He,oe=Re}if(we===C.length)return n(k,oe),Oe&&fn(k,we),fe;if(oe===null){for(;we<C.length;we++)oe=Q(k,C[we],G),oe!==null&&(_=c(oe,_,we),qe===null?fe=oe:qe.sibling=oe,qe=oe);return Oe&&fn(k,we),fe}for(oe=i(oe);we<C.length;we++)Re=M(oe,k,we,C[we],G),Re!==null&&(e&&Re.alternate!==null&&oe.delete(Re.key===null?we:Re.key),_=c(Re,_,we),qe===null?fe=Re:qe.sibling=Re,qe=Re);return e&&oe.forEach(function(sl){return t(k,sl)}),Oe&&fn(k,we),fe}function me(k,_,C,G){if(C==null)throw Error(u(151));for(var fe=null,qe=null,oe=_,we=_=0,Re=null,He=C.next();oe!==null&&!He.done;we++,He=C.next()){oe.index>we?(Re=oe,oe=null):Re=oe.sibling;var sl=O(k,oe,He.value,G);if(sl===null){oe===null&&(oe=Re);break}e&&oe&&sl.alternate===null&&t(k,oe),_=c(sl,_,we),qe===null?fe=sl:qe.sibling=sl,qe=sl,oe=Re}if(He.done)return n(k,oe),Oe&&fn(k,we),fe;if(oe===null){for(;!He.done;we++,He=C.next())He=Q(k,He.value,G),He!==null&&(_=c(He,_,we),qe===null?fe=He:qe.sibling=He,qe=He);return Oe&&fn(k,we),fe}for(oe=i(oe);!He.done;we++,He=C.next())He=M(oe,k,we,He.value,G),He!==null&&(e&&He.alternate!==null&&oe.delete(He.key===null?we:He.key),_=c(He,_,we),qe===null?fe=He:qe.sibling=He,qe=He);return e&&oe.forEach(function(F0){return t(k,F0)}),Oe&&fn(k,we),fe}function Fe(k,_,C,G){if(typeof C=="object"&&C!==null&&C.type===$&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case X:e:{for(var fe=C.key;_!==null;){if(_.key===fe){if(fe=C.type,fe===$){if(_.tag===7){n(k,_.sibling),G=o(_,C.props.children),G.return=k,k=G;break e}}else if(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&kl(fe)===_.type){n(k,_.sibling),G=o(_,C.props),as(G,C),G.return=k,k=G;break e}n(k,_);break}else t(k,_);_=_.sibling}C.type===$?(G=wl(C.props.children,k.mode,G,C.key),G.return=k,k=G):(G=rr(C.type,C.key,C.props,null,k.mode,G),as(G,C),G.return=k,k=G)}return h(k);case R:e:{for(fe=C.key;_!==null;){if(_.key===fe)if(_.tag===4&&_.stateNode.containerInfo===C.containerInfo&&_.stateNode.implementation===C.implementation){n(k,_.sibling),G=o(_,C.children||[]),G.return=k,k=G;break e}else{n(k,_);break}else t(k,_);_=_.sibling}G=go(C,k.mode,G),G.return=k,k=G}return h(k);case ye:return C=kl(C),Fe(k,_,C,G)}if(Ze(C))return re(k,_,C,G);if(st(C)){if(fe=st(C),typeof fe!="function")throw Error(u(150));return C=fe.call(C),me(k,_,C,G)}if(typeof C.then=="function")return Fe(k,_,mr(C),G);if(C.$$typeof===P)return Fe(k,_,cr(k,C),G);pr(k,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,_!==null&&_.tag===6?(n(k,_.sibling),G=o(_,C),G.return=k,k=G):(n(k,_),G=vo(C,k.mode,G),G.return=k,k=G),h(k)):n(k,_)}return function(k,_,C,G){try{ts=0;var fe=Fe(k,_,C,G);return hi=null,fe}catch(oe){if(oe===fi||oe===fr)throw oe;var qe=Wt(29,oe,null,k.mode);return qe.lanes=G,qe.return=k,qe}finally{}}}var El=gh(!0),bh=gh(!1),Yn=!1;function To(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oo(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 Zn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ve&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=sr(e),nh(e,null,n),t}return ir(e,i,t,n),sr(e)}function ns(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ql(e,n)}}function Lo(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Mo=!1;function ls(){if(Mo){var e=di;if(e!==null)throw e}}function is(e,t,n,i){Mo=!1;var o=e.updateQueue;Yn=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,g=o.shared.pending;if(g!==null){o.shared.pending=null;var S=g,T=S.next;S.next=null,h===null?c=T:h.next=T,h=S;var q=e.alternate;q!==null&&(q=q.updateQueue,g=q.lastBaseUpdate,g!==h&&(g===null?q.firstBaseUpdate=T:g.next=T,q.lastBaseUpdate=S))}if(c!==null){var Q=o.baseState;h=0,q=T=S=null,g=c;do{var O=g.lane&-536870913,M=O!==g.lane;if(M?(Ee&O)===O:(i&O)===O){O!==0&&O===ci&&(Mo=!0),q!==null&&(q=q.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var re=e,me=g;O=t;var Fe=n;switch(me.tag){case 1:if(re=me.payload,typeof re=="function"){Q=re.call(Fe,Q,O);break e}Q=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=me.payload,O=typeof re=="function"?re.call(Fe,Q,O):re,O==null)break e;Q=j({},Q,O);break e;case 2:Yn=!0}}O=g.callback,O!==null&&(e.flags|=64,M&&(e.flags|=8192),M=o.callbacks,M===null?o.callbacks=[O]:M.push(O))}else M={lane:O,tag:g.tag,payload:g.payload,callback:g.callback,next:null},q===null?(T=q=M,S=Q):q=q.next=M,h|=O;if(g=g.next,g===null){if(g=o.shared.pending,g===null)break;M=g,g=M.next,M.next=null,o.lastBaseUpdate=M,o.shared.pending=null}}while(!0);q===null&&(S=Q),o.baseState=S,o.firstBaseUpdate=T,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),Jn|=h,e.lanes=h,e.memoizedState=Q}}function wh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Sh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wh(n[e],t)}var mi=N(null),xr=N(0);function jh(e,t){e=jn,W(xr,e),W(mi,t),jn=e|t.baseLanes}function Do(){W(xr,jn),W(mi,mi.current)}function Uo(){jn=xr.current,Z(mi),Z(xr)}var Pt=N(null),va=null;function Qn(e){var t=e.alternate;W(pt,pt.current&1),W(Pt,e),va===null&&(t===null||mi.current!==null||t.memoizedState!==null)&&(va=e)}function zo(e){W(pt,pt.current),W(Pt,e),va===null&&(va=e)}function Nh(e){e.tag===22?(W(pt,pt.current),W(Pt,e),va===null&&(va=e)):Xn()}function Xn(){W(pt,pt.current),W(Pt,Pt.current)}function ea(e){Z(Pt),va===e&&(va=null),Z(pt)}var pt=N(0);function yr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Yc(n)||Zc(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 pn=0,ge=null,Ke=null,bt=null,vr=!1,pi=!1,Rl=!1,gr=0,ss=0,xi=null,$g=0;function dt(){throw Error(u(321))}function Bo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ft(e[n],t[n]))return!1;return!0}function qo(e,t,n,i,o,c){return pn=c,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?rm:ec,Rl=!1,c=n(i,o),Rl=!1,pi&&(c=kh(t,n,i,o)),_h(e),c}function _h(e){U.H=os;var t=Ke!==null&&Ke.next!==null;if(pn=0,bt=Ke=ge=null,vr=!1,ss=0,xi=null,t)throw Error(u(300));e===null||wt||(e=e.dependencies,e!==null&&or(e)&&(wt=!0))}function kh(e,t,n,i){ge=e;var o=0;do{if(pi&&(xi=null),ss=0,pi=!1,25<=o)throw Error(u(301));if(o+=1,bt=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)}U.H=um,c=t(n,i)}while(pi);return c}function Vg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?rs(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(ge.flags|=1024),t}function Ho(){var e=gr!==0;return gr=0,e}function $o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Vo(e){if(vr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vr=!1}pn=0,bt=Ke=ge=null,pi=!1,ss=gr=0,xi=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?ge.memoizedState=bt=e:bt=bt.next=e,bt}function xt(){if(Ke===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=bt===null?ge.memoizedState:bt.next;if(t!==null)bt=t,Ke=e;else{if(e===null)throw ge.alternate===null?Error(u(467)):Error(u(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},bt===null?ge.memoizedState=bt=e:bt=bt.next=e}return bt}function br(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=ss;return ss+=1,xi===null&&(xi=[]),e=xh(xi,e,t),t=ge,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?rm:ec),e}function wr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return rs(e);if(e.$$typeof===P)return Tt(e)}throw Error(u(438,String(e)))}function Yo(e){var t=null,n=ge.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=ge.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=br(),ge.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=yt;return t.index++,n}function xn(e,t){return typeof t=="function"?t(e):t}function Sr(e){var t=xt();return Zo(t,Ke,e)}function Zo(e,t,n){var i=e.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=n;var o=e.baseQueue,c=i.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,i.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var g=h=null,S=null,T=t,q=!1;do{var Q=T.lane&-536870913;if(Q!==T.lane?(Ee&Q)===Q:(pn&Q)===Q){var O=T.revertLane;if(O===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),Q===ci&&(q=!0);else if((pn&O)===O){T=T.next,O===ci&&(q=!0);continue}else Q={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},S===null?(g=S=Q,h=c):S=S.next=Q,ge.lanes|=O,Jn|=O;Q=T.action,Rl&&n(c,Q),c=T.hasEagerState?T.eagerState:n(c,Q)}else O={lane:Q,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},S===null?(g=S=O,h=c):S=S.next=O,ge.lanes|=Q,Jn|=Q;T=T.next}while(T!==null&&T!==t);if(S===null?h=c:S.next=g,!Ft(c,e.memoizedState)&&(wt=!0,q&&(n=di,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=S,i.lastRenderedState=c}return o===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Go(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var i=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);Ft(c,t.memoizedState)||(wt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function Ah(e,t,n){var i=ge,o=xt(),c=Oe;if(c){if(n===void 0)throw Error(u(407));n=n()}else n=t();var h=!Ft((Ke||o).memoizedState,n);if(h&&(o.memoizedState=n,wt=!0),o=o.queue,Io(Ch.bind(null,i,o,e),[e]),o.getSnapshot!==t||h||bt!==null&&bt.memoizedState.tag&1){if(i.flags|=2048,yi(9,{destroy:void 0},Rh.bind(null,i,o,n,t),null),et===null)throw Error(u(349));c||(pn&127)!==0||Eh(i,t,n)}return n}function Eh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ge.updateQueue,t===null?(t=br(),ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rh(e,t,n,i){t.value=n,t.getSnapshot=i,Th(t)&&Oh(e)}function Ch(e,t,n){return n(function(){Th(t)&&Oh(e)})}function Th(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ft(e,n)}catch{return!0}}function Oh(e){var t=bl(e,2);t!==null&&It(t,e,2)}function Qo(e){var t=zt();if(typeof e=="function"){var n=e;if(e=n(),Rl){Mt(!0);try{n()}finally{Mt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:e},t}function Lh(e,t,n,i){return e.baseState=n,Zo(e,Ke,typeof i=="function"?i:xn)}function Yg(e,t,n,i,o){if(_r(e))throw Error(u(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(h){c.listeners.push(h)}};U.T!==null?n(!0):c.isTransition=!1,i(c),n=t.pending,n===null?(c.next=t.pending=c,Mh(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Mh(e,t){var n=t.action,i=t.payload,o=e.state;if(t.isTransition){var c=U.T,h={};U.T=h;try{var g=n(o,i),S=U.S;S!==null&&S(h,g),Dh(e,t,g)}catch(T){Xo(e,t,T)}finally{c!==null&&h.types!==null&&(c.types=h.types),U.T=c}}else try{c=n(o,i),Dh(e,t,c)}catch(T){Xo(e,t,T)}}function Dh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Uh(e,t,i)},function(i){return Xo(e,t,i)}):Uh(e,t,n)}function Uh(e,t,n){t.status="fulfilled",t.value=n,zh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Mh(e,n)))}function Xo(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,zh(t),t=t.next;while(t!==i)}e.action=null}function zh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bh(e,t){return t}function qh(e,t){if(Oe){var n=et.formState;if(n!==null){e:{var i=ge;if(Oe){if(lt){t:{for(var o=lt,c=ya;o.nodeType!==8;){if(!c){o=null;break t}if(o=ga(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){lt=ga(o.nextSibling),i=o.data==="F!";break e}}$n(i)}i=!1}i&&(t=n[0])}}return n=zt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bh,lastRenderedState:t},n.queue=i,n=lm.bind(null,ge,i),i.dispatch=n,i=Qo(!1),c=Po.bind(null,ge,!1,i.queue),i=zt(),o={state:t,dispatch:null,action:e,pending:null},i.queue=o,n=Yg.bind(null,ge,o,c,n),o.dispatch=n,i.memoizedState=e,[t,n,!1]}function Hh(e){var t=xt();return $h(t,Ke,e)}function $h(e,t,n){if(t=Zo(e,t,Bh)[0],e=Sr(xn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=rs(t)}catch(h){throw h===fi?fr:h}else i=t;t=xt();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(ge.flags|=2048,yi(9,{destroy:void 0},Zg.bind(null,o,n),null)),[i,c,e]}function Zg(e,t){e.action=t}function Vh(e){var t=xt(),n=Ke;if(n!==null)return $h(t,n,e);xt(),t=t.memoizedState,n=xt();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function yi(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=ge.updateQueue,t===null&&(t=br(),ge.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Yh(){return xt().memoizedState}function jr(e,t,n,i){var o=zt();ge.flags|=e,o.memoizedState=yi(1|t,{destroy:void 0},n,i===void 0?null:i)}function Nr(e,t,n,i){var o=xt();i=i===void 0?null:i;var c=o.memoizedState.inst;Ke!==null&&i!==null&&Bo(i,Ke.memoizedState.deps)?o.memoizedState=yi(t,c,n,i):(ge.flags|=e,o.memoizedState=yi(1|t,c,n,i))}function Zh(e,t){jr(8390656,8,e,t)}function Io(e,t){Nr(2048,8,e,t)}function Gg(e){ge.flags|=4;var t=ge.updateQueue;if(t===null)t=br(),ge.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gh(e){var t=xt().memoizedState;return Gg({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Qh(e,t){return Nr(4,2,e,t)}function Xh(e,t){return Nr(4,4,e,t)}function Ih(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 Kh(e,t,n){n=n!=null?n.concat([e]):null,Nr(4,4,Ih.bind(null,t,e),n)}function Ko(){}function Jh(e,t){var n=xt();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Bo(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Fh(e,t){var n=xt();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Bo(t,i[1]))return i[0];if(i=e(),Rl){Mt(!0);try{e()}finally{Mt(!1)}}return n.memoizedState=[i,t],i}function Jo(e,t,n){return n===void 0||(pn&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Wm(),ge.lanes|=e,Jn|=e,n)}function Wh(e,t,n,i){return Ft(n,t)?n:mi.current!==null?(e=Jo(e,n,i),Ft(e,t)||(wt=!0),e):(pn&42)===0||(pn&1073741824)!==0&&(Ee&261930)===0?(wt=!0,e.memoizedState=n):(e=Wm(),ge.lanes|=e,Jn|=e,t)}function Ph(e,t,n,i,o){var c=J.p;J.p=c!==0&&8>c?c:8;var h=U.T,g={};U.T=g,Po(e,!1,t,n);try{var S=o(),T=U.S;if(T!==null&&T(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=Hg(S,i);us(e,t,q,na(e))}else us(e,t,i,na(e))}catch(Q){us(e,t,{then:function(){},status:"rejected",reason:Q},na())}finally{J.p=c,h!==null&&g.types!==null&&(h.types=g.types),U.T=h}}function Qg(){}function Fo(e,t,n,i){if(e.tag!==5)throw Error(u(476));var o=em(e).queue;Ph(e,o,t,ue,n===null?Qg:function(){return tm(e),n(i)})}function em(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tm(e){var t=em(e);t.next===null&&(t=e.alternate.memoizedState),us(e,t.next.queue,{},na())}function Wo(){return Tt(_s)}function am(){return xt().memoizedState}function nm(){return xt().memoizedState}function Xg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=na();e=Zn(n);var i=Gn(t,e,n);i!==null&&(It(i,t,n),ns(i,t,n)),t={cache:Ao()},e.payload=t;return}t=t.return}}function Ig(e,t,n){var i=na();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_r(e)?im(t,n):(n=xo(e,t,n,i),n!==null&&(It(n,e,i),sm(n,t,i)))}function lm(e,t,n){var i=na();us(e,t,n,i)}function us(e,t,n,i){var o={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_r(e))im(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,g=c(h,n);if(o.hasEagerState=!0,o.eagerState=g,Ft(g,h))return ir(e,t,o,0),et===null&&lr(),!1}catch{}finally{}if(n=xo(e,t,o,i),n!==null)return It(n,e,i),sm(n,t,i),!0}return!1}function Po(e,t,n,i){if(i={lane:2,revertLane:Tc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},_r(e)){if(t)throw Error(u(479))}else t=xo(e,n,i,2),t!==null&&It(t,e,2)}function _r(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function im(e,t){pi=vr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sm(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ql(e,n)}}var os={readContext:Tt,use:wr,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};os.useEffectEvent=dt;var rm={readContext:Tt,use:wr,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Zh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,jr(4194308,4,Ih.bind(null,t,e),n)},useLayoutEffect:function(e,t){return jr(4194308,4,e,t)},useInsertionEffect:function(e,t){jr(4,2,e,t)},useMemo:function(e,t){var n=zt();t=t===void 0?null:t;var i=e();if(Rl){Mt(!0);try{e()}finally{Mt(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=zt();if(n!==void 0){var o=n(t);if(Rl){Mt(!0);try{n(t)}finally{Mt(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=Ig.bind(null,ge,e),[i.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qo(e);var t=e.queue,n=lm.bind(null,ge,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ko,useDeferredValue:function(e,t){var n=zt();return Jo(n,e,t)},useTransition:function(){var e=Qo(!1);return e=Ph.bind(null,ge,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=ge,o=zt();if(Oe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),et===null)throw Error(u(349));(Ee&127)!==0||Eh(i,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,Zh(Ch.bind(null,i,c,e),[e]),i.flags|=2048,yi(9,{destroy:void 0},Rh.bind(null,i,c,n,t),null),n},useId:function(){var e=zt(),t=et.identifierPrefix;if(Oe){var n=Ia,i=Xa;n=(i&~(1<<32-mt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=gr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=$g++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Wo,useFormState:qh,useActionState:qh,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Po.bind(null,ge,!0,n),n.dispatch=t,[e,t]},useMemoCache:Yo,useCacheRefresh:function(){return zt().memoizedState=Xg.bind(null,ge)},useEffectEvent:function(e){var t=zt(),n={impl:e};return t.memoizedState=n,function(){if((Ve&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},ec={readContext:Tt,use:wr,useCallback:Jh,useContext:Tt,useEffect:Io,useImperativeHandle:Kh,useInsertionEffect:Qh,useLayoutEffect:Xh,useMemo:Fh,useReducer:Sr,useRef:Yh,useState:function(){return Sr(xn)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=xt();return Wh(n,Ke.memoizedState,e,t)},useTransition:function(){var e=Sr(xn)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:rs(e),t]},useSyncExternalStore:Ah,useId:am,useHostTransitionStatus:Wo,useFormState:Hh,useActionState:Hh,useOptimistic:function(e,t){var n=xt();return Lh(n,Ke,e,t)},useMemoCache:Yo,useCacheRefresh:nm};ec.useEffectEvent=Gh;var um={readContext:Tt,use:wr,useCallback:Jh,useContext:Tt,useEffect:Io,useImperativeHandle:Kh,useInsertionEffect:Qh,useLayoutEffect:Xh,useMemo:Fh,useReducer:Go,useRef:Yh,useState:function(){return Go(xn)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=xt();return Ke===null?Jo(n,e,t):Wh(n,Ke.memoizedState,e,t)},useTransition:function(){var e=Go(xn)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:rs(e),t]},useSyncExternalStore:Ah,useId:am,useHostTransitionStatus:Wo,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var n=xt();return Ke!==null?Lh(n,Ke,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Yo,useCacheRefresh:nm};um.useEffectEvent=Gh;function tc(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ac={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=na(),o=Zn(i);o.payload=t,n!=null&&(o.callback=n),t=Gn(e,o,i),t!==null&&(It(t,e,i),ns(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=na(),o=Zn(i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Gn(e,o,i),t!==null&&(It(t,e,i),ns(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=na(),i=Zn(n);i.tag=2,t!=null&&(i.callback=t),t=Gn(e,i,n),t!==null&&(It(t,e,n),ns(t,e,n))}};function om(e,t,n,i,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!Ki(n,i)||!Ki(o,c):!0}function cm(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&ac.enqueueReplaceState(t,t.state,null)}function Cl(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function dm(e){nr(e)}function fm(e){console.error(e)}function hm(e){nr(e)}function kr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function mm(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function nc(e,t,n){return n=Zn(n),n.tag=3,n.payload={element:null},n.callback=function(){kr(e,t)},n}function pm(e){return e=Zn(e),e.tag=3,e}function xm(e,t,n,i){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var c=i.value;e.payload=function(){return o(c)},e.callback=function(){mm(t,n,i)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){mm(t,n,i),typeof o!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var g=i.stack;this.componentDidCatch(i.value,{componentStack:g!==null?g:""})})}function Kg(e,t,n,i,o){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&oi(t,n,o,!0),n=Pt.current,n!==null){switch(n.tag){case 31:case 13:return va===null?Br():n.alternate===null&&ft===0&&(ft=3),n.flags&=-257,n.flags|=65536,n.lanes=o,i===hr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),Ec(e,i,o)),!1;case 22:return n.flags|=65536,i===hr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),Ec(e,i,o)),!1}throw Error(u(435,n.tag))}return Ec(e,i,o),Br(),!1}if(Oe)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,i!==So&&(e=Error(u(422),{cause:i}),Wi(ma(e,n)))):(i!==So&&(t=Error(u(423),{cause:i}),Wi(ma(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,i=ma(i,n),o=nc(e.stateNode,i,o),Lo(e,o),ft!==4&&(ft=2)),!1;var c=Error(u(520),{cause:i});if(c=ma(c,n),ys===null?ys=[c]:ys.push(c),ft!==4&&(ft=2),t===null)return!0;i=ma(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=nc(n.stateNode,i,e),Lo(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"&&(Fn===null||!Fn.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=pm(o),xm(o,e,n,i),Lo(n,o),!1}n=n.return}while(n!==null);return!1}var lc=Error(u(461)),wt=!1;function Ot(e,t,n,i){t.child=e===null?bh(t,null,n,i):El(t,e.child,n,i)}function ym(e,t,n,i,o){n=n.render;var c=t.ref;if("ref"in i){var h={};for(var g in i)g!=="ref"&&(h[g]=i[g])}else h=i;return Nl(t),i=qo(e,t,n,h,c,o),g=Ho(),e!==null&&!wt?($o(e,t,o),yn(e,t,o)):(Oe&&g&&bo(t),t.flags|=1,Ot(e,t,i,o),t.child)}function vm(e,t,n,i,o){if(e===null){var c=n.type;return typeof c=="function"&&!yo(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,gm(e,t,c,i,o)):(e=rr(n.type,null,i,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!fc(e,o)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:Ki,n(h,i)&&e.ref===t.ref)return yn(e,t,o)}return t.flags|=1,e=dn(c,i),e.ref=t.ref,e.return=t,t.child=e}function gm(e,t,n,i,o){if(e!==null){var c=e.memoizedProps;if(Ki(c,i)&&e.ref===t.ref)if(wt=!1,t.pendingProps=i=c,fc(e,o))(e.flags&131072)!==0&&(wt=!0);else return t.lanes=e.lanes,yn(e,t,o)}return ic(e,t,n,i,o)}function bm(e,t,n,i){var o=i.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(i=t.child=e.child,o=0;i!==null;)o=o|i.lanes|i.childLanes,i=i.sibling;i=o&~c}else i=0,t.child=null;return wm(e,t,c,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&dr(t,c!==null?c.cachePool:null),c!==null?jh(t,c):Do(),Nh(t);else return i=t.lanes=536870912,wm(e,t,c!==null?c.baseLanes|n:n,n,i)}else c!==null?(dr(t,c.cachePool),jh(t,c),Xn(),t.memoizedState=null):(e!==null&&dr(t,null),Do(),Xn());return Ot(e,t,o,n),t.child}function cs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function wm(e,t,n,i,o){var c=Ro();return c=c===null?null:{parent:gt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&dr(t,null),Do(),Nh(t),e!==null&&oi(e,t,i,!0),t.childLanes=o,null}function Ar(e,t){return t=Rr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Sm(e,t,n){return El(t,e.child,null,n),e=Ar(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Jg(e,t,n){var i=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(i.mode==="hidden")return e=Ar(t,i),t.lanes=536870912,cs(null,e);if(zo(t),(e=lt)?(e=Mp(e,ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qn!==null?{id:Xa,overflow:Ia}:null,retryLane:536870912,hydrationErrors:null},n=ih(e),n.return=t,t.child=n,Ct=t,lt=null)):e=null,e===null)throw $n(t);return t.lanes=536870912,null}return Ar(t,i)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(zo(t),o)if(t.flags&256)t.flags&=-257,t=Sm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(wt||oi(e,t,n,!1),o=(n&e.childLanes)!==0,wt||o){if(i=et,i!==null&&(h=ml(i,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,bl(e,h),It(i,e,h),lc;Br(),t=Sm(e,t,n)}else e=c.treeContext,lt=ga(h.nextSibling),Ct=t,Oe=!0,Hn=null,ya=!1,e!==null&&uh(t,e),t=Ar(t,i),t.flags|=4096;return t}return e=dn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Er(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(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ic(e,t,n,i,o){return Nl(t),n=qo(e,t,n,i,void 0,o),i=Ho(),e!==null&&!wt?($o(e,t,o),yn(e,t,o)):(Oe&&i&&bo(t),t.flags|=1,Ot(e,t,n,o),t.child)}function jm(e,t,n,i,o,c){return Nl(t),t.updateQueue=null,n=kh(t,i,n,o),_h(e),i=Ho(),e!==null&&!wt?($o(e,t,c),yn(e,t,c)):(Oe&&i&&bo(t),t.flags|=1,Ot(e,t,n,c),t.child)}function Nm(e,t,n,i,o){if(Nl(t),t.stateNode===null){var c=ii,h=n.contextType;typeof h=="object"&&h!==null&&(c=Tt(h)),c=new n(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=ac,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},To(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?Tt(h):ii,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(tc(t,n,h,i),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&ac.enqueueReplaceState(c,c.state,null),is(t,i,c,o),ls(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var g=t.memoizedProps,S=Cl(n,g);c.props=S;var T=c.context,q=n.contextType;h=ii,typeof q=="object"&&q!==null&&(h=Tt(q));var Q=n.getDerivedStateFromProps;q=typeof Q=="function"||typeof c.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(g||T!==h)&&cm(t,c,i,h),Yn=!1;var O=t.memoizedState;c.state=O,is(t,i,c,o),ls(),T=t.memoizedState,g||O!==T||Yn?(typeof Q=="function"&&(tc(t,n,Q,i),T=t.memoizedState),(S=Yn||om(t,n,S,i,O,T,h))?(q||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=i,t.memoizedState=T),c.props=i,c.state=T,c.context=h,i=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,Oo(e,t),h=t.memoizedProps,q=Cl(n,h),c.props=q,Q=t.pendingProps,O=c.context,T=n.contextType,S=ii,typeof T=="object"&&T!==null&&(S=Tt(T)),g=n.getDerivedStateFromProps,(T=typeof g=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==Q||O!==S)&&cm(t,c,i,S),Yn=!1,O=t.memoizedState,c.state=O,is(t,i,c,o),ls();var M=t.memoizedState;h!==Q||O!==M||Yn||e!==null&&e.dependencies!==null&&or(e.dependencies)?(typeof g=="function"&&(tc(t,n,g,i),M=t.memoizedState),(q=Yn||om(t,n,q,i,O,M,S)||e!==null&&e.dependencies!==null&&or(e.dependencies))?(T||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,M,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,M,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=M),c.props=i,c.state=M,c.context=S,i=q):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),i=!1)}return c=i,Er(e,t),i=(t.flags&128)!==0,c||i?(c=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&i?(t.child=El(t,e.child,null,o),t.child=El(t,null,n,o)):Ot(e,t,n,o),t.memoizedState=c.state,e=t.child):e=yn(e,t,o),e}function _m(e,t,n,i){return Sl(),t.flags|=256,Ot(e,t,n,i),t.child}var sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rc(e){return{baseLanes:e,cachePool:mh()}}function uc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=aa),e}function km(e,t,n){var i=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(o?Qn(t):Xn(),(e=lt)?(e=Mp(e,ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qn!==null?{id:Xa,overflow:Ia}:null,retryLane:536870912,hydrationErrors:null},n=ih(e),n.return=t,t.child=n,Ct=t,lt=null)):e=null,e===null)throw $n(t);return Zc(e)?t.lanes=32:t.lanes=536870912,null}var g=i.children;return i=i.fallback,o?(Xn(),o=t.mode,g=Rr({mode:"hidden",children:g},o),i=wl(i,o,n,null),g.return=t,i.return=t,g.sibling=i,t.child=g,i=t.child,i.memoizedState=rc(n),i.childLanes=uc(e,h,n),t.memoizedState=sc,cs(null,i)):(Qn(t),oc(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(c)t.flags&256?(Qn(t),t.flags&=-257,t=cc(e,t,n)):t.memoizedState!==null?(Xn(),t.child=e.child,t.flags|=128,t=null):(Xn(),g=i.fallback,o=t.mode,i=Rr({mode:"visible",children:i.children},o),g=wl(g,o,n,null),g.flags|=2,i.return=t,g.return=t,i.sibling=g,t.child=i,El(t,e.child,null,n),i=t.child,i.memoizedState=rc(n),i.childLanes=uc(e,h,n),t.memoizedState=sc,t=cs(null,i));else if(Qn(t),Zc(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var T=h.dgst;h=T,i=Error(u(419)),i.stack="",i.digest=h,Wi({value:i,source:null,stack:null}),t=cc(e,t,n)}else if(wt||oi(e,t,n,!1),h=(n&e.childLanes)!==0,wt||h){if(h=et,h!==null&&(i=ml(h,n),i!==0&&i!==S.retryLane))throw S.retryLane=i,bl(e,i),It(h,e,i),lc;Yc(g)||Br(),t=cc(e,t,n)}else Yc(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,lt=ga(g.nextSibling),Ct=t,Oe=!0,Hn=null,ya=!1,e!==null&&uh(t,e),t=oc(t,i.children),t.flags|=4096);return t}return o?(Xn(),g=i.fallback,o=t.mode,S=e.child,T=S.sibling,i=dn(S,{mode:"hidden",children:i.children}),i.subtreeFlags=S.subtreeFlags&65011712,T!==null?g=dn(T,g):(g=wl(g,o,n,null),g.flags|=2),g.return=t,i.return=t,i.sibling=g,t.child=i,cs(null,i),i=t.child,g=e.child.memoizedState,g===null?g=rc(n):(o=g.cachePool,o!==null?(S=gt._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=mh(),g={baseLanes:g.baseLanes|n,cachePool:o}),i.memoizedState=g,i.childLanes=uc(e,h,n),t.memoizedState=sc,cs(e.child,i)):(Qn(t),n=e.child,e=n.sibling,n=dn(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function oc(e,t){return t=Rr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Rr(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function cc(e,t,n){return El(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Am(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),_o(e.return,t,n)}function dc(e,t,n,i,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=n,h.tailMode=o,h.treeForkCount=c)}function Em(e,t,n){var i=t.pendingProps,o=i.revealOrder,c=i.tail;i=i.children;var h=pt.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,W(pt,h),Ot(e,t,i,n),i=Oe?Fi:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Am(e,n,t);else if(e.tag===19)Am(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&&yr(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),dc(t,!1,o,n,c,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&yr(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}dc(t,!0,n,null,c,i);break;case"together":dc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function yn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(oi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&or(e)))}function Fg(e,t,n){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),Vn(t,gt,e.memoizedState.cache),Sl();break;case 27:case 5:Ut(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:Vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zo(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Qn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?km(e,t,n):(Qn(t),e=yn(e,t,n),e!==null?e.sibling:null);Qn(t);break;case 19:var o=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(oi(e,t,n,!1),i=(n&t.childLanes)!==0),o){if(i)return Em(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),W(pt,pt.current),i)break;return null;case 22:return t.lanes=0,bm(e,t,n,t.pendingProps);case 24:Vn(t,gt,e.memoizedState.cache)}return yn(e,t,n)}function Rm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)wt=!0;else{if(!fc(e,n)&&(t.flags&128)===0)return wt=!1,Fg(e,t,n);wt=(e.flags&131072)!==0}else wt=!1,Oe&&(t.flags&1048576)!==0&&rh(t,Fi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=kl(t.elementType),t.type=e,typeof e=="function")yo(e)?(i=Cl(e,i),t.tag=1,t=Nm(null,t,e,i,n)):(t.tag=0,t=ic(null,t,e,i,n));else{if(e!=null){var o=e.$$typeof;if(o===le){t.tag=11,t=ym(null,t,e,i,n);break e}else if(o===I){t.tag=14,t=vm(null,t,e,i,n);break e}}throw t=nt(e)||e,Error(u(306,t,""))}}return t;case 0:return ic(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,o=Cl(i,t.pendingProps),Nm(e,t,i,o,n);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(u(387));i=t.pendingProps;var c=t.memoizedState;o=c.element,Oo(e,t),is(t,i,null,n);var h=t.memoizedState;if(i=h.cache,Vn(t,gt,i),i!==c.cache&&ko(t,[gt],n,!0),ls(),i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=_m(e,t,i,n);break e}else if(i!==o){o=ma(Error(u(424)),t),Wi(o),t=_m(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(lt=ga(e.firstChild),Ct=t,Oe=!0,Hn=null,ya=!0,n=bh(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Sl(),i===o){t=yn(e,t,n);break e}Ot(e,t,i,n)}t=t.child}return t;case 26:return Er(e,t),e===null?(n=Hp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oe||(n=t.type,e=t.pendingProps,i=Gr(B.current).createElement(n),i[ct]=t,i[_t]=e,Lt(i,n,e),At(i),t.stateNode=i):t.memoizedState=Hp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ut(t),e===null&&Oe&&(i=t.stateNode=zp(t.type,t.pendingProps,B.current),Ct=t,ya=!0,o=lt,tl(t.type)?(Gc=o,lt=ga(i.firstChild)):lt=o),Ot(e,t,t.pendingProps.children,n),Er(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((o=i=lt)&&(i=A0(i,t.type,t.pendingProps,ya),i!==null?(t.stateNode=i,Ct=t,lt=ga(i.firstChild),ya=!1,o=!0):o=!1),o||$n(t)),Ut(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,i=c.children,Hc(o,c)?i=null:h!==null&&Hc(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=qo(e,t,Vg,null,null,n),_s._currentValue=o),Er(e,t),Ot(e,t,i,n),t.child;case 6:return e===null&&Oe&&((e=n=lt)&&(n=E0(n,t.pendingProps,ya),n!==null?(t.stateNode=n,Ct=t,lt=null,e=!0):e=!1),e||$n(t)),null;case 13:return km(e,t,n);case 4:return Ge(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=El(t,null,i,n):Ot(e,t,i,n),t.child;case 11:return ym(e,t,t.type,t.pendingProps,n);case 7:return Ot(e,t,t.pendingProps,n),t.child;case 8:return Ot(e,t,t.pendingProps.children,n),t.child;case 12:return Ot(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Vn(t,t.type,i.value),Ot(e,t,i.children,n),t.child;case 9:return o=t.type._context,i=t.pendingProps.children,Nl(t),o=Tt(o),i=i(o),t.flags|=1,Ot(e,t,i,n),t.child;case 14:return vm(e,t,t.type,t.pendingProps,n);case 15:return gm(e,t,t.type,t.pendingProps,n);case 19:return Em(e,t,n);case 31:return Jg(e,t,n);case 22:return bm(e,t,n,t.pendingProps);case 24:return Nl(t),i=Tt(gt),e===null?(o=Ro(),o===null&&(o=et,c=Ao(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=n),o=c),t.memoizedState={parent:i,cache:o},To(t),Vn(t,gt,o)):((e.lanes&n)!==0&&(Oo(e,t),is(t,null,null,n),ls()),o=e.memoizedState,c=t.memoizedState,o.parent!==i?(o={parent:i,cache:i},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Vn(t,gt,i)):(i=c.cache,Vn(t,gt,i),i!==o.cache&&ko(t,[gt],n,!0))),Ot(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function vn(e){e.flags|=4}function hc(e,t,n,i,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(ap())e.flags|=8192;else throw Al=hr,Co}else e.flags&=-16777217}function Cm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gp(t))if(ap())e.flags|=8192;else throw Al=hr,Co}function Cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zl():536870912,e.lanes|=t,wi|=t)}function ds(e,t){if(!Oe)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 i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,i|=o.subtreeFlags&65011712,i|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,i|=o.subtreeFlags,i|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Wg(e,t,n){var i=t.pendingProps;switch(wo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),mn(gt),Ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ui(t)?vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,jo())),it(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(vn(t),c!==null?(it(t),Cm(t,c)):(it(t),hc(t,o,null,i,n))):c?c!==e.memoizedState?(vn(t),it(t),Cm(t,c)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&vn(t),it(t),hc(t,o,e,i,n)),null;case 27:if(Ra(t),n=B.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&vn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return it(t),null}e=ae.current,ui(t)?oh(t):(e=zp(o,i,n),t.stateNode=e,vn(t))}return it(t),null;case 5:if(Ra(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&vn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return it(t),null}if(c=ae.current,ui(t))oh(t);else{var h=Gr(B.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?h.createElement(o,{is:i.is}):h.createElement(o)}}c[ct]=t,c[_t]=i;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(Lt(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&vn(t)}}return it(t),hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&vn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=B.current,ui(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,o=Ct,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||kp(e.nodeValue,n)),e||$n(t,!0)}else e=Gr(e).createTextNode(i),e[ct]=t,t.stateNode=e}return it(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=ui(t),n!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ct]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else n=jo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(u(558))}return it(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=ui(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[ct]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),o=!1}else o=jo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Cr(t,t.updateQueue),it(t),null);case 4:return Ue(),e===null&&Dc(t.stateNode.containerInfo),it(t),null;case 10:return mn(t.type),it(t),null;case 19:if(Z(pt),i=t.memoizedState,i===null)return it(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)ds(i,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=yr(e),c!==null){for(t.flags|=128,ds(i,!1),e=c.updateQueue,t.updateQueue=e,Cr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)lh(n,e),n=n.sibling;return W(pt,pt.current&1|2),Oe&&fn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&tt()>Dr&&(t.flags|=128,o=!0,ds(i,!1),t.lanes=4194304)}else{if(!o)if(e=yr(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Cr(t,e),ds(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Oe)return it(t),null}else 2*tt()-i.renderingStartTime>Dr&&n!==536870912&&(t.flags|=128,o=!0,ds(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=tt(),e.sibling=null,n=pt.current,W(pt,o?n&1|2:n&1),Oe&&fn(t,i.treeForkCount),e):(it(t),null);case 22:case 23:return ea(t),Uo(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),n=t.updateQueue,n!==null&&Cr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Z(_l),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),mn(gt),it(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Pg(e,t){switch(wo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mn(gt),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ra(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(u(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(pt),null;case 4:return Ue(),null;case 10:return mn(t.type),null;case 22:case 23:return ea(t),Uo(),e!==null&&Z(_l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return mn(gt),null;case 25:return null;default:return null}}function Tm(e,t){switch(wo(t),t.tag){case 3:mn(gt),Ue();break;case 26:case 27:case 5:Ra(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:Z(pt);break;case 10:mn(t.type);break;case 22:case 23:ea(t),Uo(),e!==null&&Z(_l);break;case 24:mn(gt)}}function fs(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var o=i.next;n=o;do{if((n.tag&e)===e){i=void 0;var c=n.create,h=n.inst;i=c(),h.destroy=i}n=n.next}while(n!==o)}}catch(g){Xe(t,t.return,g)}}function In(e,t,n){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var h=i.inst,g=h.destroy;if(g!==void 0){h.destroy=void 0,o=t;var S=n,T=g;try{T()}catch(q){Xe(o,S,q)}}}i=i.next}while(i!==c)}}catch(q){Xe(t,t.return,q)}}function Om(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Sh(t,n)}catch(i){Xe(e,e.return,i)}}}function Lm(e,t,n){n.props=Cl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Xe(e,t,i)}}function hs(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(o){Xe(e,t,o)}}function Ka(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(o){Xe(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){Xe(e,t,o)}else n.current=null}function Mm(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(o){Xe(e,e.return,o)}}function mc(e,t,n){try{var i=e.stateNode;w0(i,e.type,n,t),i[_t]=t}catch(o){Xe(e,e.return,o)}}function Dm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tl(e.type)||e.tag===4}function pc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dm(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&&tl(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 xc(e,t,n){var i=e.tag;if(i===5||i===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=on));else if(i!==4&&(i===27&&tl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(xc(e,t,n),e=e.sibling;e!==null;)xc(e,t,n),e=e.sibling}function Tr(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&tl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Tr(e,t,n),e=e.sibling;e!==null;)Tr(e,t,n),e=e.sibling}function Um(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Lt(t,i,n),t[ct]=e,t[_t]=n}catch(c){Xe(e,e.return,c)}}var gn=!1,St=!1,yc=!1,zm=typeof WeakSet=="function"?WeakSet:Set,Et=null;function e0(e,t){if(e=e.containerInfo,Bc=Wr,e=Kf(e),oo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var o=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,g=-1,S=-1,T=0,q=0,Q=e,O=null;t:for(;;){for(var M;Q!==n||o!==0&&Q.nodeType!==3||(g=h+o),Q!==c||i!==0&&Q.nodeType!==3||(S=h+i),Q.nodeType===3&&(h+=Q.nodeValue.length),(M=Q.firstChild)!==null;)O=Q,Q=M;for(;;){if(Q===e)break t;if(O===n&&++T===o&&(g=h),O===c&&++q===i&&(S=h),(M=Q.nextSibling)!==null)break;Q=O,O=Q.parentNode}Q=M}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(qc={focusedElem:e,selectionRange:n},Wr=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,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,i=n.stateNode;try{var re=Cl(n.type,o);e=i.getSnapshotBeforeUpdate(re,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(me){Xe(n,n.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Vc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Vc(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function Bm(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:wn(e,n),i&4&&fs(5,n);break;case 1:if(wn(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Xe(n,n.return,h)}else{var o=Cl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Xe(n,n.return,h)}}i&64&&Om(n),i&512&&hs(n,n.return);break;case 3:if(wn(e,n),i&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{Sh(e,t)}catch(h){Xe(n,n.return,h)}}break;case 27:t===null&&i&4&&Um(n);case 26:case 5:wn(e,n),t===null&&i&4&&Mm(n),i&512&&hs(n,n.return);break;case 12:wn(e,n);break;case 31:wn(e,n),i&4&&$m(e,n);break;case 13:wn(e,n),i&4&&Vm(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=o0.bind(null,n),R0(e,n))));break;case 22:if(i=n.memoizedState!==null||gn,!i){t=t!==null&&t.memoizedState!==null||St,o=gn;var c=St;gn=i,(St=t)&&!c?Sn(e,n,(n.subtreeFlags&8772)!==0):wn(e,n),gn=o,St=c}break;case 30:break;default:wn(e,n)}}function qm(e){var t=e.alternate;t!==null&&(e.alternate=null,qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pe(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 rt=null,Zt=!1;function bn(e,t,n){for(n=n.child;n!==null;)Hm(e,t,n),n=n.sibling}function Hm(e,t,n){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Za,n)}catch{}switch(n.tag){case 26:St||Ka(n,t),bn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:St||Ka(n,t);var i=rt,o=Zt;tl(n.type)&&(rt=n.stateNode,Zt=!1),bn(e,t,n),Ss(n.stateNode),rt=i,Zt=o;break;case 5:St||Ka(n,t);case 6:if(i=rt,o=Zt,rt=null,bn(e,t,n),rt=i,Zt=o,rt!==null)if(Zt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(c){Xe(n,t,c)}else try{rt.removeChild(n.stateNode)}catch(c){Xe(n,t,c)}break;case 18:rt!==null&&(Zt?(e=rt,Op(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ri(e)):Op(rt,n.stateNode));break;case 4:i=rt,o=Zt,rt=n.stateNode.containerInfo,Zt=!0,bn(e,t,n),rt=i,Zt=o;break;case 0:case 11:case 14:case 15:In(2,n,t),St||In(4,n,t),bn(e,t,n);break;case 1:St||(Ka(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Lm(n,t,i)),bn(e,t,n);break;case 21:bn(e,t,n);break;case 22:St=(i=St)||n.memoizedState!==null,bn(e,t,n),St=i;break;default:bn(e,t,n)}}function $m(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ri(e)}catch(n){Xe(t,t.return,n)}}}function Vm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ri(e)}catch(n){Xe(t,t.return,n)}}function t0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new zm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new zm),t;default:throw Error(u(435,e.tag))}}function Or(e,t){var n=t0(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var o=c0.bind(null,e,i);i.then(o,o)}})}function Gt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var o=n[i],c=e,h=t,g=h;e:for(;g!==null;){switch(g.tag){case 27:if(tl(g.type)){rt=g.stateNode,Zt=!1;break e}break;case 5:rt=g.stateNode,Zt=!1;break e;case 3:case 4:rt=g.stateNode.containerInfo,Zt=!0;break e}g=g.return}if(rt===null)throw Error(u(160));Hm(c,h,o),rt=null,Zt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ym(t,e),t=t.sibling}var Ma=null;function Ym(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Qt(e),i&4&&(In(3,e,e.return),fs(3,e),In(5,e,e.return));break;case 1:Gt(t,e),Qt(e),i&512&&(St||n===null||Ka(n,n.return)),i&64&&gn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var o=Ma;if(Gt(t,e),Qt(e),i&512&&(St||n===null||Ka(n,n.return)),i&4){var c=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(i){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Te]||c[ct]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(i),o.head.insertBefore(c,o.querySelector("head > title"))),Lt(c,i,n),c[ct]=e,At(c),i=c;break e;case"link":var h=Yp("link","href",o).get(i+(n.href||""));if(h){for(var g=0;g<h.length;g++)if(c=h[g],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)){h.splice(g,1);break t}}c=o.createElement(i),Lt(c,i,n),o.head.appendChild(c);break;case"meta":if(h=Yp("meta","content",o).get(i+(n.content||""))){for(g=0;g<h.length;g++)if(c=h[g],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)){h.splice(g,1);break t}}c=o.createElement(i),Lt(c,i,n),o.head.appendChild(c);break;default:throw Error(u(468,i))}c[ct]=e,At(c),i=c}e.stateNode=i}else Zp(o,e.type,e.stateNode);else e.stateNode=Vp(o,i,e.memoizedProps);else c!==i?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,i===null?Zp(o,e.type,e.stateNode):Vp(o,i,e.memoizedProps)):i===null&&e.stateNode!==null&&mc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Gt(t,e),Qt(e),i&512&&(St||n===null||Ka(n,n.return)),n!==null&&i&4&&mc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Gt(t,e),Qt(e),i&512&&(St||n===null||Ka(n,n.return)),e.flags&32){o=e.stateNode;try{Wl(o,"")}catch(re){Xe(e,e.return,re)}}i&4&&e.stateNode!=null&&(o=e.memoizedProps,mc(e,o,n!==null?n.memoizedProps:o)),i&1024&&(yc=!0);break;case 6:if(Gt(t,e),Qt(e),i&4){if(e.stateNode===null)throw Error(u(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(re){Xe(e,e.return,re)}}break;case 3:if(Ir=null,o=Ma,Ma=Qr(t.containerInfo),Gt(t,e),Ma=o,Qt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ri(t.containerInfo)}catch(re){Xe(e,e.return,re)}yc&&(yc=!1,Zm(e));break;case 4:i=Ma,Ma=Qr(e.stateNode.containerInfo),Gt(t,e),Qt(e),Ma=i;break;case 12:Gt(t,e),Qt(e);break;case 31:Gt(t,e),Qt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Or(e,i)));break;case 13:Gt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Mr=tt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Or(e,i)));break;case 22:o=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,T=gn,q=St;if(gn=T||o,St=q||S,Gt(t,e),St=q,gn=T,Qt(e),i&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||S||gn||St||Tl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(c=S.stateNode,o)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{g=S.stateNode;var Q=S.memoizedProps.style,O=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;g.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(re){Xe(S,S.return,re)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(re){Xe(S,S.return,re)}}}else if(t.tag===18){if(n===null){S=t;try{var M=S.stateNode;o?Lp(M,!0):Lp(S.stateNode,!1)}catch(re){Xe(S,S.return,re)}}}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}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Or(e,n))));break;case 19:Gt(t,e),Qt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Or(e,i)));break;case 30:break;case 21:break;default:Gt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(Dm(i)){n=i;break}i=i.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var o=n.stateNode,c=pc(e);Tr(e,c,o);break;case 5:var h=n.stateNode;n.flags&32&&(Wl(h,""),n.flags&=-33);var g=pc(e);Tr(e,g,h);break;case 3:case 4:var S=n.stateNode.containerInfo,T=pc(e);xc(e,T,S);break;default:throw Error(u(161))}}catch(q){Xe(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Zm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bm(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:In(4,t,t.return),Tl(t);break;case 1:Ka(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Lm(t,t.return,n),Tl(t);break;case 27:Ss(t.stateNode);case 26:case 5:Ka(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function Sn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:Sn(o,c,n),fs(4,c);break;case 1:if(Sn(o,c,n),i=c,o=i.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(T){Xe(i,i.return,T)}if(i=c,o=i.updateQueue,o!==null){var g=i.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)wh(S[o],g)}catch(T){Xe(i,i.return,T)}}n&&h&64&&Om(c),hs(c,c.return);break;case 27:Um(c);case 26:case 5:Sn(o,c,n),n&&i===null&&h&4&&Mm(c),hs(c,c.return);break;case 12:Sn(o,c,n);break;case 31:Sn(o,c,n),n&&h&4&&$m(o,c);break;case 13:Sn(o,c,n),n&&h&4&&Vm(o,c);break;case 22:c.memoizedState===null&&Sn(o,c,n),hs(c,c.return);break;case 30:break;default:Sn(o,c,n)}t=t.sibling}}function vc(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&&Pi(n))}function gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pi(e))}function Da(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gm(e,t,n,i),t=t.sibling}function Gm(e,t,n,i){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Da(e,t,n,i),o&2048&&fs(9,t);break;case 1:Da(e,t,n,i);break;case 3:Da(e,t,n,i),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pi(e)));break;case 12:if(o&2048){Da(e,t,n,i),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,g=c.onPostCommit;typeof g=="function"&&g(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Xe(t,t.return,S)}}else Da(e,t,n,i);break;case 31:Da(e,t,n,i);break;case 13:Da(e,t,n,i);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Da(e,t,n,i):ms(e,t):c._visibility&2?Da(e,t,n,i):(c._visibility|=2,vi(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),o&2048&&vc(h,t);break;case 24:Da(e,t,n,i),o&2048&&gc(t.alternate,t);break;default:Da(e,t,n,i)}}function vi(e,t,n,i,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,g=n,S=i,T=h.flags;switch(h.tag){case 0:case 11:case 15:vi(c,h,g,S,o),fs(8,h);break;case 23:break;case 22:var q=h.stateNode;h.memoizedState!==null?q._visibility&2?vi(c,h,g,S,o):ms(c,h):(q._visibility|=2,vi(c,h,g,S,o)),o&&T&2048&&vc(h.alternate,h);break;case 24:vi(c,h,g,S,o),o&&T&2048&&gc(h.alternate,h);break;default:vi(c,h,g,S,o)}t=t.sibling}}function ms(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,o=i.flags;switch(i.tag){case 22:ms(n,i),o&2048&&vc(i.alternate,i);break;case 24:ms(n,i),o&2048&&gc(i.alternate,i);break;default:ms(n,i)}t=t.sibling}}var ps=8192;function gi(e,t,n){if(e.subtreeFlags&ps)for(e=e.child;e!==null;)Qm(e,t,n),e=e.sibling}function Qm(e,t,n){switch(e.tag){case 26:gi(e,t,n),e.flags&ps&&e.memoizedState!==null&&$0(n,Ma,e.memoizedState,e.memoizedProps);break;case 5:gi(e,t,n);break;case 3:case 4:var i=Ma;Ma=Qr(e.stateNode.containerInfo),gi(e,t,n),Ma=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ps,ps=16777216,gi(e,t,n),ps=i):gi(e,t,n));break;default:gi(e,t,n)}}function Xm(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 xs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Et=i,Km(i,e)}Xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Im(e),e=e.sibling}function Im(e){switch(e.tag){case 0:case 11:case 15:xs(e),e.flags&2048&&In(9,e,e.return);break;case 3:xs(e);break;case 12:xs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Lr(e)):xs(e);break;default:xs(e)}}function Lr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Et=i,Km(i,e)}Xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:In(8,t,t.return),Lr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Lr(t));break;default:Lr(t)}e=e.sibling}}function Km(e,t){for(;Et!==null;){var n=Et;switch(n.tag){case 0:case 11:case 15:In(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Pi(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Et=i;else e:for(n=e;Et!==null;){i=Et;var o=i.sibling,c=i.return;if(qm(i),i===n){Et=null;break e}if(o!==null){o.return=c,Et=o;break e}Et=c}}}var a0={getCacheForType:function(e){var t=Tt(gt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Tt(gt).controller.signal}},n0=typeof WeakMap=="function"?WeakMap:Map,Ve=0,et=null,_e=null,Ee=0,Qe=0,ta=null,Kn=!1,bi=!1,bc=!1,jn=0,ft=0,Jn=0,Ol=0,wc=0,aa=0,wi=0,ys=null,Xt=null,Sc=!1,Mr=0,Jm=0,Dr=1/0,Ur=null,Fn=null,kt=0,Wn=null,Si=null,Nn=0,jc=0,Nc=null,Fm=null,vs=0,_c=null;function na(){return(Ve&2)!==0&&Ee!==0?Ee&-Ee:U.T!==null?Tc():Xl()}function Wm(){if(aa===0)if((Ee&536870912)===0||Oe){var e=Ta;Ta<<=1,(Ta&3932160)===0&&(Ta=262144),aa=e}else aa=536870912;return e=Pt.current,e!==null&&(e.flags|=32),aa}function It(e,t,n){(e===et&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(ji(e,0),Pn(e,Ee,aa,!1)),sn(e,n),((Ve&2)===0||e!==et)&&(e===et&&((Ve&2)===0&&(Ol|=n),ft===4&&Pn(e,Ee,aa,!1)),Ja(e))}function Pm(e,t,n){if((Ve&6)!==0)throw Error(u(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ln(e,t),o=i?s0(e,t):Ac(e,t,!0),c=i;do{if(o===0){bi&&!i&&Pn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!l0(n)){o=Ac(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var g=e;o=ys;var S=g.current.memoizedState.isDehydrated;if(S&&(ji(g,h).flags|=256),h=Ac(g,h,!1),h!==2){if(bc&&!S){g.errorRecoveryDisabledLanes|=c,Ol|=c,o=4;break e}c=Xt,Xt=o,c!==null&&(Xt===null?Xt=c:Xt.push.apply(Xt,c))}o=h}if(c=!1,o!==2)continue}}if(o===1){ji(e,0),Pn(e,t,0,!0);break}e:{switch(i=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Pn(i,t,aa,!Kn);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=Mr+300-tt(),10<o)){if(Pn(i,t,aa,!Kn),Un(i,0,!0)!==0)break e;Nn=t,i.timeoutHandle=Cp(ep.bind(null,i,n,Xt,Ur,Sc,t,aa,Ol,wi,Kn,c,"Throttled",-0,0),o);break e}ep(i,n,Xt,Ur,Sc,t,aa,Ol,wi,Kn,c,null,-0,0)}}break}while(!0);Ja(e)}function ep(e,t,n,i,o,c,h,g,S,T,q,Q,O,M){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},Qm(t,c,Q);var re=(c&62914560)===c?Mr-tt():(c&4194048)===c?Jm-tt():0;if(re=V0(Q,re),re!==null){Nn=c,e.cancelPendingCommit=re(up.bind(null,e,t,c,n,i,o,h,g,S,q,Q,null,O,M)),Pn(e,c,h,!T);return}}up(e,t,c,n,i,o,h,g,S)}function l0(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 i=0;i<n.length;i++){var o=n[i],c=o.getSnapshot;o=o.value;try{if(!Ft(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 Pn(e,t,n,i){t&=~wc,t&=~Ol,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var o=t;0<o;){var c=31-mt(o),h=1<<c;i[c]=-1,o&=~h}n!==0&&Gl(e,n,t)}function zr(){return(Ve&6)===0?(gs(0),!1):!0}function kc(){if(_e!==null){if(Qe===0)var e=_e.return;else e=_e,hn=jl=null,Vo(e),hi=null,ts=0,e=_e;for(;e!==null;)Tm(e.alternate,e),e=e.return;_e=null}}function ji(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,N0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Nn=0,kc(),et=e,_e=n=dn(e.current,null),Ee=t,Qe=0,ta=null,Kn=!1,bi=ln(e,t),bc=!1,wi=aa=wc=Ol=Jn=ft=0,Xt=ys=null,Sc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var o=31-mt(i),c=1<<o;t|=e[o],i&=~c}return jn=t,lr(),n}function tp(e,t){ge=null,U.H=os,t===fi||t===fr?(t=yh(),Qe=3):t===Co?(t=yh(),Qe=4):Qe=t===lc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,_e===null&&(ft=1,kr(e,ma(t,e.current)))}function ap(){var e=Pt.current;return e===null?!0:(Ee&4194048)===Ee?va===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===va:!1}function np(){var e=U.H;return U.H=os,e===null?os:e}function lp(){var e=U.A;return U.A=a0,e}function Br(){ft=4,Kn||(Ee&4194048)!==Ee&&Pt.current!==null||(bi=!0),(Jn&134217727)===0&&(Ol&134217727)===0||et===null||Pn(et,Ee,aa,!1)}function Ac(e,t,n){var i=Ve;Ve|=2;var o=np(),c=lp();(et!==e||Ee!==t)&&(Ur=null,ji(e,t)),t=!1;var h=ft;e:do try{if(Qe!==0&&_e!==null){var g=_e,S=ta;switch(Qe){case 8:kc(),h=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var T=Qe;if(Qe=0,ta=null,Ni(e,g,S,T),n&&bi){h=0;break e}break;default:T=Qe,Qe=0,ta=null,Ni(e,g,S,T)}}i0(),h=ft;break}catch(q){tp(e,q)}while(!0);return t&&e.shellSuspendCounter++,hn=jl=null,Ve=i,U.H=o,U.A=c,_e===null&&(et=null,Ee=0,lr()),h}function i0(){for(;_e!==null;)ip(_e)}function s0(e,t){var n=Ve;Ve|=2;var i=np(),o=lp();et!==e||Ee!==t?(Ur=null,Dr=tt()+500,ji(e,t)):bi=ln(e,t);e:do try{if(Qe!==0&&_e!==null){t=_e;var c=ta;t:switch(Qe){case 1:Qe=0,ta=null,Ni(e,t,c,1);break;case 2:case 9:if(ph(c)){Qe=0,ta=null,sp(t);break}t=function(){Qe!==2&&Qe!==9||et!==e||(Qe=7),Ja(e)},c.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:ph(c)?(Qe=0,ta=null,sp(t)):(Qe=0,ta=null,Ni(e,t,c,7));break;case 5:var h=null;switch(_e.tag){case 26:h=_e.memoizedState;case 5:case 27:var g=_e;if(h?Gp(h):g.stateNode.complete){Qe=0,ta=null;var S=g.sibling;if(S!==null)_e=S;else{var T=g.return;T!==null?(_e=T,qr(T)):_e=null}break t}}Qe=0,ta=null,Ni(e,t,c,5);break;case 6:Qe=0,ta=null,Ni(e,t,c,6);break;case 8:kc(),ft=6;break e;default:throw Error(u(462))}}r0();break}catch(q){tp(e,q)}while(!0);return hn=jl=null,U.H=i,U.A=o,Ve=n,_e!==null?0:(et=null,Ee=0,lr(),ft)}function r0(){for(;_e!==null&&!tn();)ip(_e)}function ip(e){var t=Rm(e.alternate,e,jn);e.memoizedProps=e.pendingProps,t===null?qr(e):_e=t}function sp(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jm(n,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=jm(n,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:Vo(t);default:Tm(n,t),t=_e=lh(t,jn),t=Rm(n,t,jn)}e.memoizedProps=e.pendingProps,t===null?qr(e):_e=t}function Ni(e,t,n,i){hn=jl=null,Vo(t),hi=null,ts=0;var o=t.return;try{if(Kg(e,o,t,n,Ee)){ft=1,kr(e,ma(n,e.current)),_e=null;return}}catch(c){if(o!==null)throw _e=o,c;ft=1,kr(e,ma(n,e.current)),_e=null;return}t.flags&32768?(Oe||i===1?e=!0:bi||(Ee&536870912)!==0?e=!1:(Kn=e=!0,(i===2||i===9||i===3||i===6)&&(i=Pt.current,i!==null&&i.tag===13&&(i.flags|=16384))),rp(t,e)):qr(t)}function qr(e){var t=e;do{if((t.flags&32768)!==0){rp(t,Kn);return}e=t.return;var n=Wg(t.alternate,t,jn);if(n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);ft===0&&(ft=5)}function rp(e,t){do{var n=Pg(e.alternate,e);if(n!==null){n.flags&=32767,_e=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=n}while(e!==null);ft=6,_e=null}function up(e,t,n,i,o,c,h,g,S){e.cancelPendingCommit=null;do Hr();while(kt!==0);if((Ve&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=po,Hi(e,n,c,h,g,S),e===et&&(_e=et=null,Ee=0),Si=t,Wn=e,Nn=n,jc=c,Nc=o,Fm=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,d0(nn,function(){return hp(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null,o=J.p,J.p=2,h=Ve,Ve|=4;try{e0(e,t,n)}finally{Ve=h,J.p=o,U.T=i}}kt=1,op(),cp(),dp()}}function op(){if(kt===1){kt=0;var e=Wn,t=Si,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var i=J.p;J.p=2;var o=Ve;Ve|=4;try{Ym(t,e);var c=qc,h=Kf(e.containerInfo),g=c.focusedElem,S=c.selectionRange;if(h!==g&&g&&g.ownerDocument&&If(g.ownerDocument.documentElement,g)){if(S!==null&&oo(g)){var T=S.start,q=S.end;if(q===void 0&&(q=T),"selectionStart"in g)g.selectionStart=T,g.selectionEnd=Math.min(q,g.value.length);else{var Q=g.ownerDocument||document,O=Q&&Q.defaultView||window;if(O.getSelection){var M=O.getSelection(),re=g.textContent.length,me=Math.min(S.start,re),Fe=S.end===void 0?me:Math.min(S.end,re);!M.extend&&me>Fe&&(h=Fe,Fe=me,me=h);var k=Xf(g,me),_=Xf(g,Fe);if(k&&_&&(M.rangeCount!==1||M.anchorNode!==k.node||M.anchorOffset!==k.offset||M.focusNode!==_.node||M.focusOffset!==_.offset)){var C=Q.createRange();C.setStart(k.node,k.offset),M.removeAllRanges(),me>Fe?(M.addRange(C),M.extend(_.node,_.offset)):(C.setEnd(_.node,_.offset),M.addRange(C))}}}}for(Q=[],M=g;M=M.parentNode;)M.nodeType===1&&Q.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<Q.length;g++){var G=Q[g];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}Wr=!!Bc,qc=Bc=null}finally{Ve=o,J.p=i,U.T=n}}e.current=t,kt=2}}function cp(){if(kt===2){kt=0;var e=Wn,t=Si,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var i=J.p;J.p=2;var o=Ve;Ve|=4;try{Bm(e,t.alternate,t)}finally{Ve=o,J.p=i,U.T=n}}kt=3}}function dp(){if(kt===4||kt===3){kt=0,an();var e=Wn,t=Si,n=Nn,i=Fm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?kt=5:(kt=0,Si=Wn=null,fp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Fn=null),pl(n),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Za,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=U.T,o=J.p,J.p=2,U.T=null;try{for(var c=e.onRecoverableError,h=0;h<i.length;h++){var g=i[h];c(g.value,{componentStack:g.stack})}}finally{U.T=t,J.p=o}}(Nn&3)!==0&&Hr(),Ja(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===_c?vs++:(vs=0,_c=e):vs=0,gs(0)}}function fp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pi(t)))}function Hr(){return op(),cp(),dp(),hp()}function hp(){if(kt!==5)return!1;var e=Wn,t=jc;jc=0;var n=pl(Nn),i=U.T,o=J.p;try{J.p=32>n?32:n,U.T=null,n=Nc,Nc=null;var c=Wn,h=Nn;if(kt=0,Si=Wn=null,Nn=0,(Ve&6)!==0)throw Error(u(331));var g=Ve;if(Ve|=4,Im(c.current),Gm(c,c.current,h,n),Ve=g,gs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Za,c)}catch{}return!0}finally{J.p=o,U.T=i,fp(e,t)}}function mp(e,t,n){t=ma(n,t),t=nc(e.stateNode,t,2),e=Gn(e,t,2),e!==null&&(sn(e,2),Ja(e))}function Xe(e,t,n){if(e.tag===3)mp(e,e,n);else for(;t!==null;){if(t.tag===3){mp(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Fn===null||!Fn.has(i))){e=ma(n,e),n=pm(2),i=Gn(t,n,2),i!==null&&(xm(n,i,t,e),sn(i,2),Ja(i));break}}t=t.return}}function Ec(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new n0;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(n)||(bc=!0,o.add(n),e=u0.bind(null,e,t,n),t.then(e,e))}function u0(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Ee&n)===n&&(ft===4||ft===3&&(Ee&62914560)===Ee&&300>tt()-Mr?(Ve&2)===0&&ji(e,0):wc|=n,wi===Ee&&(wi=0)),Ja(e)}function pp(e,t){t===0&&(t=Zl()),e=bl(e,t),e!==null&&(sn(e,t),Ja(e))}function o0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pp(e,n)}function c0(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),pp(e,n)}function d0(e,t){return Ya(e,t)}var $r=null,_i=null,Rc=!1,Vr=!1,Cc=!1,el=0;function Ja(e){e!==_i&&e.next===null&&(_i===null?$r=_i=e:_i=_i.next=e),Vr=!0,Rc||(Rc=!0,h0())}function gs(e,t){if(!Cc&&Vr){Cc=!0;do for(var n=!1,i=$r;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var h=i.suspendedLanes,g=i.pingedLanes;c=(1<<31-mt(42|e)+1)-1,c&=o&~(h&~g),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,gp(i,c))}else c=Ee,c=Un(i,i===et?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||ln(i,c)||(n=!0,gp(i,c));i=i.next}while(n);Cc=!1}}function f0(){xp()}function xp(){Vr=Rc=!1;var e=0;el!==0&&j0()&&(e=el);for(var t=tt(),n=null,i=$r;i!==null;){var o=i.next,c=yp(i,t);c===0?(i.next=null,n===null?$r=o:n.next=o,o===null&&(_i=n)):(n=i,(e!==0||(c&3)!==0)&&(Vr=!0)),i=o}kt!==0&&kt!==5||gs(e),el!==0&&(el=0)}function yp(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-mt(c),g=1<<h,S=o[h];S===-1?((g&n)===0||(g&i)!==0)&&(o[h]=Rt(g,t)):S<=t&&(e.expiredLanes|=g),c&=~g}if(t=et,n=Ee,n=Un(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&On(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ln(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&On(i),pl(n)){case 2:case 8:n=Ln;break;case 32:n=nn;break;case 268435456:n=Ht;break;default:n=nn}return i=vp.bind(null,e),n=Ya(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&On(i),e.callbackPriority=2,e.callbackNode=null,2}function vp(e,t){if(kt!==0&&kt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hr()&&e.callbackNode!==n)return null;var i=Ee;return i=Un(e,e===et?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Pm(e,i,t),yp(e,tt()),e.callbackNode!=null&&e.callbackNode===n?vp.bind(null,e):null)}function gp(e,t){if(Hr())return null;Pm(e,t,!0)}function h0(){_0(function(){(Ve&6)!==0?Ya(Ca,f0):xp()})}function Tc(){if(el===0){var e=ci;e===0&&(e=Ga,Ga<<=1,(Ga&261888)===0&&(Ga=256)),el=e}return el}function bp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Js(""+e)}function wp(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 m0(e,t,n,i,o){if(t==="submit"&&n&&n.stateNode===o){var c=bp((o[_t]||null).action),h=i.submitter;h&&(t=(t=h[_t]||null)?bp(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var g=new er("action","action",null,i,o);e.push({event:g,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(el!==0){var S=h?wp(o,h):new FormData(o);Fo(n,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(g.preventDefault(),S=h?wp(o,h):new FormData(o),Fo(n,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var Oc=0;Oc<mo.length;Oc++){var Lc=mo[Oc],p0=Lc.toLowerCase(),x0=Lc[0].toUpperCase()+Lc.slice(1);La(p0,"on"+x0)}La(Wf,"onAnimationEnd"),La(Pf,"onAnimationIteration"),La(eh,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(Og,"onTransitionRun"),La(Lg,"onTransitionStart"),La(Mg,"onTransitionCancel"),La(th,"onTransitionEnd"),Jl("onMouseEnter",["mouseout","mouseover"]),Jl("onMouseLeave",["mouseout","mouseover"]),Jl("onPointerEnter",["pointerout","pointerover"]),Jl("onPointerLeave",["pointerout","pointerover"]),xl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xl("onBeforeInput",["compositionend","keypress","textInput","paste"]),xl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bs="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(" "),y0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bs));function Sp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],o=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var h=i.length-1;0<=h;h--){var g=i[h],S=g.instance,T=g.currentTarget;if(g=g.listener,S!==c&&o.isPropagationStopped())break e;c=g,o.currentTarget=T;try{c(o)}catch(q){nr(q)}o.currentTarget=null,c=S}else for(h=0;h<i.length;h++){if(g=i[h],S=g.instance,T=g.currentTarget,g=g.listener,S!==c&&o.isPropagationStopped())break e;c=g,o.currentTarget=T;try{c(o)}catch(q){nr(q)}o.currentTarget=null,c=S}}}}function ke(e,t){var n=t[Y];n===void 0&&(n=t[Y]=new Set);var i=e+"__bubble";n.has(i)||(jp(t,e,2,!1),n.add(i))}function Mc(e,t,n){var i=0;t&&(i|=4),jp(n,e,i,t)}var Yr="_reactListening"+Math.random().toString(36).slice(2);function Dc(e){if(!e[Yr]){e[Yr]=!0,xf.forEach(function(n){n!=="selectionchange"&&(y0.has(n)||Mc(n,!1,e),Mc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yr]||(t[Yr]=!0,Mc("selectionchange",!1,t))}}function jp(e,t,n,i){switch(Wp(t)){case 2:var o=G0;break;case 8:o=Q0;break;default:o=Jc}n=o.bind(null,t,n,e),o=void 0,!eo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),i?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 Uc(e,t,n,i,o){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var g=i.stateNode.containerInfo;if(g===o)break;if(h===4)for(h=i.return;h!==null;){var S=h.tag;if((S===3||S===4)&&h.stateNode.containerInfo===o)return;h=h.return}for(;g!==null;){if(h=Vt(g),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){i=c=h;continue e}g=g.parentNode}}i=i.return}Ef(function(){var T=c,q=Wu(n),Q=[];e:{var O=ah.get(e);if(O!==void 0){var M=er,re=e;switch(e){case"keypress":if(Ws(n)===0)break e;case"keydown":case"keyup":M=cg;break;case"focusin":re="focus",M=lo;break;case"focusout":re="blur",M=lo;break;case"beforeblur":case"afterblur":M=lo;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":M=Tf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=Wv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=hg;break;case Wf:case Pf:case eh:M=tg;break;case th:M=pg;break;case"scroll":case"scrollend":M=Jv;break;case"wheel":M=yg;break;case"copy":case"cut":case"paste":M=ng;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=Lf;break;case"toggle":case"beforetoggle":M=gg}var me=(t&4)!==0,Fe=!me&&(e==="scroll"||e==="scrollend"),k=me?O!==null?O+"Capture":null:O;me=[];for(var _=T,C;_!==null;){var G=_;if(C=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||C===null||k===null||(G=Vi(_,k),G!=null&&me.push(ws(_,G,C))),Fe)break;_=_.return}0<me.length&&(O=new M(O,re,null,n,q),Q.push({event:O,listeners:me}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",O&&n!==Fu&&(re=n.relatedTarget||n.fromElement)&&(Vt(re)||re[Oa]))break e;if((M||O)&&(O=q.window===q?q:(O=q.ownerDocument)?O.defaultView||O.parentWindow:window,M?(re=n.relatedTarget||n.toElement,M=T,re=re?Vt(re):null,re!==null&&(Fe=f(re),me=re.tag,re!==Fe||me!==5&&me!==27&&me!==6)&&(re=null)):(M=null,re=T),M!==re)){if(me=Tf,G="onMouseLeave",k="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(me=Lf,G="onPointerLeave",k="onPointerEnter",_="pointer"),Fe=M==null?O:$i(M),C=re==null?O:$i(re),O=new me(G,_+"leave",M,n,q),O.target=Fe,O.relatedTarget=C,G=null,Vt(q)===T&&(me=new me(k,_+"enter",re,n,q),me.target=C,me.relatedTarget=Fe,G=me),Fe=G,M&&re)t:{for(me=v0,k=M,_=re,C=0,G=k;G;G=me(G))C++;G=0;for(var fe=_;fe;fe=me(fe))G++;for(;0<C-G;)k=me(k),C--;for(;0<G-C;)_=me(_),G--;for(;C--;){if(k===_||_!==null&&k===_.alternate){me=k;break t}k=me(k),_=me(_)}me=null}else me=null;M!==null&&Np(Q,O,M,me,!1),re!==null&&Fe!==null&&Np(Q,Fe,re,me,!0)}}e:{if(O=T?$i(T):window,M=O.nodeName&&O.nodeName.toLowerCase(),M==="select"||M==="input"&&O.type==="file")var qe=$f;else if(qf(O))if(Vf)qe=Rg;else{qe=Ag;var oe=kg}else M=O.nodeName,!M||M.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?T&&Ju(T.elementType)&&(qe=$f):qe=Eg;if(qe&&(qe=qe(e,T))){Hf(Q,qe,n,q);break e}oe&&oe(e,O,T),e==="focusout"&&T&&O.type==="number"&&T.memoizedProps.value!=null&&Ku(O,"number",O.value)}switch(oe=T?$i(T):window,e){case"focusin":(qf(oe)||oe.contentEditable==="true")&&(ai=oe,co=T,Ji=null);break;case"focusout":Ji=co=ai=null;break;case"mousedown":fo=!0;break;case"contextmenu":case"mouseup":case"dragend":fo=!1,Jf(Q,n,q);break;case"selectionchange":if(Tg)break;case"keydown":case"keyup":Jf(Q,n,q)}var we;if(so)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else ti?zf(e,n)&&(Re="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Re="onCompositionStart");Re&&(Mf&&n.locale!=="ko"&&(ti||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&ti&&(we=Rf()):(Bn=q,to="value"in Bn?Bn.value:Bn.textContent,ti=!0)),oe=Zr(T,Re),0<oe.length&&(Re=new Of(Re,e,null,n,q),Q.push({event:Re,listeners:oe}),we?Re.data=we:(we=Bf(n),we!==null&&(Re.data=we)))),(we=wg?Sg(e,n):jg(e,n))&&(Re=Zr(T,"onBeforeInput"),0<Re.length&&(oe=new Of("onBeforeInput","beforeinput",null,n,q),Q.push({event:oe,listeners:Re}),oe.data=we)),m0(Q,e,T,n,q)}Sp(Q,t)})}function ws(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zr(e,t){for(var n=t+"Capture",i=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Vi(e,n),o!=null&&i.unshift(ws(e,o,c)),o=Vi(e,t),o!=null&&i.push(ws(e,o,c))),e.tag===3)return i;e=e.return}return[]}function v0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Np(e,t,n,i,o){for(var c=t._reactName,h=[];n!==null&&n!==i;){var g=n,S=g.alternate,T=g.stateNode;if(g=g.tag,S!==null&&S===i)break;g!==5&&g!==26&&g!==27||T===null||(S=T,o?(T=Vi(n,c),T!=null&&h.unshift(ws(n,T,S))):o||(T=Vi(n,c),T!=null&&h.push(ws(n,T,S)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var g0=/\r\n?/g,b0=/\u0000|\uFFFD/g;function _p(e){return(typeof e=="string"?e:""+e).replace(g0,`
|
|
49
|
+
`).replace(b0,"")}function kp(e,t){return t=_p(t),_p(e)===t}function Je(e,t,n,i,o,c){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Wl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Wl(e,""+i);break;case"className":Is(e,"class",i);break;case"tabIndex":Is(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Is(e,n,i);break;case"style":kf(e,i,c);break;case"data":if(t!=="object"){Is(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Js(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="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(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Js(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=on);break;case"onScroll":i!=null&&ke("scroll",e);break;case"onScrollEnd":i!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(n=i.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=Js(""+i),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":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":ke("beforetoggle",e),ke("toggle",e),Xs(e,"popover",i);break;case"xlinkActuate":un(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":un(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":un(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":un(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":un(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":un(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":un(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Xs(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Iv.get(n)||n,Xs(e,n,i))}}function zc(e,t,n,i,o,c){switch(n){case"style":kf(e,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(n=i.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Wl(e,i):(typeof i=="number"||typeof i=="bigint")&&Wl(e,""+i);break;case"onScroll":i!=null&&ke("scroll",e);break;case"onScrollEnd":i!=null&&ke("scrollend",e);break;case"onClick":i!=null&&(e.onclick=on);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yf.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[_t]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof i=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,o);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):Xs(e,n,i)}}}function Lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var i=!1,o=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":i=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Je(e,t,c,h,n,null)}}o&&Je(e,t,"srcSet",n.srcSet,n,null),i&&Je(e,t,"src",n.src,n,null);return;case"input":ke("invalid",e);var g=c=h=o=null,S=null,T=null;for(i in n)if(n.hasOwnProperty(i)){var q=n[i];if(q!=null)switch(i){case"name":o=q;break;case"type":h=q;break;case"checked":S=q;break;case"defaultChecked":T=q;break;case"value":c=q;break;case"defaultValue":g=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:Je(e,t,i,q,n,null)}}Sf(e,c,g,S,T,h,o,!1);return;case"select":ke("invalid",e),i=h=c=null;for(o in n)if(n.hasOwnProperty(o)&&(g=n[o],g!=null))switch(o){case"value":c=g;break;case"defaultValue":h=g;break;case"multiple":i=g;default:Je(e,t,o,g,n,null)}t=c,n=h,e.multiple=!!i,t!=null?Fl(e,!!i,t,!1):n!=null&&Fl(e,!!i,n,!0);return;case"textarea":ke("invalid",e),c=o=i=null;for(h in n)if(n.hasOwnProperty(h)&&(g=n[h],g!=null))switch(h){case"value":i=g;break;case"defaultValue":o=g;break;case"children":c=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(u(91));break;default:Je(e,t,h,g,n,null)}Nf(e,i,o,c);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(i=n[S],i!=null))switch(S){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Je(e,t,S,i,n,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(i=0;i<bs.length;i++)ke(bs[i],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(T in n)if(n.hasOwnProperty(T)&&(i=n[T],i!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Je(e,t,T,i,n,null)}return;default:if(Ju(t)){for(q in n)n.hasOwnProperty(q)&&(i=n[q],i!==void 0&&zc(e,t,q,i,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(i=n[g],i!=null&&Je(e,t,g,i,n,null))}function w0(e,t,n,i){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,h=null,g=null,S=null,T=null,q=null;for(M in n){var Q=n[M];if(n.hasOwnProperty(M)&&Q!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":S=Q;default:i.hasOwnProperty(M)||Je(e,t,M,null,i,Q)}}for(var O in i){var M=i[O];if(Q=n[O],i.hasOwnProperty(O)&&(M!=null||Q!=null))switch(O){case"type":c=M;break;case"name":o=M;break;case"checked":T=M;break;case"defaultChecked":q=M;break;case"value":h=M;break;case"defaultValue":g=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:M!==Q&&Je(e,t,O,M,i,Q)}}Iu(e,h,g,S,T,q,c,o);return;case"select":M=h=g=O=null;for(c in n)if(S=n[c],n.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":M=S;default:i.hasOwnProperty(c)||Je(e,t,c,null,i,S)}for(o in i)if(c=i[o],S=n[o],i.hasOwnProperty(o)&&(c!=null||S!=null))switch(o){case"value":O=c;break;case"defaultValue":g=c;break;case"multiple":h=c;default:c!==S&&Je(e,t,o,c,i,S)}t=g,n=h,i=M,O!=null?Fl(e,!!n,O,!1):!!i!=!!n&&(t!=null?Fl(e,!!n,t,!0):Fl(e,!!n,n?[]:"",!1));return;case"textarea":M=O=null;for(g in n)if(o=n[g],n.hasOwnProperty(g)&&o!=null&&!i.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Je(e,t,g,null,i,o)}for(h in i)if(o=i[h],c=n[h],i.hasOwnProperty(h)&&(o!=null||c!=null))switch(h){case"value":O=o;break;case"defaultValue":M=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&Je(e,t,h,o,i,c)}jf(e,O,M);return;case"option":for(var re in n)if(O=n[re],n.hasOwnProperty(re)&&O!=null&&!i.hasOwnProperty(re))switch(re){case"selected":e.selected=!1;break;default:Je(e,t,re,null,i,O)}for(S in i)if(O=i[S],M=n[S],i.hasOwnProperty(S)&&O!==M&&(O!=null||M!=null))switch(S){case"selected":e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Je(e,t,S,O,i,M)}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 me in n)O=n[me],n.hasOwnProperty(me)&&O!=null&&!i.hasOwnProperty(me)&&Je(e,t,me,null,i,O);for(T in i)if(O=i[T],M=n[T],i.hasOwnProperty(T)&&O!==M&&(O!=null||M!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Je(e,t,T,O,i,M)}return;default:if(Ju(t)){for(var Fe in n)O=n[Fe],n.hasOwnProperty(Fe)&&O!==void 0&&!i.hasOwnProperty(Fe)&&zc(e,t,Fe,void 0,i,O);for(q in i)O=i[q],M=n[q],!i.hasOwnProperty(q)||O===M||O===void 0&&M===void 0||zc(e,t,q,O,i,M);return}}for(var k in n)O=n[k],n.hasOwnProperty(k)&&O!=null&&!i.hasOwnProperty(k)&&Je(e,t,k,null,i,O);for(Q in i)O=i[Q],M=n[Q],!i.hasOwnProperty(Q)||O===M||O==null&&M==null||Je(e,t,Q,O,i,M)}function Ap(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function S0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var o=n[i],c=o.transferSize,h=o.initiatorType,g=o.duration;if(c&&g&&Ap(h)){for(h=0,g=o.responseEnd,i+=1;i<n.length;i++){var S=n[i],T=S.startTime;if(T>g)break;var q=S.transferSize,Q=S.initiatorType;q&&Ap(Q)&&(S=S.responseEnd,h+=q*(S<g?1:(g-T)/(S-T)))}if(--i,t+=8*(c+h)/(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 Bc=null,qc=null;function Gr(e){return e.nodeType===9?e:e.ownerDocument}function Ep(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 Rp(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 Hc(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 $c=null;function j0(){var e=window.event;return e&&e.type==="popstate"?e===$c?!1:($c=e,!0):($c=null,!1)}var Cp=typeof setTimeout=="function"?setTimeout:void 0,N0=typeof clearTimeout=="function"?clearTimeout:void 0,Tp=typeof Promise=="function"?Promise:void 0,_0=typeof queueMicrotask=="function"?queueMicrotask:typeof Tp<"u"?function(e){return Tp.resolve(null).then(e).catch(k0)}:Cp;function k0(e){setTimeout(function(){throw e})}function tl(e){return e==="head"}function Op(e,t){var n=t,i=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(o),Ri(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Ss(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ss(n);for(var c=n.firstChild;c;){var h=c.nextSibling,g=c.nodeName;c[Te]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&Ss(e.ownerDocument.body);n=o}while(n);Ri(t)}function Lp(e,t){var n=e;e=0;do{var i=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||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Vc(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":Vc(n),Pe(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function A0(e,t,n,i){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Te])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=ga(e.nextSibling),e===null)break}return null}function E0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ga(e.nextSibling),e===null))return null;return e}function Mp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ga(e.nextSibling),e===null))return null;return e}function Yc(e){return e.data==="$?"||e.data==="$~"}function Zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function R0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ga(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 Gc=null;function Dp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ga(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Up(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 zp(e,t,n){switch(t=Gr(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ss(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pe(e)}var ba=new Map,Bp=new Set;function Qr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _n=J.d;J.d={f:C0,r:T0,D:O0,C:L0,L:M0,m:D0,X:z0,S:U0,M:B0};function C0(){var e=_n.f(),t=zr();return e||t}function T0(e){var t=Il(e);t!==null&&t.tag===5&&t.type==="form"?tm(t):_n.r(e)}var ki=typeof document>"u"?null:document;function qp(e,t,n){var i=ki;if(i&&typeof t=="string"&&t){var o=fa(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Bp.has(o)||(Bp.add(o),e={rel:e,crossOrigin:n,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),Lt(t,"link",e),At(t),i.head.appendChild(t)))}}function O0(e){_n.D(e),qp("dns-prefetch",e,null)}function L0(e,t){_n.C(e,t),qp("preconnect",e,t)}function M0(e,t,n){_n.L(e,t,n);var i=ki;if(i&&e&&t){var o='link[rel="preload"][as="'+fa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+fa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+fa(n.imageSizes)+'"]')):o+='[href="'+fa(e)+'"]';var c=o;switch(t){case"style":c=Ai(e);break;case"script":c=Ei(e)}ba.has(c)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ba.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(js(c))||t==="script"&&i.querySelector(Ns(c))||(t=i.createElement("link"),Lt(t,"link",e),At(t),i.head.appendChild(t)))}}function D0(e,t){_n.m(e,t);var n=ki;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+fa(i)+'"][href="'+fa(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ei(e)}if(!ba.has(c)&&(e=j({rel:"modulepreload",href:e},t),ba.set(c,e),n.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ns(c)))return}i=n.createElement("link"),Lt(i,"link",e),At(i),n.head.appendChild(i)}}}function U0(e,t,n){_n.S(e,t,n);var i=ki;if(i&&e){var o=Kl(i).hoistableStyles,c=Ai(e);t=t||"default";var h=o.get(c);if(!h){var g={loading:0,preload:null};if(h=i.querySelector(js(c)))g.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ba.get(c))&&Qc(e,n);var S=h=i.createElement("link");At(S),Lt(S,"link",e),S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Xr(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:g},o.set(c,h)}}}function z0(e,t){_n.X(e,t);var n=ki;if(n&&e){var i=Kl(n).hoistableScripts,o=Ei(e),c=i.get(o);c||(c=n.querySelector(Ns(o)),c||(e=j({src:e,async:!0},t),(t=ba.get(o))&&Xc(e,t),c=n.createElement("script"),At(c),Lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function B0(e,t){_n.M(e,t);var n=ki;if(n&&e){var i=Kl(n).hoistableScripts,o=Ei(e),c=i.get(o);c||(c=n.querySelector(Ns(o)),c||(e=j({src:e,async:!0,type:"module"},t),(t=ba.get(o))&&Xc(e,t),c=n.createElement("script"),At(c),Lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Hp(e,t,n,i){var o=(o=B.current)?Qr(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ai(n.href),n=Kl(o).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ai(n.href);var c=Kl(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(js(e)))&&!c._p&&(h.instance=c,h.state.loading=5),ba.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},ba.set(e,n),c||q0(o,e,n,h.state))),t&&i===null)throw Error(u(528,""));return h}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ei(n),n=Kl(o).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Ai(e){return'href="'+fa(e)+'"'}function js(e){return'link[rel="stylesheet"]['+e+"]"}function $p(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function q0(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Lt(t,"link",n),At(t),e.head.appendChild(t))}function Ei(e){return'[src="'+fa(e)+'"]'}function Ns(e){return"script[async]"+e}function Vp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+fa(n.href)+'"]');if(i)return t.instance=i,At(i),i;var o=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),At(i),Lt(i,"style",o),Xr(i,n.precedence,e),t.instance=i;case"stylesheet":o=Ai(n.href);var c=e.querySelector(js(o));if(c)return t.state.loading|=4,t.instance=c,At(c),c;i=$p(n),(o=ba.get(o))&&Qc(i,o),c=(e.ownerDocument||e).createElement("link"),At(c);var h=c;return h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Lt(c,"link",i),t.state.loading|=4,Xr(c,n.precedence,e),t.instance=c;case"script":return c=Ei(n.src),(o=e.querySelector(Ns(c)))?(t.instance=o,At(o),o):(i=n,(o=ba.get(c))&&(i=j({},n),Xc(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),At(o),Lt(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Xr(i,n.precedence,e));return t.instance}function Xr(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,h=0;h<i.length;h++){var g=i[h];if(g.dataset.precedence===t)c=g;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 Qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ir=null;function Yp(e,t,n){if(Ir===null){var i=new Map,o=Ir=new Map;o.set(n,i)}else o=Ir,i=o.get(n),i||(i=new Map,o.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var c=n[o];if(!(c[Te]||c[ct]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var g=i.get(h);g?g.push(c):i.set(h,[c])}}return i}function Zp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function H0(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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Gp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $0(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Ai(i.href),c=t.querySelector(js(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Kr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,At(c);return}c=t.ownerDocument||t,i=$p(i),(o=ba.get(o))&&Qc(i,o),c=c.createElement("link"),At(c);var h=c;h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Lt(c,"link",i),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=Kr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ic=0;function V0(e,t){return e.stylesheets&&e.count===0&&Fr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Fr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ic===0&&(Ic=62500*S0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fr(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Ic?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Kr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jr=null;function Fr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jr=new Map,t.forEach(Y0,e),Jr=null,Kr.call(e))}function Y0(e,t){if(!(t.state.loading&4)){var n=Jr.get(e);if(n)var i=n.get(null);else{n=new Map,Jr.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var h=o[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),i=h)}i&&n.set(null,i)}o=t.instance,h=o.getAttribute("data-precedence"),c=n.get(h)||i,c===i&&n.set(null,o),n.set(h,o),this.count++,i=Kr.bind(this),o.addEventListener("load",i),o.addEventListener("error",i),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var _s={$$typeof:P,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function Z0(e,t,n,i,o,c,h,g,S){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=hl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hl(0),this.hiddenUpdates=hl(null),this.identifierPrefix=i,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Qp(e,t,n,i,o,c,h,g,S,T,q,Q){return e=new Z0(e,t,n,h,S,T,q,Q,g),t=1,c===!0&&(t|=24),c=Wt(3,null,null,t),e.current=c,c.stateNode=e,t=Ao(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:n,cache:t},To(c),e}function Xp(e){return e?(e=ii,e):ii}function Ip(e,t,n,i,o,c){o=Xp(o),i.context===null?i.context=o:i.pendingContext=o,i=Zn(t),i.payload={element:n},c=c===void 0?null:c,c!==null&&(i.callback=c),n=Gn(e,i,t),n!==null&&(It(n,e,t),ns(n,e,t))}function Kp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Kc(e,t){Kp(e,t),(e=e.alternate)&&Kp(e,t)}function Jp(e){if(e.tag===13||e.tag===31){var t=bl(e,67108864);t!==null&&It(t,e,67108864),Kc(e,67108864)}}function Fp(e){if(e.tag===13||e.tag===31){var t=na();t=zn(t);var n=bl(e,t);n!==null&&It(n,e,t),Kc(e,t)}}var Wr=!0;function G0(e,t,n,i){var o=U.T;U.T=null;var c=J.p;try{J.p=2,Jc(e,t,n,i)}finally{J.p=c,U.T=o}}function Q0(e,t,n,i){var o=U.T;U.T=null;var c=J.p;try{J.p=8,Jc(e,t,n,i)}finally{J.p=c,U.T=o}}function Jc(e,t,n,i){if(Wr){var o=Fc(i);if(o===null)Uc(e,t,i,Pr,n),Pp(e,i);else if(I0(o,e,t,n,i))i.stopPropagation();else if(Pp(e,i),t&4&&-1<X0.indexOf(e)){for(;o!==null;){var c=Il(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=ca(c.pendingLanes);if(h!==0){var g=c;for(g.pendingLanes|=2,g.entangledLanes|=2;h;){var S=1<<31-mt(h);g.entanglements[1]|=S,h&=~S}Ja(c),(Ve&6)===0&&(Dr=tt()+500,gs(0))}}break;case 31:case 13:g=bl(c,2),g!==null&&It(g,c,2),zr(),Kc(c,2)}if(c=Fc(i),c===null&&Uc(e,t,i,Pr,n),c===o)break;o=c}o!==null&&i.stopPropagation()}else Uc(e,t,i,null,n)}}function Fc(e){return e=Wu(e),Wc(e)}var Pr=null;function Wc(e){if(Pr=null,e=Vt(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=x(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 Pr=e,null}function Wp(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(Vl()){case Ca:return 2;case Ln:return 8;case nn:case Mn:return 32;case Ht:return 268435456;default:return 32}default:return 32}}var Pc=!1,al=null,nl=null,ll=null,ks=new Map,As=new Map,il=[],X0="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 Pp(e,t){switch(e){case"focusin":case"focusout":al=null;break;case"dragenter":case"dragleave":nl=null;break;case"mouseover":case"mouseout":ll=null;break;case"pointerover":case"pointerout":ks.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(t.pointerId)}}function Es(e,t,n,i,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Il(t),t!==null&&Jp(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function I0(e,t,n,i,o){switch(t){case"focusin":return al=Es(al,e,t,n,i,o),!0;case"dragenter":return nl=Es(nl,e,t,n,i,o),!0;case"mouseover":return ll=Es(ll,e,t,n,i,o),!0;case"pointerover":var c=o.pointerId;return ks.set(c,Es(ks.get(c)||null,e,t,n,i,o)),!0;case"gotpointercapture":return c=o.pointerId,As.set(c,Es(As.get(c)||null,e,t,n,i,o)),!0}return!1}function ex(e){var t=Vt(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,rn(e.priority,function(){Fp(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,rn(e.priority,function(){Fp(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 eu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fc(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Fu=i,n.target.dispatchEvent(i),Fu=null}else return t=Il(n),t!==null&&Jp(t),e.blockedOn=n,!1;t.shift()}return!0}function tx(e,t,n){eu(e)&&n.delete(t)}function K0(){Pc=!1,al!==null&&eu(al)&&(al=null),nl!==null&&eu(nl)&&(nl=null),ll!==null&&eu(ll)&&(ll=null),ks.forEach(tx),As.forEach(tx)}function tu(e,t){e.blockedOn===t&&(e.blockedOn=null,Pc||(Pc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,K0)))}var au=null;function ax(e){au!==e&&(au=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){au===e&&(au=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],o=e[t+2];if(typeof i!="function"){if(Wc(i||n)===null)continue;break}var c=Il(n);c!==null&&(e.splice(t,3),t-=3,Fo(c,{pending:!0,data:o,method:n.method,action:i},i,o))}}))}function Ri(e){function t(S){return tu(S,e)}al!==null&&tu(al,e),nl!==null&&tu(nl,e),ll!==null&&tu(ll,e),ks.forEach(t),As.forEach(t);for(var n=0;n<il.length;n++){var i=il[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<il.length&&(n=il[0],n.blockedOn===null);)ex(n),n.blockedOn===null&&il.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var o=n[i],c=n[i+1],h=o[_t]||null;if(typeof c=="function")h||ax(n);else if(h){var g=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[_t]||null)g=h.formAction;else if(Wc(o)!==null)continue}else g=h.action;typeof g=="function"?n[i+1]=g:(n.splice(i,3),i-=3),ax(n)}}}function nx(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return o=h})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),i||setTimeout(n,20)}function n(){if(!i&&!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 i=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function ed(e){this._internalRoot=e}nu.prototype.render=ed.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,i=na();Ip(n,i,e,t,null,null)},nu.prototype.unmount=ed.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ip(e.current,2,null,e,null,null),zr(),t[Oa]=null}};function nu(e){this._internalRoot=e}nu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<il.length&&t!==0&&t<il[n].priority;n++);il.splice(n,0,e),n===0&&ex(e)}};var lx=l.version;if(lx!=="19.2.7")throw Error(u(527,lx,"19.2.7"));J.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var J0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{Za=lu.inject(J0),at=lu}catch{}}return Cs.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,i="",o=dm,c=fm,h=hm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Qp(e,1,!1,null,null,n,i,null,o,c,h,nx),e[Oa]=t.current,Dc(e),new ed(t)},Cs.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var i=!1,o="",c=dm,h=fm,g=hm,S=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=Qp(e,1,!0,t,n??null,i,o,S,c,h,g,nx),t.context=Xp(null),n=t.current,i=na(),i=zn(i),o=Zn(i),o.callback=null,Gn(n,o,i),n=i,t.current.lanes=n,sn(t,n),Ja(t),e[Oa]=t.current,Dc(e),new nu(t)},Cs.version="19.2.7",Cs}var mx;function sb(){if(mx)return nd.exports;mx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),nd.exports=ib(),nd.exports}var rb=sb();/**
|
|
50
|
+
* react-router v7.18.4
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Id=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,gy=/^[\\/]{2}/;function ub(a,l){return l+a.replace(/\\/g,"/")}var px="popstate";function xx(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function ob(a={}){function l(u,d){var v;let f=(v=d.state)==null?void 0:v.masked,{pathname:m,search:x,hash:y}=f||u.location;return Td("",{pathname:m,search:x,hash:y},d.state&&d.state.usr||null,d.state&&d.state.key||"default",f?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function s(u,d){return typeof d=="string"?d:Dl(d)}return db(l,s,null,a)}function ut(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function ka(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function cb(){return Math.random().toString(36).substring(2,10)}function yx(a,l){return{usr:a.state,key:a.key,idx:l,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function Td(a,l,s=null,u,d){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?Ui(l):l,state:s,key:l&&l.key||u||cb(),mask:d}}function Dl({pathname:a="/",search:l="",hash:s=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(a+=s.charAt(0)==="#"?s:"#"+s),a}function Ui(a){let l={};if(a){let s=a.indexOf("#");s>=0&&(l.hash=a.substring(s),a=a.substring(0,s));let u=a.indexOf("?");u>=0&&(l.search=a.substring(u),a=a.substring(0,u)),a&&(l.pathname=a)}return l}function db(a,l,s,u={}){let{window:d=document.defaultView,v5Compat:f=!1}=u,m=d.history,x="POP",y=null,v=w();v==null&&(v=0,m.replaceState({...m.state,idx:v},""));function w(){return(m.state||{idx:null}).idx}function j(){x="POP";let L=w(),H=L==null?null:L-v;v=L,y&&y({action:x,location:$.location,delta:H})}function D(L,H){x="PUSH";let F=xx(L)?L:Td($.location,L,H);v=w()+1;let P=yx(F,v),le=$.createHref(F.mask||F);try{m.pushState(P,"",le)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(le)}f&&y&&y({action:x,location:$.location,delta:1})}function X(L,H){x="REPLACE";let F=xx(L)?L:Td($.location,L,H);v=w();let P=yx(F,v),le=$.createHref(F.mask||F);m.replaceState(P,"",le),f&&y&&y({action:x,location:$.location,delta:0})}function R(L){return fb(d,L)}let $={get action(){return x},get location(){return a(d,m)},listen(L){if(y)throw new Error("A history only accepts one active listener");return d.addEventListener(px,j),y=L,()=>{d.removeEventListener(px,j),y=null}},createHref(L){return l(d,L)},createURL:R,encodeLocation(L){let H=R(L);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:D,replace:X,go(L){return m.go(L)}};return $}function fb(a,l,s=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),ut(u,"No window.location.(origin|href) available to create URL");let d=typeof l=="string"?l:Dl(l);return d=d.replace(/ $/,"%20"),!s&&gy.test(d)&&(d=u+d),new URL(d,u)}function by(a,l,s="/"){return hb(a,l,s,!1)}function hb(a,l,s,u,d){let f=typeof l=="string"?Ui(l):l,m=Rn(f.pathname||"/",s);if(m==null)return null;let x=mb(a),y=null,v=_b(m);for(let w=0;y==null&&w<x.length;++w)y=Nb(x[w],v,u);return y}function mb(a){let l=wy(a);return pb(l),l}function wy(a,l=[],s=[],u="",d=!1){let f=(m,x,y=d,v)=>{let w={relativePath:v===void 0?m.path||"":v,caseSensitive:m.caseSensitive===!0,childrenIndex:x,route:m};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(u)&&y)return;ut(w.relativePath.startsWith(u),`Absolute route path "${w.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(u.length)}let j=Ba([u,w.relativePath]),D=s.concat(w);m.children&&m.children.length>0&&(ut(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),wy(m.children,l,D,j,y)),!(m.path==null&&!m.index)&&l.push({path:j,score:Sb(j,m.index),routesMeta:D.map((X,R)=>{let[$,L]=Ny(X.relativePath,X.caseSensitive,R===D.length-1);return{...X,matcher:$,compiledParams:L}})})};return a.forEach((m,x)=>{var y;if(m.path===""||!((y=m.path)!=null&&y.includes("?")))f(m,x);else for(let v of Sy(m.path))f(m,x,!0,v)}),l}function Sy(a){let l=a.split("/");if(l.length===0)return[];let[s,...u]=l,d=s.endsWith("?"),f=s.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=Sy(u.join("/")),x=[];return x.push(...m.map(y=>y===""?f:[f,y].join("/"))),d&&x.push(...m),x.map(y=>a.startsWith("/")&&y===""?"/":y)}function pb(a){a.sort((l,s)=>l.score!==s.score?s.score-l.score:jb(l.routesMeta.map(u=>u.childrenIndex),s.routesMeta.map(u=>u.childrenIndex)))}var xb=/^:[\w-]+$/,yb=3,vb=2,gb=1,bb=10,wb=-2,vx=a=>a==="*";function Sb(a,l){let s=a.split("/"),u=s.length;return s.some(vx)&&(u+=wb),l&&(u+=vb),s.filter(d=>!vx(d)).reduce((d,f)=>d+(xb.test(f)?yb:f===""?gb:bb),u)}function jb(a,l){return a.length===l.length&&a.slice(0,-1).every((u,d)=>u===l[d])?a[a.length-1]-l[l.length-1]:0}function Nb(a,l,s=!1){let{routesMeta:u}=a,d={},f="/",m=[];for(let x=0;x<u.length;++x){let y=u[x],v=x===u.length-1,w=f==="/"?l:l.slice(f.length)||"/",j={path:y.relativePath,caseSensitive:y.caseSensitive,end:v},D=y.matcher&&y.compiledParams?jy(j,w,y.matcher,y.compiledParams):yu(j,w),X=y.route;if(!D&&v&&s&&!u[u.length-1].route.index&&(D=yu({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!D)return null;Object.assign(d,D.params),m.push({params:d,pathname:Ba([f,D.pathname]),pathnameBase:Eb(Ba([f,D.pathnameBase])),route:X}),D.pathnameBase!=="/"&&(f=Ba([f,D.pathnameBase]))}return m}function yu(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[s,u]=Ny(a.path,a.caseSensitive,a.end);return jy(a,l,s,u)}function jy(a,l,s,u){let d=l.match(s);if(!d)return null;let f=d[0],m=Li(f,1),x=d.slice(1);return{params:u.reduce((v,{paramName:w,isOptional:j},D)=>{if(w==="*"){let R=x[D]||"";m=Li(f.slice(0,f.length-R.length),1)}const X=x[D];return j&&!X?v[w]=void 0:v[w]=(X||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:m,pattern:a}}function Ny(a,l=!1,s=!0){ka(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let u=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,x,y,v,w)=>{if(u.push({paramName:x,isOptional:y!=null}),y){let j=w.charAt(v+m.length);return j&&j!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,l?void 0:"i"),u]}function _b(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return ka(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function Rn(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,u=a.charAt(s);return u&&u!=="/"?null:a.slice(s)||"/"}function kb(a,l="/"){let{pathname:s,search:u="",hash:d=""}=typeof a=="string"?Ui(a):a,f;return s?(s=_y(s),s.startsWith("/")||s.startsWith("\\")?f=gx(s.substring(1),"/"):f=gx(s,l)):f=l,{pathname:f,search:Rb(u),hash:Cb(d)}}function gx(a,l){let s=Li(l).split("/");return a.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function rd(a,l,s,u){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ab(a){return a.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function Kd(a){let l=Ab(a);return l.map((s,u)=>u===l.length-1?s.pathname:s.pathnameBase)}function Ou(a,l,s,u=!1){let d;typeof a=="string"?d=Ui(a):(d={...a},ut(!d.pathname||!d.pathname.includes("?"),rd("?","pathname","search",d)),ut(!d.pathname||!d.pathname.includes("#"),rd("#","pathname","hash",d)),ut(!d.search||!d.search.includes("#"),rd("#","search","hash",d)));let f=a===""||d.pathname==="",m=f?"/":d.pathname,x;if(m==null)x=s;else{let j=l.length-1;if(!u&&m.startsWith("..")){let D=m.split("/");for(;D[0]==="..";)D.shift(),j-=1;d.pathname=D.join("/")}x=j>=0?l[j]:"/"}let y=kb(d,x),v=m&&m!=="/"&&m.endsWith("/"),w=(f||m===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(v||w)&&(y.pathname+="/"),y}var _y=a=>a.replace(/[\\/]{2,}/g,"/"),Ba=a=>_y(a.join("/"));function Li(a,l=0){let s=a.length;for(;s>l&&a.charCodeAt(s-1)===47;)s--;return s===a.length?a:a.slice(0,s)}var Eb=a=>Li(a).replace(/^\/*/,"/"),Rb=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Cb=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Tb=class{constructor(a,l,s,u=!1){this.status=a,this.statusText=l||"",this.internal=u,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Ob(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Lb(a){let l=a.map(s=>s.route.path).filter(Boolean);return Ba(l)||"/"}var ky=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ay(a,l){let s=a;if(typeof s!="string"||!Id.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let u=s,d=!1;if(ky)try{let f=new URL(window.location.href),m=gy.test(s)?new URL(ub(s,f.protocol)):new URL(s),x=Rn(m.pathname,l);m.origin===f.origin&&x!=null?s=x+m.search+m.hash:d=!0}catch{ka(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var bx=new URL("http://localhost");function Jd(a){if(a.createURL)return a.createURL("/");try{return new URL(a.createHref("/"),bx)}catch{return bx}}function ud(a,l){return a.origin===l.origin&&(a.origin!=="null"||a.protocol===l.protocol&&a.host===l.host)}function Mb(a,l){if(a.startsWith("//"))return!0;let s=l.protocol.toLowerCase();return a.toLowerCase().startsWith(s)?l.host===""||a.slice(s.length).startsWith("//"):!1}function Fd(a,l,s,u){let d=null;try{d=a==null?null:new URL(a,s)}catch{}let f=new URL(l,s),m=d!=null&&!ud(d,s),x=!ud(f,s);if(u==="reject"){if(m||x)throw new Error("External navigation is not allowed")}else if(x&&(d==null||!Mb(a,d)||!ud(d,f)))throw new Error("External navigation is not allowed")}var Ey=["POST","PUT","PATCH","DELETE"];new Set(Ey);var Db=["GET",...Ey];new Set(Db);var Ub=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function zb(a){try{return Ub.includes(new URL(a).protocol)}catch{return!1}}var zi=b.createContext(null);zi.displayName="DataRouter";var Lu=b.createContext(null);Lu.displayName="DataRouterState";var Ry=b.createContext(!1);function Bb(){return b.useContext(Ry)}var Cy=b.createContext({isTransitioning:!1});Cy.displayName="ViewTransition";var qb=b.createContext(new Map);qb.displayName="Fetchers";var Hb=b.createContext(null);Hb.displayName="Await";var ra=b.createContext(null);ra.displayName="Navigation";var Zs=b.createContext(null);Zs.displayName="Location";var Ha=b.createContext({outlet:null,matches:[],isDataRoute:!1});Ha.displayName="Route";var Wd=b.createContext(null);Wd.displayName="RouteError";var Ty="REACT_ROUTER_ERROR",$b="REDIRECT",Vb="ROUTE_ERROR_RESPONSE";function Yb(a){if(a.startsWith(`${Ty}:${$b}:{`))try{let l=JSON.parse(a.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function Zb(a){if(a.startsWith(`${Ty}:${Vb}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new Tb(l.status,l.statusText,l.data)}catch{}}function Gb(a,{relative:l}={}){ut(Bi(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:u}=b.useContext(ra),{hash:d,pathname:f,search:m}=Gs(a,{relative:l}),x=f;return s!=="/"&&(x=f==="/"?s:Ba([s,f])),u.createHref({pathname:x,search:m,hash:d})}function Bi(){return b.useContext(Zs)!=null}function Aa(){return ut(Bi(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Zs).location}var Oy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ly(a){b.useContext(ra).static||b.useLayoutEffect(a)}function Mu(){let{isDataRoute:a}=b.useContext(Ha);return a?i1():Qb()}function Qb(){ut(Bi(),"useNavigate() may be used only in the context of a <Router> component.");let a=b.useContext(zi),{basename:l,navigator:s}=b.useContext(ra),{matches:u}=b.useContext(Ha),{pathname:d}=Aa(),f=JSON.stringify(Kd(u)),m=b.useRef(!1);return Ly(()=>{m.current=!0}),b.useCallback((y,v={})=>{if(ka(m.current,Oy),!m.current)return;if(typeof y=="number"){s.go(y);return}let w=Ou(y,JSON.parse(f),d,v.relative==="path");a==null&&l!=="/"&&(w.pathname=w.pathname==="/"?l:Ba([l,w.pathname])),Fd(typeof y=="string"?y:Dl(y),s.createHref(w),Jd(s),"reject"),(v.replace?s.replace:s.push)(w,v.state,v)},[l,s,f,d,a])}b.createContext(null);function Xb(){let{matches:a}=b.useContext(Ha),l=a[a.length-1];return(l==null?void 0:l.params)??{}}function Gs(a,{relative:l}={}){let{matches:s}=b.useContext(Ha),{pathname:u}=Aa(),d=JSON.stringify(Kd(s));return b.useMemo(()=>Ou(a,JSON.parse(d),u,l==="path"),[a,d,u,l])}function Ib(a,l){return My(a,l)}function My(a,l,s){var L;ut(Bi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=b.useContext(ra),{matches:d}=b.useContext(Ha),f=d[d.length-1],m=f?f.params:{},x=f?f.pathname:"/",y=f?f.pathnameBase:"/",v=f&&f.route;{let H=v&&v.path||"";Uy(x,!v||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${H}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let w=Aa(),j;if(l){let H=typeof l=="string"?Ui(l):l;ut(y==="/"||((L=H.pathname)==null?void 0:L.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${H.pathname}" was given in the \`location\` prop.`),j=H}else j=w;let D=j.pathname||"/",X=D;if(y!=="/"){let H=y.replace(/^\//,"").split("/");X="/"+D.replace(/^\//,"").split("/").slice(H.length).join("/")}let R=s&&s.state.matches.length?s.state.matches.map(H=>Object.assign(H,{route:s.manifest[H.route.id]||H.route})):by(a,{pathname:X});ka(v||R!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),ka(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let $=Pb(R&&R.map(H=>Object.assign({},H,{params:Object.assign({},m,H.params),pathname:Ba([y,u.encodeLocation?u.encodeLocation(H.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?y:Ba([y,u.encodeLocation?u.encodeLocation(H.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),d,s);return l&&$?b.createElement(Zs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...j},navigationType:"POP"}},$):$}function Kb(){let a=l1(),l=Ob(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),s=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},f={padding:"2px 4px",backgroundColor:u},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),s?b.createElement("pre",{style:d},s):null,m)}var Jb=b.createElement(Kb,null),Dy=class extends b.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const s=Zb(a.digest);s&&(a=s)}let l=a!==void 0?b.createElement(Ha.Provider,{value:this.props.routeContext},b.createElement(Wd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?b.createElement(Fb,{error:a},l):l}};Dy.contextType=Ry;var od=new WeakMap;function Fb({children:a,error:l}){let{basename:s,navigator:u}=b.useContext(ra);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let d=Yb(l.digest);if(d){let f=od.get(l);if(f)throw f;let m=Ay(d.location,s),x=m.absoluteURL||m.to;if(Fd(d.location,x,Jd(u),"allow-explicit"),zb(x))throw new Error("Invalid redirect location");if(ky&&!od.get(l))if(m.isExternal||d.reloadDocument)window.location.href=x;else{const y=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw od.set(l,y),y}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x}`})}}return a}function Wb({routeContext:a,match:l,children:s}){let u=b.useContext(zi);return u&&u.static&&u.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(Ha.Provider,{value:a},s)}function Pb(a,l=[],s){let u=s==null?void 0:s.state;if(a==null){if(!u)return null;if(u.errors)a=u.matches;else if(l.length===0&&!u.initialized&&u.matches.length>0)a=u.matches;else return null}let d=a,f=u==null?void 0:u.errors;if(f!=null){let w=d.findIndex(j=>j.route.id&&(f==null?void 0:f[j.route.id])!==void 0);ut(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,w+1))}let m=!1,x=-1;if(s&&u){m=u.renderFallback;for(let w=0;w<d.length;w++){let j=d[w];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(x=w),j.route.id){let{loaderData:D,errors:X}=u,R=j.route.loader&&!D.hasOwnProperty(j.route.id)&&(!X||X[j.route.id]===void 0);if(j.route.lazy||R){s.isStatic&&(m=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let y=s==null?void 0:s.onError,v=u&&y?(w,j)=>{var D,X;y(w,{location:u.location,params:((X=(D=u.matches)==null?void 0:D[0])==null?void 0:X.params)??{},pattern:Lb(u.matches),errorInfo:j})}:void 0;return d.reduceRight((w,j,D)=>{let X,R=!1,$=null,L=null;u&&(X=f&&j.route.id?f[j.route.id]:void 0,$=j.route.errorElement||Jb,m&&(x<0&&D===0?(Uy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,L=null):x===D&&(R=!0,L=j.route.hydrateFallbackElement||null)));let H=l.concat(d.slice(0,D+1)),F=()=>{let P;return X?P=$:R?P=L:j.route.Component?P=b.createElement(j.route.Component,null):j.route.element?P=j.route.element:P=w,b.createElement(Wb,{match:j,routeContext:{outlet:w,matches:H,isDataRoute:u!=null},children:P})};return u&&(j.route.ErrorBoundary||j.route.errorElement||D===0)?b.createElement(Dy,{location:u.location,revalidation:u.revalidation,component:$,error:X,children:F(),routeContext:{outlet:null,matches:H,isDataRoute:!0},onError:v}):F()},null)}function Pd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e1(a){let l=b.useContext(zi);return ut(l,Pd(a)),l}function t1(a){let l=b.useContext(Lu);return ut(l,Pd(a)),l}function a1(a){let l=b.useContext(Ha);return ut(l,Pd(a)),l}function ef(a){let l=a1(a),s=l.matches[l.matches.length-1];return ut(s.route.id,`${a} can only be used on routes that contain a unique "id"`),s.route.id}function n1(){return ef("useRouteId")}function l1(){var u;let a=b.useContext(Wd),l=t1("useRouteError"),s=ef("useRouteError");return a!==void 0?a:(u=l.errors)==null?void 0:u[s]}function i1(){let{router:a}=e1("useNavigate"),l=ef("useNavigate"),s=b.useRef(!1);return Ly(()=>{s.current=!0}),b.useCallback(async(d,f={})=>{ka(s.current,Oy),s.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:l,...f}))},[a,l])}var wx={};function Uy(a,l,s){!l&&!wx[a]&&(wx[a]=!0,ka(!1,s))}b.memo(s1);function s1({routes:a,manifest:l,future:s,state:u,isStatic:d,onError:f}){return My(a,void 0,{manifest:l,state:u,isStatic:d,onError:f})}function zy({to:a,replace:l,state:s,relative:u}){ut(Bi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:f}=b.useContext(ra);ka(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=b.useContext(Ha),{pathname:x}=Aa(),y=Mu(),v=Ou(a,Kd(m),x,u==="path");Fd(typeof a=="string"?a:Dl(a),f.createHref(v),Jd(f),"reject");let w=JSON.stringify(v);return b.useEffect(()=>{y(JSON.parse(w),{replace:l,state:s,relative:u})},[y,w,u,l,s]),null}function Ll(a){ut(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function r1({basename:a="/",children:l=null,location:s,navigationType:u="POP",navigator:d,static:f=!1,useTransitions:m}){ut(!Bi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=a.replace(/^\/*/,"/"),y=b.useMemo(()=>({basename:x,navigator:d,static:f,useTransitions:m,future:{}}),[x,d,f,m]);typeof s=="string"&&(s=Ui(s));let{pathname:v="/",search:w="",hash:j="",state:D=null,key:X="default",mask:R}=s,$=b.useMemo(()=>{let L=Rn(v,x);return L==null?null:{location:{pathname:L,search:w,hash:j,state:D,key:X,mask:R},navigationType:u}},[x,v,w,j,D,X,u,R]);return ka($!=null,`<Router basename="${x}"> is not able to match the URL "${v}${w}${j}" because it does not start with the basename, so the <Router> won't render anything.`),$==null?null:b.createElement(ra.Provider,{value:y},b.createElement(Zs.Provider,{children:l,value:$}))}function u1({children:a,location:l}){return Ib(Od(a),l)}function Od(a,l=[]){let s=[];return b.Children.forEach(a,(u,d)=>{if(!b.isValidElement(u))return;let f=[...l,d];if(u.type===b.Fragment){s.push.apply(s,Od(u.props.children,f));return}ut(u.type===Ll,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ut(!u.props.index||!u.props.children,"An index route cannot have child routes.");let m={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(m.children=Od(u.props.children,f)),s.push(m)}),s}var hu="get",mu="application/x-www-form-urlencoded";function Du(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function o1(a){return Du(a)&&a.tagName.toLowerCase()==="button"}function c1(a){return Du(a)&&a.tagName.toLowerCase()==="form"}function d1(a){return Du(a)&&a.tagName.toLowerCase()==="input"}function f1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function h1(a,l){return a.button===0&&(!l||l==="_self")&&!f1(a)}function Ld(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((l,s)=>{let u=a[s];return l.concat(Array.isArray(u)?u.map(d=>[s,d]):[[s,u]])},[]))}function m1(a,l){let s=Ld(a);return l&&l.forEach((u,d)=>{s.has(d)||l.getAll(d).forEach(f=>{s.append(d,f)})}),s}var iu=null;function p1(){if(iu===null)try{new FormData(document.createElement("form"),0),iu=!1}catch{iu=!0}return iu}var x1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function cd(a){return a!=null&&!x1.has(a)?(ka(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mu}"`),null):a}function y1(a,l){let s,u,d,f,m;if(c1(a)){let x=a.getAttribute("action");u=x?Rn(x,l):null,s=a.getAttribute("method")||hu,d=cd(a.getAttribute("enctype"))||mu,f=new FormData(a)}else if(o1(a)||d1(a)&&(a.type==="submit"||a.type==="image")){let x=a.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=a.getAttribute("formaction")||x.getAttribute("action");if(u=y?Rn(y,l):null,s=a.getAttribute("formmethod")||x.getAttribute("method")||hu,d=cd(a.getAttribute("formenctype"))||cd(x.getAttribute("enctype"))||mu,f=new FormData(x,a),!p1()){let{name:v,type:w,value:j}=a;if(w==="image"){let D=v?`${v}.`:"";f.append(`${D}x`,"0"),f.append(`${D}y`,"0")}else v&&f.append(v,j)}}else{if(Du(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=hu,u=null,d=mu,m=a}return f&&d==="text/plain"&&(m=f,f=void 0),{action:u,method:s.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function tf(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function By(a,l,s,u){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return s?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:l&&Rn(d.pathname,l)==="/"?d.pathname=`${Li(l)}/_root.${u}`:d.pathname=`${Li(d.pathname)}.${u}`,d}async function v1(a,l){if(a.id in l)return l[a.id];try{let s=await import(a.module);return l[a.id]=s,s}catch(s){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function g1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function b1(a,l,s){let u=await Promise.all(a.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await v1(f,s);return m.links?m.links():[]}return[]}));return N1(u.flat(1).filter(g1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Sx(a,l,s,u,d,f){let m=(y,v)=>s[v]?y.route.id!==s[v].route.id:!0,x=(y,v)=>{var w;return s[v].pathname!==y.pathname||((w=s[v].route.path)==null?void 0:w.endsWith("*"))&&s[v].params["*"]!==y.params["*"]};return f==="assets"?l.filter((y,v)=>m(y,v)||x(y,v)):f==="data"?l.filter((y,v)=>{var j;let w=u.routes[y.route.id];if(!w||!w.hasLoader)return!1;if(m(y,v)||x(y,v))return!0;if(y.route.shouldRevalidate){let D=y.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((j=s[0])==null?void 0:j.params)||{},nextUrl:new URL(a,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof D=="boolean")return D}return!0}):[]}function w1(a,l,{includeHydrateFallback:s}={}){return S1(a.map(u=>{let d=l.routes[u.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),s&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function S1(a){return[...new Set(a)]}function j1(a){let l={},s=Object.keys(a).sort();for(let u of s)l[u]=a[u];return l}function N1(a,l){let s=new Set;return new Set(l),a.reduce((u,d)=>{let f=JSON.stringify(j1(d));return s.has(f)||(s.add(f),u.push({key:f,link:d})),u},[])}function af(){let a=b.useContext(zi);return tf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function _1(){let a=b.useContext(Lu);return tf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var nf=b.createContext(void 0);nf.displayName="FrameworkContext";function Uu(){let a=b.useContext(nf);return tf(a,"You must render this element inside a <HydratedRouter> element"),a}function k1(a,l){let s=b.useContext(nf),[u,d]=b.useState(!1),[f,m]=b.useState(!1),{onFocus:x,onBlur:y,onMouseEnter:v,onMouseLeave:w,onTouchStart:j}=l,D=b.useRef(null);b.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let $=H=>{H.forEach(F=>{m(F.isIntersecting)})},L=new IntersectionObserver($,{threshold:.5});return D.current&&L.observe(D.current),()=>{L.disconnect()}}},[a]),b.useEffect(()=>{if(u){let $=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout($)}}},[u]);let X=()=>{d(!0)},R=()=>{d(!1),m(!1)};return s?a!=="intent"?[f,D,{}]:[f,D,{onFocus:Ts(x,X),onBlur:Ts(y,R),onMouseEnter:Ts(v,X),onMouseLeave:Ts(w,R),onTouchStart:Ts(j,X)}]:[!1,D,{}]}function Ts(a,l){return s=>{a&&a(s),s.defaultPrevented||l(s)}}function A1({page:a,...l}){let s=Bb(),{nonce:u}=Uu(),{router:d}=af(),f=b.useMemo(()=>by(d.routes,a,d.basename),[d.routes,a,d.basename]);return f?(l.nonce==null&&u&&(l={...l,nonce:u}),s?b.createElement(R1,{page:a,matches:f,...l}):b.createElement(C1,{page:a,matches:f,...l})):null}function E1(a){let{manifest:l,routeModules:s}=Uu(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return b1(a,l,s).then(m=>{f||d(m)}),()=>{f=!0}},[a,l,s]),u}function R1({page:a,matches:l,...s}){let u=Aa(),{future:d}=Uu(),{basename:f}=af(),m=b.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let x=By(a,f,d.v8_trailingSlashAwareDataRequests,"rsc"),y=!1,v=[];for(let w of l)typeof w.route.shouldRevalidate=="function"?y=!0:v.push(w.route.id);return y&&v.length>0&&x.searchParams.set("_routes",v.join(",")),[x.pathname+x.search]},[f,d.v8_trailingSlashAwareDataRequests,a,u,l]);return b.createElement(b.Fragment,null,m.map(x=>b.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...s})))}function C1({page:a,matches:l,...s}){let u=Aa(),{future:d,manifest:f,routeModules:m}=Uu(),{basename:x}=af(),{loaderData:y,matches:v}=_1(),w=b.useMemo(()=>Sx(a,l,v,f,u,"data"),[a,l,v,f,u]),j=b.useMemo(()=>Sx(a,l,v,f,u,"assets"),[a,l,v,f,u]),D=b.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let $=new Set,L=!1;if(l.forEach(F=>{var le;let P=f.routes[F.route.id];!P||!P.hasLoader||(!w.some(V=>V.route.id===F.route.id)&&F.route.id in y&&((le=m[F.route.id])!=null&&le.shouldRevalidate)||P.hasClientLoader?L=!0:$.add(F.route.id))}),$.size===0)return[];let H=By(a,x,d.v8_trailingSlashAwareDataRequests,"data");return L&&$.size>0&&H.searchParams.set("_routes",l.filter(F=>$.has(F.route.id)).map(F=>F.route.id).join(",")),[H.pathname+H.search]},[x,d.v8_trailingSlashAwareDataRequests,y,u,f,w,l,a,m]),X=b.useMemo(()=>w1(j,f),[j,f]),R=E1(j);return b.createElement(b.Fragment,null,D.map($=>b.createElement("link",{key:$,rel:"prefetch",as:"fetch",href:$,...s})),X.map($=>b.createElement("link",{key:$,rel:"modulepreload",href:$,...s})),R.map(({key:$,link:L})=>b.createElement("link",{key:$,nonce:s.nonce,...L,crossOrigin:L.crossOrigin??s.crossOrigin})))}function T1(...a){return l=>{a.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var O1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{O1&&(window.__reactRouterVersion="7.18.4")}catch{}function L1({basename:a,children:l,useTransitions:s,window:u}){let d=b.useRef();d.current==null&&(d.current=ob({window:u,v5Compat:!0}));let f=d.current,[m,x]=b.useState({action:f.action,location:f.location}),y=b.useCallback(v=>{s===!1?x(v):b.startTransition(()=>x(v))},[s]);return b.useLayoutEffect(()=>f.listen(y),[f,y]),b.createElement(r1,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,useTransitions:s})}var sa=b.forwardRef(function({onClick:l,discover:s="render",prefetch:u="none",relative:d,reloadDocument:f,replace:m,mask:x,state:y,target:v,to:w,preventScrollReset:j,viewTransition:D,defaultShouldRevalidate:X,...R},$){let{basename:L,navigator:H,useTransitions:F}=b.useContext(ra),P=typeof w=="string"&&Id.test(w),le=Ay(w,L);w=le.to;let V=Gb(w,{relative:d}),Ne=Aa(),I=null;if(x){let Ze=Ou(x,[],Ne.mask?Ne.mask.pathname:"/",!0);L!=="/"&&(Ze.pathname=Ze.pathname==="/"?L:Ba([L,Ze.pathname])),I=H.createHref(Ze)}let[ye,De,yt]=k1(u,R),Nt=U1(w,{replace:m,mask:x,state:y,target:v,preventScrollReset:j,relative:d,viewTransition:D,defaultShouldRevalidate:X,useTransitions:F});function st(Ze){l&&l(Ze),Ze.defaultPrevented||Nt(Ze)}let ht=!(le.isExternal||f),nt=b.createElement("a",{...R,...yt,href:(ht?I:void 0)||le.absoluteURL||V,onClick:ht?st:l,ref:T1($,De),target:v,"data-discover":!P&&s==="render"?"true":void 0});return ye&&!P?b.createElement(b.Fragment,null,nt,b.createElement(A1,{page:V})):nt});sa.displayName="Link";var pu=b.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:u="",end:d=!1,style:f,to:m,viewTransition:x,children:y,...v},w){let j=Gs(m,{relative:v.relative}),D=Aa(),X=b.useContext(Lu),{navigator:R,basename:$}=b.useContext(ra),L=X!=null&&$1(j)&&x===!0,H=R.encodeLocation?R.encodeLocation(j).pathname:j.pathname,F=D.pathname,P=X&&X.navigation&&X.navigation.location?X.navigation.location.pathname:null;s||(F=F.toLowerCase(),P=P?P.toLowerCase():null,H=H.toLowerCase()),P&&$&&(P=Rn(P,$)||P);const le=H!=="/"&&H.endsWith("/")?H.length-1:H.length;let V=F===H||!d&&F.startsWith(H)&&F.charAt(le)==="/",Ne=P!=null&&(P===H||!d&&P.startsWith(H)&&P.charAt(H.length)==="/"),I={isActive:V,isPending:Ne,isTransitioning:L},ye=V?l:void 0,De;typeof u=="function"?De=u(I):De=[u,V?"active":null,Ne?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let yt=typeof f=="function"?f(I):f;return b.createElement(sa,{...v,"aria-current":ye,className:De,ref:w,style:yt,to:m,viewTransition:x},typeof y=="function"?y(I):y)});pu.displayName="NavLink";var M1=b.forwardRef(({discover:a="render",fetcherKey:l,navigate:s,reloadDocument:u,replace:d,state:f,method:m=hu,action:x,onSubmit:y,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D,...X},R)=>{let{useTransitions:$}=b.useContext(ra),L=q1(),H=H1(x,{relative:v}),F=m.toLowerCase()==="get"?"get":"post",P=typeof x=="string"&&Id.test(x),le=V=>{if(y&&y(V),V.defaultPrevented)return;V.preventDefault();let Ne=V.nativeEvent.submitter,I=(Ne==null?void 0:Ne.getAttribute("formmethod"))||m,ye=()=>L(Ne||V.currentTarget,{fetcherKey:l,method:I,navigate:s,replace:d,state:f,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D});$&&s!==!1?b.startTransition(()=>ye()):ye()};return b.createElement("form",{ref:R,method:F,action:H,onSubmit:u?y:le,...X,"data-discover":!P&&a==="render"?"true":void 0})});M1.displayName="Form";function D1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qy(a){let l=b.useContext(zi);return ut(l,D1(a)),l}function U1(a,{target:l,replace:s,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y,useTransitions:v}={}){let w=Mu(),j=Aa(),D=Gs(a,{relative:m});return b.useCallback(X=>{if(h1(X,l)){X.preventDefault();let R=s!==void 0?s:Dl(j)===Dl(D),$=()=>w(a,{replace:R,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y});v?b.startTransition(()=>$()):$()}},[j,w,D,s,u,d,l,a,f,m,x,y,v])}function Hy(a){ka(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=b.useRef(Ld(a)),s=b.useRef(!1),u=Aa(),d=b.useMemo(()=>m1(u.search,s.current?null:l.current),[u.search]),f=Mu(),m=b.useCallback((x,y)=>{const v=Ld(typeof x=="function"?x(new URLSearchParams(d)):x);s.current=!0,f("?"+v,y)},[f,d]);return[d,m]}var z1=0,B1=()=>`__${String(++z1)}__`;function q1(){let{router:a}=qy("useSubmit"),{basename:l}=b.useContext(ra),s=n1(),u=a.fetch,d=a.navigate;return b.useCallback(async(f,m={})=>{let{action:x,method:y,encType:v,formData:w,body:j}=y1(f,l);if(m.navigate===!1){let D=m.fetcherKey||B1();await u(D,s,m.action||x,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:w,body:j,formMethod:m.method||y,formEncType:m.encType||v,flushSync:m.flushSync})}else await d(m.action||x,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:w,body:j,formMethod:m.method||y,formEncType:m.encType||v,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[u,d,l,s])}function H1(a,{relative:l}={}){let{basename:s}=b.useContext(ra),u=b.useContext(Ha);ut(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...Gs(a||".",{relative:l})},m=Aa();if(a==null){f.search=m.search;let x=new URLSearchParams(f.search),y=x.getAll("index");if(y.some(w=>w==="")){x.delete("index"),y.filter(j=>j).forEach(j=>x.append("index",j));let w=x.toString();f.search=w?`?${w}`:""}}return(!a||a===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:Ba([s,f.pathname])),Dl(f)}function $1(a,{relative:l}={}){let s=b.useContext(Cy);ut(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=qy("useViewTransitionState"),d=Gs(a,{relative:l});if(!s.isTransitioning)return!1;let f=Rn(s.currentLocation.pathname,u)||s.currentLocation.pathname,m=Rn(s.nextLocation.pathname,u)||s.nextLocation.pathname;return yu(d.pathname,m)!=null||yu(d.pathname,f)!=null}var ze;(function(a){a.assertEqual=d=>{};function l(d){}a.assertIs=l;function s(d){throw new Error}a.assertNever=s,a.arrayToEnum=d=>{const f={};for(const m of d)f[m]=m;return f},a.getValidEnumValues=d=>{const f=a.objectKeys(d).filter(x=>typeof d[d[x]]!="number"),m={};for(const x of f)m[x]=d[x];return a.objectValues(m)},a.objectValues=d=>a.objectKeys(d).map(function(f){return d[f]}),a.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{const f=[];for(const m in d)Object.prototype.hasOwnProperty.call(d,m)&&f.push(m);return f},a.find=(d,f)=>{for(const m of d)if(f(m))return m},a.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&Number.isFinite(d)&&Math.floor(d)===d;function u(d,f=" | "){return d.map(m=>typeof m=="string"?`'${m}'`:m).join(f)}a.joinValues=u,a.jsonStringifyReplacer=(d,f)=>typeof f=="bigint"?f.toString():f})(ze||(ze={}));var jx;(function(a){a.mergeShapes=(l,s)=>({...l,...s})})(jx||(jx={}));const ie=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ol=a=>{switch(typeof a){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return Number.isNaN(a)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(a)?ie.array:a===null?ie.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?ie.promise:typeof Map<"u"&&a instanceof Map?ie.map:typeof Set<"u"&&a instanceof Set?ie.set:typeof Date<"u"&&a instanceof Date?ie.date:ie.object;default:return ie.unknown}},K=ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Cn extends Error{get errors(){return this.issues}constructor(l){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=l}format(l){const s=l||function(f){return f.message},u={_errors:[]},d=f=>{for(const m of f.issues)if(m.code==="invalid_union")m.unionErrors.map(d);else if(m.code==="invalid_return_type")d(m.returnTypeError);else if(m.code==="invalid_arguments")d(m.argumentsError);else if(m.path.length===0)u._errors.push(s(m));else{let x=u,y=0;for(;y<m.path.length;){const v=m.path[y];y===m.path.length-1?(x[v]=x[v]||{_errors:[]},x[v]._errors.push(s(m))):x[v]=x[v]||{_errors:[]},x=x[v],y++}}};return d(this),u}static assert(l){if(!(l instanceof Cn))throw new Error(`Not a ZodError: ${l}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(l=s=>s.message){const s={},u=[];for(const d of this.issues)if(d.path.length>0){const f=d.path[0];s[f]=s[f]||[],s[f].push(l(d))}else u.push(l(d));return{formErrors:u,fieldErrors:s}}get formErrors(){return this.flatten()}}Cn.create=a=>new Cn(a);const Md=(a,l)=>{let s;switch(a.code){case K.invalid_type:a.received===ie.undefined?s="Required":s=`Expected ${a.expected}, received ${a.received}`;break;case K.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(a.expected,ze.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:s=`Unrecognized key(s) in object: ${ze.joinValues(a.keys,", ")}`;break;case K.invalid_union:s="Invalid input";break;case K.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ze.joinValues(a.options)}`;break;case K.invalid_enum_value:s=`Invalid enum value. Expected ${ze.joinValues(a.options)}, received '${a.received}'`;break;case K.invalid_arguments:s="Invalid function arguments";break;case K.invalid_return_type:s="Invalid function return type";break;case K.invalid_date:s="Invalid date";break;case K.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(s=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?s=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?s=`Invalid input: must end with "${a.validation.endsWith}"`:ze.assertNever(a.validation):a.validation!=="regex"?s=`Invalid ${a.validation}`:s="Invalid";break;case K.too_small:a.type==="array"?s=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?s=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?s=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?s=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?s=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:s="Invalid input";break;case K.too_big:a.type==="array"?s=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?s=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?s=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?s=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?s=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:s="Invalid input";break;case K.custom:s="Invalid input";break;case K.invalid_intersection_types:s="Intersection results could not be merged";break;case K.not_multiple_of:s=`Number must be a multiple of ${a.multipleOf}`;break;case K.not_finite:s="Number must be finite";break;default:s=l.defaultError,ze.assertNever(a)}return{message:s}};let V1=Md;function Y1(){return V1}const Z1=a=>{const{data:l,path:s,errorMaps:u,issueData:d}=a,f=[...s,...d.path||[]],m={...d,path:f};if(d.message!==void 0)return{...d,path:f,message:d.message};let x="";const y=u.filter(v=>!!v).slice().reverse();for(const v of y)x=v(m,{data:l,defaultError:x}).message;return{...d,path:f,message:x}};function te(a,l){const s=Y1(),u=Z1({issueData:l,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,s,s===Md?void 0:Md].filter(d=>!!d)});a.common.issues.push(u)}class Bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(l,s){const u=[];for(const d of s){if(d.status==="aborted")return pe;d.status==="dirty"&&l.dirty(),u.push(d.value)}return{status:l.value,value:u}}static async mergeObjectAsync(l,s){const u=[];for(const d of s){const f=await d.key,m=await d.value;u.push({key:f,value:m})}return Bt.mergeObjectSync(l,u)}static mergeObjectSync(l,s){const u={};for(const d of s){const{key:f,value:m}=d;if(f.status==="aborted"||m.status==="aborted")return pe;f.status==="dirty"&&l.dirty(),m.status==="dirty"&&l.dirty(),f.value!=="__proto__"&&(typeof m.value<"u"||d.alwaysSet)&&(u[f.value]=m.value)}return{status:l.value,value:u}}}const pe=Object.freeze({status:"aborted"}),Ls=a=>({status:"dirty",value:a}),Ea=a=>({status:"valid",value:a}),Nx=a=>a.status==="aborted",_x=a=>a.status==="dirty",Mi=a=>a.status==="valid",vu=a=>typeof Promise<"u"&&a instanceof Promise;var ce;(function(a){a.errToObj=l=>typeof l=="string"?{message:l}:l||{},a.toString=l=>typeof l=="string"?l:l==null?void 0:l.message})(ce||(ce={}));class en{constructor(l,s,u,d){this._cachedPath=[],this.parent=l,this.data=s,this._path=u,this._key=d}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kx=(a,l)=>{if(Mi(l))return{success:!0,data:l.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Cn(a.common.issues);return this._error=s,this._error}}};function Se(a){if(!a)return{};const{errorMap:l,invalid_type_error:s,required_error:u,description:d}=a;if(l&&(s||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return l?{errorMap:l,description:d}:{errorMap:(m,x)=>{const{message:y}=a;return m.code==="invalid_enum_value"?{message:y??x.defaultError}:typeof x.data>"u"?{message:y??u??x.defaultError}:m.code!=="invalid_type"?{message:x.defaultError}:{message:y??s??x.defaultError}},description:d}}class Ce{get description(){return this._def.description}_getType(l){return ol(l.data)}_getOrReturnCtx(l,s){return s||{common:l.parent.common,data:l.data,parsedType:ol(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}_processInputParams(l){return{status:new Bt,ctx:{common:l.parent.common,data:l.data,parsedType:ol(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}}_parseSync(l){const s=this._parse(l);if(vu(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(l){const s=this._parse(l);return Promise.resolve(s)}parse(l,s){const u=this.safeParse(l,s);if(u.success)return u.data;throw u.error}safeParse(l,s){const u={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:ol(l)},d=this._parseSync({data:l,path:u.path,parent:u});return kx(u,d)}"~validate"(l){var u,d;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:ol(l)};if(!this["~standard"].async)try{const f=this._parseSync({data:l,path:[],parent:s});return Mi(f)?{value:f.value}:{issues:s.common.issues}}catch(f){(d=(u=f==null?void 0:f.message)==null?void 0:u.toLowerCase())!=null&&d.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:l,path:[],parent:s}).then(f=>Mi(f)?{value:f.value}:{issues:s.common.issues})}async parseAsync(l,s){const u=await this.safeParseAsync(l,s);if(u.success)return u.data;throw u.error}async safeParseAsync(l,s){const u={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:ol(l)},d=this._parse({data:l,path:u.path,parent:u}),f=await(vu(d)?d:Promise.resolve(d));return kx(u,f)}refine(l,s){const u=d=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(d):s;return this._refinement((d,f)=>{const m=l(d),x=()=>f.addIssue({code:K.custom,...u(d)});return typeof Promise<"u"&&m instanceof Promise?m.then(y=>y?!0:(x(),!1)):m?!0:(x(),!1)})}refinement(l,s){return this._refinement((u,d)=>l(u)?!0:(d.addIssue(typeof s=="function"?s(u,d):s),!1))}_refinement(l){return new Hl({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:l}})}superRefine(l){return this._refinement(l)}constructor(l){this.spa=this.safeParseAsync,this._def=l,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return En.create(this,this._def)}nullable(){return $l.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pa.create(this)}promise(){return Nu.create(this,this._def)}or(l){return bu.create([this,l],this._def)}and(l){return wu.create(this,l,this._def)}transform(l){return new Hl({...Se(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:l}})}default(l){const s=typeof l=="function"?l:()=>l;return new _u({...Se(this._def),innerType:this,defaultValue:s,typeName:xe.ZodDefault})}brand(){return new Zy({typeName:xe.ZodBranded,type:this,...Se(this._def)})}catch(l){const s=typeof l=="function"?l:()=>l;return new ku({...Se(this._def),innerType:this,catchValue:s,typeName:xe.ZodCatch})}describe(l){const s=this.constructor;return new s({...this._def,description:l})}pipe(l){return sf.create(this,l)}readonly(){return Au.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const G1=/^c[^\s-]{8,}$/i,Q1=/^[0-9a-z]+$/,X1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,I1=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K1=/^[a-z0-9_-]{21}$/i,J1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,F1=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,W1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,P1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dd;const ew=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,aw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$y="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sw=new RegExp(`^${$y}$`);function Vy(a){let l="[0-5]\\d";a.precision?l=`${l}\\.\\d{${a.precision}}`:a.precision==null&&(l=`${l}(\\.\\d+)?`);const s=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${s}`}function rw(a){return new RegExp(`^${Vy(a)}$`)}function uw(a){let l=`${$y}T${Vy(a)}`;const s=[];return s.push(a.local?"Z?":"Z"),a.offset&&s.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${s.join("|")})`,new RegExp(`^${l}$`)}function ow(a,l){return!!((l==="v4"||!l)&&ew.test(a)||(l==="v6"||!l)&&aw.test(a))}function cw(a,l){if(!J1.test(a))return!1;try{const[s]=a.split(".");if(!s)return!1;const u=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),d=JSON.parse(atob(u));return!(typeof d!="object"||d===null||"typ"in d&&(d==null?void 0:d.typ)!=="JWT"||!d.alg||l&&d.alg!==l)}catch{return!1}}function dw(a,l){return!!((l==="v4"||!l)&&tw.test(a)||(l==="v6"||!l)&&nw.test(a))}class Fa extends Ce{_parse(l){if(this._def.coerce&&(l.data=String(l.data)),this._getType(l)!==ie.string){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_type,expected:ie.string,received:f.parsedType}),pe}const u=new Bt;let d;for(const f of this._def.checks)if(f.kind==="min")l.data.length<f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")l.data.length>f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="length"){const m=l.data.length>f.value,x=l.data.length<f.value;(m||x)&&(d=this._getOrReturnCtx(l,d),m?te(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):x&&te(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")W1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"email",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")dd||(dd=new RegExp(P1,"u")),dd.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"emoji",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")I1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"uuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")K1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"nanoid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")G1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"cuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")Q1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"cuid2",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")X1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"ulid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(l.data)}catch{d=this._getOrReturnCtx(l,d),te(d,{validation:"url",code:K.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"regex",code:K.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?l.data=l.data.trim():f.kind==="includes"?l.data.includes(f.value,f.position)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?l.data=l.data.toLowerCase():f.kind==="toUpperCase"?l.data=l.data.toUpperCase():f.kind==="startsWith"?l.data.startsWith(f.value)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?l.data.endsWith(f.value)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?uw(f).test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?sw.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?rw(f).test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?F1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"duration",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?ow(l.data,f.version)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"ip",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?cw(l.data,f.alg)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"jwt",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?dw(l.data,f.version)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"cidr",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?lw.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"base64",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?iw.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"base64url",code:K.invalid_string,message:f.message}),u.dirty()):ze.assertNever(f);return{status:u.value,value:l.data}}_regex(l,s,u){return this.refinement(d=>l.test(d),{validation:s,code:K.invalid_string,...ce.errToObj(u)})}_addCheck(l){return new Fa({...this._def,checks:[...this._def.checks,l]})}email(l){return this._addCheck({kind:"email",...ce.errToObj(l)})}url(l){return this._addCheck({kind:"url",...ce.errToObj(l)})}emoji(l){return this._addCheck({kind:"emoji",...ce.errToObj(l)})}uuid(l){return this._addCheck({kind:"uuid",...ce.errToObj(l)})}nanoid(l){return this._addCheck({kind:"nanoid",...ce.errToObj(l)})}cuid(l){return this._addCheck({kind:"cuid",...ce.errToObj(l)})}cuid2(l){return this._addCheck({kind:"cuid2",...ce.errToObj(l)})}ulid(l){return this._addCheck({kind:"ulid",...ce.errToObj(l)})}base64(l){return this._addCheck({kind:"base64",...ce.errToObj(l)})}base64url(l){return this._addCheck({kind:"base64url",...ce.errToObj(l)})}jwt(l){return this._addCheck({kind:"jwt",...ce.errToObj(l)})}ip(l){return this._addCheck({kind:"ip",...ce.errToObj(l)})}cidr(l){return this._addCheck({kind:"cidr",...ce.errToObj(l)})}datetime(l){return typeof l=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:l}):this._addCheck({kind:"datetime",precision:typeof(l==null?void 0:l.precision)>"u"?null:l==null?void 0:l.precision,offset:(l==null?void 0:l.offset)??!1,local:(l==null?void 0:l.local)??!1,...ce.errToObj(l==null?void 0:l.message)})}date(l){return this._addCheck({kind:"date",message:l})}time(l){return typeof l=="string"?this._addCheck({kind:"time",precision:null,message:l}):this._addCheck({kind:"time",precision:typeof(l==null?void 0:l.precision)>"u"?null:l==null?void 0:l.precision,...ce.errToObj(l==null?void 0:l.message)})}duration(l){return this._addCheck({kind:"duration",...ce.errToObj(l)})}regex(l,s){return this._addCheck({kind:"regex",regex:l,...ce.errToObj(s)})}includes(l,s){return this._addCheck({kind:"includes",value:l,position:s==null?void 0:s.position,...ce.errToObj(s==null?void 0:s.message)})}startsWith(l,s){return this._addCheck({kind:"startsWith",value:l,...ce.errToObj(s)})}endsWith(l,s){return this._addCheck({kind:"endsWith",value:l,...ce.errToObj(s)})}min(l,s){return this._addCheck({kind:"min",value:l,...ce.errToObj(s)})}max(l,s){return this._addCheck({kind:"max",value:l,...ce.errToObj(s)})}length(l,s){return this._addCheck({kind:"length",value:l,...ce.errToObj(s)})}nonempty(l){return this.min(1,ce.errToObj(l))}trim(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(l=>l.kind==="datetime")}get isDate(){return!!this._def.checks.find(l=>l.kind==="date")}get isTime(){return!!this._def.checks.find(l=>l.kind==="time")}get isDuration(){return!!this._def.checks.find(l=>l.kind==="duration")}get isEmail(){return!!this._def.checks.find(l=>l.kind==="email")}get isURL(){return!!this._def.checks.find(l=>l.kind==="url")}get isEmoji(){return!!this._def.checks.find(l=>l.kind==="emoji")}get isUUID(){return!!this._def.checks.find(l=>l.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(l=>l.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(l=>l.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(l=>l.kind==="cuid2")}get isULID(){return!!this._def.checks.find(l=>l.kind==="ulid")}get isIP(){return!!this._def.checks.find(l=>l.kind==="ip")}get isCIDR(){return!!this._def.checks.find(l=>l.kind==="cidr")}get isBase64(){return!!this._def.checks.find(l=>l.kind==="base64")}get isBase64url(){return!!this._def.checks.find(l=>l.kind==="base64url")}get minLength(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxLength(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}}Fa.create=a=>new Fa({checks:[],typeName:xe.ZodString,coerce:(a==null?void 0:a.coerce)??!1,...Se(a)});function fw(a,l){const s=(a.toString().split(".")[1]||"").length,u=(l.toString().split(".")[1]||"").length,d=s>u?s:u,f=Number.parseInt(a.toFixed(d).replace(".","")),m=Number.parseInt(l.toFixed(d).replace(".",""));return f%m/10**d}class Ul extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(l){if(this._def.coerce&&(l.data=Number(l.data)),this._getType(l)!==ie.number){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_type,expected:ie.number,received:f.parsedType}),pe}let u;const d=new Bt;for(const f of this._def.checks)f.kind==="int"?ze.isInteger(l.data)||(u=this._getOrReturnCtx(l,u),te(u,{code:K.invalid_type,expected:"integer",received:"float",message:f.message}),d.dirty()):f.kind==="min"?(f.inclusive?l.data<f.value:l.data<=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?l.data>f.value:l.data>=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="multipleOf"?fw(l.data,f.value)!==0&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):f.kind==="finite"?Number.isFinite(l.data)||(u=this._getOrReturnCtx(l,u),te(u,{code:K.not_finite,message:f.message}),d.dirty()):ze.assertNever(f);return{status:d.value,value:l.data}}gte(l,s){return this.setLimit("min",l,!0,ce.toString(s))}gt(l,s){return this.setLimit("min",l,!1,ce.toString(s))}lte(l,s){return this.setLimit("max",l,!0,ce.toString(s))}lt(l,s){return this.setLimit("max",l,!1,ce.toString(s))}setLimit(l,s,u,d){return new Ul({...this._def,checks:[...this._def.checks,{kind:l,value:s,inclusive:u,message:ce.toString(d)}]})}_addCheck(l){return new Ul({...this._def,checks:[...this._def.checks,l]})}int(l){return this._addCheck({kind:"int",message:ce.toString(l)})}positive(l){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(l)})}negative(l){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(l)})}multipleOf(l,s){return this._addCheck({kind:"multipleOf",value:l,message:ce.toString(s)})}finite(l){return this._addCheck({kind:"finite",message:ce.toString(l)})}safe(l){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(l)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(l)})}get minValue(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxValue(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}get isInt(){return!!this._def.checks.find(l=>l.kind==="int"||l.kind==="multipleOf"&&ze.isInteger(l.value))}get isFinite(){let l=null,s=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(s===null||u.value>s)&&(s=u.value):u.kind==="max"&&(l===null||u.value<l)&&(l=u.value)}return Number.isFinite(s)&&Number.isFinite(l)}}Ul.create=a=>new Ul({checks:[],typeName:xe.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...Se(a)});class zl extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(l){if(this._def.coerce)try{l.data=BigInt(l.data)}catch{return this._getInvalidInput(l)}if(this._getType(l)!==ie.bigint)return this._getInvalidInput(l);let u;const d=new Bt;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?l.data<f.value:l.data<=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?l.data>f.value:l.data>=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="multipleOf"?l.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):ze.assertNever(f);return{status:d.value,value:l.data}}_getInvalidInput(l){const s=this._getOrReturnCtx(l);return te(s,{code:K.invalid_type,expected:ie.bigint,received:s.parsedType}),pe}gte(l,s){return this.setLimit("min",l,!0,ce.toString(s))}gt(l,s){return this.setLimit("min",l,!1,ce.toString(s))}lte(l,s){return this.setLimit("max",l,!0,ce.toString(s))}lt(l,s){return this.setLimit("max",l,!1,ce.toString(s))}setLimit(l,s,u,d){return new zl({...this._def,checks:[...this._def.checks,{kind:l,value:s,inclusive:u,message:ce.toString(d)}]})}_addCheck(l){return new zl({...this._def,checks:[...this._def.checks,l]})}positive(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(l)})}negative(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(l)})}multipleOf(l,s){return this._addCheck({kind:"multipleOf",value:l,message:ce.toString(s)})}get minValue(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxValue(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}}zl.create=a=>new zl({checks:[],typeName:xe.ZodBigInt,coerce:(a==null?void 0:a.coerce)??!1,...Se(a)});class gu extends Ce{_parse(l){if(this._def.coerce&&(l.data=!!l.data),this._getType(l)!==ie.boolean){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:ie.boolean,received:u.parsedType}),pe}return Ea(l.data)}}gu.create=a=>new gu({typeName:xe.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...Se(a)});class Di extends Ce{_parse(l){if(this._def.coerce&&(l.data=new Date(l.data)),this._getType(l)!==ie.date){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_type,expected:ie.date,received:f.parsedType}),pe}if(Number.isNaN(l.data.getTime())){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_date}),pe}const u=new Bt;let d;for(const f of this._def.checks)f.kind==="min"?l.data.getTime()<f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?l.data.getTime()>f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):ze.assertNever(f);return{status:u.value,value:new Date(l.data.getTime())}}_addCheck(l){return new Di({...this._def,checks:[...this._def.checks,l]})}min(l,s){return this._addCheck({kind:"min",value:l.getTime(),message:ce.toString(s)})}max(l,s){return this._addCheck({kind:"max",value:l.getTime(),message:ce.toString(s)})}get minDate(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l!=null?new Date(l):null}get maxDate(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l!=null?new Date(l):null}}Di.create=a=>new Di({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:xe.ZodDate,...Se(a)});class Ax extends Ce{_parse(l){if(this._getType(l)!==ie.symbol){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:ie.symbol,received:u.parsedType}),pe}return Ea(l.data)}}Ax.create=a=>new Ax({typeName:xe.ZodSymbol,...Se(a)});class Dd extends Ce{_parse(l){if(this._getType(l)!==ie.undefined){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:ie.undefined,received:u.parsedType}),pe}return Ea(l.data)}}Dd.create=a=>new Dd({typeName:xe.ZodUndefined,...Se(a)});class Ud extends Ce{_parse(l){if(this._getType(l)!==ie.null){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:ie.null,received:u.parsedType}),pe}return Ea(l.data)}}Ud.create=a=>new Ud({typeName:xe.ZodNull,...Se(a)});class Ex extends Ce{constructor(){super(...arguments),this._any=!0}_parse(l){return Ea(l.data)}}Ex.create=a=>new Ex({typeName:xe.ZodAny,...Se(a)});class zd extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(l){return Ea(l.data)}}zd.create=a=>new zd({typeName:xe.ZodUnknown,...Se(a)});class fl extends Ce{_parse(l){const s=this._getOrReturnCtx(l);return te(s,{code:K.invalid_type,expected:ie.never,received:s.parsedType}),pe}}fl.create=a=>new fl({typeName:xe.ZodNever,...Se(a)});class Rx extends Ce{_parse(l){if(this._getType(l)!==ie.undefined){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:ie.void,received:u.parsedType}),pe}return Ea(l.data)}}Rx.create=a=>new Rx({typeName:xe.ZodVoid,...Se(a)});class Pa extends Ce{_parse(l){const{ctx:s,status:u}=this._processInputParams(l),d=this._def;if(s.parsedType!==ie.array)return te(s,{code:K.invalid_type,expected:ie.array,received:s.parsedType}),pe;if(d.exactLength!==null){const m=s.data.length>d.exactLength.value,x=s.data.length<d.exactLength.value;(m||x)&&(te(s,{code:m?K.too_big:K.too_small,minimum:x?d.exactLength.value:void 0,maximum:m?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),u.dirty())}if(d.minLength!==null&&s.data.length<d.minLength.value&&(te(s,{code:K.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),u.dirty()),d.maxLength!==null&&s.data.length>d.maxLength.value&&(te(s,{code:K.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),u.dirty()),s.common.async)return Promise.all([...s.data].map((m,x)=>d.type._parseAsync(new en(s,m,s.path,x)))).then(m=>Bt.mergeArray(u,m));const f=[...s.data].map((m,x)=>d.type._parseSync(new en(s,m,s.path,x)));return Bt.mergeArray(u,f)}get element(){return this._def.type}min(l,s){return new Pa({...this._def,minLength:{value:l,message:ce.toString(s)}})}max(l,s){return new Pa({...this._def,maxLength:{value:l,message:ce.toString(s)}})}length(l,s){return new Pa({...this._def,exactLength:{value:l,message:ce.toString(s)}})}nonempty(l){return this.min(1,l)}}Pa.create=(a,l)=>new Pa({type:a,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Se(l)});function Ti(a){if(a instanceof jt){const l={};for(const s in a.shape){const u=a.shape[s];l[s]=En.create(Ti(u))}return new jt({...a._def,shape:()=>l})}else return a instanceof Pa?new Pa({...a._def,type:Ti(a.element)}):a instanceof En?En.create(Ti(a.unwrap())):a instanceof $l?$l.create(Ti(a.unwrap())):a instanceof Bl?Bl.create(a.items.map(l=>Ti(l))):a}class jt extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const l=this._def.shape(),s=ze.objectKeys(l);return this._cached={shape:l,keys:s},this._cached}_parse(l){if(this._getType(l)!==ie.object){const v=this._getOrReturnCtx(l);return te(v,{code:K.invalid_type,expected:ie.object,received:v.parsedType}),pe}const{status:u,ctx:d}=this._processInputParams(l),{shape:f,keys:m}=this._getCached(),x=[];if(!(this._def.catchall instanceof fl&&this._def.unknownKeys==="strip"))for(const v in d.data)m.includes(v)||x.push(v);const y=[];for(const v of m){const w=f[v],j=d.data[v];y.push({key:{status:"valid",value:v},value:w._parse(new en(d,j,d.path,v)),alwaysSet:v in d.data})}if(this._def.catchall instanceof fl){const v=this._def.unknownKeys;if(v==="passthrough")for(const w of x)y.push({key:{status:"valid",value:w},value:{status:"valid",value:d.data[w]}});else if(v==="strict")x.length>0&&(te(d,{code:K.unrecognized_keys,keys:x}),u.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const v=this._def.catchall;for(const w of x){const j=d.data[w];y.push({key:{status:"valid",value:w},value:v._parse(new en(d,j,d.path,w)),alwaysSet:w in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const v=[];for(const w of y){const j=await w.key,D=await w.value;v.push({key:j,value:D,alwaysSet:w.alwaysSet})}return v}).then(v=>Bt.mergeObjectSync(u,v)):Bt.mergeObjectSync(u,y)}get shape(){return this._def.shape()}strict(l){return ce.errToObj,new jt({...this._def,unknownKeys:"strict",...l!==void 0?{errorMap:(s,u)=>{var f,m;const d=((m=(f=this._def).errorMap)==null?void 0:m.call(f,s,u).message)??u.defaultError;return s.code==="unrecognized_keys"?{message:ce.errToObj(l).message??d}:{message:d}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(l){return new jt({...this._def,shape:()=>({...this._def.shape(),...l})})}merge(l){return new jt({unknownKeys:l._def.unknownKeys,catchall:l._def.catchall,shape:()=>({...this._def.shape(),...l._def.shape()}),typeName:xe.ZodObject})}setKey(l,s){return this.augment({[l]:s})}catchall(l){return new jt({...this._def,catchall:l})}pick(l){const s={};for(const u of ze.objectKeys(l))l[u]&&this.shape[u]&&(s[u]=this.shape[u]);return new jt({...this._def,shape:()=>s})}omit(l){const s={};for(const u of ze.objectKeys(this.shape))l[u]||(s[u]=this.shape[u]);return new jt({...this._def,shape:()=>s})}deepPartial(){return Ti(this)}partial(l){const s={};for(const u of ze.objectKeys(this.shape)){const d=this.shape[u];l&&!l[u]?s[u]=d:s[u]=d.optional()}return new jt({...this._def,shape:()=>s})}required(l){const s={};for(const u of ze.objectKeys(this.shape))if(l&&!l[u])s[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof En;)f=f._def.innerType;s[u]=f}return new jt({...this._def,shape:()=>s})}keyof(){return Yy(ze.objectKeys(this.shape))}}jt.create=(a,l)=>new jt({shape:()=>a,unknownKeys:"strip",catchall:fl.create(),typeName:xe.ZodObject,...Se(l)});jt.strictCreate=(a,l)=>new jt({shape:()=>a,unknownKeys:"strict",catchall:fl.create(),typeName:xe.ZodObject,...Se(l)});jt.lazycreate=(a,l)=>new jt({shape:a,unknownKeys:"strip",catchall:fl.create(),typeName:xe.ZodObject,...Se(l)});class bu extends Ce{_parse(l){const{ctx:s}=this._processInputParams(l),u=this._def.options;function d(f){for(const x of f)if(x.result.status==="valid")return x.result;for(const x of f)if(x.result.status==="dirty")return s.common.issues.push(...x.ctx.common.issues),x.result;const m=f.map(x=>new Cn(x.ctx.common.issues));return te(s,{code:K.invalid_union,unionErrors:m}),pe}if(s.common.async)return Promise.all(u.map(async f=>{const m={...s,common:{...s.common,issues:[]},parent:null};return{result:await f._parseAsync({data:s.data,path:s.path,parent:m}),ctx:m}})).then(d);{let f;const m=[];for(const y of u){const v={...s,common:{...s.common,issues:[]},parent:null},w=y._parseSync({data:s.data,path:s.path,parent:v});if(w.status==="valid")return w;w.status==="dirty"&&!f&&(f={result:w,ctx:v}),v.common.issues.length&&m.push(v.common.issues)}if(f)return s.common.issues.push(...f.ctx.common.issues),f.result;const x=m.map(y=>new Cn(y));return te(s,{code:K.invalid_union,unionErrors:x}),pe}}get options(){return this._def.options}}bu.create=(a,l)=>new bu({options:a,typeName:xe.ZodUnion,...Se(l)});const An=a=>a instanceof qd?An(a.schema):a instanceof Hl?An(a.innerType()):a instanceof ju?[a.value]:a instanceof ql?a.options:a instanceof Hd?ze.objectValues(a.enum):a instanceof _u?An(a._def.innerType):a instanceof Dd?[void 0]:a instanceof Ud?[null]:a instanceof En?[void 0,...An(a.unwrap())]:a instanceof $l?[null,...An(a.unwrap())]:a instanceof Zy||a instanceof Au?An(a.unwrap()):a instanceof ku?An(a._def.innerType):[];class lf extends Ce{_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==ie.object)return te(s,{code:K.invalid_type,expected:ie.object,received:s.parsedType}),pe;const u=this.discriminator,d=s.data[u],f=this.optionsMap.get(d);return f?s.common.async?f._parseAsync({data:s.data,path:s.path,parent:s}):f._parseSync({data:s.data,path:s.path,parent:s}):(te(s,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(l,s,u){const d=new Map;for(const f of s){const m=An(f.shape[l]);if(!m.length)throw new Error(`A discriminator value for key \`${l}\` could not be extracted from all schema options`);for(const x of m){if(d.has(x))throw new Error(`Discriminator property ${String(l)} has duplicate value ${String(x)}`);d.set(x,f)}}return new lf({typeName:xe.ZodDiscriminatedUnion,discriminator:l,options:s,optionsMap:d,...Se(u)})}}function Bd(a,l){const s=ol(a),u=ol(l);if(a===l)return{valid:!0,data:a};if(s===ie.object&&u===ie.object){const d=ze.objectKeys(l),f=ze.objectKeys(a).filter(x=>d.indexOf(x)!==-1),m={...a,...l};for(const x of f){const y=Bd(a[x],l[x]);if(!y.valid)return{valid:!1};m[x]=y.data}return{valid:!0,data:m}}else if(s===ie.array&&u===ie.array){if(a.length!==l.length)return{valid:!1};const d=[];for(let f=0;f<a.length;f++){const m=a[f],x=l[f],y=Bd(m,x);if(!y.valid)return{valid:!1};d.push(y.data)}return{valid:!0,data:d}}else return s===ie.date&&u===ie.date&&+a==+l?{valid:!0,data:a}:{valid:!1}}class wu extends Ce{_parse(l){const{status:s,ctx:u}=this._processInputParams(l),d=(f,m)=>{if(Nx(f)||Nx(m))return pe;const x=Bd(f.value,m.value);return x.valid?((_x(f)||_x(m))&&s.dirty(),{status:s.value,value:x.data}):(te(u,{code:K.invalid_intersection_types}),pe)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([f,m])=>d(f,m)):d(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}wu.create=(a,l,s)=>new wu({left:a,right:l,typeName:xe.ZodIntersection,...Se(s)});class Bl extends Ce{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==ie.array)return te(u,{code:K.invalid_type,expected:ie.array,received:u.parsedType}),pe;if(u.data.length<this._def.items.length)return te(u,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&u.data.length>this._def.items.length&&(te(u,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const f=[...u.data].map((m,x)=>{const y=this._def.items[x]||this._def.rest;return y?y._parse(new en(u,m,u.path,x)):null}).filter(m=>!!m);return u.common.async?Promise.all(f).then(m=>Bt.mergeArray(s,m)):Bt.mergeArray(s,f)}get items(){return this._def.items}rest(l){return new Bl({...this._def,rest:l})}}Bl.create=(a,l)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bl({items:a,typeName:xe.ZodTuple,rest:null,...Se(l)})};class Su extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==ie.object)return te(u,{code:K.invalid_type,expected:ie.object,received:u.parsedType}),pe;const d=[],f=this._def.keyType,m=this._def.valueType;for(const x in u.data)d.push({key:f._parse(new en(u,x,u.path,x)),value:m._parse(new en(u,u.data[x],u.path,x)),alwaysSet:x in u.data});return u.common.async?Bt.mergeObjectAsync(s,d):Bt.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(l,s,u){return s instanceof Ce?new Su({keyType:l,valueType:s,typeName:xe.ZodRecord,...Se(u)}):new Su({keyType:Fa.create(),valueType:l,typeName:xe.ZodRecord,...Se(s)})}}class Cx extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==ie.map)return te(u,{code:K.invalid_type,expected:ie.map,received:u.parsedType}),pe;const d=this._def.keyType,f=this._def.valueType,m=[...u.data.entries()].map(([x,y],v)=>({key:d._parse(new en(u,x,u.path,[v,"key"])),value:f._parse(new en(u,y,u.path,[v,"value"]))}));if(u.common.async){const x=new Map;return Promise.resolve().then(async()=>{for(const y of m){const v=await y.key,w=await y.value;if(v.status==="aborted"||w.status==="aborted")return pe;(v.status==="dirty"||w.status==="dirty")&&s.dirty(),x.set(v.value,w.value)}return{status:s.value,value:x}})}else{const x=new Map;for(const y of m){const v=y.key,w=y.value;if(v.status==="aborted"||w.status==="aborted")return pe;(v.status==="dirty"||w.status==="dirty")&&s.dirty(),x.set(v.value,w.value)}return{status:s.value,value:x}}}}Cx.create=(a,l,s)=>new Cx({valueType:l,keyType:a,typeName:xe.ZodMap,...Se(s)});class Hs extends Ce{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==ie.set)return te(u,{code:K.invalid_type,expected:ie.set,received:u.parsedType}),pe;const d=this._def;d.minSize!==null&&u.data.size<d.minSize.value&&(te(u,{code:K.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),s.dirty()),d.maxSize!==null&&u.data.size>d.maxSize.value&&(te(u,{code:K.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),s.dirty());const f=this._def.valueType;function m(y){const v=new Set;for(const w of y){if(w.status==="aborted")return pe;w.status==="dirty"&&s.dirty(),v.add(w.value)}return{status:s.value,value:v}}const x=[...u.data.values()].map((y,v)=>f._parse(new en(u,y,u.path,v)));return u.common.async?Promise.all(x).then(y=>m(y)):m(x)}min(l,s){return new Hs({...this._def,minSize:{value:l,message:ce.toString(s)}})}max(l,s){return new Hs({...this._def,maxSize:{value:l,message:ce.toString(s)}})}size(l,s){return this.min(l,s).max(l,s)}nonempty(l){return this.min(1,l)}}Hs.create=(a,l)=>new Hs({valueType:a,minSize:null,maxSize:null,typeName:xe.ZodSet,...Se(l)});class qd extends Ce{get schema(){return this._def.getter()}_parse(l){const{ctx:s}=this._processInputParams(l);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}qd.create=(a,l)=>new qd({getter:a,typeName:xe.ZodLazy,...Se(l)});class ju extends Ce{_parse(l){if(l.data!==this._def.value){const s=this._getOrReturnCtx(l);return te(s,{received:s.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:l.data}}get value(){return this._def.value}}ju.create=(a,l)=>new ju({value:a,typeName:xe.ZodLiteral,...Se(l)});function Yy(a,l){return new ql({values:a,typeName:xe.ZodEnum,...Se(l)})}class ql extends Ce{_parse(l){if(typeof l.data!="string"){const s=this._getOrReturnCtx(l),u=this._def.values;return te(s,{expected:ze.joinValues(u),received:s.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(l.data)){const s=this._getOrReturnCtx(l),u=this._def.values;return te(s,{received:s.data,code:K.invalid_enum_value,options:u}),pe}return Ea(l.data)}get options(){return this._def.values}get enum(){const l={};for(const s of this._def.values)l[s]=s;return l}get Values(){const l={};for(const s of this._def.values)l[s]=s;return l}get Enum(){const l={};for(const s of this._def.values)l[s]=s;return l}extract(l,s=this._def){return ql.create(l,{...this._def,...s})}exclude(l,s=this._def){return ql.create(this.options.filter(u=>!l.includes(u)),{...this._def,...s})}}ql.create=Yy;class Hd extends Ce{_parse(l){const s=ze.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(l);if(u.parsedType!==ie.string&&u.parsedType!==ie.number){const d=ze.objectValues(s);return te(u,{expected:ze.joinValues(d),received:u.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(ze.getValidEnumValues(this._def.values))),!this._cache.has(l.data)){const d=ze.objectValues(s);return te(u,{received:u.data,code:K.invalid_enum_value,options:d}),pe}return Ea(l.data)}get enum(){return this._def.values}}Hd.create=(a,l)=>new Hd({values:a,typeName:xe.ZodNativeEnum,...Se(l)});class Nu extends Ce{unwrap(){return this._def.type}_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==ie.promise&&s.common.async===!1)return te(s,{code:K.invalid_type,expected:ie.promise,received:s.parsedType}),pe;const u=s.parsedType===ie.promise?s.data:Promise.resolve(s.data);return Ea(u.then(d=>this._def.type.parseAsync(d,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Nu.create=(a,l)=>new Nu({type:a,typeName:xe.ZodPromise,...Se(l)});class Hl extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(l){const{status:s,ctx:u}=this._processInputParams(l),d=this._def.effect||null,f={addIssue:m=>{te(u,m),m.fatal?s.abort():s.dirty()},get path(){return u.path}};if(f.addIssue=f.addIssue.bind(f),d.type==="preprocess"){const m=d.transform(u.data,f);if(u.common.async)return Promise.resolve(m).then(async x=>{if(s.value==="aborted")return pe;const y=await this._def.schema._parseAsync({data:x,path:u.path,parent:u});return y.status==="aborted"?pe:y.status==="dirty"||s.value==="dirty"?Ls(y.value):y});{if(s.value==="aborted")return pe;const x=this._def.schema._parseSync({data:m,path:u.path,parent:u});return x.status==="aborted"?pe:x.status==="dirty"||s.value==="dirty"?Ls(x.value):x}}if(d.type==="refinement"){const m=x=>{const y=d.refinement(x,f);if(u.common.async)return Promise.resolve(y);if(y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return x};if(u.common.async===!1){const x=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return x.status==="aborted"?pe:(x.status==="dirty"&&s.dirty(),m(x.value),{status:s.value,value:x.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(x=>x.status==="aborted"?pe:(x.status==="dirty"&&s.dirty(),m(x.value).then(()=>({status:s.value,value:x.value}))))}if(d.type==="transform")if(u.common.async===!1){const m=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Mi(m))return pe;const x=d.transform(m.value,f);if(x instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:x}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(m=>Mi(m)?Promise.resolve(d.transform(m.value,f)).then(x=>({status:s.value,value:x})):pe);ze.assertNever(d)}}Hl.create=(a,l,s)=>new Hl({schema:a,typeName:xe.ZodEffects,effect:l,...Se(s)});Hl.createWithPreprocess=(a,l,s)=>new Hl({schema:l,effect:{type:"preprocess",transform:a},typeName:xe.ZodEffects,...Se(s)});class En extends Ce{_parse(l){return this._getType(l)===ie.undefined?Ea(void 0):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}En.create=(a,l)=>new En({innerType:a,typeName:xe.ZodOptional,...Se(l)});class $l extends Ce{_parse(l){return this._getType(l)===ie.null?Ea(null):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}$l.create=(a,l)=>new $l({innerType:a,typeName:xe.ZodNullable,...Se(l)});class _u extends Ce{_parse(l){const{ctx:s}=this._processInputParams(l);let u=s.data;return s.parsedType===ie.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}_u.create=(a,l)=>new _u({innerType:a,typeName:xe.ZodDefault,defaultValue:typeof l.default=="function"?l.default:()=>l.default,...Se(l)});class ku extends Ce{_parse(l){const{ctx:s}=this._processInputParams(l),u={...s,common:{...s.common,issues:[]}},d=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return vu(d)?d.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new Cn(u.common.issues)},input:u.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new Cn(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}ku.create=(a,l)=>new ku({innerType:a,typeName:xe.ZodCatch,catchValue:typeof l.catch=="function"?l.catch:()=>l.catch,...Se(l)});class Tx extends Ce{_parse(l){if(this._getType(l)!==ie.nan){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:ie.nan,received:u.parsedType}),pe}return{status:"valid",value:l.data}}}Tx.create=a=>new Tx({typeName:xe.ZodNaN,...Se(a)});class Zy extends Ce{_parse(l){const{ctx:s}=this._processInputParams(l),u=s.data;return this._def.type._parse({data:u,path:s.path,parent:s})}unwrap(){return this._def.type}}class sf extends Ce{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return f.status==="aborted"?pe:f.status==="dirty"?(s.dirty(),Ls(f.value)):this._def.out._parseAsync({data:f.value,path:u.path,parent:u})})();{const d=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return d.status==="aborted"?pe:d.status==="dirty"?(s.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:u.path,parent:u})}}static create(l,s){return new sf({in:l,out:s,typeName:xe.ZodPipeline})}}class Au extends Ce{_parse(l){const s=this._def.innerType._parse(l),u=d=>(Mi(d)&&(d.value=Object.freeze(d.value)),d);return vu(s)?s.then(d=>u(d)):u(s)}unwrap(){return this._def.innerType}}Au.create=(a,l)=>new Au({innerType:a,typeName:xe.ZodReadonly,...Se(l)});var xe;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(xe||(xe={}));const p=Fa.create,A=Ul.create;zl.create;const Le=gu.create;Di.create;const Gy=zd.create;fl.create;const ne=Pa.create,z=jt.create,hw=bu.create,Qy=lf.create;wu.create;Bl.create;const $s=Su.create,_a=ju.create,he=ql.create;Nu.create;En.create;$l.create;const Ox={string:(a=>Fa.create({...a,coerce:!0})),number:(a=>Ul.create({...a,coerce:!0})),boolean:(a=>gu.create({...a,coerce:!0})),bigint:(a=>zl.create({...a,coerce:!0})),date:(a=>Di.create({...a,coerce:!0}))},mw=pe,pw=p().regex(/^github\.com\/[^/]+\/[^/]+$/,"Expected github.com/<owner>/<repo>"),xw=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;function yw(a){const l=a.trim();return l?!!(l.startsWith("/")||l.startsWith("~")||l.startsWith(".")||/^[A-Za-z]:[\\/]/.test(l)||l.startsWith("\\\\")):!1}function rf(a){const l=a.trim();if(!l)throw new Error("Repository is required");if(yw(l))throw new Error("Local filesystem paths are no longer accepted. Pass a GitHub URL or owner/repo (e.g. https://github.com/acme/app or acme/app).");let s,u;const d=xw.exec(l);if(d&&!l.includes("://")&&!l.toLowerCase().includes("github.com"))s=d[1],u=d[2];else{let m=l;/^[a-z][a-z0-9+.-]*:\/\//i.test(m)||(m.startsWith("git@")?m=m.replace(/^git@([^:]+):/,"https://$1/"):m=`https://${m}`);let x;try{x=new URL(m)}catch{throw new Error(`Unrecognized GitHub repository reference: ${a}`)}if(!/^([^.]+\.)?github\.com$/i.test(x.hostname))throw new Error(`Only github.com repositories are supported (got host ${x.hostname})`);const y=x.pathname.replace(/^\/+|\/+$/g,"").split("/");if(y.length<2||!y[0]||!y[1])throw new Error(`Unrecognized GitHub repository reference: ${a}`);s=y[0],u=y[1].replace(/\.git$/i,"")}if(!s||!u||s.includes("..")||u.includes(".."))throw new Error(`Unrecognized GitHub repository reference: ${a}`);const f=pw.parse(`github.com/${s}/${u}`);return{owner:s,repo:u,identity:f,cloneUrl:`https://github.com/${s}/${u}.git`}}const Xy=p().min(1).transform((a,l)=>{try{return rf(a).identity}catch(s){return l.addIssue({code:K.custom,message:s.message}),mw}}),Iy="repo:",vw=he(["resolved","unresolved","conflict","invalid"]),gw=z({status:vw,repository:p().optional(),sourceLabel:p().optional(),labels:ne(p()).optional(),error:p().optional()});function bw(a){return a?a.filter(l=>l.toLowerCase().startsWith(Iy)):[]}const ww=100,Sw=z({label:p(),repository:p()});z({mappings:ne(Sw).max(ww+1)});function Ky(a){const l=bw(a);if(l.length===0)return{status:"unresolved",labels:[]};if(l.length>1)return{status:"conflict",labels:[...l]};const s=l[0],u=s.slice(Iy.length).trim();if(!u)return{status:"invalid",labels:[s],error:"Repository label has no value"};try{return{status:"resolved",repository:rf(u).identity,sourceLabel:s,labels:[s]}}catch(d){return{status:"invalid",labels:[s],error:d.message}}}const Jy=z({id:p(),title:p(),url:p(),subtitle:p().optional(),source:p().optional()});z({linearAttachmentId:p(),kind:he(["file","link"]),title:p(),safeFileName:p().optional(),blobPath:p().optional(),contentType:p().optional(),sizeBytes:A().int().nonnegative().optional(),sha256:p().optional(),url:p(),subtitle:p().optional(),source:p().optional()});const qt=he(["claude_code","cursor_local","codex_local","muse_code"]),qa=z({maxTurns:A().positive().nullable().optional(),maxBudgetUsd:A().positive().nullable().optional()}),Fy=z({plan:qa.optional(),execute:qa.optional(),reflect:qa.optional()});function xu(a){if(!(a!=null&&a.trim()))return null;try{const l=qa.parse(JSON.parse(a));return l.maxTurns==null&&l.maxBudgetUsd==null?null:l}catch{return null}}function jw(a){return!a||a.maxTurns==null&&a.maxBudgetUsd==null?null:JSON.stringify(a)}const uf=he(["developer","reviewer","legacy"]),Nw=he(["queued","running","done","failed","timed_out","cancelled"]);z({id:p().uuid(),issueId:p().uuid(),role:uf,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:qt.nullable(),model:p().nullable(),budgetJson:p().nullable(),worktreePath:p().nullable(),inputSha:p().nullable(),status:Nw,sessionRef:p().nullable(),logPath:p().nullable(),exitCode:A().int().nullable(),errorJson:p().nullable(),metadataJson:p().nullable(),profileSnapshotJson:p().nullable(),processPid:A().int().nullable(),processOwner:p().nullable(),processStartedAt:p().nullable(),deckCorrelationId:p().uuid().nullable(),createdAt:p(),startedAt:p().nullable(),heartbeatAt:p().nullable(),completedAt:p().nullable(),updatedAt:p()});z({issueId:p().uuid(),role:uf,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:qt.nullable(),model:p().nullable().optional(),budgetJson:p().nullable().optional(),inputSha:p().nullable().optional(),metadataJson:p().nullable().optional(),profileSnapshotJson:p().nullable().optional()});const _w=z({worktreeWrite:Le(),publishReview:Le(),outboundMutation:Le(),resolveHumanAction:Le()}),Wy=z({worktreeWrite:Le().optional(),outboundMutation:Le().optional()}).strict(),zu=he(["low","medium","high"]);z({version:_a(1),agentId:p().nullable(),role:uf,runtime:qt.nullable(),model:p().nullable(),effort:zu.nullable().default(null),budgetJson:p().nullable(),permissionPolicy:_w,deckId:p().nullable(),purpose:p().nullable(),capturedAt:p()});const Py="auto",kw="muse-spark-1.3-contributor",Aw=z({code:he(["cli_missing","runtime_auth","runtime_unknown","runtime_capability","cursor_keychain","usage_capped","deck_offline","deck_unauthorized","workspace_missing","deck_missing","mcp_not_registered","github_cli_missing","github_auth","github_unreachable"]),message:p()}),Ew=z({id:p().uuid(),name:p(),runtime:qt,workspaceRoot:p().nullable(),deckId:p().uuid().nullable(),deckName:p().nullable(),playbookId:p().nullable(),defaultPlanModel:p().nullable(),defaultExecuteModel:p().nullable(),defaultPlanBudgetJson:p().nullable(),defaultExecuteBudgetJson:p().nullable(),defaultModel:p().nullable(),defaultEffort:zu.nullable(),defaultBudgetJson:p().nullable(),purpose:p().nullable(),playbookIdsJson:p().nullable(),externalMemoryRefsJson:p().nullable(),permissionPolicyJson:p().nullable(),isBuiltin:Le(),createdAt:p(),updatedAt:p()}),ev=Ew.extend({healthy:Le(),issues:ne(Aw)});z({name:p().min(1),runtime:qt,deckId:p().uuid(),defaultModel:p().nullable().optional(),defaultEffort:zu.nullable().optional(),defaultBudget:qa.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Wy.nullable().optional()});z({name:p().min(1).optional(),runtime:qt.optional(),deckId:p().uuid().nullable().optional(),defaultModel:p().nullable().optional(),defaultEffort:zu.nullable().optional(),defaultBudget:qa.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Wy.nullable().optional()});z({agents:ne(ev),issueCount:A()});function Lx(a){return a.defaultModel??a.defaultExecuteModel??a.defaultPlanModel??null}function Rw(a){const l=xu(a.defaultBudgetJson)??xu(a.defaultExecuteBudgetJson)??xu(a.defaultPlanBudgetJson);return jw(l)}const Cw=he(["slack_message","email","service_tool_call"]),Tw=z({target:p().min(1).max(120),body:p().min(1).max(4e3)}),Ow=z({serviceName:p().min(1).max(120),toolName:p().min(1).max(120),arguments:$s(Gy())}),Lw=z({actionType:Cw,summary:Tw,toolCall:Ow}),Mw=he(["pending","sent","rejected"]);z({draft:Lw,status:Mw,sentAt:p().optional(),rejectedAt:p().optional(),bodyMismatch:Le().optional(),deliveryAttempts:A().int().min(0).default(0)});z({draftArtifactId:p().uuid(),sentAt:p(),toolResult:$s(Gy()),permalink:p().url().optional()});const Dw=z({failure_summary:p().min(1),user_feedback_excerpt:p().min(1),corrected_output_hint:p().optional()}),Uw=Qy("op",[z({op:_a("add_item"),section:p().min(1),text:p().min(1)}),z({op:_a("amend_item"),section:p().min(1),anchor:p().min(1),text:p().min(1)}),z({op:_a("remove_item"),section:p().min(1),anchor:p().min(1)}),z({op:_a("set_triggers"),triggers:ne(p())}),z({op:_a("rewrite_body"),text:p()})]);z({rationale:p().min(1),ops:ne(Uw).min(1),evidence:Dw.optional()});const zw="v1",tv=he(["feature","bug fix","refactor","investigation","split child"]);tv.options;const Bw=z({text:p(),evidence:p().nullable()}),qw=z({version:_a(zw),executionMode:tv,nonGoals:ne(p()),exitPredicate:p(),onePrStoppingPoint:p(),acceptanceCriteria:ne(Bw)}),av={executionMode:"Builder execution mode",nonGoals:"Non-goals",exitPredicate:"Exit predicate",onePrStoppingPoint:"One-PR stopping point",acceptanceCriteria:"Acceptance criteria"},Hw=Object.keys(av);function $w(a){return a.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}Object.fromEntries(Hw.map(a=>[$w(av[a]),a]));const Vw=he(["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"]),Yw=he(["human","developer","reviewer","system"]),nv=he(["manual","linear","agent"]),Zw=z({id:p().uuid(),source:nv,externalId:p().nullable(),externalLabel:p().nullable(),externalUrl:p().nullable(),title:p(),description:p().nullable(),acceptanceCriteria:p().nullable(),executionContract:qw.nullable().optional(),repo:p(),baseBranch:p(),status:Vw,currentOwner:Yw,currentIntent:p().nullable(),developerAgentId:p().uuid().nullable(),reviewerAgentId:p().uuid().nullable(),maxReviewRounds:A().int().min(1),currentRound:A().int().min(1),maxInfraAttempts:A().int().min(0),infraAttempts:A().int().min(0),maxCiAttempts:A().int().min(0),ciAttempts:A().int().min(0),branch:p().nullable(),baseSha:p().nullable(),headSha:p().nullable(),prNumber:A().int().nullable(),prUrl:p().nullable(),autoMerge:Le(),createdAt:p(),updatedAt:p()});z({title:p().min(1),description:p().optional(),acceptanceCriteria:p().optional(),repo:Xy,baseBranch:p().min(1).default("main"),developerAgentId:p().uuid(),reviewerAgentId:p().uuid(),maxReviewRounds:A().int().min(1).default(3),maxInfraAttempts:A().int().min(0).default(3),autoMerge:Le().default(!0),source:nv.default("manual"),externalId:p().optional(),externalLabel:p().optional(),externalUrl:p().optional(),enqueue:Le().default(!0),linearAttachments:ne(Jy).optional()});z({title:p().min(1).optional(),description:p().nullable().optional(),acceptanceCriteria:p().nullable().optional(),repo:Xy.optional(),baseBranch:p().min(1).optional(),developerAgentId:p().uuid().optional(),reviewerAgentId:p().uuid().optional(),maxReviewRounds:A().int().min(1).optional(),maxInfraAttempts:A().int().min(0).optional(),autoMerge:Le().optional()});const Mx={ready:["developing","closed"],developing:["developing","reviewing","needs_human","closed"],reviewing:["reviewing","repairing","final_review","needs_human","closed"],repairing:["repairing","reviewing","needs_human","closed"],needs_human:["developing","reviewing","repairing","final_review","done","closed"],final_review:["final_review","done","repairing","needs_human","closed"],done:[],closed:[]};Object.keys(Mx).filter(a=>Mx[a].length===0);const Gw=he(["enqueued","already_queued","not_queued"]);Zw.extend({created:Le(),queue:Gw,priorPasses:A().int().min(0)});z({id:p(),issueId:p().nullable(),workerSessionId:p().nullable(),kind:p(),contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});const Qw=he(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","muse_no_progress","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),Xw=he(["task","infrastructure","unknown"]),Iw=he(["high","medium","low"]),Kw=he(["outcome_kind","session_error","spawn_log","workflow_event","recovery"]),Jw=he(["exact","inferred"]),$d=z({code:Qw,domain:Xw,primary:Le(),confidence:Iw,evidenceSource:Kw,occurredAt:p().nullable(),eventCursor:A().int().nullable(),rawReason:p(),sessionId:p().nullable(),logPath:p().nullable(),eventId:p().nullable(),eventType:p().nullable(),quality:Jw}),Fw=he(["commit","verification_receipt","branch_pushed"]),Ww=he(["sampler","salvage","session_end"]),of=he(["worktree","commit","verification_receipt","publish_only"]);z({kind:Fw,observedSha:p().nullable(),observedAt:p(),origin:Ww.nullable(),inputSha:p().nullable(),samplingPrecisionMs:A().int().nullable(),branch:p().nullable()});z({kinds:ne(of),retryReason:p().nullable()});const Pw=he(["done","closed","migrated"]);z({id:p().uuid(),issueId:p().uuid(),workflowVersion:p(),startedAt:p(),completedAt:p().nullable(),outcome:Pw.nullable()});const e2=he(["issue.created","issue.reassigned","issue.source_reloaded","workflow.started","worker.started","worker.completed","worker.failed","worker.deferred","worktree.ready","worktree.deps_ready","inputs.materialized","deck.connected","brief.resolved","branch.pushed","checks.started","pull_request.opened","pull_request.updated","checks.completed","review.submitted","repair.started","guidance.added","task_snapshot.refreshed","human_action.requested","human_action.resolved","final_review.requested","issue.completed","issue.closed","queue.enqueued","queue.wait_reason_changed","queue.admitted","queue.removed","agent.started","agent.completed","host.suspended","checkpoint.observed","retry.reused","auto_merge.conflict_sync","auto_merge.conflict_repair_queued","base.probe","base.advanced","operator_verification.waived","legacy.imported"]);z({id:p().uuid(),issueId:p().uuid(),workflowInstanceId:p().uuid().nullable(),workerSessionId:p().uuid().nullable(),type:e2,actorType:he(["human","developer","reviewer","system"]),actorRef:p().nullable(),stage:p(),round:A().int().nullable(),payloadJson:p().nullable(),artifactRef:p().nullable(),idempotencyKey:p().nullable(),causationEventId:p().uuid().nullable(),ts:p()});const t2=he(["product_scope_decision","policy_escalation","attempts_exhausted","final_review","deck_interaction_required","reflection_interaction_required","outbound_delivery_interaction_required","muse_capability","operator_verification"]),a2=he(["open","resolved"]);z({id:p().uuid(),issueId:p().uuid().nullable(),runId:p().uuid().nullable(),workflowInstanceId:p().uuid().nullable(),actionType:t2,reason:p(),question:p(),evidenceJson:p().nullable(),responseOptionsJson:p().nullable(),continuationPreviewJson:p().nullable(),requestId:p().nullable(),status:a2,resolutionJson:p().nullable(),resolvedBy:p().nullable(),requestedAt:p(),resolvedAt:p().nullable()});function Bu(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}function n2(a){const l=Bu(a.responseOptionsJson);return Array.isArray(l)?l.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function cf(a){return Bu(a.evidenceJson)??{}}function qu(a){const s=cf(a).pushDivergence;return!s||typeof s!="object"?null:s}function l2(a){const s=cf(a).worktreeBlocker;return!!s&&typeof s=="object"&&typeof s.fingerprint=="string"}function i2(a){return cf(a).mergeFailure===!0}function lv(a){const l=Bu(a.continuationPreviewJson);return typeof(l==null?void 0:l.resumeRole)=="string"?l.resumeRole:null}const s2=/worktree|unpushed|uncommitted|dirty|preserved|non-fast-forward|diverged|already used by|recovery:|force-with-lease/i,r2=/could not be pushed|non-fast-forward|rejected.*push|push.*rejected/i,u2=/uncommitted|dirty worktree|has uncommitted changes/i;function iv(a){const l=/\n?Recovery:\s*\n?/,s=a.match(l);if(!s||s.index===void 0)return{head:a.trim(),commands:[]};const u=a.slice(0,s.index).trim(),f=a.slice(s.index+s[0].length).split(`
|
|
61
|
+
`).map(m=>m.trim()).filter(m=>m.length>0);return{head:u,commands:f}}function o2(a){const s=iv(a).head.replace(/\s+/g," ").trim(),u=s.match(/^(.+?[.!?])(\s|$)/);return(u?u[1]:s).trim()}const c2=/(?:~|\/(?:[^/\s\\:"'*?<>|][^/\s\\:"'*?<>|]*))+(?:\/[^/\s\\:"'*?<>|]+)*/g;function d2(a){const l=[],s=new Set,u=f=>{const m=f.trim().replace(/[.,;:!?)"'\]]+$/,"");m.length<2||s.has(m)||(s.add(m),l.push(m))};for(const f of[a.reason,a.question])for(const m of f.matchAll(c2)){const x=m[0];/^\/\d+(\.\d+)*$/.test(x)||!x.includes("/")&&!x.startsWith("~")||u(x)}const d=qu(a);return typeof(d==null?void 0:d.worktreePath)=="string"&&d.worktreePath&&u(d.worktreePath),l}function Dx(a){return a.length>12?a.slice(0,12):a}function f2(a){const l=[],s=qu(a);if(s&&typeof s.localSha=="string"&&typeof s.remoteSha=="string"){const d=typeof s.branch=="string"?s.branch:"the branch",f=typeof s.ahead=="number"?` (+${s.ahead})`:"",m=typeof s.behind=="number"?` (+${s.behind})`:"";l.push(`Push: local ${s.localSha}${f} · origin/${d} ${s.remoteSha}${m}`),typeof s.observedRemoteSha=="string"&&s.observedRemoteSha!==s.remoteSha&&l.push(`Remote moved: origin/${d} is now at ${s.observedRemoteSha}`),typeof s.lastLeaseError=="string"&&s.lastLeaseError&&l.push(`Last lease attempt: ${s.lastLeaseError}`)}const u=lv(a);return u&&l.push(`Continuation: resumes as ${u}`),l}function h2(a){return a==="close"||a==="reject"||a==="abort"}function rl(a){return a.length===0?null:a.some(l=>l.choice==="push_with_lease")?"push_with_lease":(a.find(l=>!h2(l.choice))??a[0]).choice}function m2(a){if(a.actionType!=="policy_escalation")return"other";if(i2(a))return"merge-failure";const l=qu(a);if((l==null?void 0:l.relationship)==="diverged")return"diverged-push";if(l&&(l.relationship==="behind"||typeof l.localSha=="string"))return"unpushed";const s=`${a.reason}
|
|
62
|
+
${a.question}`;return r2.test(s)?"unpushed":lv(a)==="reviewer"?"reviewer-retry":u2.test(s)?"dirty-worktree":l2(a)||/already used by worktree/i.test(s)||/worktree/i.test(s)&&/Recovery:/.test(s)?"worktree-conflict":"ordinary-escalation"}const p2="Resume safely";function sv(a){const l=m2(a),s=n2(a),{commands:u}=iv(a.reason),d=d2(a),f=f2(a),m=(()=>{const y=Bu(a.evidenceJson);return y==null?null:JSON.stringify(y,null,2)})(),x={question:a.question,reason:a.reason,commands:u,paths:d,factLines:f,evidencePretty:m};switch(l){case"diverged-push":{const y=qu(a),v=y&&typeof y.branch=="string"&&typeof y.localSha=="string"&&typeof y.remoteSha=="string"?` (origin/${y.branch}: local ${Dx(y.localSha)} against remote ${Dx(y.remoteSha)})`:"";return{kind:l,title:"Publish these finished commits with a pinned lease?",context:`Your branch diverged from the remote — confirm the pinned commits${v} under Details, then choose Push with lease.`,safeResume:!1,displayOptions:s,primaryChoice:rl(s),details:x}}case"unpushed":return{kind:l,title:"The push was rejected — how should we proceed?",context:"Your commits are saved; resuming continues development without discarding them.",safeResume:!1,displayOptions:s,primaryChoice:rl(s),details:x};case"worktree-conflict":return{kind:l,title:"A saved worktree still holds this branch — how should we proceed?",context:"Your work is preserved; check the worktree path and recovery steps under Details before choosing.",safeResume:!1,displayOptions:s,primaryChoice:rl(s),details:x};case"dirty-worktree":return{kind:l,title:"Uncommitted changes were preserved — how should we proceed?",context:"Nothing was discarded; review the saved changes under Details before choosing.",safeResume:!1,displayOptions:s,primaryChoice:rl(s),details:x};case"merge-failure":return{kind:l,title:"The merge failed after approval — retry it?",context:"The work is already approved; retrying the merge publishes the same commits without a new developer round.",safeResume:!1,displayOptions:s,primaryChoice:rl(s),details:x};case"reviewer-retry":return{kind:l,title:"The review attempt failed — retry it?",context:"Nothing is wrong with the code itself; retrying re-queues the reviewer at the same pinned commit.",safeResume:!0,displayOptions:s,primaryChoice:rl(s),details:x};case"ordinary-escalation":{const y=o2(a.reason),v=!s2.test(`${a.reason}
|
|
63
|
+
${a.question}`),w=v?s.map(j=>j.choice==="resume"&&j.label==="Resume development"?{...j,label:p2}:j):s;return{kind:l,title:"Development is parked — resume or close?",context:y?`${y} Choose ${v?"Resume safely":"Resume"} to continue, or Close to stop.`:null,safeResume:v,displayOptions:w,primaryChoice:rl(w),details:x}}case"other":default:return{kind:"other",title:a.question,context:null,safeResume:!1,displayOptions:s,primaryChoice:rl(s),details:x}}}const x2=he(["blocking","non_blocking"]),y2=he(["open","resolved","recurring","superseded"]);z({id:p().uuid(),issueId:p().uuid(),fingerprint:p(),severity:x2,title:p(),rationale:p(),evidenceRef:p().nullable(),file:p().nullable(),line:A().int().nullable(),status:y2,firstRound:A().int().min(1),lastRound:A().int().min(1)});z({id:p().uuid(),issueId:p().uuid(),workerSessionId:p().uuid(),role:he(["developer","reviewer","legacy"]),runtime:p().nullable(),tokensIn:A().int().nullable(),tokensOut:A().int().nullable(),costUsd:A().nullable(),durationMs:A().int().nullable(),ts:p(),model:p().nullable().optional()});const v2=z({available:_a(!0)}),g2=z({available:_a(!1),until:p(),reason:p()});Qy("available",[v2,g2]);const df=he(["supported_protocol","observed_event","experimental_api","unavailable"]),Hu=he(["unsupported","missing","expired","unparsable","stale"]),b2=he(["five_hour","weekly"]),w2=z({message:p().min(1),consecutiveFailures:A().int().positive(),firstFailureAt:p(),lastFailureAt:p()}),S2=z({windowKey:p().min(1),providerBucket:p().min(1),durationMinutes:A().int().positive().nullable(),displayLabel:p().min(1),usedValue:A().nullable(),usedUnit:p().nullable(),remainingPercent:A().min(0).max(100).nullable(),resetAt:p().nullable(),observedAt:p(),freshUntil:p().nullable(),expiresAt:p().nullable(),source:df,unavailableReason:Hu.nullable(),unavailableDetail:w2.nullable().optional(),criticalRole:b2.nullable()}),j2=he(["five_hour","weekly","billing_cycle"]),N2=z({unavailableUntil:p(),reason:p(),windowRole:j2.nullable()}),_2=z({runtime:qt,windows:ne(S2),unavailableReason:Hu.nullable(),activeCap:N2.nullable().optional()});z({runtimes:ne(_2),generatedAt:p()});z({configured:Le(),cycleStart:p().nullable(),cycleEnd:p().nullable(),spendValue:A().nullable(),spendUnit:p().nullable(),hardLimitValue:A().nullable(),hardLimitUnit:p().nullable(),memberCount:A().nullable(),memberLimitOverrideCount:A().nullable(),usagePeriodStart:p().nullable(),usagePeriodEnd:p().nullable(),usageSpendValue:A().nullable(),usageSpendUnit:p().nullable(),source:df,unavailableReason:Hu.nullable(),observedAt:p().nullable(),generatedAt:p()});z({enabled:Le(),configured:Le(),cycleLabel:p().nullable(),cycleStart:p().nullable(),cycleEnd:p().nullable(),usageValue:A().nullable(),usageUnit:p().nullable(),remainingPercent:A().min(0).max(100).nullable(),source:df,unavailableReason:Hu.nullable(),observedAt:p().nullable(),generatedAt:p()});function rv(a,l=Date.now()){if(a.remainingPercent===null||a.source==="unavailable"||a.unavailableReason!==null)return!1;if(a.resetAt!==null){const s=Date.parse(a.resetAt);if(!Number.isFinite(s)||s<=l)return!1}if(a.freshUntil!==null){const s=Date.parse(a.freshUntil);if(!Number.isFinite(s)||s<=l)return!1}if(a.expiresAt!==null){const s=Date.parse(a.expiresAt);if(!Number.isFinite(s)||s<=l)return!1}if(a.observedAt){const s=Date.parse(a.observedAt);if(!Number.isFinite(s)||s>l+6e4)return!1}return!0}const k2=he(["queued","admitted","removed"]),A2=z({id:p().uuid(),issueId:p().uuid(),position:A().int(),enqueuedAt:p(),state:k2,waitReason:p().nullable(),waitReasonAt:p().nullable()});A2.extend({title:p().optional(),issueStatus:p().optional()});z({issueId:p().uuid()});const E2=hw([_a("top"),_a("bottom"),z({before:p().uuid()}).strict(),z({after:p().uuid()}).strict()]);z({to:E2});const uv=5;z({maxActiveIssues:A().int().min(1).max(uv)});z({active:A().int().min(0),waiting:A().int().min(0),limit:A().int().min(0),maxActiveIssues:A().int().min(1),ceiling:A().int().min(0),options:ne(A().int().min(1)),overCap:Le()});const la=he(["exact","inferred","unavailable"]),$u=z({quality:la,reasons:ne(p())}),ov=he(["queue_wait","coordinator_setup","agent_process","coordinator_validation_publish","coordinator_work"]),Bs=z({phase:ov,startMs:A().int().nullable(),endMs:A().int().nullable(),durationMs:A().int().nullable(),quality:la,reasons:ne(p()),sessionId:p().nullable(),startCursor:A().int().nullable(),endCursor:A().int().nullable()}),R2=$u.extend({phase:ov,durationMs:A().int().nullable(),rawCount:A().int(),known:A().int(),total:A().int()}),cv=z({kind:he(["admission_dependency_wait","runtime_health_preflight","unexplained_silence","human_wait"]),startMs:A().int().nullable(),endMs:A().int().nullable(),durationMs:A().int().nullable(),quality:la,reasons:ne(p()),category:p().nullable(),sessionId:p().nullable()}),Jt=$u.extend({value:A().nullable(),known:A().int(),total:A().int()}),Wa=$u.extend({p50:A().nullable(),p95:A().nullable(),n:A().int()}),C2=z({sessionId:p(),role:p(),runtime:p().nullable(),model:p().nullable(),status:p(),round:A().int(),publishOnly:Le(),setup:Bs,agentProcess:Bs,validationPublish:Bs,spawnEnvelopeMs:A().int().nullable(),spawnEnvelopeQuality:la,spawnEnvelopeReasons:ne(p()),failureCauses:ne($d),reuseKinds:ne(of).optional(),silence:ne(cv),silenceQuality:la,silenceReasons:ne(p()),tokensIn:A().int().nullable(),tokensOut:A().int().nullable(),costUsd:A().nullable(),usageDurationMs:A().int().nullable(),usageQuality:la,usageReasons:ne(p())}),T2=z({kind:p().nullable(),observedSha:p().nullable(),msSinceWorkflowStart:A().int().nullable(),quality:la,reasons:ne(p())}),O2=z({attempts:A().int(),retries:A().int(),cold:A().int(),reused:A().int(),unknown:A().int(),publishOnly:A().int(),reuseRate:A().nullable(),preservedKinds:ne(of).optional(),quality:la,reasons:ne(p())}),L2=z({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:la,reasons:ne(p())});z({issueId:p(),elapsed:Bs,rawIntervals:ne(Bs),unionedDurations:ne(R2),exclusiveTotalMs:A().int().nullable(),exclusiveTotalQuality:la,exclusiveTotalReasons:ne(p()),nested:ne(cv),attempts:ne(C2),primaryFailure:$d.nullable(),primaryFailureQuality:la,primaryFailureReasons:ne(p()),consequenceCauses:ne($d),waste:z({failedAttempts:A().int(),publishOnlyAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),firstCheckpoint:T2,retry:O2,reviewer:L2,humanWaitMs:A().int().nullable(),humanWaitQuality:la,humanWaitReasons:ne(p()),interventionCount:A().int(),coverage:z({duration:Jt,tokens:Jt,cost:Jt})});z({from:p().nullable().default(null),to:p().nullable().default(null),role:p().nullable().default(null),runtime:p().nullable().default(null),model:p().nullable().default(null),status:p().nullable().default(null),repo:p().nullable().default(null),limit:A().int().min(1).max(200).default(50),offset:A().int().min(0).default(0)});const fd=$u.extend({numerator:A().int(),denominator:A().int(),rate:A().nullable()}),hd=z({key:p(),attempts:A().int(),successes:A().int(),successRate:A().nullable(),retries:A().int(),retryRate:A().nullable(),wallTimeMs:Wa});z({window:z({from:p(),to:p(),defaultApplied:Le()}),pagination:z({limit:A().int(),offset:A().int(),totalIssues:A().int()}),issueIds:ne(p()),phaseWallTime:$s(p(),Wa),attemptSuccess:fd,issueSuccess:fd,primaryFailures:ne(z({code:p(),count:A().int(),rate:A().nullable()})),primaryFailureDenominator:A().int(),waste:z({failedAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),checkpointLatencyMs:Wa,retryReuse:fd,reviewer:z({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:la,reasons:ne(p())}),humanInterventions:z({totalActions:A().int(),issuesWithIntervention:A().int(),humanWaitMs:Wa}),byRole:ne(hd),byRuntime:ne(hd),byModel:ne(hd),coverage:z({duration:Jt,tokens:Jt,cost:Jt})});const M2=100,dv=25,fv=5,D2=he(["developer","reviewer","legacy"]),U2=he(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","muse_no_progress","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),z2=he(["task","infrastructure","unknown"]);z({from:p().optional(),to:p().optional(),repo:p().optional(),role:D2.optional(),runtime:p().optional(),model:p().optional(),status:p().optional(),page:Ox.number().int().min(1).default(1),limit:Ox.number().int().min(1).max(M2).default(dv)});const hv=he(["exact","inferred","unavailable"]),wa=z({sum:A().nullable(),known:A().int().min(0),total:A().int().min(0),quality:hv,reasons:ne(p())}),md=z({key:p(),issues:A().int().min(0),attempts:A().int().min(0),issueSuccess:A().nullable(),issueSuccessDenominator:A().int().min(0),attemptSuccess:A().nullable(),attemptSuccessDenominator:A().int().min(0),sessionWallMs:Wa,spawnEnvelopeMs:Wa,retryRate:A().nullable(),tokensIn:wa,tokensOut:wa,costUsd:wa,durationMs:wa,failedDurationMs:wa,failedTokensIn:wa,failedTokensOut:wa,failedCostUsd:wa}),B2=z({code:U2,domain:z2,count:A().int().min(0),share:A().nullable(),issueIds:ne(p()),issueTotal:A().int().min(0)}),q2=z({id:p(),title:p(),status:p(),repo:p(),attempts:A().int().min(0),updatedAt:p()}),H2=z({window:z({from:p(),to:p()}),filters:z({repo:p().nullable(),role:p().nullable(),runtime:p().nullable(),model:p().nullable(),status:ne(p())}),summary:z({issues:A().int().min(0),closedIssues:A().int().min(0),issueSuccess:A().nullable(),attempts:A().int().min(0),terminalAttempts:A().int().min(0),attemptSuccess:A().nullable(),retryRate:A().nullable(),retryExtraAttempts:A().int().min(0),reuseRate:A().nullable(),reuseDenominator:A().int().min(0),humanWaitMs:A().int().min(0),humanWaitQuality:hv,interventions:A().int().min(0),avgReviewerRounds:A().nullable(),reviewedIssues:A().int().min(0),changeRequestRate:A().nullable(),sessionWallMs:Wa,spawnEnvelopeMs:Wa,checkpointMs:Wa,phaseWallMs:ne(z({phase:p(),stat:Wa})),failedDurationMs:wa,failedTokensIn:wa,failedTokensOut:wa,failedCostUsd:wa}),byRole:ne(md),byRuntime:ne(md),byModel:ne(md),failures:ne(B2),issues:ne(q2),pagination:z({page:A().int().min(1),limit:A().int().min(1),total:A().int().min(0),totalPages:A().int().min(0)}),meta:z({generatedAt:p(),partial:Le(),partialReasons:ne(p())})});function mv(a){const l=new URLSearchParams;for(const[s,u]of Object.entries(a)){if(u==null)continue;const d=String(u).trim();d&&(s==="page"&&d==="1"||s==="limit"&&d===String(dv)||l.set(s,d))}return l.sort(),l.toString()}function ul(a,l){return a.sum===null||a.known===0?"Unavailable":a.known<a.total?`${l(a.sum)} (${a.known}/${a.total} known)`:l(a.sum)}function pv(a){return a<fv?`n=${a} (sparse)`:`n=${a}`}function Vd(a){return a<fv}function Ux(a,l){if(a.n===0||a.p50===null&&a.p95===null)return"Unavailable";const s=u=>u===null?"–":l(u);return`P50 ${s(a.p50)} · P95 ${s(a.p95)} (${pv(a.n)})`}function Ms(a){return`$${a.toFixed(2)}`}function Ie(a){return a.toLocaleString("en-US")}function $2(a){if(!Number.isFinite(a))return Ie(a);const l=Math.abs(a);if(l<1e3)return Ie(a);const s=u=>u>=100?String(Math.round(u)):u.toFixed(1).replace(/\.0$/,"");return l<1e6?`${s(a/1e3)}K`:`${s(a/1e6)}M`}function Kt(a){if(a<1e3)return`${Math.round(a)} ms`;const l=a/1e3;if(l<60)return`${l.toFixed(1)} s`;const s=Math.floor(l/60),u=Math.round(l%60);return s<60?`${s}m ${u}s`:`${Math.floor(s/60)}h ${s%60}m`}function Vu(a){return a===null||!Number.isFinite(a)?"Unavailable":`${(a*100).toFixed(1)}%`}const V2=he(["queued","plan_pending","plan_approved","running","review","done","failed","cancelled"]),xv=he(["code","communication","email","research","content","other"]),Y2=he(["task_snapshot","draft_plan","approved_plan","plan_triage","plan_answers","acceptance_criteria","transcript","stream_trace","usage","agent_session","execution_result","diff","pr","email_draft","slack_draft","service_draft","document","research_brief","deliverable","feedback","playbook_patch","playbook_use_receipt","deck_feedback_signal","reflect_status","linear_sync","send_receipt","result_qa"]),Yu=he(["plan","execute","reflect","qa"]),yv=he(["retry","approve"]);z({patchId:p(),playbookId:p().optional(),playbookTitle:p().optional(),rationale:p().optional(),status:_a("proposed"),trigger:yv,dashboardUrl:p().optional()});z({status:he(["pending","completed","failed","skipped"]),trigger:yv,error:p().optional()});const Z2=z({type:he(["system","human","context","thinking","assistant","tool","rate_limit","result"]),text:p(),toolName:p().optional()});z({phase:Yu,runtime:qt,entries:ne(Z2)});const G2=z({phase:Yu,runtime:qt,totalCostUsd:A().optional(),inputTokens:A().optional(),outputTokens:A().optional(),cacheReadTokens:A().optional(),cacheWriteTokens:A().optional(),durationMs:A().optional(),model:p().optional(),numTurns:A().optional(),maxTurns:A().optional(),maxBudgetUsd:A().optional()}),Q2=z({label:p(),usage:G2,maxTurns:A().optional(),maxBudgetUsd:A().optional()});z({lines:ne(Q2),total:z({totalCostUsd:A(),inputTokens:A(),outputTokens:A(),durationMs:A(),numTurns:A()})});z({phase:Yu,runtime:qt,sessionId:p()});z({phase:Yu,exitCode:A(),resultText:p().optional(),isError:Le().optional(),blocker:z({summary:p().optional()}).optional()});z({path:p(),title:p(),markdown:p()});z({markdown:p(),sessionId:p().optional()});const X2=he(["manual","linear"]);z({id:p(),title:p(),description:p().optional(),url:p().optional()});const kn=z({id:p().uuid(),source:X2,externalId:p().nullable(),externalLabel:p().nullable(),taskCategory:xv,title:p(),description:p().nullable(),repo:p().nullable(),artifactWorkspace:p().nullable(),agentId:p().uuid().nullable(),agentName:p().nullable(),deckId:p().nullable(),deckName:p().nullable(),playbookId:p().nullable(),runtime:qt.nullable(),planModel:p().nullable(),executeModel:p().nullable(),status:V2,lineageId:p().uuid().nullable(),acceptanceCriteria:p().nullable(),approvalGatesJson:p().nullable(),budgetJson:p().nullable(),createdAt:p(),updatedAt:p()});z({id:p().uuid(),runId:p().uuid(),kind:Y2,contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});z({id:p().uuid(),runId:p().uuid(),type:p(),payloadJson:p().nullable(),ts:p()});z({title:p().min(1),description:p().optional(),taskCategory:xv.default("other"),repo:p().optional(),artifactWorkspace:p().optional(),acceptanceCriteria:p().optional(),status:he(["queued","plan_pending","plan_approved"]).default("plan_pending"),agentId:p().uuid(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:Fy.optional()});z({runtime:qt,deckId:p().uuid().optional(),playbookId:p().optional(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:Fy.optional()});z({planMarkdown:p(),approve:Le().default(!1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),planBudget:qa.nullable().optional(),executeBudget:qa.nullable().optional()});z({runtime:qt.optional(),deckId:p().uuid().optional(),playbookId:p().optional(),executeModel:p().nullable().optional(),executeBudget:qa.nullable().optional()});z({feedback:p().min(1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),executeBudget:qa.nullable().optional()});z({outboundBody:p().min(1).max(4e3).optional()});const I2=z({id:p(),identifier:p(),title:p(),description:p().optional(),url:p(),state:p().optional(),labels:ne(p()).optional(),teamId:p().optional(),branchName:p().optional(),repoResolution:gw.optional(),attachments:ne(Jy).optional()});z({stateFilter:ne(p()),teamId:p().nullable(),assigneeMe:Le(),syncEnabled:Le()});const Yd=z({stateFilter:ne(p().min(1)).min(1),teamId:p().nullable(),assigneeMe:Le()});Yd.extend({persisted:Yd,envOverrides:z({stateFilter:Le(),teamId:Le()})});Yd.partial();const K2=z({id:p(),name:p(),key:p().optional()}),J2=z({name:p(),type:p().optional(),teamId:p().optional()});z({teams:ne(K2),workflowStates:ne(J2),viewer:z({id:p(),name:p(),email:p().optional()}).nullable()});z({candidates:ne(I2),hasMore:Le()});z({host:p(),port:A().int().min(1).max(65535),envOverride:Le()});const F2=he(["UNAUTHORIZED","DECK_UNAVAILABLE"]);z({connected:Le(),apiUrl:p(),mcpUrl:p(),deckCount:A().optional(),envOverride:Le(),error:p().optional(),deckAccessError:F2.optional(),deckAccessErrorMessage:p().optional()});z({agentId:p().uuid().optional(),autoAgent:Le().optional(),planModel:p().nullable().optional()}).refine(a=>a.agentId!==void 0||a.autoAgent===!0,{message:"Provide agentId or autoAgent: true"});z({planModel:p().nullable().optional(),planBudget:qa.nullable().optional(),feedback:p().optional(),editedMarkdown:p().optional()});const W2=z({id:p(),label:p()});z({runtime:qt,models:ne(W2),source:he(["live","fallback"])});z({planReviewCount:A(),resultReviewCount:A(),maxConcurrent:A(),planningActiveRuns:ne(kn),planningQueuedRuns:ne(kn),runningRuns:ne(kn),waitingExecution:ne(kn),resultReviewRuns:ne(kn),recentDone:ne(kn),awaitingPlanReview:ne(kn),awaitingAnswerRuns:ne(kn),openQuestionCounts:$s(p(),A()),pendingSendCounts:$s(p(),A()),sentRunIds:ne(p()).optional(),autoApprovedRunIds:ne(p()),runs:ne(kn),agentDeckOnline:Le(),agents:ne(ev),agentIssueCount:A()});const vv=new Map,pd=new Map;function Zd(a){return vv.get(a)??null}function P2(a,l){l.models.length!==0&&vv.set(a,l)}function eS(a,l){const s=Zd(a);if(s)return Promise.resolve(s);const u=pd.get(a);if(u)return u;const d=l().then(f=>(P2(a,f),f)).finally(()=>pd.delete(a));return pd.set(a,d),d}const be="";async function Ye(a){const l=await a.text();try{const s=JSON.parse(l),u=s.error??s.message;if(typeof u=="string"&&u.trim())return u.replace(/^Error:\s*/i,"")}catch{}return l}async function tS(){const a=await fetch(`${be}/api/intake/linear`);if(!a.ok)throw new Error(await a.text());const l=await a.json();return{candidates:l.candidates??[],hasMore:!!l.hasMore}}async function aS(a){const l=await fetch(`${be}/api/intake/linear/lookup?q=${encodeURIComponent(a)}`),s=await l.json().catch(()=>({}));if(!l.ok)throw new Error(s.error??`Lookup failed (${l.status})`);if(!s.candidate)throw new Error("Linear issue not found");return s.candidate}async function nS(){const a=await fetch(`${be}/api/intake/linear/config`);if(!a.ok)throw new Error(await Ye(a));return a.json()}async function lS(a){const l=await fetch(`${be}/api/intake/linear/config`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function iS(){const a=await fetch(`${be}/api/intake/linear/metadata`);if(!a.ok)throw new Error(await Ye(a));return a.json()}async function sS(){const a=await fetch(`${be}/api/settings/repository-mappings`);if(!a.ok)throw new Error(await Ye(a));return(await a.json()).mappings??[]}async function rS(a){const l=await fetch(`${be}/api/settings/repository-mappings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mappings:a})});if(!l.ok)throw new Error(await Ye(l));return(await l.json()).mappings??[]}async function uS(){const a=await fetch(`${be}/api/agents`);if(!a.ok)throw new Error("Failed to fetch agents");return a.json()}async function oS(a){const l=await fetch(`${be}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await l.text());return l.json()}async function cS(a,l){const s=await fetch(`${be}/api/agents/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await s.text());return s.json()}async function dS(a){const l=await fetch(`${be}/api/agents/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await l.text())}async function fS(a,l){return eS(a,async()=>{const u=await fetch(`${be}/api/runtimes/${a}/models`);if(!u.ok)throw new Error(await u.text());return u.json()})}async function gv(){const a=await fetch(`${be}/api/runtime-capacity`);if(!a.ok)throw new Error(await a.text());return a.json()}async function bv(){const a=await fetch(`${be}/api/agent-deck/status`);if(!a.ok)throw new Error(await a.text());return a.json()}async function hS(){const a=await fetch(`${be}/api/host-power`);if(!a.ok)throw new Error(await a.text());return a.json()}async function mS(){try{const a=await fetch(`${be}/api/agent-deck/decks`),l=await a.json().catch(()=>null);return a.ok?{ok:!0,decks:(l==null?void 0:l.data)??[]}:{ok:!1,code:l==null?void 0:l.code,message:(l==null?void 0:l.error)??`Agent Deck error (${a.status})`}}catch(a){return{ok:!1,message:a instanceof Error?a.message:String(a)}}}async function zx(a){const l=new URLSearchParams,s=a.map(f=>f.trim()).filter(Boolean);s.length>0&&l.set("status",s.join(",")),l.set("page","1"),l.set("limit","1"),l.sort();const u=await fetch(`${be}/api/issues?${l.toString()}`);if(!u.ok)throw new Error(await Ye(u));const d=await u.json();return typeof d.total=="number"?d.total:0}async function pS(a){var u,d,f;const l=new URLSearchParams;(u=a.q)!=null&&u.trim()&&l.set("q",a.q.trim()),(d=a.status)!=null&&d.trim()&&l.set("status",a.status.trim()),(f=a.repo)!=null&&f.trim()&&l.set("repo",a.repo.trim()),a.needsAttention&&l.set("needsAttention","1"),l.set("page",String(a.page&&a.page>1?Math.floor(a.page):1)),l.set("direction",a.direction??"desc"),l.sort();const s=await fetch(`${be}/api/issues?${l.toString()}`);if(!s.ok)throw new Error(await Ye(s));return s.json()}async function xS(){const a=await fetch(`${be}/api/issues/recent-repos`);if(!a.ok)throw new Error(await Ye(a));return(await a.json()).repos??[]}async function wv(a){const l=await fetch(`${be}/api/issues/${a}`);if(!l.ok)throw new Error(await Ye(l));return l.json()}async function yS(a){const l=await fetch(`${be}/api/issues/${a}/execution-analysis`);if(!l.ok)throw new Error(await Ye(l));return l.json()}async function vS(a){const l=await fetch(`${be}/api/issues/${a}/evidence`);if(!l.ok)throw new Error(await Ye(l));return l.json()}async function gS(a,l){const s=await fetch(`${be}/api/issues/${a}/artifacts/${l}/trace`);if(!s.ok)throw new Error(await Ye(s));return s.json()}async function bS(a){const l=await fetch(`${be}/api/issues`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function Ds(a,l){const s=await fetch(`${be}/api/issues/${a}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await Ye(s));return s.json()}async function wS(a){const l=await fetch(`${be}/api/issues/${a}/reload-source`,{method:"POST"});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function Sv(a){const l=await fetch(`${be}/api/issues/${a}/start`,{method:"POST"});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function jv(a){const l=await fetch(`${be}/api/issues/${a}/execute`,{method:"POST"});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function SS(a,l="web"){const s=await fetch(`${be}/api/issues/${a}/abort`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:l})});if(!s.ok)throw new Error(await Ye(s));return s.json()}async function jS(a){const l=await fetch(`${be}/api/issues/${a}/park`,{method:"POST"});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function NS(a,l="web"){const s=await fetch(`${be}/api/issues/${a}/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({closedBy:l})});if(!s.ok)throw new Error(await Ye(s));return s.json()}async function _S(a){const l=await fetch(`${be}/api/issues/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function kS(a){const l=await fetch(`${be}/api/queue`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:a})});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function Nv(a){const l=await fetch(`${be}/api/queue/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function su(a,l){const s=await fetch(`${be}/api/queue/${a}/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({to:l})});if(!s.ok)throw new Error(await Ye(s));return s.json()}async function Bx(){const a=await fetch(`${be}/api/queue`);if(!a.ok)throw new Error(await Ye(a));return a.json()}async function qx(){const a=await fetch(`${be}/api/queue/status`);if(!a.ok)throw new Error(await Ye(a));return a.json()}async function AS(a){const l=await fetch(`${be}/api/queue/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxActiveIssues:a})});if(!l.ok)throw new Error(await Ye(l));return l.json()}async function ES(a,l){const s=await fetch(`${be}/api/issues/${a}/guidance`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({markdown:l})});if(!s.ok)throw new Error(await Ye(s));return s.json()}async function RS(a){const l=mv(a),s=await fetch(`${be}/api/execution-report${l?`?${l}`:""}`);if(!s.ok)throw new Error(await Ye(s));const u=await s.json(),d=H2.safeParse(u);if(!d.success)throw new Error(`Unexpected report shape: ${d.error.message}`);return d.data}async function CS(){const a=await fetch(`${be}/api/human-actions`);if(!a.ok)throw new Error(await Ye(a));return a.json()}async function _v(a,l,s,u){const d=await fetch(`${be}/api/human-actions/${a}/resolve`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u!=null&&u.trim()?{resolvedBy:l,choice:s,note:u.trim()}:{resolvedBy:l,choice:s})});if(!d.ok)throw new Error(await Ye(d));return d.json()}function TS(a){return a||Py}function OS({runtime:a,label:l,value:s,onChange:u,defaultModelId:d,disabled:f,compact:m}){const x=Zd(a),[y,v]=b.useState((x==null?void 0:x.models)??[]),[w,j]=b.useState((x==null?void 0:x.source)??"fallback"),[D,X]=b.useState(!x);b.useEffect(()=>{const L=Zd(a);if(L){v(L.models),j(L.source),X(!1);return}X(!0),fS(a).then(H=>{v(H.models),j(H.source)}).catch(()=>v([])).finally(()=>X(!1))},[a]);const R=b.useMemo(()=>{var L,H;if(a==="cursor_local"){const F=TS(d);return((L=y.find(P=>P.id===F))==null?void 0:L.label)??"Auto (subscription pool)"}return d?((H=y.find(F=>F.id===d))==null?void 0:H.label)??d:"runtime default"},[a,d,y]),$=a==="cursor_local"?D?"Loading models…":`Agent default (${R})`:D?"Loading models…":`Default (${R})`;return r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:l}),r.jsxs("select",{className:"field text-sm",disabled:f||D,value:s,onChange:L=>u(L.target.value),children:[r.jsx("option",{value:"",children:$}),y.map(L=>r.jsx("option",{value:L.id,children:L.label},L.id))]}),a==="cursor_local"&&!D&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Auto and Composer use your Cursor subscription pool. Other models draw API credits."}),w==="fallback"&&y.length>0&&!D&&a==="cursor_local"&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Run cursor-agent login to load the full model list."})]})}function Hx(a){const l={};return a.allowWorktreeWrite||(l.worktreeWrite=!1),Object.keys(l).length?l:null}function LS(a){let l={};try{a!=null&&a.trim()&&(l=JSON.parse(a))}catch{l={}}return{allowWorktreeWrite:l.worktreeWrite!==!1}}function $x({value:a,onChange:l,agentDeckOnline:s,disabled:u}){const[d,f]=b.useState([]),[m,x]=b.useState(null);b.useEffect(()=>{mS().then(w=>{w.ok?(f(w.decks),x(null)):(f([]),x(w.message))})},[]);const y=w=>l({...a,...w}),v=a.runtime==="codex_local"||a.runtime==="claude_code";return r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"font-ui-display text-base uppercase tracking-wide text-[#92E4DD]",children:"Agent"}),r.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Runtime (required)"}),r.jsxs("select",{className:"field",disabled:u,value:a.runtime,onChange:w=>{const j=w.target.value;y({runtime:j,defaultModel:j==="cursor_local"?Py:j==="muse_code"?kw:"",defaultEffort:j==="cursor_local"||j==="muse_code"?"":a.defaultEffort})},children:[r.jsx("option",{value:"claude_code",children:"Claude Code (claude -p)"}),r.jsx("option",{value:"cursor_local",children:"Cursor local (cursor-agent -p)"}),r.jsx("option",{value:"codex_local",children:"Codex local (codex exec)"}),r.jsx("option",{value:"muse_code",children:"Muse Code (muse exec) — developer only, trial"})]}),r.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Agent Deck (required)"}),r.jsxs("select",{className:"field",disabled:u||!s||!!m,value:a.deckId,onChange:w=>y({deckId:w.target.value}),required:!0,children:[r.jsx("option",{value:"",disabled:!!a.deckId,children:s?m?"Agent Deck error — see below":"Select a deck…":"Agent Deck offline"}),d.map(w=>r.jsxs("option",{value:w.id,children:["◆ ",w.name]},w.id))]}),s&&m&&r.jsx("p",{className:"text-xs text-amber-300/90",children:m}),r.jsxs("div",{className:"pt-2 mt-2 border-t border-white/10 space-y-2",children:[r.jsx("div",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:"Issue-centric session defaults"}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Purpose (optional)"}),r.jsx("input",{className:"field text-sm",placeholder:"e.g. backend refactors on the payments service",disabled:u,value:a.purpose,onChange:w=>y({purpose:w.target.value})})]}),r.jsxs("div",{className:`grid gap-2 ${v?"grid-cols-2":"grid-cols-1"}`,children:[r.jsx(OS,{runtime:a.runtime,label:"Default model",value:a.defaultModel,onChange:w=>y({defaultModel:w}),disabled:u,compact:!0}),v&&r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Reasoning effort"}),r.jsxs("select",{className:"field text-sm",disabled:u,value:a.defaultEffort,onChange:w=>y({defaultEffort:w.target.value}),children:[r.jsx("option",{value:"",children:"Runtime default"}),r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"})]})]})]}),a.runtime==="muse_code"&&r.jsx("p",{className:"text-xs text-white/40",children:"Developer role only — keep a Claude or Codex agent as the reviewer. The developer session receives the selected deck above. Contributor-tier content may be used for product improvement; use it on non-sensitive tickets."}),a.runtime==="cursor_local"&&r.jsx("p",{className:"text-xs text-white/40",children:"Cursor has no separate effort flag — put effort in the model id if needed (e.g. parameterized `[effort=high]`)."}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max turns"}),r.jsx("input",{className:"field text-sm",type:"number",min:1,placeholder:"none",disabled:u,value:a.defaultBudget.maxTurns,onChange:w=>y({defaultBudget:{...a.defaultBudget,maxTurns:w.target.value}})})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max $ / session"}),r.jsx("input",{className:"field text-sm",type:"number",min:0,step:"0.1",placeholder:"none",disabled:u,value:a.defaultBudget.maxBudgetUsd,onChange:w=>y({defaultBudget:{...a.defaultBudget,maxBudgetUsd:w.target.value}})})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Developer capabilities"}),r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm text-white/70",children:r.jsxs("label",{className:"flex items-center gap-1.5",children:[r.jsx("input",{type:"checkbox",disabled:u,checked:a.allowWorktreeWrite,onChange:w=>y({allowWorktreeWrite:w.target.checked})}),"Write files"]})}),r.jsx("p",{className:"text-xs text-white/40",children:"Unchecking runs the developer read-only (no Write/Edit/Bash grant), same as a reviewer. There is no separate push / open-PR toggle — a session with file-write access can already push and open PRs, and no mechanism here can restrict just that without also removing write access."})]})]})]})}function ia(a){return a==="claude_code"?"Claude":a==="cursor_local"?"Cursor":a==="codex_local"?"Codex":a==="muse_code"?"Muse Code":"No agent"}function MS(){return{maxTurns:"",maxBudgetUsd:""}}function Vx(a){const l=a.maxTurns.trim()?Number(a.maxTurns):null,s=a.maxBudgetUsd.trim()?Number(a.maxBudgetUsd):null;return l==null&&s==null||l!=null&&(!Number.isFinite(l)||l<=0)||s!=null&&(!Number.isFinite(s)||s<=0)?null:{maxTurns:l,maxBudgetUsd:s}}function DS(a){const l=xu(a);return{maxTurns:(l==null?void 0:l.maxTurns)!=null?String(l.maxTurns):"",maxBudgetUsd:(l==null?void 0:l.maxBudgetUsd)!=null?String(l.maxBudgetUsd):""}}function Os({children:a,className:l="",title:s}){return r.jsx("span",{title:s,className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium uppercase tracking-wide border ${l}`,children:a})}function ru(a,l){const s=a.find(d=>d.runtime===l);if(!s)return{ok:!1,detail:"no agent"};const u=s.issues.find(d=>d.code==="cli_missing"||d.code==="runtime_auth"||d.code==="runtime_unknown"||d.code==="runtime_capability"||d.code==="cursor_keychain");return u?{ok:!1,detail:u.message}:{ok:!0,detail:"CLI ready"}}function US(a){const l=a.flatMap(s=>s.issues).find(s=>s.code==="github_cli_missing"||s.code==="github_auth"||s.code==="github_unreachable");return l?{ok:!1,detail:l.message}:a.length===0?{ok:!1,detail:"no agent"}:{ok:!0,detail:"gh ready"}}function Ci({ok:a}){return r.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${a?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":!0})}function zS({agents:a,agentDeckOnline:l}){const[s,u]=b.useState(null);b.useEffect(()=>{bv().then(w=>u(w.mcpUrl)).catch(()=>u(null))},[l]);const d=ru(a,"claude_code"),f=ru(a,"cursor_local"),m=ru(a,"codex_local"),x=a.some(w=>w.runtime==="muse_code")?ru(a,"muse_code"):null,y=US(a),v=a.flatMap(w=>w.issues).find(w=>w.code==="mcp_not_registered");return r.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-1.5 text-xs text-white/45",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Connections"}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:d.detail,children:[r.jsx(Ci,{ok:d.ok}),r.jsx("span",{className:d.ok?"text-white/55":"text-amber-200/90",children:"Claude"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:f.detail,children:[r.jsx(Ci,{ok:f.ok}),r.jsx("span",{className:f.ok?"text-white/55":"text-amber-200/90",children:"Cursor"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:m.detail,children:[r.jsx(Ci,{ok:m.ok}),r.jsx("span",{className:m.ok?"text-white/55":"text-amber-200/90",children:"Codex"})]}),x&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:x.detail,children:[r.jsx(Ci,{ok:x.ok}),r.jsx("span",{className:x.ok?"text-white/55":"text-amber-200/90",children:"Muse Code"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:y.detail,children:[r.jsx(Ci,{ok:y.ok}),r.jsx("span",{className:y.ok?"text-white/55":"text-amber-200/90",children:"GitHub"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:(v==null?void 0:v.message)??(s?`MCP ${s}`:"Agent Deck optional"),children:[r.jsx(Ci,{ok:l&&!v}),r.jsxs("span",{className:l&&!v?"text-[#92E4DD]/80":v?"text-amber-200/90":"text-white/35",children:["Agent Deck MCP",l?v?" (setup needed)":"":" (optional)"]})]})]})}function kv(a,l){const s=a.activeCap??null;if(s===null)return null;const u=Date.parse(s.unavailableUntil);return Number.isFinite(u)&&u>l?s:null}function Zu(a){return`capped until ${new Date(a.unavailableUntil).toLocaleString()}`}function Av(a){return a<10?"critical":a<30?"warning":"normal"}function Ev(a){const l=a.unavailableDetail;if(!l)return null;const s=l.consecutiveFailures,u=new Date(l.firstFailureAt).toLocaleString();return`unavailable: ${l.message} (${s} consecutive failed refresh${s===1?"":"es"} since ${u})`}const ff={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},Yx={critical:"font-bold text-red-400",warning:"text-yellow-400",normal:"font-medium"},BS=new Set(["claude_code","codex_local","muse_code"]),Zx="billing_cycle",Gx="1M",Qx="5H",Xx="1W";function Ix(a,l,s,u){if(a!==null)return Rv(a,l,null);const d=s??"missing";return{key:u,label:l,kind:"unknown",reason:d,title:`${l}: N/A (${ff[d]})`}}function Rv(a,l,s){if(a.unavailableReason===null&&a.remainingPercent!==null){const d=a.remainingPercent,f=a.resetAt?`, resets ${new Date(a.resetAt).toLocaleString()}`:"",m=s?`, ${s}`:"";return{key:a.windowKey,label:l,kind:"known",remaining:Math.round(d),rawRemaining:d,title:`${l}: ${Math.round(d)}% remaining${m}${f}`}}const u=a.unavailableReason??"missing";return{key:a.windowKey,label:l,kind:"unknown",reason:u,title:`${l}: N/A (${Ev(a)??ff[u]})`}}function xd(a,l,s){return{key:a,label:l,kind:"known",remaining:0,rawRemaining:0,title:`${l}: 0% remaining, ${Zu(s)}`}}function yd(a,l){return{key:"capped",label:"capped",kind:"capped",title:`${ia(a)} ${Zu(l)}`}}function qS(a,l=Date.now()){const s=kv(a,l);if(a.runtime==="cursor_local"){const u=a.windows.find(d=>d.windowKey===Zx)??null;return s!==null?s.windowRole==="billing_cycle"?[xd((u==null?void 0:u.windowKey)??Zx,Gx,s)]:[yd(a.runtime,s)]:u===null?[]:[Rv(u,Gx,"current billing cycle")]}if(BS.has(a.runtime)){if(s!==null&&s.windowRole!=="five_hour"&&s.windowRole!=="weekly")return[yd(a.runtime,s)];const u=a.windows.find(f=>f.criticalRole==="five_hour")??null,d=a.windows.find(f=>f.criticalRole==="weekly")??null;return[(s==null?void 0:s.windowRole)==="five_hour"?xd((u==null?void 0:u.windowKey)??"missing-5H",Qx,s):Ix(u,Qx,a.unavailableReason,"missing-5H"),(s==null?void 0:s.windowRole)==="weekly"?xd((d==null?void 0:d.windowKey)??"missing-1W",Xx,s):Ix(d,Xx,a.unavailableReason,"missing-1W")]}return s!==null?[yd(a.runtime,s)]:[]}function HS({row:a}){if(a.kind==="capped")return r.jsx("span",{"data-testid":"capacity-window-capped",title:a.title,className:"inline-flex items-center gap-1 rounded border border-white/15 bg-white/5 px-1.5 py-0.5 whitespace-nowrap",children:r.jsx("span",{"data-severity":"critical",className:Yx.critical,children:a.label})});const l=a.kind==="known";return r.jsxs("span",{"data-testid":`capacity-window-${a.key}`,"data-reason":a.kind==="unknown"?a.reason:void 0,title:a.title,className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 whitespace-nowrap ${l?"border-white/15 bg-white/5 text-white/70":"border-white/10 bg-transparent text-white/35"}`,children:[r.jsx("span",{className:"text-white/40",children:a.label}),a.kind==="known"?(()=>{const s=Av(a.rawRemaining);return r.jsxs("span",{"data-severity":s,className:Yx[s],children:[a.remaining,"%"]})})():r.jsx("span",{children:"N/A"})]})}function $S({data:a,nowMs:l}){return a.runtimes.length===0?null:r.jsxs("div",{"data-testid":"runtime-capacity-strip",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Runtime capacity"}),a.runtimes.map(s=>{const u=qS(s,l);return r.jsxs("span",{"data-testid":`capacity-entry-${s.runtime}`,className:"inline-flex min-w-0 flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"shrink-0 whitespace-nowrap font-medium text-white/55",children:ia(s.runtime)}),u.length===0?r.jsx("span",{"data-testid":`capacity-entry-${s.runtime}-na`,"data-reason":s.unavailableReason??"missing",title:`N/A (${ff[s.unavailableReason??"missing"]})`,className:"whitespace-nowrap text-white/35",children:"N/A"}):u.map(d=>r.jsx(HS,{row:d},d.key))]},s.runtime)})]})}function VS({refreshTick:a}){const[l,s]=b.useState(null);return b.useEffect(()=>{let u=!1;return gv().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[a]),l?r.jsx($S,{data:l}):null}const YS="agent-dealer:host-power-sleep-notice-dismissed:";function Cv(a){return`${YS}${a}`}function Kx(a){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(Cv(a))==="1"}catch{return!1}}function ZS(a){if(!(typeof localStorage>"u"))try{localStorage.setItem(Cv(a),"1")}catch{}}function GS({status:a}){const[l,s]=b.useState(()=>Kx(a.serverInstanceId));b.useEffect(()=>{s(Kx(a.serverInstanceId))},[a.serverInstanceId]);const u=a.sleepTimerNotice,d=!!u&&!l,f=()=>{ZS(a.serverInstanceId),s(!0)};return r.jsxs("div",{className:"space-y-2","data-testid":"host-power-status",children:[r.jsx("p",{className:"text-xs text-white/45 font-mono","data-testid":"host-power-hold-line",children:a.holdStatusLine}),d&&u&&r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2 rounded border border-amber-400/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/90","data-testid":"host-power-sleep-notice",role:"status",children:[r.jsx("p",{className:"min-w-0 flex-1 leading-relaxed font-mono",children:u.message}),r.jsx("button",{type:"button",onClick:f,className:"shrink-0 text-amber-100/70 hover:text-amber-50 underline-offset-2 hover:underline","data-testid":"host-power-sleep-notice-dismiss",children:"Dismiss"})]})]})}function QS({status:a,pollMs:l=5e3}){const[s,u]=b.useState(a??null);return b.useEffect(()=>{if(a!==void 0){u(a);return}let d=!1;const f=()=>{hS().then(x=>{d||u(x)}).catch(()=>{d||u(null)})};f();const m=setInterval(f,l);return()=>{d=!0,clearInterval(m)}},[a,l]),s?r.jsx(GS,{status:s}):null}const XS="data:image/svg+xml,%3csvg%20viewBox='0%200%20248%20248'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20aria-hidden='true'%3e%3cpath%20d='M52.4285%20162.873L98.7844%20136.879L99.5485%20134.602L98.7844%20133.334H96.4921L88.7237%20132.862L62.2346%20132.153L39.3113%20131.207L17.0249%20130.026L11.4214%20128.844L6.2%20121.873L6.7094%20118.447L11.4214%20115.257L18.171%20115.847L33.0711%20116.911L55.485%20118.447L71.6586%20119.392L95.728%20121.873H99.5485L100.058%20120.337L98.7844%20119.392L97.7656%20118.447L74.5877%20102.732L49.4995%2086.1905L36.3823%2076.62L29.3779%2071.7757L25.8121%2067.2858L24.2839%2057.3608L30.6515%2050.2716L39.3113%2050.8623L41.4763%2051.4531L50.2636%2058.1879L68.9842%2072.7209L93.4357%2090.6804L97.0015%2093.6343L98.4374%2092.6652L98.6571%2091.9801L97.0015%2089.2625L83.757%2065.2772L69.621%2040.8192L63.2534%2030.6579L61.5978%2024.632C60.9565%2022.1032%2060.579%2020.0111%2060.579%2017.4246L67.8381%207.49965L71.9133%206.19995L81.7193%207.49965L85.7946%2011.0443L91.9074%2024.9865L101.714%2046.8451L116.996%2076.62L121.453%2085.4816L123.873%2093.6343L124.764%2096.1155H126.292V94.6976L127.566%2077.9197L129.858%2057.3608L132.15%2030.8942L132.915%2023.4505L136.608%2014.4708L143.994%209.62643L149.725%2012.344L154.437%2019.0788L153.8%2023.4505L150.998%2041.6463L145.522%2070.1215L141.957%2089.2625H143.994L146.414%2086.7813L156.093%2074.0206L172.266%2053.698L179.398%2045.6635L187.803%2036.802L193.152%2032.5484H203.34L210.726%2043.6549L207.415%2055.1159L196.972%2068.3492L188.312%2079.5739L175.896%2096.2095L168.191%20109.585L168.882%20110.689L170.738%20110.53L198.755%20104.504L213.91%20101.787L231.994%2098.7149L240.144%20102.496L241.036%20106.395L237.852%20114.311L218.495%20119.037L195.826%20123.645L162.07%20131.592L161.696%20131.893L162.137%20132.547L177.36%20133.925L183.855%20134.279H199.774L229.447%20136.524L237.215%20141.605L241.8%20147.867L241.036%20152.711L229.065%20158.737L213.019%20154.956L175.45%20145.977L162.587%20142.787H160.805V143.85L171.502%20154.366L191.242%20172.089L215.82%20195.011L217.094%20200.682L213.91%20205.172L210.599%20204.699L188.949%20188.394L180.544%20181.069L161.696%20165.118H160.422V166.772L164.752%20173.152L187.803%20207.771L188.949%20218.405L187.294%20221.832L181.308%20223.959L174.813%20222.777L161.187%20203.754L147.305%20182.486L136.098%20163.345L134.745%20164.2L128.075%20235.42L125.019%20239.082L117.887%20241.8L111.902%20237.31L108.718%20229.984L111.902%20215.452L115.722%20196.547L118.779%20181.541L121.58%20162.873L123.291%20156.636L123.14%20156.219L121.773%20156.449L107.699%20175.752L86.304%20204.699L69.3663%20222.777L65.291%20224.431L58.2867%20220.768L58.9235%20214.27L62.8713%20208.48L86.304%20178.705L100.44%20160.155L109.551%20149.507L109.462%20147.967L108.959%20147.924L46.6977%20188.512L35.6182%20189.93L30.7788%20185.44L31.4156%20178.115L33.7079%20175.752L52.4285%20162.873Z'%20fill='%23D97757'/%3e%3c/svg%3e",IS="/assets/codex-YZSpL-SB.png",KS="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20aria-hidden='true'%3e%3cpath%20fill='%23EDEDED'%20d='M11.503.131%201.891%205.678a.84.84%200%200%200-.42.726v11.188c0%20.3.162.575.42.724l9.609%205.55a1%201%200%200%200%20.998%200l9.61-5.55a.84.84%200%200%200%20.42-.724V6.404a.84.84%200%200%200-.42-.726L12.497.131a1.01%201.01%200%200%200-.996%200M2.657%206.338h18.55c.263%200%20.43.287.297.515L12.23%2022.918c-.062.107-.229.064-.229-.06V12.335a.59.59%200%200%200-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23'/%3e%3c/svg%3e",JS="/assets/muse-CtdcC6ve.svg";function Gu({src:a,className:l}){return r.jsx("span",{className:`inline-flex items-center justify-center rounded-lg bg-white/[0.04] ${l??"h-8 w-8"}`,children:r.jsx("img",{src:a,alt:"",className:"h-[70%] w-[70%] object-contain",draggable:!1})})}function FS({className:a="h-8 w-8"}){return r.jsx(Gu,{src:XS,className:a})}function WS({className:a="h-8 w-8"}){return r.jsx(Gu,{src:KS,className:a})}function PS({className:a="h-8 w-8"}){return r.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:a,"aria-hidden":!0,children:[r.jsx("rect",{width:"32",height:"32",rx:"8",fill:"white",fillOpacity:"0.06"}),r.jsx("circle",{cx:"16",cy:"13",r:"4.5",stroke:"#92E4DD",strokeWidth:"1.75"}),r.jsx("path",{d:"M8.5 24.5c1.2-3.5 3.8-5.5 7.5-5.5s6.3 2 7.5 5.5",stroke:"#92E4DD",strokeWidth:"1.75",strokeLinecap:"round"})]})}function ej({className:a="h-8 w-8"}){return r.jsx(Gu,{src:IS,className:a})}function tj({className:a="h-8 w-8"}){return r.jsx(Gu,{src:JS,className:a})}function Tv({runtime:a,className:l="h-8 w-8 shrink-0"}){return a==="claude_code"?r.jsx(FS,{className:l}):a==="cursor_local"?r.jsx(WS,{className:l}):a==="codex_local"?r.jsx(ej,{className:l}):a==="muse_code"?r.jsx(tj,{className:l}):r.jsx(PS,{className:l})}const uu=()=>({runtime:"claude_code",deckId:"",purpose:"",defaultModel:"",defaultEffort:"",defaultBudget:MS(),allowWorktreeWrite:!0});function aj({agents:a,agentDeckOnline:l,onRefresh:s}){const[u,d]=b.useState(!1),[f,m]=b.useState(""),[x,y]=b.useState(uu()),[v,w]=b.useState(!1),[j,D]=b.useState(null),[X,R]=b.useState(""),[$,L]=b.useState(uu()),H=async I=>{if(I.preventDefault(),!(!f.trim()||!x.deckId)){w(!0);try{const ye={name:f.trim(),runtime:x.runtime,deckId:x.deckId,defaultModel:x.defaultModel.trim()||null,defaultEffort:x.defaultEffort||null,defaultBudget:Vx(x.defaultBudget),purpose:x.purpose.trim()||null,permissionPolicy:Hx(x)};await oS(ye),m(""),y(uu()),d(!1),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},F=I=>{D(I.id),R(I.name),L({runtime:I.runtime,deckId:I.deckId??"",purpose:I.purpose??"",defaultModel:Lx(I)??"",defaultEffort:I.defaultEffort??"",defaultBudget:DS(Rw(I)),...LS(I.permissionPolicyJson)})},P=()=>{D(null),L(uu())},le=async I=>{if(!(!X.trim()||!$.deckId)){w(!0);try{const ye={name:X.trim(),runtime:$.runtime,deckId:$.deckId,defaultModel:$.defaultModel.trim()||null,defaultEffort:$.defaultEffort||null,defaultBudget:Vx($.defaultBudget),purpose:$.purpose.trim()||null,permissionPolicy:Hx($)};await cS(I.id,ye),P(),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},V=async I=>{if(confirm(`Delete agent "${I.name}"?`)){w(!0);try{await dS(I.id),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},Ne=a.filter(I=>!I.healthy).length;return r.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 max-w-6xl mx-auto w-full",children:[r.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"heading-page",children:"Agents"}),r.jsx("p",{className:"text-sm text-white/50 mt-1",children:"Saved execution profiles — pick one when creating an issue instead of configuring each task"}),r.jsxs("p",{className:"text-sm text-white/45 mt-2",children:[a.length," agent",a.length===1?"":"s",Ne>0&&r.jsxs("span",{className:"text-red-400 ml-2",children:["· ",Ne," need",Ne===1?"s":""," attention"]})]})]}),r.jsx(zS,{agents:a,agentDeckOnline:l})]}),r.jsxs("div",{className:"mb-4 overflow-x-auto space-y-2",children:[r.jsx(VS,{}),r.jsx(QS,{})]}),r.jsx("div",{className:"space-y-3 mb-6",children:a.map(I=>{const ye=Lx(I);return r.jsxs("div",{className:"panel flex flex-col sm:flex-row sm:items-start gap-3 justify-between",children:[r.jsxs("div",{className:"flex gap-3 min-w-0 flex-1",children:[r.jsx(Tv,{runtime:I.runtime}),r.jsxs("div",{className:"space-y-2 min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-lg font-semibold text-[#E8F6F4]",children:I.name}),!I.healthy&&r.jsx(Os,{className:"bg-red-500/15 text-red-300 border-red-400/30 normal-case",children:"Needs fix"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.jsx(Os,{className:"bg-white/5 text-white/55 border-white/15 normal-case",children:ia(I.runtime)}),I.deckName?r.jsxs(Os,{className:"bg-[#92E4DD]/10 text-[#92E4DD] border-[#92E4DD]/25 normal-case",children:["◆ ",I.deckName]}):r.jsx(Os,{className:"bg-white/5 text-white/40 border-white/10 normal-case",children:"No deck"}),ye&&r.jsx(Os,{className:"bg-white/5 text-white/50 border-white/10 normal-case truncate max-w-[10rem]",title:ye,children:ye})]}),j===I.id&&r.jsxs("div",{className:"space-y-3 pt-2 border-t border-white/10",children:[r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),r.jsx("input",{className:"field text-sm",value:X,onChange:De=>R(De.target.value)})]}),r.jsx($x,{value:$,onChange:L,agentDeckOnline:l}),r.jsxs("div",{className:"flex gap-2 pt-1",children:[r.jsx("button",{type:"button",disabled:v||!X.trim()||!$.deckId,onClick:()=>le(I),className:"btn-gold text-sm px-3 py-1.5",children:"Save"}),r.jsx("button",{type:"button",onClick:P,className:"btn-ghost text-sm px-3 py-1.5",children:"Cancel"})]})]}),I.issues.length>0&&r.jsx("ul",{className:"text-sm text-red-300/90 space-y-1",children:I.issues.map((De,yt)=>r.jsxs("li",{children:["· ",De.message]},yt))})]})]}),r.jsxs("div",{className:"flex gap-2 shrink-0",children:[j!==I.id&&r.jsx("button",{type:"button",disabled:v,onClick:()=>F(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Edit"}),r.jsx("button",{type:"button",disabled:v,onClick:()=>V(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Delete"})]})]},I.id)})}),u?r.jsxs("form",{onSubmit:H,className:"panel space-y-3",children:[r.jsx("h2",{className:"heading-panel",children:"New Agent"}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),r.jsx("input",{className:"field",placeholder:"e.g. Claude · Work",value:f,onChange:I=>m(I.target.value)})]}),r.jsx($x,{value:x,onChange:y,agentDeckOnline:l}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"submit",disabled:v||!f.trim()||!x.deckId,className:"btn-gold px-4 py-2",children:v?"Saving…":"Create agent"}),r.jsx("button",{type:"button",onClick:()=>d(!1),className:"btn-ghost px-4 py-2",children:"Cancel"})]})]}):r.jsx("button",{type:"button",onClick:()=>d(!0),className:"btn-gold px-4 py-2",children:"Add agent"})]})}function nj(a){try{return rf(a).identity}catch{return null}}function lj(a,l){return a!=="linear"||!l?null:l.repoResolution??Ky(l.labels)}function ij(a,l){if(!l)return a;const s=l.repoResolution??Ky(l.labels);return s.status==="resolved"&&s.repository?s.repository:a}function sj(a,l){var u;const s=lj(a,l);if(!s)return null;if(s.status==="conflict")return`Conflicting repo: labels (${(s.labels??[]).join(", ")}) — kept the current repository. Fix the labels in Linear or type a repository below.`;if(s.status==="invalid"){const d=((u=s.labels)==null?void 0:u[0])??"repo:",f=s.error?` — ${s.error}`:"";return`Invalid repository label ${d}${f}. Kept the current repository — fix the label in Linear or type a repository below.`}return null}function Jx(a){return a.title.trim().length>0&&nj(a.repo)!=null&&a.developerAgentId.length>0&&a.reviewerAgentId.length>0}function rj(a,l,s){const u=s?a.find(d=>d.id===s):void 0;return u&&!l.some(d=>d.id===u.id)?[u,...l]:[...l]}function uj(a,l){return{candidates:[l,...a.filter(s=>s.id!==l.id)],selectedId:l.id}}const vd=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"],oj={q:"",status:"",repo:"",needsAttention:!1},Ov=["latest"],hf="latest",mf="desc";function Qs(a){return a.startsWith("?")?a.slice(1):a}function Fx(a){var s,u,d;const l=new URLSearchParams(Qs(a));return{q:((s=l.get("q"))==null?void 0:s.trim())??"",status:((u=l.get("status"))==null?void 0:u.trim())??"",repo:((d=l.get("repo"))==null?void 0:d.trim())??"",needsAttention:l.get("needsAttention")==="1"||l.get("needsAttention")==="true"}}function Qu(a){const l=new URLSearchParams(Qs(a)),s=w=>{var D;const j=(D=l.get(w))==null?void 0:D.trim();return j||void 0},u={},d=s("q");d!==void 0&&(u.q=d);const f=s("status");f!==void 0&&(u.status=f);const m=s("repo");m!==void 0&&(u.repo=m),(l.get("needsAttention")==="1"||l.get("needsAttention")==="true")&&(u.needsAttention=!0);const x=Number(l.get("page"));Number.isInteger(x)&&x>=1&&(u.page=x);const y=s("sort");y!==void 0&&Ov.includes(y)&&(u.sort=y);const v=s("direction");return(v==="asc"||v==="desc")&&(u.direction=v),u}function cj(a){return Qu(a).sort??hf}function Lv(a){return Qu(a).direction??mf}function dj(a){var s,u,d;const l=new URLSearchParams;return(s=a.q)!=null&&s.trim()&&l.set("q",a.q.trim()),(u=a.status)!=null&&u.trim()&&l.set("status",a.status.trim()),(d=a.repo)!=null&&d.trim()&&l.set("repo",a.repo.trim()),a.needsAttention&&l.set("needsAttention","1"),a.page!==void 0&&Number.isInteger(a.page)&&a.page>1&&l.set("page",String(a.page)),a.sort!==void 0&&a.sort!==hf&&l.set("sort",a.sort),a.direction!==void 0&&a.direction!==mf&&l.set("direction",a.direction),l.sort(),l.toString()}function fj(a){const l={};return a.q.trim()&&(l.q=a.q.trim()),a.status.trim()&&(l.status=a.status.trim()),a.repo.trim()&&(l.repo=a.repo.trim()),a.needsAttention&&(l.needsAttention=!0),l}function hj(a,l){const s=new URLSearchParams(Qs(a));return l<=1?s.delete("page"):s.set("page",String(Math.floor(l))),s.sort(),s.toString()}function mj(a,l){const s=Qu(a),u=fj(l);return s.sort!==void 0&&(u.sort=s.sort),s.direction!==void 0&&(u.direction=s.direction),dj(u)}function pj(a,l){const s=new URLSearchParams(Qs(a));return l===hf?s.delete("sort"):s.set("sort",l),s.delete("page"),s.sort(),s.toString()}function xj(a){const l=new URLSearchParams(Qs(a)),s=Lv(a)==="asc"?"desc":"asc";return s===mf?l.delete("direction"):l.set("direction",s),l.delete("page"),l.sort(),l.toString()}function Wx(a){if(a.total===0)return"No issues match these filters";const l=(a.page-1)*a.limit+1,s=Math.min(a.total,a.page*a.limit);return`Showing ${l}–${s} of ${a.total} issues`}function Px(a){return a.totalPages<=1?"":`Page ${a.page} of ${a.totalPages}`}function ey(a){return!!(a.q||a.status||a.repo||a.needsAttention)}const yj={ready:"bg-white/10 text-white/70 border-white/20",developing:"bg-cyber-violet/20 text-cyber-violet-light border-cyber-violet/40",reviewing:"bg-cyber-gold/20 text-[#E8DC7A] border-cyber-gold/40",repairing:"bg-cyber-violet/25 text-cyber-violet-light border-cyber-violet/50",final_review:"bg-amber-500/20 text-amber-300 border-amber-400/40",needs_human:"bg-red-500/20 text-red-300 border-red-400/40",done:"bg-cyber-teal/20 text-cyber-teal border-cyber-teal/40",closed:"bg-white/5 text-white/40 border-white/10"},vj={ready:"Ready",developing:"Developing",reviewing:"Reviewing",repairing:"Repairing",final_review:"Final review",needs_human:"Needs human",done:"Done",closed:"Closed"};function Mv({status:a}){return r.jsx("span",{className:`text-xs leading-none px-2 py-1 rounded border tabular-nums ${yj[a]}`,children:vj[a]})}function gj(a){return a==="latest"?"Latest":a}function bj({sort:a,direction:l,onSortChange:s,onToggleDirection:u}){const d=l==="asc";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-white/50",children:["Sort",r.jsx("select",{"aria-label":"Sort issues",className:"bg-black/30 border border-white/10 rounded px-2 py-1 text-xs text-white/80",value:a,onChange:f=>s(f.target.value),children:Ov.map(f=>r.jsx("option",{value:f,children:gj(f)},f))})]}),r.jsxs("button",{type:"button",onClick:u,"aria-label":d?"Sort order: oldest first":"Sort order: newest first","aria-pressed":d,title:d?"Show newest first":"Show oldest first",className:"font-ui-display px-2 py-1 text-xs rounded border border-white/15 text-white/70 hover:text-white",children:[r.jsx("span",{"aria-hidden":"true",children:d?"↑":"↓"})," ",d?"Oldest first":"Newest first"]})]})}const Dv="agent-dealer:first-issue-dismissed:v1";function wj(a){return a.healthy}function Sj(a){return a.healthy&&a.runtime!=="muse_code"}function jj(a){const l=a.some(wj),s=a.some(Sj);return l&&s?"new-issue":"agents"}function Nj(a){return a.historyTotal===0&&!a.filtersActive&&!a.dismissed}function Uv(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function _j(a=Uv()){try{return(a==null?void 0:a.getItem(Dv))==="1"}catch{return!1}}function kj(a=Uv()){try{a==null||a.setItem(Dv,"1")}catch{}}function Aj({agents:a,onStartIssue:l,onDismiss:s}){const u=jj(a);return r.jsx("section",{"aria-label":"Create your first issue","data-testid":"first-issue-strip",className:"mb-4 rounded border border-[#C4B643]/40 bg-[#C4B643]/5 px-4 py-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-ui-display text-sm font-medium text-white/90",children:"Create your first issue"}),r.jsx("p",{className:"mt-1 text-sm text-white/60",children:"Connect a developer and a reviewer agent, pick a GitHub repository, then create the issue. Capacity status in the header is informational — it never blocks creating an issue."}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[u==="agents"?r.jsx(sa,{to:"/agents","data-testid":"first-issue-primary",className:"btn-gold px-4 py-2 text-sm",children:"Configure agents"}):r.jsx("button",{type:"button","data-testid":"first-issue-primary",className:"btn-gold px-4 py-2 text-sm",onClick:l,children:"New issue"}),u==="agents"&&r.jsx("span",{className:"text-xs text-white/40",children:"then pick a repository and create the issue"})]})]}),r.jsx("button",{type:"button","aria-label":"Dismiss first-issue guide",title:"Dismiss",onClick:s,className:"shrink-0 rounded px-2 py-1 text-sm text-white/40 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:"✕"})]})})}function zv({value:a,onChange:l,recentRepos:s=[],id:u}){return r.jsxs("div",{className:"space-y-1",children:[s.length>0&&r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:s.includes(a)?a:"",onChange:d=>{d.target.value&&l(d.target.value)},"aria-label":"Recent repositories",children:[r.jsx("option",{value:"",children:"Recent repositories…"}),s.map(d=>r.jsx("option",{value:d,children:d},d))]}),r.jsx("input",{id:u,className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"GitHub URL or owner/repo",value:a,onChange:d=>l(d.target.value)})]})}function Ej(){return{label:"",repository:""}}function Rj(a){const l=new Set;for(const s of a){const u=s.label.trim();if(!u)return"Labels must not be empty";if(u.length>100)return`Label "${u}" must be 1–100 characters`;const d=u.toLowerCase();if(l.has(d))return`Duplicate label "${u}"`;if(l.add(d),!s.repository.trim())return`Repository for "${u}" must not be empty`}return a.length>100?"At most 100 mappings are allowed":null}function Cj({recentRepos:a=[],initialMappings:l,loadMappings:s=sS,saveMappings:u=rS,onClose:d}){const[f,m]=b.useState(l??[]),[x,y]=b.useState(l!==void 0),[v,w]=b.useState(null),[j,D]=b.useState(null),[X,R]=b.useState(!1);b.useEffect(()=>{if(l!==void 0)return;let H=!0;return s().then(F=>{H&&(m(F),y(!0))}).catch(F=>{H&&(w(String(F)),y(!0))}),()=>{H=!1}},[l,s]);const $=(H,F)=>{m(P=>P.map((le,V)=>V===H?{...le,...F}:le))},L=async()=>{w(null),D(null);const H=Rj(f);if(H){w(H);return}R(!0);try{const F=await u(f.map(P=>({label:P.label.trim(),repository:P.repository})));m(F),D(F.length===0?"Mappings cleared":`Saved ${F.length} mapping${F.length===1?"":"s"}`)}catch(F){w(String(F))}finally{R(!1)}};return r.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Repository mappings",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-white/60",children:"Repository mappings"}),d&&r.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:d,children:"Close"})]}),x?f.length===0?r.jsx("p",{className:"text-xs text-white/40",children:"No mappings yet — add one to prefill the Repository field from a Linear label."}):f.map((H,F)=>r.jsxs("div",{className:"flex gap-2 items-start","data-testid":"mapping-row",children:[r.jsx("input",{className:"w-40 shrink-0 bg-black/30 border border-white/10 rounded px-2 py-1.5 text-sm",placeholder:"Linear label","aria-label":`Linear label for mapping ${F+1}`,value:H.label,onChange:P=>$(F,{label:P.target.value})}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(zv,{value:H.repository,onChange:P=>$(F,{repository:P}),recentRepos:a})}),r.jsx("button",{type:"button",className:"shrink-0 text-xs text-white/50 hover:text-white px-1 py-1.5",onClick:()=>m(P=>P.filter((le,V)=>V!==F)),children:"Remove"})]},F)):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"}),v&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"mappings-error",children:v}),j&&r.jsx("p",{className:"text-xs text-teal-200/80",children:j}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-white/15 text-white/70 hover:text-white",onClick:()=>m(H=>[...H,Ej()]),children:"Add mapping"}),r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:X||!x,onClick:()=>void L(),children:X?"Saving…":"Save changes"})]})]})}const Tj=["Backlog","Todo","In Progress","In Review"];function gd(a,l){const s=l?a.filter(f=>f.teamId===l):a,u=new Set,d=[];for(const f of s){const m=f.name.toLowerCase();u.has(m)||(u.add(m),d.push(f.name))}return d}function ty(a,l){return l.length===0?[...a]:a.filter(s=>l.some(u=>u.toLowerCase()===s.toLowerCase()))}function Oj(a,l){return a!==null&&!l}function Lj({initialConfig:a,initialMetadata:l,loadConfig:s=nS,loadMetadata:u=iS,saveConfig:d=lS,onSaved:f,onClose:m}){var se;const[x,y]=b.useState(a===void 0?null:a),[v,w]=b.useState(l===void 0?null:l),[j,D]=b.useState((a==null?void 0:a.persisted.teamId)??""),[X,R]=b.useState((a==null?void 0:a.persisted.assigneeMe)??!1),[$,L]=b.useState((a==null?void 0:a.persisted.stateFilter)??[...Tj]),[H,F]=b.useState(a!==void 0),[P,le]=b.useState(l!==void 0),[V,Ne]=b.useState(a===null?"Could not load saved Linear intake filters":null),[I,ye]=b.useState(l===null?"Could not load Linear teams and statuses":null),[De,yt]=b.useState(null),[Nt,st]=b.useState(!1),[ht,nt]=b.useState(null);b.useEffect(()=>{if(a!==void 0)return;let B=!0;return s().then(de=>{B&&(y(de),D(de.persisted.teamId??""),R(de.persisted.assigneeMe),L(de.persisted.stateFilter),Ne(null),F(!0))}).catch(de=>{B&&(y(null),Ne(String(de)),F(!0))}),()=>{B=!1}},[a,s]),b.useEffect(()=>{if(l!==void 0)return;let B=!0;return u().then(de=>{B&&(w(de),ye(null),le(!0))}).catch(de=>{B&&(w(null),ye(String(de)),le(!0))}),()=>{B=!1}},[l,u]),b.useEffect(()=>{if(!v)return;const B=gd(v.workflowStates,j||null);L(de=>ty(de,B))},[v,j]);const Ze=b.useMemo(()=>gd((v==null?void 0:v.workflowStates)??[],j||null),[v,j]),U=Ze.length>0?Ze:$,J=!!(x!=null&&x.envOverrides.teamId),ue=!!(x!=null&&x.envOverrides.stateFilter),Ae=J||ue,Me=H&&P,N=Oj(x,Nt),Z=B=>{L(de=>de.some(Ue=>Ue.toLowerCase()===B.toLowerCase())?de.filter(Ue=>Ue.toLowerCase()!==B.toLowerCase()):[...de,B])},W=async()=>{if(nt(null),yt(null),!x){nt("Saved filters are unavailable — reload before saving");return}if($.length===0){nt("Select at least one workflow status");return}st(!0);try{const B=gd((v==null?void 0:v.workflowStates)??[],j.trim()||null),de=ty($,B);if(de.length===0){nt("Select at least one workflow status"),st(!1);return}const Ge=await d({stateFilter:de,teamId:j.trim()||null,assigneeMe:X});y(Ge),D(Ge.persisted.teamId??""),R(Ge.persisted.assigneeMe),L(Ge.persisted.stateFilter),yt(Ge.envOverrides.stateFilter||Ge.envOverrides.teamId?"Saved locally — env still overrides the disabled controls":"Saved"),f==null||f()}catch(B){nt(String(B))}finally{st(!1)}},ae=V||I||ht;return r.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Linear intake filters",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-white/60",children:"Linear intake filters"}),m&&r.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:m,children:"Close"})]}),Me?r.jsxs(r.Fragment,{children:[Ae&&r.jsxs("p",{className:"text-xs text-amber-200/90 rounded bg-amber-500/10 border border-amber-400/20 px-2 py-1.5","data-testid":"linear-filter-env-notice",children:[J&&ue?r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_TEAM_ID"})," and"," ",r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_STATE_FILTER"})," override saved Team and Status."]}):J?r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_TEAM_ID"})," overrides saved Team."]}):r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_STATE_FILTER"})," overrides saved Status."]})," ","Remove the env var to use the value below."]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Team"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-2 py-1.5 text-sm disabled:opacity-50","aria-label":"Team",value:j,disabled:J||!x,onChange:B=>D(B.target.value),children:[r.jsx("option",{value:"",children:"All teams"}),((v==null?void 0:v.teams)??[]).map(B=>r.jsxs("option",{value:B.id,children:[B.name,B.key?` (${B.key})`:""]},B.id))]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:!x,children:[r.jsx("legend",{className:"text-xs text-white/50",children:"Assignee"}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"linear-assignee",checked:!X,onChange:()=>R(!1),className:"accent-[#C4B643]"}),"Anyone"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"linear-assignee",checked:X,onChange:()=>R(!0),className:"accent-[#C4B643]"}),"Assigned to me",(se=v==null?void 0:v.viewer)!=null&&se.name?r.jsxs("span",{className:"text-xs text-white/40",children:["(",v.viewer.name,")"]}):null]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:ue||!x,children:[r.jsx("legend",{className:"text-xs text-white/50",children:"Status"}),U.length===0?r.jsx("p",{className:"text-xs text-white/40",children:"No workflow statuses available."}):r.jsx("div",{className:"max-h-40 overflow-y-auto space-y-1","data-testid":"linear-status-list",children:U.map(B=>{const de=$.some(Ge=>Ge.toLowerCase()===B.toLowerCase());return r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:de,disabled:ue||!x,onChange:()=>Z(B),className:"accent-[#C4B643]","aria-label":`Status ${B}`}),B]},B)})})]}),ae&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"linear-filters-error",children:ae}),De&&r.jsx("p",{className:"text-xs text-teal-200/80","data-testid":"linear-filters-notice",children:De}),r.jsx("div",{className:"flex gap-2",children:r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:!N,"data-testid":"linear-filters-save",onClick:()=>void W(),children:Nt?"Saving…":"Save"})})]}):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"})]})}function Bv(a){return a.issues.some(l=>l.code==="usage_capped")}function qv(a){return[...a].sort((l,s)=>Number(s.healthy)-Number(l.healthy))}function dl(a){var u;const l=`${a.name} · ${ia(a.runtime)}`,s=[];if(!a.healthy){const d=((u=a.issues[0])==null?void 0:u.message)??"unhealthy";s.push(`NEEDS FIX: ${d}`)}return Bv(a)&&s.push("USAGE CAPPED"),s.length>0?`${l} — ${s.join(" · ")}`:l}function Eu(a){var l;return a?a.healthy?Bv(a)?"Usage capped — admission will refuse until the cap lifts":null:((l=a.issues[0])==null?void 0:l.message)??"Agent is unhealthy":null}function Hv({agents:a,initialDeveloperId:l,initialReviewerId:s,busy:u,onSave:d,onCancel:f,variant:m="queued",notice:x=null}){var P,le;const[y,v]=b.useState(l??""),[w,j]=b.useState(s??""),D=qv(a),X=a.find(V=>V.id===y),R=a.find(V=>V.id===w),$=Eu(X),L=Eu(R),H=y===(l??"")&&w===(s??""),F=m==="parked"?"Save via the issue PATCH contract — keeps the worktree and branch, records the change on the timeline; resume continues with the new agents":"Save via the issue PATCH contract — keeps queue position and rechecks the wait reason";return r.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("p",{className:"text-xs text-white/50",children:m==="parked"?r.jsx(r.Fragment,{children:"Swap the developer and/or reviewer to another profile — the worktree, branch and review rounds are kept, the change is recorded on the timeline, and a resume continues with the new agents."}):r.jsx(r.Fragment,{children:"Reassign agents — queue position is kept, the wait reason is rechecked, and the change is recorded on the timeline."})}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:y,disabled:u,title:X?`${X.name} · ${ia(X.runtime)}${X.healthy?" · healthy":` · ${((P=X.issues[0])==null?void 0:P.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:V=>v(V.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),D.map(V=>r.jsx("option",{value:V.id,title:dl(V),children:(V.healthy?"● ":"○ ")+dl(V)},V.id))]}),$&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:$})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:w,disabled:u,title:R?`${R.name} · ${ia(R.runtime)}${R.healthy?" · healthy":` · ${((le=R.issues[0])==null?void 0:le.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:V=>j(V.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),D.map(V=>V.runtime==="muse_code"?r.jsx("option",{value:V.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${V.name} · ${ia(V.runtime)} — reviewer not supported`},V.id):r.jsx("option",{value:V.id,title:dl(V),children:(V.healthy?"● ":"○ ")+dl(V)},V.id))]}),L&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:L})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:u||!y||!w||H,title:F,onClick:()=>d(y,w),children:"Save agents"}),r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:u,title:m==="parked"?"Reset the selectors to the issue's current agents":void 0,onClick:()=>{if(m==="parked"){v(l??""),j(s??""),f==null||f();return}f==null||f()},children:"Cancel"})]}),x&&r.jsx("p",{className:"text-xs text-emerald-200/90",children:x})]})}function Ru({className:a="w-3.5 h-3.5"}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:a,"aria-hidden":!0,children:r.jsx("path",{fillRule:"evenodd",d:"M8.982 1.566a1.13 1.13 0 0 0-1.964 0L.165 13.233c-.457.778.091 1.767.982 1.767h13.706c.891 0 1.439-.99.982-1.767L8.982 1.566zM8 5.697a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 5.697zm0 7.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"})})}const Mj={final_review:"Final review",attempts_exhausted:"Attempts exhausted",policy_escalation:"Policy escalation",product_scope_decision:"Product scope decision",deck_interaction_required:"Agent Deck interaction required",reflection_interaction_required:"Reflection interaction required",outbound_delivery_interaction_required:"Outbound delivery interaction required",muse_capability:"Muse capability",operator_verification:"Operator verification"};function Dj(a){return Mj[a]??a}function Uj(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}function zj(a){const l=Uj(a.responseOptionsJson);return Array.isArray(l)?l.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function Bj(a){return a==="close"||a==="reject"||a==="abort"}function qj({options:a,disabled:l,onChoose:s}){return a.length===0?null:r.jsx("div",{className:"flex flex-wrap gap-2",children:a.map(u=>r.jsx("button",{type:"button",className:`${Bj(u.choice)?"btn-ghost-danger":"btn-gold"} px-3 py-1 text-xs disabled:opacity-50`,disabled:l,onClick:()=>s(u.choice),children:u.label},u.choice))})}function qs({action:a,linkTo:l,onChoose:s,disabled:u,children:d,hideChoicesHint:f}){const m=sv(a),x=l?r.jsx(sa,{to:l,className:"text-sm text-white/85 hover:text-white hover:underline",children:m.title}):r.jsx("span",{className:"text-sm text-white/85",children:m.title});return r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs uppercase tracking-wide text-red-300/80",children:Dj(a.actionType)}),r.jsx("span",{className:"text-xs text-white/35 shrink-0",children:new Date(a.requestedAt).toLocaleString()})]}),r.jsx("div",{children:x}),m.context&&r.jsx("p",{className:"text-xs text-white/55",children:m.context}),s?m.displayOptions.length>0?r.jsx(qj,{options:m.displayOptions,disabled:u,onChoose:s}):r.jsxs("p",{className:"text-xs text-amber-200/80",children:["This item declares no response options — resolve it from the CLI (",r.jsx("code",{children:"agent-dealer action"}),")."]}):!f&&m.displayOptions.length>0&&r.jsxs("p",{className:"text-xs text-white/50",children:["To decide: ",m.displayOptions.map(y=>y.label).join(" · ")]}),d,r.jsxs("details",{children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Details"}),r.jsxs("div",{className:"mt-1.5 space-y-1.5 rounded border border-white/10 bg-black/20 px-3 py-2",children:[r.jsx("p",{className:"text-xs text-white/60 whitespace-pre-wrap",children:m.details.question}),m.details.question!==m.details.reason&&r.jsx("p",{className:"text-xs text-white/60 whitespace-pre-wrap",children:m.details.reason}),m.details.factLines.map(y=>r.jsx("p",{className:"text-xs text-white/60",children:y},y)),m.details.paths.length>0&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Saved paths:"}),m.details.paths.map(y=>r.jsx("p",{className:"font-mono break-all",children:y},y))]}),m.details.commands.length>0&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Recovery commands:"}),r.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all",children:m.details.commands.join(`
|
|
64
|
+
`)})]}),m.details.evidencePretty&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Evidence:"}),r.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all",children:m.details.evidencePretty})]})]})]})]})}function Hj({actions:a,busyActionId:l,onResolve:s}){const[u,d]=b.useState({});return a.length===0?null:r.jsxs("div",{className:"mb-4 rounded border border-red-400/30 bg-red-500/10",children:[r.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 border-b border-red-400/20",children:[r.jsx(Ru,{className:"w-4 h-4 shrink-0 text-red-300"}),r.jsxs("span",{className:"font-ui-display text-sm font-medium text-red-200",children:[a.length," ",a.length===1?"item needs":"items need"," your attention"]})]}),r.jsx("div",{className:"divide-y divide-white/5",children:a.map(f=>{if(f.issueId)return r.jsx("div",{className:"px-4 py-3 hover:bg-white/5 transition-colors",children:r.jsx(qs,{action:f,linkTo:`/issues/${f.issueId}`})},f.id);const m=f.actionType==="operator_verification",x=u[f.id]??"";return r.jsx("div",{className:"px-4 py-3",children:r.jsx(qs,{action:f,disabled:l===f.id||m&&!x.trim(),onChoose:y=>s(f.id,y,m?x:void 0),children:m&&r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Result note (required) — paste the probe output, waiver reason, or repair note",value:x,disabled:l===f.id,onChange:y=>d(v=>({...v,[f.id]:y.target.value}))})})},f.id)})})]})}function $j({admission:a,queueLength:l,limitBusy:s,onLimitChange:u}){return r.jsxs("div",{className:"px-4 py-2 border-b border-cyber-teal/20 flex items-center justify-between gap-3",children:[r.jsx("span",{className:"font-ui-display text-sm font-medium text-cyber-teal",children:"Admission queue"}),r.jsx("span",{className:"flex items-center gap-2 text-xs text-white/40",children:a?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[a.active," active · ",a.waiting," waiting · limit"," ",a.limit,a.overCap?" · over capacity":""]}),a.options.length>0?r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-white/35",children:"limit"}),r.jsx("select",{"aria-label":"Active issue limit",className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/80 disabled:opacity-50",value:a.options.includes(a.maxActiveIssues)?a.maxActiveIssues:a.limit,disabled:s,title:a.ceiling<uv?`Capped by the worker/spawn ceiling (${a.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:d=>u(Number(d.target.value)),children:a.options.map(d=>r.jsx("option",{value:d,children:d},d))})]}):r.jsxs("span",{title:`Capped by the worker/spawn ceiling (${a.ceiling})`,children:["max ",a.ceiling]})]}):l>0?r.jsxs("span",{children:[l," waiting · sequential"]}):r.jsx("span",{children:"Loading admission status…"})})]})}const Vj=5e3;function Yj(a,l){const s=setInterval(a,l);return()=>clearInterval(s)}const Zj="web";function Gj(a){if(typeof a!="object"||a===null)return null;const l=a.deletedNotice;return typeof l=="string"&&l.length>0?l:null}function Qj(a){const l=Date.now()-new Date(a).getTime(),s=Math.floor(l/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const u=Math.floor(s/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}function Xj({agents:a,humanActions:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=Hy(),v=x.toString(),w=Qu(v),j=b.useRef(w);j.current=w;const[D,X]=b.useState(()=>Fx(v)),[R,$]=b.useState(!1),L=ey(w),[H,F]=b.useState(!1),[P,le]=b.useState(!1),[V,Ne]=b.useState(!1),[I,ye]=b.useState("manual"),[De,yt]=b.useState([]),[Nt,st]=b.useState(!1),[ht,nt]=b.useState(""),Ze=b.useRef(ht);Ze.current=ht;const[U,J]=b.useState(""),[ue,Ae]=b.useState(!1),[Me,N]=b.useState([]),[Z,W]=b.useState(""),[ae,se]=b.useState(""),[B,de]=b.useState("main"),[Ge,Ue]=b.useState(""),[Ut,Ra]=b.useState(""),[ua,$a]=b.useState(""),[Be,Va]=b.useState(""),[ot,vt]=b.useState(!0),[Tn,$e]=b.useState(null),Ya=Aa(),On=Gj(Ya.state),[tn,an]=b.useState(!1),[tt,Vl]=b.useState([]),[Ca,Ln]=b.useState(null),[nn,Mn]=b.useState(!1),[Ht,Yl]=b.useState(null),[qi,Za]=b.useState(()=>_j()),[at,Mt]=b.useState(null),[mt,oa]=b.useState(null),We=De.find(E=>E.id===ht)??null,Dn=I==="linear"&&We!=null,Ga=sj(I,We),Ta=Jx({title:Z,repo:ae,developerAgentId:ua,reviewerAgentId:Be}),Qa=E=>{pS(E).then(d).catch(ee=>$e(String(ee)))},ca=()=>{zx([...vd]).then(Yl).catch(()=>{})},Un=()=>{kj(),Za(!0)},ln=Nj({historyTotal:Ht,filtersActive:L,dismissed:qi}),Rt=()=>{Qa(j.current),Bx().then(Vl).catch(()=>{}),qx().then(Ln).catch(()=>{}),ca()},Zl=async E=>{Mn(!0),$e(null);try{const ee=await AS(E);Ln(ee),Rt()}catch(ee){$e(String(ee))}finally{Mn(!1)}},hl=async E=>{oa(E),$e(null);try{const ee=await wv(E);Mt({issueId:E,developerAgentId:ee.issue.developerAgentId,reviewerAgentId:ee.issue.reviewerAgentId})}catch(ee){$e(String(ee))}finally{oa(null)}},sn=async(E,ee)=>{if(at){oa(at.issueId);try{await Ds(at.issueId,{developerAgentId:E,reviewerAgentId:ee}),Mt(null),Rt()}catch(Te){Mt(null),$e(String(Te)),Rt()}finally{oa(null)}}},Hi=async E=>{oa(E),$e(null);try{await Sv(E),Rt()}catch(ee){$e(String(ee))}finally{oa(null)}},Gl=async E=>{oa(E),$e(null);try{await jv(E),Rt()}catch(ee){$e(String(ee)),Rt()}finally{oa(null)}},Ql=E=>{const ee=mj(v,E);y(ee?Object.fromEntries(new URLSearchParams(ee)):{})},ml=()=>{X(oj),y({})},zn=E=>{const ee=hj(v,E);y(ee?Object.fromEntries(new URLSearchParams(ee)):{})},pl=E=>{const ee=pj(v,E);y(ee?Object.fromEntries(new URLSearchParams(ee)):{})},Xl=()=>{const E=xj(v);y(E?Object.fromEntries(new URLSearchParams(E)):{})},rn=E=>X(ee=>({...ee,...E})),$t=async(E,ee,Te)=>{m(E),$e(null);try{await _v(E,Zj,ee,Te),s(),Rt()}catch(Pe){$e(String(Pe))}finally{m(null)}};b.useEffect(()=>{X(Fx(v))},[v]),b.useEffect(()=>{const E=()=>{Qa(j.current),Bx().then(Vl).catch(()=>{}),qx().then(Ln).catch(()=>{})};E(),zx([...vd]).then(Yl).catch(()=>{});const ee=Yj(E,Vj);return()=>ee()},[v]);const ct=()=>{tS().then(E=>{st(E.hasMore),yt(ee=>rj(ee,E.candidates,Ze.current))}).catch(E=>$e(`Linear inbox: ${String(E)}`))};b.useEffect(()=>{H&&(xS().then(N).catch(()=>N([])),I==="linear"&&ct())},[H,I]),b.useEffect(()=>{We&&(W(`${We.identifier}: ${We.title}`),Ue(We.description??""),Ra(""),se(E=>ij(E,We)))},[We]);const _t=()=>{W(""),se(""),Ue(""),Ra(""),nt(""),J(""),vt(!0),de("main")},Oa=E=>{yt(ee=>uj(ee,E).candidates),nt(E.id),J(E.identifier)},Y=async()=>{const E=U.trim();if(!E){$e("Paste a Linear id (e.g. NOT-103) or issue URL");return}Ae(!0),$e(null);try{const ee=await aS(E);Oa(ee)}catch(ee){$e(`Linear lookup: ${String(ee)}`)}finally{Ae(!1)}},je=async()=>{if(!Jx({title:Z,repo:ae,developerAgentId:ua,reviewerAgentId:Be})){$e("Title, GitHub repository, developer, and reviewer are required");return}try{await bS({title:Z.trim(),repo:ae.trim(),baseBranch:B.trim()||"main",description:Ge.trim()||void 0,acceptanceCriteria:Ut.trim()||void 0,developerAgentId:ua,reviewerAgentId:Be,maxReviewRounds:3,maxInfraAttempts:3,autoMerge:ot,source:I==="linear"&&We?"linear":"manual",externalId:We==null?void 0:We.id,externalLabel:We==null?void 0:We.identifier,externalUrl:We==null?void 0:We.url,linearAttachments:We==null?void 0:We.attachments}),F(!1),_t(),Rt()}catch(E){$e(String(E))}};return r.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Issues"}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:()=>F(E=>!E),children:"New issue"})]}),Tn&&r.jsx("p",{className:"text-sm text-red-300 mb-3",children:Tn}),On&&!tn&&r.jsxs("div",{className:"mb-3 p-3 rounded border border-white/15 bg-white/[0.04] flex items-start justify-between gap-3",children:[r.jsx("p",{className:"text-sm text-white/85",children:On}),r.jsx("button",{type:"button",className:"font-ui-display shrink-0 text-xs text-white/50 hover:text-white",onClick:()=>an(!0),children:"Dismiss"})]}),ln&&r.jsx(Aj,{agents:a,onStartIssue:()=>F(!0),onDismiss:Un}),H&&r.jsxs("div",{className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsxs("p",{className:"text-xs text-white/50",children:["Workflow:"," ",r.jsxs("span",{className:"text-white/75",children:["developer → reviewer → ",ot?"auto-merge on approve":"final human review"]}),"."]}),r.jsxs("div",{className:"flex gap-2 text-sm",children:[r.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${I==="manual"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>{ye("manual"),nt("")},children:"Manual"}),r.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${I==="linear"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>ye("linear"),children:"From Linear"})]}),I==="linear"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"NOT-103 or Linear URL",value:U,onChange:E=>J(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),Y())}}),r.jsx("button",{type:"button",className:"font-ui-display px-3 py-2 rounded border border-teal/40 text-teal text-sm disabled:opacity-50",disabled:ue||!U.trim(),onClick:()=>void Y(),children:ue?"…":"Lookup"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Or pick from open inbox…"}),r.jsx("button",{type:"button","aria-label":"Configure Linear intake filters",title:"Configure Linear intake filters","aria-expanded":V,onClick:()=>Ne(E=>!E),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6Z",stroke:"currentColor",strokeWidth:"1.3"}),r.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm","aria-label":"Or pick from open inbox",value:ht,onChange:E=>{const ee=E.target.value;nt(ee);const Te=De.find(Pe=>Pe.id===ee);Te&&J(Te.identifier)},children:[r.jsx("option",{value:"",children:"Select an issue…"}),De.map(E=>r.jsxs("option",{value:E.id,children:[E.identifier,": ",E.title]},E.id))]}),V&&r.jsx(Lj,{onClose:()=>Ne(!1),onSaved:ct}),Nt&&r.jsx("p",{className:"text-xs text-white/40","data-testid":"linear-candidates-has-more",children:"Showing the 50 most recently updated matches. Use exact ID/URL lookup above for another issue."})]})]}),r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm disabled:opacity-60",placeholder:"Title",value:Z,disabled:Dn,onChange:E=>W(E.target.value)}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm disabled:opacity-60",rows:3,placeholder:"Problem statement / description",value:Ge,disabled:Dn,onChange:E=>Ue(E.target.value)}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:3,placeholder:"Acceptance criteria (derived from the ticket when left empty)",value:Ut,onChange:E=>Ra(E.target.value)}),r.jsxs("div",{className:"flex gap-2 items-stretch",children:[r.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Repository"}),r.jsx("button",{type:"button","aria-label":"Configure repository mappings",title:"Configure repository mappings","aria-expanded":P,onClick:()=>le(E=>!E),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6Z",stroke:"currentColor",strokeWidth:"1.3"}),r.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})})]}),r.jsx(zv,{value:ae,onChange:se,recentRepos:Me}),P&&r.jsx(Cj,{recentRepos:Me,onClose:()=>le(!1)}),Ga&&r.jsx("p",{className:"text-xs text-amber-200/80","data-testid":"repo-label-warning",children:Ga})]}),r.jsx("input",{className:"w-32 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Base (seed)",title:"Seed only — managed GitHub clones use the remote default at first checkout",value:B,onChange:E=>de(E.target.value)})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:ua,onChange:E=>$a(E.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),a.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:Be,onChange:E=>Va(E.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),a.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:ot,onChange:E=>vt(E.target.checked),className:"accent-[#C4B643]"}),"Auto-merge when reviewer approves (skip final human review)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 disabled:opacity-40",disabled:!Ta,title:Ta?void 0:"Title, GitHub repository, developer, and reviewer are required",onClick:je,children:I==="linear"?"Kick from Linear":"Create"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{F(!1),_t()},children:"Cancel"})]})]}),r.jsxs("div",{className:"mb-4 rounded border border-cyber-teal/25 bg-cyber-teal/5",children:[r.jsx($j,{admission:Ca,queueLength:tt.length,limitBusy:nn,onLimitChange:E=>void Zl(E)}),tt.length>0&&r.jsx("div",{className:"divide-y divide-white/5",children:tt.map((E,ee)=>r.jsxs("div",{children:[r.jsxs("div",{className:"px-4 py-2 flex items-start gap-3",children:[r.jsx("span",{className:"text-xs text-white/35 w-5 shrink-0 pt-0.5",children:E.position}),r.jsxs(sa,{to:`/issues/${E.issueId}`,className:"flex-1 min-w-0 text-left hover:text-cyber-teal",children:[r.jsx("span",{className:"text-sm text-white/85 truncate block",children:E.title??E.issueId.slice(0,8)}),E.waitReason?r.jsx("span",{className:"text-xs text-amber-200/80 block mt-0.5",children:E.waitReason}):r.jsxs("span",{className:"text-xs text-white/35 block mt-0.5",children:[E.issueStatus??"queued"," · next up"]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:mt===E.issueId,title:"Change the developer/reviewer agents — keeps queue position and rechecks the wait reason",onClick:()=>void hl(E.issueId),children:"Edit"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:mt===E.issueId,title:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:()=>void Hi(E.issueId),children:"Run next"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:mt===E.issueId,title:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:()=>void Gl(E.issueId),children:"Execute now"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===0,title:"Move to top",onClick:()=>{su(E.issueId,"top").then(Rt).catch(Te=>$e(String(Te)))},children:"Top"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===0,title:"Move up",onClick:()=>{const Te=tt[ee-1];Te&&su(E.issueId,{before:Te.issueId}).then(Rt).catch(Pe=>$e(String(Pe)))},children:"↑"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===tt.length-1,title:"Move down",onClick:()=>{const Te=tt[ee+1];Te&&su(E.issueId,{after:Te.issueId}).then(Rt).catch(Pe=>$e(String(Pe)))},children:"↓"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===tt.length-1,title:"Move to bottom",onClick:()=>{su(E.issueId,"bottom").then(Rt).catch(Te=>$e(String(Te)))},children:"Bottom"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-white",onClick:()=>{Nv(E.issueId).then(Rt).catch(Te=>$e(String(Te)))},children:"Remove"})]})]}),(at==null?void 0:at.issueId)===E.issueId&&r.jsx("div",{className:"px-4 pb-3 pl-12",children:r.jsx(Hv,{agents:a,initialDeveloperId:at.developerAgentId,initialReviewerId:at.reviewerAgentId,busy:mt===E.issueId,onSave:(Te,Pe)=>void sn(Te,Pe),onCancel:()=>Mt(null)})})]},E.id))})]}),r.jsx(Hj,{actions:l,busyActionId:f,onResolve:(E,ee,Te)=>void $t(E,ee,Te)}),r.jsxs("div",{className:"mb-4 rounded border border-white/10 bg-panel-elevated/60",children:[r.jsxs("button",{type:"button","aria-expanded":R,"aria-controls":"issues-filter-form",onClick:()=>$(E=>!E),className:"w-full flex items-center gap-2 px-4 py-2.5 text-sm text-white/70 hover:text-white",children:[r.jsx("span",{"aria-hidden":"true",className:"text-xs text-white/40 w-3 shrink-0",children:R?"▾":"▸"}),r.jsx("span",{className:"font-ui-display",children:R?"Hide filters":"Show filters"}),L&&r.jsx("span",{"data-testid":"filters-active-indicator",title:"The issue list is filtered",className:"text-xs px-2 py-0.5 rounded-full border border-[#C4B643]/50 text-[#C4B643]",children:"Filtered"})]}),R&&r.jsx("form",{id:"issues-filter-form","aria-label":"Issues filters",className:"px-4 pb-4",onSubmit:E=>{E.preventDefault(),Ql(D)},children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Search"}),r.jsx("input",{type:"text",placeholder:"Title or label (e.g. NOT-175)",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.q,onChange:E=>rn({q:E.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Status"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.status,onChange:E=>rn({status:E.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),vd.map(E=>r.jsx("option",{value:E,children:E},E))]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Repository"}),r.jsx("input",{type:"text",placeholder:"github.com/owner/repo",title:"Exact repository identity",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.repo,onChange:E=>rn({repo:E.target.value})})]}),r.jsx("div",{className:"flex items-end gap-2",children:r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer pb-2",children:[r.jsx("input",{type:"checkbox",checked:D.needsAttention,onChange:E=>rn({needsAttention:E.target.checked}),className:"accent-[#C4B643]"}),"Needs attention"]})}),r.jsxs("div",{className:"flex items-end gap-2 sm:col-span-2 lg:col-span-4",children:[r.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),r.jsx("button",{type:"button",className:"px-4 py-2 text-sm text-white/60 hover:text-white",onClick:ml,children:"Reset"})]})]})})]}),u===null?r.jsx("p",{className:"text-white/50 text-sm",children:"Loading…"}):u.total===0&&!ey(w)?r.jsx("p",{className:"text-white/45 text-sm",children:"No issues yet — create one to get started."}):u.total===0?r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/40 px-4 py-3",children:[r.jsx("p",{className:"text-white/45 text-sm",children:Wx(u)}),r.jsx("button",{type:"button",className:"mt-2 px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white",onClick:ml,children:"Reset filters"})]}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-2",children:[r.jsx(bj,{sort:cj(v),direction:Lv(v),onSortChange:pl,onToggleDirection:Xl}),r.jsxs("p",{className:"text-xs text-white/40 tabular-nums",children:[Wx(u),Px(u)?` · ${Px(u)}`:""]})]}),r.jsx("div",{className:"space-y-2",children:u.issues.map(E=>{const ee=tt.find(Te=>Te.issueId===E.id);return r.jsxs(sa,{to:`/issues/${E.id}`,className:"w-full text-left flex items-center gap-3 px-4 py-3 rounded border border-white/10 bg-panel-elevated/40 hover:bg-panel-elevated/70 transition-colors",children:[E.hasOpenHumanAction&&r.jsx(Ru,{className:"w-4 h-4 shrink-0 text-red-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-white/90 truncate",children:E.title}),ee!=null&&ee.waitReason?r.jsx("p",{className:"text-xs text-amber-200/80 truncate",title:ee.waitReason,children:ee.waitReason}):E.currentIntent&&r.jsx("p",{className:"text-xs text-white/50 truncate",children:E.currentIntent})]}),r.jsx("span",{className:"text-xs text-white/40 capitalize shrink-0",children:E.currentOwner}),ee&&r.jsxs("span",{className:"text-xs px-2 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal shrink-0",title:ee.waitReason??"Next up for admission",children:["Queued #",ee.position]}),r.jsx(Mv,{status:E.status}),r.jsx("span",{className:"text-xs text-white/35 shrink-0 w-16 text-right",children:Qj(E.updatedAt)})]},E.id)})}),u.totalPages>1&&r.jsxs("nav",{"aria-label":"Issues pages",className:"mt-3 flex items-center gap-2",children:[r.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white disabled:opacity-40",disabled:u.page<=1,onClick:()=>zn(u.page-1),children:"Previous"}),r.jsxs("span",{className:"text-xs text-white/45 tabular-nums",children:["Page ",u.page," of ",u.totalPages]}),r.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white disabled:opacity-40",disabled:u.page>=u.totalPages,onClick:()=>zn(u.page+1),children:"Next"})]})]})]})}const Ij=["developer","reviewer","legacy"],ay=["claude_code","cursor_local","codex_local"],Kj=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"];function Oi(a,l){return a.n===0||a.p50===null&&a.p95===null?{available:!1,p50Text:null,p95Text:null,sampleText:"n=0",sampleTitle:"No observations in this cohort",sparse:!0}:{available:!0,p50Text:a.p50===null?null:l(a.p50),p95Text:a.p95===null?null:l(a.p95),sampleText:pv(a.n),sampleTitle:`Sample size ${a.n}${Vd(a.n)?" — fewer than 5 observations, compare with care":""}`,sparse:Vd(a.n)}}function Sa(a,l,s){if(a.sum===null||a.known===0)return{available:!1,valueText:"N/A",exactText:null,noteText:null,noteTitle:null,incomplete:a.known<a.total};const u=l(a.sum),d=s!=null&&s.compact?$2(a.sum):u,f=a.known<a.total;return{available:!0,valueText:d,exactText:s!=null&&s.compact?u:null,noteText:f?`${Ie(a.known)}/${Ie(a.total)} known`:null,noteTitle:f?"Partial sample — missing provider metadata is excluded, never zero":null,incomplete:f}}function Vs(a,l,s){return a===null||l===0?{available:!1,valueText:"N/A",evidenceCounts:null,evidenceNoun:null,title:`No ${s} in this cohort`}:{available:!0,valueText:Vu(a),evidenceCounts:`${Ie(Math.round(a*l))}/${Ie(l)}`,evidenceNoun:s,title:`Exact share over ${l} ${s}`}}function ny(a,l,s){const u=Vs(a,l,s);return u.available?{text:`${u.valueText} (${u.evidenceCounts} ${u.evidenceNoun})`,title:u.title}:{text:u.valueText,title:u.title}}function bd(a){const l=ny(a.issueSuccess,a.issueSuccessDenominator,"closed"),s=ny(a.attemptSuccess,a.attemptSuccessDenominator,"terminal attempts");return{key:a.key,issuesText:Ie(a.issues),attemptsText:Ie(a.attempts),issueSuccessText:l.text,issueSuccessTitle:l.title,attemptSuccessText:s.text,attemptSuccessTitle:s.title,issueSuccessDisplay:Vs(a.issueSuccess,a.issueSuccessDenominator,"closed"),attemptSuccessDisplay:Vs(a.attemptSuccess,a.attemptSuccessDenominator,"terminal attempts"),wallText:Ux(a.sessionWallMs,Kt),envelopeText:Ux(a.spawnEnvelopeMs,Kt),retryText:a.retryRate===null?"N/A":Vu(a.retryRate),retryTitle:"Extra attempts after a terminal attempt in the same issue/role/round ÷ attempts",tokensInText:ul(a.tokensIn,Ie),tokensOutText:ul(a.tokensOut,Ie),costText:ul(a.costUsd,Ms),costIncomplete:a.costUsd.known<a.costUsd.total,durationText:ul(a.durationMs,Kt),failedCostText:ul(a.failedCostUsd,Ms),failedTokensText:`${ul(a.failedTokensIn,Ie)} in · ${ul(a.failedTokensOut,Ie)} out`,failedDurationText:ul(a.failedDurationMs,Kt),wall:Oi(a.sessionWallMs,Kt),envelope:Oi(a.spawnEnvelopeMs,Kt),tokensIn:Sa(a.tokensIn,Ie,{compact:!0}),tokensOut:Sa(a.tokensOut,Ie,{compact:!0}),cost:Sa(a.costUsd,Ms),duration:Sa(a.durationMs,Kt),failedCost:Sa(a.failedCostUsd,Ms),failedTokensIn:Sa(a.failedTokensIn,Ie,{compact:!0}),failedTokensOut:Sa(a.failedTokensOut,Ie,{compact:!0}),failedDuration:Sa(a.failedDurationMs,Kt),failedIncomplete:a.failedCostUsd.known<a.failedCostUsd.total||a.failedTokensIn.known<a.failedTokensIn.total||a.failedTokensOut.known<a.failedTokensOut.total||a.failedDurationMs.known<a.failedDurationMs.total,sparse:a.attempts>0&&Vd(a.attempts)}}function Jj(a,l){const s=a.code==="unknown";return{code:a.code,domain:a.domain,countText:Ie(a.count),shareText:a.share===null?"N/A":Vu(a.share),shareTitle:l>0?`${Ie(a.count)} of ${Ie(l)} issues with a failed attempt`:"No issues with a failed attempt in scope",isUnknown:s,blurb:s?"Ambiguous evidence — not promoted to a specific cause.":`Primary cause · ${a.domain} domain`,displayCode:s?"Cause not recorded":a.code,displayNote:s?"Needs more evidence":`Primary cause · ${a.domain} domain`,issueIds:a.issueIds,hiddenIssueCount:Math.max(0,a.issueTotal-a.issueIds.length)}}function Fj(a){const l=a.reduce((s,u)=>s+u.count,0);return a.map(s=>Jj(s,l))}function Wj(a){return`/issues/${a}`}function ly(a,l){if(a!=null&&a.trim()&&/^\d{4}-\d{2}-\d{2}$/.test(a.trim()))return l?`${a.trim()}T23:59:59.999Z`:`${a.trim()}T00:00:00.000Z`}function iy(a){if(!a)return"";const l=a.match(/^(\d{4}-\d{2}-\d{2})/);return l?l[1]:""}function sy(a){const l=new URLSearchParams(a.startsWith("?")?a.slice(1):a),s=u=>{var d;return((d=l.get(u))==null?void 0:d.trim())??""};return{fromDate:iy(s("from")),toDate:iy(s("to")),repo:s("repo"),role:s("role"),runtime:s("runtime"),model:s("model"),status:s("status")}}function Pj(a){const l=new URLSearchParams(a.startsWith("?")?a.slice(1):a),s=d=>{var m;const f=(m=l.get(d))==null?void 0:m.trim();return f||void 0},u={};for(const d of["from","to","repo","role","runtime","model","status"]){const f=s(d);f!==void 0&&(u[d]=f)}return u}function eN(a,l,s){const u=new URLSearchParams(a.startsWith("?")?a.slice(1):a);u.set(l,s),u.delete("page"),u.delete("limit"),u.sort();const d=u.toString();return`/reports/execution${d?`?${d}`:""}`}function tN(a){return{from:ly(a.fromDate,!1),to:ly(a.toDate,!0),repo:a.repo.trim()||void 0,role:a.role||void 0,runtime:a.runtime.trim()||void 0,model:a.model.trim()||void 0,status:a.status.trim()||void 0}}function wd(a){return a===null?"N/A":Vu(a)}function Ua({label:a,value:l,valueTitle:s,note:u}){return r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[r.jsx("p",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:a}),r.jsx("div",{className:"mt-1 font-mono text-lg font-semibold text-white/90 tabular-nums",title:s,children:l}),u&&r.jsx("div",{className:"mt-0.5 font-ui-display text-xs text-white/40",children:u})]})}function Cu({display:a,compact:l}){if(!a.available)return r.jsx("span",{className:"font-mono text-white/45",title:a.title,children:"N/A"});const s=l?"font-mono text-sm font-medium text-white/85 tabular-nums leading-tight whitespace-nowrap":"font-mono text-base sm:text-lg font-semibold text-white/90 tabular-nums leading-tight whitespace-nowrap";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",title:a.title,children:[r.jsx("span",{className:s,"aria-label":a.title,children:a.valueText}),r.jsxs("span",{className:"font-ui-display min-w-0 break-words text-xs text-white/40",children:["(",r.jsx("span",{className:"font-mono tabular-nums",children:a.evidenceCounts})," ",a.evidenceNoun,")"]})]})}function Us({display:a,compact:l}){if(!a.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=l?"font-ui-display text-[11px] uppercase tracking-wide text-white/40":"font-ui-display text-xs uppercase tracking-wide text-white/40",u=l?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-3 gap-y-0.5",children:[r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:s,children:"P50"}),r.jsx("span",{className:u,children:a.p50Text??"N/A"})]}),r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:s,children:"P95"}),r.jsx("span",{className:u,children:a.p95Text??"N/A"})]}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:a.sampleTitle,children:a.sampleText})]})}function ja({display:a,compact:l}){if(!a.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=a.exactText??a.valueText,u=l?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx("span",{className:u,title:s,"aria-label":s,children:a.valueText}),a.noteText&&r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:a.noteTitle??void 0,children:a.noteText})]})}function Sd({caption:a,dimension:l,rows:s,cohortLink:u}){return s.length===0?r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[r.jsx("h4",{className:"font-ui-display text-sm font-medium text-white/80",children:a}),r.jsx("p",{className:"font-ui-display mt-1 text-sm text-white/45",children:"No attempts in this dimension for these filters."})]}):r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[1440px] text-sm",children:[r.jsxs("caption",{className:"sr-only",children:[a," — sorted by name, never by cost"]}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:a}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempts"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issue success"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempt success"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Session wall P50/P95"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Retry rate"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens in"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens out"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Cost"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Duration"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed cost"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed tokens"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed runtime"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:s.map(d=>r.jsxs("tr",{className:"tabular-nums",children:[r.jsxs("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:[u?r.jsx(sa,{to:u(l,d.key),className:"text-cyber-teal hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",title:`Filter the report to ${l} ${d.key}`,children:d.key}):d.key,d.sparse&&r.jsx("span",{className:"font-ui-display ml-2 text-xs font-normal text-amber-200/80",title:"Fewer than 5 attempts — compare with care",children:"sparse"})]}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.issuesText}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.attemptsText}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.issueSuccessTitle,children:r.jsx(Cu,{display:d.issueSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.attemptSuccessTitle,children:r.jsx(Cu,{display:d.attemptSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Us,{display:d.wall,compact:!0})}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:d.retryTitle,children:d.retryText}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.tokensIn,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.tokensOut,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.cost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.duration,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.failedCost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-1.5",children:[r.jsx(ja,{display:d.failedTokensIn,compact:!0}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"in"}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"·"}),r.jsx(ja,{display:d.failedTokensOut,compact:!0}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"out"})]})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.failedDuration,compact:!0})})]},d.key))})]})})}const aN={fromDate:"",toDate:"",repo:"",role:"",runtime:"",model:"",status:""};function nN({loading:a,error:l,report:s,onRetry:u,cohortLink:d}){const f=(s==null?void 0:s.summary)??null,m=b.useMemo(()=>s?Fj(s.failures):[],[s]),x=b.useMemo(()=>s?s.failures.reduce((y,v)=>y+v.count,0):0,[s]);return r.jsxs("div",{"aria-live":"polite",children:[a&&r.jsx("p",{role:"status",className:"text-sm text-white/50",children:"Loading execution report…"}),!a&&l&&r.jsxs("div",{className:"rounded border border-red-400/30 bg-red-500/10 px-4 py-3",role:"alert",children:[r.jsxs("p",{className:"font-ui-display text-sm text-red-200",children:["Couldn’t load the execution report: ",l]}),r.jsx("button",{type:"button",className:"font-ui-display mt-2 px-3 py-1.5 text-sm rounded border border-red-300/40 text-red-100 hover:bg-red-500/20",onClick:u,children:"Retry"})]}),!a&&!l&&s&&f&&r.jsxs("div",{className:"space-y-6",children:[s.meta.partial&&r.jsxs("div",{className:"rounded border border-amber-300/30 bg-amber-400/10 px-4 py-3",children:[r.jsx("p",{className:"font-ui-display text-sm text-amber-100 font-medium",children:"Partial metadata"}),r.jsx("ul",{className:"font-ui-display mt-1 list-disc list-inside text-sm text-amber-100/80",children:s.meta.partialReasons.map(y=>r.jsx("li",{children:y},y))})]}),f.issues===0?r.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No issues match these filters in this window. Widen the date range or clear filters."}):r.jsxs(r.Fragment,{children:[r.jsx("section",{"aria-label":"Summary",children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-3",children:[r.jsx(Ua,{label:"Issue success",value:r.jsx(Cu,{display:Vs(f.issueSuccess,f.closedIssues,"closed")}),valueTitle:`done / (done + closed), denominator ${f.closedIssues}`,note:`${Ie(f.issues)} issues · ${Ie(f.closedIssues)} closed`}),r.jsx(Ua,{label:"Attempt success",value:r.jsx(Cu,{display:Vs(f.attemptSuccess,f.terminalAttempts,"terminal")}),valueTitle:`done sessions / terminal sessions, denominator ${f.terminalAttempts}`,note:`${Ie(f.attempts)} attempts · ${Ie(f.terminalAttempts)} terminal`}),r.jsx(Ua,{label:"Retry rate",value:wd(f.retryRate),valueTitle:`${f.retryExtraAttempts} extra attempts after a terminal attempt in the same issue/role/round ÷ ${f.attempts} attempts`,note:`Reuse rate ${wd(f.reuseRate)} over ${Ie(f.reuseDenominator)} reviewer sessions with input SHA`}),r.jsx(Ua,{label:"Human wait",value:Kt(f.humanWaitMs),note:`${Ie(f.interventions)} interventions`}),r.jsx(Ua,{label:"Session wall P50/P95",value:r.jsx(Us,{display:Oi(f.sessionWallMs,Kt)}),note:"Session bookkeeping proxy — never CLI runtime"}),r.jsx(Ua,{label:"Spawn envelope P50/P95",value:r.jsx(Us,{display:Oi(f.spawnEnvelopeMs,Kt)}),note:"Coordinator-measured; includes slot wait + post-exit work"}),r.jsx(Ua,{label:"Checkpoint latency P50/P95",value:r.jsx(Us,{display:Oi(f.checkpointMs,Kt)}),note:"Session start → first heartbeat"}),r.jsx(Ua,{label:"Reviewer rounds (avg)",value:f.avgReviewerRounds===null?"N/A":f.avgReviewerRounds.toFixed(1),note:`Change-request rate ${wd(f.changeRequestRate)} over ${Ie(f.reviewedIssues)} reviewed`})]})}),r.jsxs("section",{"aria-label":"Failed-attempt waste",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Failed-attempt waste (known values only)"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[r.jsx(Ua,{label:"Failed cost",value:r.jsx(ja,{display:Sa(f.failedCostUsd,Ms)})}),r.jsx(Ua,{label:"Failed tokens",value:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx(ja,{display:Sa(f.failedTokensIn,Ie,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"in"}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"·"}),r.jsx(ja,{display:Sa(f.failedTokensOut,Ie,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"out"})]})}),r.jsx(Ua,{label:"Failed runtime",value:r.jsx(ja,{display:Sa(f.failedDurationMs,Kt)})})]})]}),r.jsxs("section",{"aria-label":"Phase wall time",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Phase wall time"}),r.jsx("p",{className:"font-ui-display text-xs text-white/40 mb-2",children:"Composed from the execution-analysis read model over the same issues: exact when agent start/complete events are recorded, inferred usage-envelope backfill otherwise. Rows without evidence read N/A — never a guess. See per-row reasons."}),r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[r.jsx("caption",{className:"sr-only",children:"Exclusive phase wall times. Boundaries without defensible evidence are N/A."}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Phase"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"P50 / P95"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Why"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:f.phaseWallMs.map(y=>r.jsxs("tr",{className:"tabular-nums",children:[r.jsx("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:y.phase}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Us,{display:Oi(y.stat,Kt),compact:!0})}),r.jsx("td",{className:"font-ui-display px-3 py-2 text-xs text-white/45",children:y.stat.reasons.join(", ")})]},y.phase))})]})})]}),r.jsxs("section",{"aria-label":"Comparisons",className:"space-y-4",children:[r.jsxs("h3",{className:"font-ui-display text-sm font-medium text-white/80",children:["Comparisons ",r.jsx("span",{className:"font-normal text-white/40",children:"— sorted by name, never by cost"})]}),r.jsx(Sd,{caption:"By role",dimension:"role",rows:s.byRole.map(bd),cohortLink:d}),r.jsx(Sd,{caption:"By runtime",dimension:"runtime",rows:s.byRuntime.map(bd),cohortLink:d}),r.jsx(Sd,{caption:"By model",dimension:"model",rows:s.byModel.map(bd),cohortLink:d})]}),r.jsxs("section",{"aria-label":"Why attempts failed",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Why attempts failed"}),r.jsxs("p",{className:"font-ui-display text-xs text-white/40 mb-2",children:["Each issue with a failed attempt is counted once using its primary actionable cause, and may later have recovered. Share is over"," ",Ie(x)," failed ",x===1?"issue":"issues"," in scope."]}),m.length===0?r.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No failed attempts in this window."}):r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[r.jsx("caption",{className:"sr-only",children:"Why attempts failed: each issue counted once by primary cause. Cause not recorded is its own bucket and is never promoted."}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Failure"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Domain"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Share"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Example issues"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:m.map(y=>r.jsxs("tr",{className:y.isUnknown?"bg-amber-400/5 tabular-nums":"tabular-nums",children:[r.jsxs("th",{scope:"row",className:"px-4 py-2 text-left text-white/85",children:[r.jsx("span",{className:"font-ui-display block font-medium",title:y.code,children:y.displayCode}),r.jsx("span",{className:`font-ui-display block text-xs font-normal ${y.isUnknown?"text-amber-200/90":"text-white/40"}`,children:y.displayNote})]}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:y.domain}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:y.countText}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:y.shareTitle,children:y.shareText}),r.jsx("td",{className:"px-3 py-2",children:r.jsxs("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[y.issueIds.map(v=>r.jsx(sa,{to:Wj(v),className:"text-cyber-teal hover:underline font-mono text-xs",children:v.slice(0,8)},v)),y.hiddenIssueCount>0&&r.jsxs("span",{className:"font-ui-display text-xs text-white/40",children:["+",y.hiddenIssueCount," more"]})]})})]},y.code))})]})})]})]})]})]})}function lN(){const[a,l]=Hy(),s=a.toString(),u=b.useMemo(()=>Pj(s),[s]),[d,f]=b.useState(()=>sy(s)),[m,x]=b.useState(null),[y,v]=b.useState(!0),[w,j]=b.useState(null),[D,X]=b.useState(0);b.useEffect(()=>{f(sy(s))},[s]),b.useEffect(()=>{let L=!1;return v(!0),j(null),RS(u).then(H=>{L||(x(H),v(!1))}).catch(H=>{L||(j(H instanceof Error?H.message:String(H)),v(!1))}),()=>{L=!0}},[s,D]);const R=L=>{const H=mv(tN(L));l(H?Object.fromEntries(new URLSearchParams(H)):{})},$=L=>f(H=>({...H,...L}));return r.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[r.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2 mb-1",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Execution report"}),m&&r.jsxs("p",{className:"font-ui-display text-xs text-white/40",children:["Window ",new Date(m.window.from).toLocaleDateString()," –"," ",new Date(m.window.to).toLocaleDateString()," · generated"," ",new Date(m.meta.generatedAt).toLocaleTimeString()]})]}),r.jsx("p",{className:"font-ui-display text-sm text-white/50 mb-4",children:"Reliability, latency, retry waste, and metadata coverage by role, runtime, and model. Missing cost/token data reads as N/A — never as zero."}),r.jsx("form",{"aria-label":"Report filters",className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60",onSubmit:L=>{L.preventDefault(),R(d)},children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"From"}),r.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.fromDate,onChange:L=>$({fromDate:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"To"}),r.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.toDate,onChange:L=>$({toDate:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Repository"}),r.jsx("input",{type:"text",placeholder:"github.com/owner/repo",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.repo,onChange:L=>$({repo:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Role"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.role,onChange:L=>$({role:L.target.value}),children:[r.jsx("option",{value:"",children:"All roles"}),Ij.map(L=>r.jsx("option",{value:L,children:L},L))]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Runtime"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.runtime,onChange:L=>{$({runtime:L.target.value})},children:[r.jsx("option",{value:"",children:"All runtimes"}),ay.map(L=>r.jsx("option",{value:L,children:L},L)),r.jsx("option",{value:"unknown",children:"unknown (missing metadata)"}),d.runtime&&!ay.includes(d.runtime)&&r.jsxs("option",{value:d.runtime,children:[d.runtime," (from URL)"]})]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Model"}),r.jsx("input",{type:"text",placeholder:"Any model",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.model,onChange:L=>$({model:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Issue status"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.status,onChange:L=>$({status:L.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),Kj.map(L=>r.jsx("option",{value:L,children:L},L))]})]}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{f(aN),l({})},children:"Reset"})]})]})}),r.jsx(nN,{loading:y,error:w,report:m,onRetry:()=>X(L=>L+1),cohortLink:(L,H)=>eN(s,L,H)})]})}function ry(a,l){var d;if(!a)return"Not assigned";const s=l.find(f=>f.id===a);if(!s)return"Unavailable — profile removed";const u=`${s.name} · ${ia(s.runtime)}`;return s.healthy?u:`${u} (unhealthy: ${((d=s.issues[0])==null?void 0:d.message)??"needs attention"})`}function uy(a,l){var u;if(!a)return;const s=l.find(d=>d.id===a);return s?`${s.name} · ${ia(s.runtime)}${s.healthy?" · healthy":` · ${((u=s.issues[0])==null?void 0:u.message)??"unhealthy"}`}`:`Configured profile ${a} is not on record (deleted?)`}function iN({agents:a,initialRepo:l,initialDeveloperId:s,initialReviewerId:u,busy:d,onSave:f,onCancel:m}){var P,le;const[x,y]=b.useState(l),[v,w]=b.useState(s??""),[j,D]=b.useState(u??""),X=qv(a),R=a.find(V=>V.id===v),$=a.find(V=>V.id===j),L=Eu(R),H=Eu($),F=x.trim()===l&&v===(s??"")&&j===(u??"");return r.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("p",{className:"text-xs text-white/50",children:"Edit configuration — repository, developer, and reviewer save together. Queue position is kept, readiness and the wait reason are rechecked, and the change is recorded on the timeline."}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Repository"}),r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:x,disabled:d,placeholder:"GitHub URL or owner/repo",title:"GitHub URL or owner/repo — normalized to github.com/owner/repo, same validation as issue creation",onChange:V=>y(V.target.value)})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:v,disabled:d,title:R?`${R.name} · ${ia(R.runtime)}${R.healthy?" · healthy":` · ${((P=R.issues[0])==null?void 0:P.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:V=>w(V.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),X.map(V=>r.jsx("option",{value:V.id,title:dl(V),children:(V.healthy?"● ":"○ ")+dl(V)},V.id))]}),L&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:L})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:j,disabled:d,title:$?`${$.name} · ${ia($.runtime)}${$.healthy?" · healthy":` · ${((le=$.issues[0])==null?void 0:le.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:V=>D(V.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),X.map(V=>V.runtime==="muse_code"?r.jsx("option",{value:V.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${V.name} · ${ia(V.runtime)} — reviewer not supported`},V.id):r.jsx("option",{value:V.id,title:dl(V),children:(V.healthy?"● ":"○ ")+dl(V)},V.id))]}),H&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:H})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:d||!x.trim()||!v||!j||F,title:"Save via the issue PATCH contract — keeps queue position, rechecks readiness and the wait reason",onClick:()=>f(x.trim(),v,j),children:"Save configuration"}),r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:d,onClick:m,children:"Cancel"})]})]})}function sN({autoMerge:a,policy:l,busy:s,onToggle:u}){const d=!!(l!=null&&l.editable&&u),f=a?"On":"Off";return r.jsxs("div",{className:"space-y-1","data-testid":"auto-merge-policy",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[r.jsx("span",{id:"auto-merge-policy-label",className:"text-white/45",children:"Auto-merge after reviewer approval"}),d?r.jsxs("button",{type:"button",role:"switch","aria-checked":a,"aria-labelledby":"auto-merge-policy-label","aria-busy":s,disabled:s,title:a?"Turn auto-merge off — approval then waits for final human review":"Turn auto-merge on — approval then merges the PR",className:`inline-flex items-center gap-2 rounded-full border px-2 py-0.5 text-xs disabled:opacity-50 ${a?"border-cyber-teal/50 bg-cyber-teal/15 text-cyber-teal":"border-white/15 bg-white/5 text-white/70"}`,onClick:()=>u==null?void 0:u(!a),children:[r.jsx("span",{"aria-hidden":"true",className:`relative inline-block h-3 w-6 rounded-full ${a?"bg-cyber-teal/60":"bg-white/20"}`,children:r.jsx("span",{className:`absolute top-0.5 h-2 w-2 rounded-full bg-white transition-all ${a?"left-3.5":"left-0.5"}`})}),f]}):r.jsx("span",{className:"text-white/85",children:f})]}),d?r.jsx("p",{className:"text-xs text-white/45",children:"Read when the reviewer approves. Changing it keeps the queue position, task, agents and branch."}):(l==null?void 0:l.reason)&&r.jsxs("p",{className:"text-xs text-white/45",children:["Locked — ",l.reason]})]})}function rN({issue:a,agents:l,canEdit:s,editing:u,busy:d,onBeginEdit:f,onSave:m,onCancel:x,autoMergePolicy:y,onToggleAutoMerge:v}){return r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1.5",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Configuration"}),r.jsxs("p",{className:"text-sm text-white/85",title:`Exact repository identity: ${a.repo}`,children:[r.jsx("span",{className:"text-white/45",children:"Repository "}),a.repo]}),r.jsxs("p",{className:"text-sm text-white/85",title:uy(a.developerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Developer "}),ry(a.developerAgentId,l)]}),r.jsxs("p",{className:"text-sm text-white/85",title:uy(a.reviewerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Reviewer "}),ry(a.reviewerAgentId,l)]}),r.jsx(sN,{autoMerge:a.autoMerge,policy:y,busy:d,onToggle:v}),s&&!u&&r.jsx("button",{type:"button",className:"text-xs text-cyber-teal hover:underline disabled:opacity-50",disabled:d,onClick:f,children:"Edit configuration"}),s&&u&&r.jsx(iN,{agents:l,initialRepo:a.repo,initialDeveloperId:a.developerAgentId,initialReviewerId:a.reviewerAgentId,busy:d,onSave:m,onCancel:x})]})}function uN({contract:a}){return r.jsxs("section",{"aria-label":"Execution contract",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Execution contract"}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal",children:a.version}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 text-white/70",children:a.executionMode})]}),r.jsxs("div",{className:"text-sm text-white/85 space-y-1.5",children:[r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"Exit predicate: "}),a.exitPredicate]}),r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"One-PR stopping point: "}),a.onePrStoppingPoint]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45",children:"Non-goals:"}),r.jsx("ul",{className:"list-disc pl-5 text-white/75",children:a.nonGoals.map(l=>r.jsx("li",{children:l},l))})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45",children:"Acceptance criteria:"}),r.jsx("ul",{className:"space-y-1",children:a.acceptanceCriteria.map(l=>r.jsxs("li",{children:[r.jsxs("p",{className:"text-white/80",children:["☐ ",l.text]}),l.evidence&&r.jsxs("p",{className:"pl-5 text-xs text-white/55",children:["Evidence: ",l.evidence]})]},l.text))})]})]}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Compiled from the ticket description — edit the description to change it."})]})}function oN(a){return a===void 0?"unknown size":`${a.toLocaleString("en-US")} bytes`}function cN({attachments:a}){if(!(a!=null&&a.length))return null;const l=a.filter(u=>u.kind==="file"),s=a.filter(u=>u.kind==="link");return r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1","data-testid":"source-attachments",children:[r.jsx("p",{className:"text-xs text-white/45 font-medium uppercase tracking-wide",children:"Source attachments"}),l.map(u=>r.jsxs("p",{className:"text-sm text-white/85","data-testid":"source-attachment-file",children:[r.jsx("span",{className:"text-cyber-teal",children:"file"})," ",u.safeFileName??u.title,r.jsxs("span",{className:"text-white/45",children:[" ","· ",oN(u.sizeBytes),u.sha256?` · sha256:${u.sha256.slice(0,16)}…`:"",u.contentType?` · ${u.contentType}`:""]})]},u.linearAttachmentId)),s.map(u=>r.jsxs("p",{className:"text-sm text-white/85","data-testid":"source-attachment-link",children:[r.jsx("span",{className:"text-amber-300",children:"link"})," ",u.title,r.jsxs("span",{className:"text-white/45",children:[" ","· ",u.url,u.subtitle?` · ${u.subtitle}`:""]})]},u.linearAttachmentId)),r.jsx("p",{className:"text-xs text-white/40",children:"Files are Dealer-stored snapshots — the Builder reads local bytes, never the expiring Linear URL. Links are metadata only, never downloaded. Files uploaded only inside Linear comments are not imported."})]})}function ou(a){return a==="developer"?"Developer":a==="reviewer"?"Reviewer":"Worker"}const jd={"issue.created":()=>"Issue created","issue.reassigned":a=>{const l=Ml(a.payloadJson);return l&&typeof l.toAutoMerge=="boolean"&&l.toRepo===void 0?`Auto-merge turned ${l.toAutoMerge?"on":"off"}`:"Configuration updated"},"issue.source_reloaded":()=>"Task text reloaded from Linear","workflow.started":()=>"Workflow started","worker.started":a=>`${ou(a.actorType)} started${a.round?` (round ${a.round})`:""}`,"worker.completed":a=>`${ou(a.actorType)} finished${a.round?` (round ${a.round})`:""}`,"worker.failed":a=>`${ou(a.actorType)} failed${a.round?` (round ${a.round})`:""}`,"worker.deferred":a=>{var l;return((l=Ml(a.payloadJson))==null?void 0:l.outcome)==="deck_unavailable"?`Waiting for Agent Deck${a.round?` (round ${a.round})`:""}`:`${ou(a.actorType)} deferred${a.round?` (round ${a.round})`:""}`},"worktree.ready":()=>"Worktree ready","worktree.deps_ready":()=>"Dependencies ready","deck.connected":()=>"Deck connected","brief.resolved":()=>"Brief resolved","base.probe":a=>{var s;const l=(s=Ml(a.payloadJson))==null?void 0:s.result;return l==="conflict"?"Base conflict found before publish":l==="skipped"?"Base conflict probe skipped":l==="deferred"?"Base conflict probe waiting on base fetch":l==="failed"?"Base conflict probe failed; not published":"Base conflict probe clean"},"branch.pushed":()=>"Branch pushed","checks.started":()=>"Checks started","pull_request.opened":()=>"Developer opened the PR","pull_request.updated":()=>"Developer updated the PR","checks.completed":()=>"Checks completed","review.submitted":()=>"Reviewer submitted a review","repair.started":a=>`Repair round ${a.round??"?"} started`,"guidance.added":()=>"Guidance added","task_snapshot.refreshed":()=>"Task snapshot refreshed","human_action.requested":()=>"Human action requested","human_action.resolved":()=>"Human action resolved","final_review.requested":()=>"Final review requested","issue.completed":()=>"Issue completed","issue.closed":()=>"Issue closed"};function Ml(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}const dN={approved:"text-cyber-teal",changes_requested:"text-amber-300",escalated:"text-red-300"};function fN({e:a}){var l;if(a.type==="pull_request.opened"||a.type==="pull_request.updated"){const s=Ml(a.payloadJson);return a.artifactRef?r.jsxs("a",{href:a.artifactRef,target:"_blank",rel:"noreferrer",className:"text-sm text-cyber-teal hover:underline",children:["PR ",s!=null&&s.prNumber?`#${s.prNumber}`:""," ",s!=null&&s.branch?`(${s.branch})`:""]}):null}if(a.type==="review.submitted"){const s=Ml(a.payloadJson);return s?r.jsxs("span",{className:"text-sm",children:[r.jsx("span",{className:dN[s.verdict]??"text-white/70",children:s.verdict.replace("_"," ")}),(l=s.findings)!=null&&l.length?` · ${s.findings.length} finding(s)`:""]}):null}if(a.type==="guidance.added"){const s=Ml(a.payloadJson);return s!=null&&s.markdown?r.jsxs("span",{className:"text-sm text-white/55 italic",children:["— ",s.markdown]}):null}if(a.type==="worker.started"||a.type==="worker.completed"||a.type==="worker.failed"||a.type==="worker.deferred"||a.type==="worktree.ready"||a.type==="deck.connected"||a.type==="brief.resolved"||a.type==="branch.pushed"||a.type==="checks.started"||a.type==="checks.completed"){const s=Ml(a.payloadJson);if(!s)return null;const u=[];return s.runtime&&u.push(s.runtime),s.model&&u.push(s.model),s.sessionId&&u.push(s.sessionId.slice(0,8)),s.worktreePath&&u.push(s.worktreePath),s.resolution&&u.push(s.resolution),s.branch&&u.push(s.branch),s.commitsAhead!=null&&u.push(`${s.commitsAhead} ahead`),s.snapshot&&u.push(s.snapshot),(a.type==="worker.deferred"||a.type==="worker.failed")&&(s.reason&&u.push(s.reason),a.type==="worker.deferred"&&s.until&&u.push(`until ${new Date(s.until).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`)),u.length===0?null:r.jsxs("span",{className:"text-xs text-white/40",children:["· ",u.join(" · ")]})}return null}function hN(a){var l;return((l=jd[a.type])==null?void 0:l.call(jd,a))??a.type}const oy={human:"You",system:"System",developer:"Developer",reviewer:"Reviewer"},mN={human:"bg-cyber-teal/15 text-cyber-teal",system:"bg-white/10 text-white/50",developer:"bg-cyber-violet/20 text-cyber-violet-light",reviewer:"bg-[#C4B643]/25 text-[#E8DC7A]"};function pN(a){return a.actorRef?`${oy[a.actorType]} · ${a.actorRef}`:oy[a.actorType]}function xN({events:a}){return a.length===0?r.jsx("p",{className:"text-white/40 text-sm",children:"No activity yet."}):r.jsx("div",{className:"space-y-1",children:a.map(l=>r.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-white/5 last:border-0",children:[r.jsx("span",{className:"text-xs text-white/35 w-20 shrink-0 tabular-nums",children:new Date(l.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:`text-[11px] leading-none px-1.5 py-0.5 rounded shrink-0 ${mN[l.actorType]}`,children:pN(l)}),r.jsx("span",{className:"text-sm text-white/80 min-w-0 break-words [overflow-wrap:anywhere]",children:hN(l)}),r.jsx(fN,{e:l})]},l.id))})}function za(a){if(a==null||!Number.isFinite(a))return null;if(a<1e3)return"<1s";const l=Math.round(a/1e3);if(l<60)return`${l}s`;const s=Math.floor(l/60);if(s<60){const f=l%60;return f===0?`${s}m`:`${s}m ${f}s`}const u=Math.floor(s/60),d=s%60;return d===0?`${u}h`:`${u}h ${d}m`}function cy(a){return a==null||!Number.isFinite(a)?null:`${Math.round(a).toLocaleString("en-US")} tokens`}function yN(a){return a==null||!Number.isFinite(a)?null:`$${a.toFixed(2)}`}const vN={queue_wait:"Queue / admission wait",coordinator_setup:"Setup",agent_process:"Agent process",coordinator_validation_publish:"Validation / publish",coordinator_work:"Coordinator work"},dy={model_provider_wait:"Silent · waiting on model provider",tool_or_subprocess_in_flight:"Silent · tool/subprocess in flight",host_suspended:"Silent · host suspended",no_structured_output:"Silent · no structured output yet",unknown:"Silent · unknown cause"},Gd={worktree:"worktree",commit:"commit",verification_receipt:"verification receipt",publish_only:"publish-only result"},gN=new Set(["failed","timed_out","error"]);function pf(a){return a.replace(/_/g," ")}function Ys(a,l){const s=`Evidence quality: ${a}`;return l.length>0?`${s} — ${l.join(", ")}`:s}function Na({quality:a,reasons:l}){return r.jsxs("span",{className:`text-[11px] tabular-nums ${a==="exact"?"text-white/60":a==="inferred"?"text-amber-300/90":"text-white/60 italic"}`,title:Ys(a,l),children:["· ",a,l.length>0&&r.jsxs("span",{className:"sr-only",children:[" (",l.join(", "),")"]})]})}function cl({reasons:a}){const l=a.length>0?a.join(", "):"no reason recorded";return r.jsxs("span",{className:"text-white/45 italic",title:`Unavailable — ${l}`,children:["Unavailable",r.jsxs("span",{className:"text-[11px]",children:[" — ",l]})]})}function cu({covered:a,format:l,unit:s}){if(a.value==null)return r.jsx(cl,{reasons:a.reasons});const u=a.known<a.total;return r.jsxs("span",{title:`${Ys(a.quality,a.reasons)} · known ${a.known} of ${a.total} ${s}`,children:[l(a.value),r.jsx(Na,{quality:a.quality,reasons:a.reasons}),u&&r.jsxs("span",{className:"text-[11px] text-white/60",title:`Known for ${a.known} of ${a.total} ${s}`,children:[" ","(known ",a.known," of ",a.total,")"]})]})}function fy({cause:a,primary:l}){return r.jsxs("div",{className:l?"p-2.5 rounded border border-red-400/30 bg-red-500/10 space-y-1":"p-2 rounded border border-white/10 bg-white/[0.02] space-y-1",children:[r.jsxs("p",{className:l?"text-sm font-medium text-red-200":"text-xs text-white/60",children:[l?"First failure: ":"Consequence: ",pf(a.code)]}),r.jsx("p",{className:l?"text-sm text-white/85 whitespace-pre-wrap break-words":"text-xs text-white/55 whitespace-pre-wrap break-words",children:a.rawReason}),r.jsxs("p",{className:"text-[11px] text-white/60",title:Ys(a.quality==="exact"?"exact":"inferred",[`evidence: ${a.evidenceSource}`,`confidence: ${a.confidence}`]),children:[a.domain," · ",a.confidence," confidence · via ",a.evidenceSource.replace(/_/g," ")," · ",a.quality,a.occurredAt?` · ${new Date(a.occurredAt).toLocaleString()}`:""]})]})}function bN({interval:a}){const l=dy[a.category??"unknown"]??dy.unknown,s=za(a.durationMs),u=a.category==="host_suspended";return r.jsxs("li",{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 py-1 border-b border-white/5 last:border-0 ${u?"text-amber-200/90":"text-white/70"}`,children:[r.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded border shrink-0 ${u?"border-amber-400/40 bg-amber-500/10":"border-white/15 bg-white/5"}`,title:u?"Overlapping durable host-sleep evidence split this gap — the host was suspended, not the agent.":"Observational gap with no new structured activity — not a diagnosis of what the agent was doing.",children:l}),r.jsx("span",{className:"text-xs tabular-nums",children:s??r.jsx(cl,{reasons:a.reasons})}),r.jsx(Na,{quality:a.quality,reasons:a.reasons})]})}function wN({attempt:a}){const l=a.reuseKinds;return l===void 0?r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60 italic",title:"Reuse unknown for this retry — no reuse evidence recorded.",children:"reuse unknown"}):l.length===0?r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60",title:"Cold retry — no prior worktree, commit, or verification was reused.",children:"cold retry"}):r.jsx(r.Fragment,{children:l.map(s=>r.jsxs("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 bg-cyber-teal/10 text-cyber-teal",title:`This retry preserved the prior ${Gd[s]??s} instead of starting cold.`,children:["reused ",Gd[s]??s]},s))})}function SN({attempt:a,isRetry:l}){const s=za(a.setup.durationMs),u=za(a.agentProcess.durationMs),d=za(a.validationPublish.durationMs),f=l&&a.role==="developer";return r.jsxs("li",{className:"py-1.5 border-b border-white/5 last:border-0 space-y-0.5",children:[r.jsxs("p",{className:"text-sm text-white/85",children:[r.jsx("span",{className:"capitalize",children:a.role}),r.jsxs("span",{className:"text-white/45",children:[a.runtime?` · ${a.runtime}`:"",a.model?` · ${a.model}`:"",` · round ${a.round} · ${a.status}`]}),a.publishOnly&&r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-cyber-violet/40 bg-cyber-violet/10 text-cyber-violet-light",title:"Publish-only attempt: no agent process ran — the coordinator published prior work.",children:"publish-only"}),f&&!a.publishOnly&&r.jsx(wN,{attempt:a})]}),r.jsxs("p",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:s?void 0:`Setup unavailable — ${a.setup.reasons.join(", ")||"no reason recorded"}`,children:["Setup ",s??r.jsxs("span",{className:"italic",children:["Unavailable — ",a.setup.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:a.setup.quality,reasons:a.setup.reasons})," · ",r.jsxs("span",{title:u?void 0:`Agent process unavailable — ${a.agentProcess.reasons.join(", ")||"no reason recorded"}`,children:["Agent ",u??r.jsxs("span",{className:"italic",children:["Unavailable — ",a.agentProcess.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:a.agentProcess.quality,reasons:a.agentProcess.reasons})," · ",r.jsxs("span",{title:d?void 0:`Validation/publish unavailable — ${a.validationPublish.reasons.join(", ")||"no reason recorded"}`,children:["Validation/publish ",d??r.jsxs("span",{className:"italic",children:["Unavailable — ",a.validationPublish.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:a.validationPublish.quality,reasons:a.validationPublish.reasons})]}),a.failureCauses.length>0&&r.jsxs("p",{className:"text-[11px] text-white/60",children:["Failures: ",a.failureCauses.map(m=>pf(m.code)).join(", ")]})]})}function jN({analysis:a}){const l=za(a.elapsed.durationMs),s=za(a.exclusiveTotalMs),u=za(a.firstCheckpoint.msSinceWorkflowStart),d=a.nested.filter(R=>R.kind!=="unexplained_silence"),f=a.attempts.flatMap(R=>R.silence),m=a.attempts.length>0&&a.attempts.every(R=>R.silence.length===0&&R.silenceQuality==="unavailable"),x=a.attempts.filter(R=>R.silence.length===0&&R.silenceQuality==="unavailable"),y=a.waste.failedAttempts>0||a.waste.publishOnlyAttempts>0||a.attempts.some(R=>R.failureCauses.length>0||gN.has(R.status)),v=za(a.humanWaitMs),w=a.retry.reuseRate==null?null:`${Math.round(a.retry.reuseRate*100)}% reused`,D=(a.retry.preservedKinds??[]).map(R=>Gd[R]??R),X=a.waste.failedAttempts>0||a.waste.publishOnlyAttempts>0;return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:["Elapsed ",l??r.jsx(cl,{reasons:a.elapsed.reasons}),r.jsx(Na,{quality:a.elapsed.quality,reasons:a.elapsed.reasons})]}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums",title:"Unioned top-level phases with overlaps removed (human wait excluded). Nested waits below explain phases — they are never added to this total.",children:["Exclusive phase total ",s??r.jsx(cl,{reasons:a.exclusiveTotalReasons}),r.jsx(Na,{quality:a.exclusiveTotalQuality,reasons:a.exclusiveTotalReasons}),r.jsx("span",{children:" · overlaps unioned, not summed"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Phase breakdown"}),r.jsx("ul",{children:a.unionedDurations.map(R=>{const $=za(R.durationMs);return r.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 py-0.5 text-sm",children:[r.jsx("span",{className:"text-white/70 w-36 shrink-0",children:vN[R.phase]??R.phase}),r.jsx("span",{className:"text-white/85 tabular-nums",children:$??r.jsx(cl,{reasons:R.reasons})}),r.jsx(Na,{quality:R.quality,reasons:R.reasons}),R.known<R.total&&r.jsxs("span",{className:"text-[11px] text-white/60",children:["(known ",R.known," of ",R.total,")"]})]},R.phase)})}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums mt-1",children:["Human wait ",v??r.jsx(cl,{reasons:a.humanWaitReasons}),r.jsx(Na,{quality:a.humanWaitQuality,reasons:a.humanWaitReasons}),r.jsx("span",{title:"Human wait is tracked separately — it never adds to the phase total.",children:" · never additive"})]}),d.length>0&&r.jsx("ul",{className:"mt-1",children:d.map((R,$)=>r.jsxs("li",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:"Nested drill-down: explains its parent phase, never adds to the total.",children:["↳ ",R.kind==="human_wait"?"Human wait":R.category??R.kind]})," ",za(R.durationMs)??r.jsx(cl,{reasons:R.reasons}),r.jsx(Na,{quality:R.quality,reasons:R.reasons})]},$))})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Attempts (",a.attempts.length,")"]}),a.attempts.length===0?r.jsx("p",{className:"text-xs text-white/45 italic",children:"No attempts recorded yet."}):r.jsx("ul",{children:a.attempts.map((R,$)=>r.jsx(SN,{attempt:R,isRetry:$>0},R.sessionId))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Failure"}),a.primaryFailure?r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(fy,{cause:a.primaryFailure,primary:!0}),a.consequenceCauses.length>0&&r.jsx("div",{className:"space-y-1 opacity-80",children:a.consequenceCauses.map((R,$)=>r.jsx(fy,{cause:R,primary:!1},`${R.code}-${$}`))})]}):y?r.jsxs("p",{className:"text-sm text-white/60 italic",title:Ys("unavailable",a.primaryFailureReasons),children:["Unknown — ",a.primaryFailureReasons.join(", ")||"no failure evidence recorded"]}):r.jsx("p",{className:"text-sm text-white/45",children:"No failure recorded."})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Retry waste (",a.waste.failedAttempts," failed attempt",a.waste.failedAttempts===1?"":"s",")"]}),X?r.jsxs("p",{className:"text-sm text-white/85 flex flex-wrap gap-x-3 gap-y-0.5 tabular-nums",children:[r.jsxs("span",{title:"Failed-attempt agent-process time over known values only",children:["Runtime ",r.jsx(cu,{covered:a.waste.runtimeMs,format:R=>za(Math.round(R))??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt input tokens over known values only",children:["In ",r.jsx(cu,{covered:a.waste.tokensIn,format:R=>cy(R)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt output tokens over known values only",children:["Out ",r.jsx(cu,{covered:a.waste.tokensOut,format:R=>cy(R)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt known cost over known values only",children:["Cost ",r.jsx(cu,{covered:a.waste.costUsd,format:R=>yN(R)??"?",unit:"attempts"})]})]}):r.jsx("p",{className:"text-sm text-white/45",children:"No failed attempts — no retry waste."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"First checkpoint"}),a.firstCheckpoint.msSinceWorkflowStart==null&&a.firstCheckpoint.kind==null?r.jsxs("p",{className:"text-sm text-white/60 italic",title:Ys(a.firstCheckpoint.quality,a.firstCheckpoint.reasons),children:["Unavailable — ",a.firstCheckpoint.reasons.join(", ")||"no checkpoint recorded"]}):r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:[a.firstCheckpoint.kind?pf(a.firstCheckpoint.kind):"Checkpoint",a.firstCheckpoint.observedSha?` · ${a.firstCheckpoint.observedSha.slice(0,12)}`:"",u?` · ${u} after workflow start`:"",r.jsx(Na,{quality:a.firstCheckpoint.quality,reasons:a.firstCheckpoint.reasons})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Retry reuse"}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Retry reuse summary",children:[r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 bg-cyber-teal/10 text-cyber-teal",title:"Retries that preserved prior work — a reused worktree, commit, or verification receipt.",children:["Reused ",a.retry.reused]}),r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60",title:"Retries that started cold — no prior worktree, commit, or verification was reused.",children:["Cold ",a.retry.cold]}),a.retry.unknown>0&&r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60 italic",title:`Unknown reuse for ${a.retry.unknown} retr${a.retry.unknown===1?"y":"ies"} — ${a.retry.reasons.join(", ")||"no reuse evidence"}.`,children:["Unknown ",a.retry.unknown]}),a.retry.publishOnly>0&&r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-violet/40 bg-cyber-violet/10 text-cyber-violet-light",title:"Publish-only retries ran no agent process — the coordinator published already-verified work.",children:["Publish-only ",a.retry.publishOnly]}),r.jsxs("span",{className:"text-[11px] text-white/60 tabular-nums self-center",children:[a.retry.retries===0?"No retries":w??r.jsx(cl,{reasons:a.retry.reasons}),r.jsx(Na,{quality:a.retry.quality,reasons:a.retry.reasons})]})]}),r.jsx("p",{className:"text-[11px] text-white/60 mt-0.5",children:a.retry.retries===0?"No retries — nothing to preserve.":D.length>0?`Preserved: ${D.join(", ")}.`:a.retry.unknown>0?`Preservation unknown for ${a.retry.unknown} retr${a.retry.unknown===1?"y":"ies"} — no reuse evidence.`:"No prior work preserved — every retry started cold."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Silence"}),r.jsx("p",{className:"text-[11px] text-white/60 mb-1",children:"Silence is observational — gaps with no new structured activity. It describes what was observed, never a diagnosis."}),f.length===0?m?r.jsx("p",{className:"text-sm text-white/60 italic",children:"Unknown — silence cannot be derived without agent-process bounds."}):r.jsx("p",{className:"text-sm text-white/45",children:"No silence observed."}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{"aria-label":"Observed silence intervals",children:f.map((R,$)=>r.jsx(bN,{interval:R},$))}),x.length>0&&r.jsx("ul",{"aria-label":"Attempts with unknown silence",className:"mt-1",children:x.map(R=>r.jsxs("li",{className:"text-[11px] text-white/60 italic py-0.5",children:["Silence unknown for attempt ",R.sessionId.length>12?`${R.sessionId.slice(0,8)}…`:R.sessionId," —"," ",R.silenceReasons.join(", ")||"no silence evidence recorded"]},R.sessionId))})]})]})]})}function NN({issueId:a}){const[l,s]=b.useState(null),[u,d]=b.useState(null),[f,m]=b.useState(!0);return b.useEffect(()=>{s(null),d(null),m(!0);let x=!1;return yS(a).then(y=>{x||(s(y),m(!1))}).catch(y=>{x||(/not found/i.test(String(y))?(s(null),d(null)):d(String(y).replace(/^Error:\s*/i,"")),m(!1))}),()=>{x=!0}},[a]),r.jsxs("section",{"aria-labelledby":"execution-analysis-heading",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03]",children:[r.jsx("h3",{id:"execution-analysis-heading",className:"font-ui-display text-sm font-medium text-white/85 mb-2",children:"Execution analysis"}),f&&r.jsx("p",{className:"text-xs text-white/40",children:"Loading execution analysis…"}),!f&&u&&r.jsx("p",{className:"text-xs text-red-300",children:u}),!f&&!u&&!l&&r.jsx("p",{className:"text-xs text-white/45",children:"No execution analysis yet — start the workflow to see where time goes."}),!f&&!u&&l&&r.jsx(jN,{analysis:l})]})}const _N="web";function kN(a){try{const l=JSON.parse(a);return typeof l.text=="string"?l.text:JSON.stringify(l,null,2)}catch{return a}}function Nd(a){const l=Math.floor(a/6e4);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function AN(a){if(!a)return"no heartbeat yet";const l=Math.max(0,Math.floor((Date.now()-new Date(a).getTime())/1e3));return l<5?"just now":l<60?`${l}s ago`:`${Math.floor(l/60)}m ago`}function zs(a){if(!a)return null;const l=a.split(/[/\\]/).filter(Boolean);return l.length<=2?a:l.slice(-2).join("/")}function _d(a){var l;return[a.branch,a.tipLabel,(l=a.worktree)!=null&&l.path?zs(a.worktree.path):null].filter(Boolean).join(" · ")}function kd(a){var l;return[a.restartRisk?"restart risk":null,(l=a.worktree)!=null&&l.preserved?"dirty worktree preserved":null].filter(Boolean).map(s=>` · ${s}`).join("")}function Ad(a){var l;return!!(a.restartRisk||(l=a.worktree)!=null&&l.preserved)}function EN(a,l){return!a||!l?!1:a===l?!0:a.includes(l)}function RN({busy:a,onConfirm:l,onCancel:s}){return r.jsxs("div",{className:"mt-2 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-sm text-white/90 font-medium",children:"Close this issue?"}),r.jsx("p",{className:"text-sm text-white/70",children:"It will not execute. Any queue entry will be removed. History is retained and can be found as closed work — filter the Issues list by status closed or open this page directly."}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm rounded border border-red-400/50 text-red-200 hover:bg-red-500/20 disabled:opacity-50",disabled:a,onClick:l,children:"Close issue"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:s,children:"Keep issue"})]})]})}function CN(a){return a.externalLabel??a.id}function TN(a,l){return a===l}function ON({expectedToken:a,externalLabel:l,busy:s,onConfirm:u,onCancel:d}){const[f,m]=b.useState(""),x=TN(f,a);return r.jsxs("div",{className:"mt-2 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-sm text-white/90 font-medium",children:"Delete this issue from Dealer?"}),r.jsxs("p",{className:"text-sm text-white/70",children:["This permanently deletes the Dealer-local issue — its history, evidence, and files cannot be recovered.",l?` The Linear ticket ${l} will not be deleted.`:" There is no linked Linear ticket to affect."]}),r.jsxs("label",{className:"block text-xs text-white/60",children:["Type ",r.jsx("span",{className:"font-mono text-white/85",children:a})," to confirm",r.jsx("input",{className:"mt-1 block w-full bg-black/30 border border-white/10 rounded px-3 py-1.5 text-sm text-white/90 font-mono",value:f,onChange:y=>m(y.target.value),placeholder:a,autoComplete:"off"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm rounded border border-red-400/50 text-red-200 hover:bg-red-500/20 disabled:opacity-50",disabled:s||!x,onClick:u,children:"Delete from Dealer"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:d,children:"Keep issue"})]})]})}function LN(a){const l=a.externalLabel??a.issueId,s=a.residualPaths.length>0?` ${a.residualPaths.length} Dealer-owned file(s) could not be removed: ${a.residualPaths.join(", ")}`:"";return a.externalLabel?`Issue ${l} deleted from Dealer. The Linear ticket was not deleted.${s}`:`Issue ${l} permanently deleted from Dealer.${s}`}async function MN(a,l){try{await l.patchAutoMerge(a)}catch(s){return l.reportError(s),await l.refresh(),"refused"}return await l.refresh(),"saved"}async function DN(a,l,s){try{const u=await s.removeIssue(a),d=LN({issueId:a,externalLabel:l.externalLabel,residualPaths:u.residualPaths});return s.closeConfirmation(),s.onHumanActionsChanged(),s.navigateToIssues(d),"deleted"}catch(u){return s.closeConfirmation(),s.reportError(u),s.refresh(),"refused"}}const UN="Agents updated. Resume to continue with the new agents.";function zN(a,l,s,u){const d={};return s!==(a??"")&&(d.developerAgentId=s),u!==(l??"")&&(d.reviewerAgentId=u),d}function BN(a){const l=a.humanActions.find(s=>s.status==="open");if(l)return sv(l).title;switch(a.issue.currentOwner){case"developer":return"Waiting on the developer";case"reviewer":return"Waiting on the reviewer";case"human":return"Waiting on you";default:return a.issue.status==="done"||a.issue.status==="closed"?"Complete":"Idle"}}function qN({issueId:a,detail:l,agents:s,onHumanActionsChanged:u,refresh:d,onError:f}){var Oa;const[m,x]=b.useState(null),[y,v]=b.useState({}),[w,j]=b.useState(""),[D,X]=b.useState(!1),[R,$]=b.useState(""),[L,H]=b.useState(""),[F,P]=b.useState(""),[le,V]=b.useState(!1),[Ne,I]=b.useState(null),[ye,De]=b.useState(!1),[yt,Nt]=b.useState(null),[st,ht]=b.useState(!1),[nt,Ze]=b.useState(!1),U=Mu(),[J,ue]=b.useState(!1),[Ae,Me]=b.useState(null),[N,Z]=b.useState({}),[W,ae]=b.useState({}),se=Y=>f(String(Y)),{issue:B,timeline:de,humanActions:Ge,usageSummary:Ue,readiness:Ut,humanWaitMs:Ra,interventionCount:ua,latestWorkflowInstance:$a,activeWorkerSession:Be,liveProgress:Va,latestSessionFailure:ot,branchTipStatus:vt,queued:Tn,queueEntry:$e,capWait:Ya,pendingSnapshotChangedFields:On}=l,tn=s.find(Y=>Y.id===B.developerAgentId),an=tn&&!tn.healthy,tt=((Oa=tn==null?void 0:tn.issues[0])==null?void 0:Oa.message)??"Developer agent is unhealthy",Vl=$a?new Date($a.completedAt??Date.now()).getTime()-new Date($a.startedAt).getTime():0,Ca=Ge.filter(Y=>Y.status==="open"),Ln=B.status==="needs_human"&&Ca.some(Y=>Y.actionType==="attempts_exhausted"||Y.actionType==="policy_escalation"),nn=(Be==null?void 0:Be.status)==="running",Mn=Ca.some(Y=>Y.actionType==="product_scope_decision"),Ht=$a!=null&&$a.completedAt===null,Yl=Ut.ok===!1||Mn&&!nn,qi=B.status==="ready"&&!Ht,Za=Yl||qi,at=B.source==="linear"&&!nn&&(B.status==="ready"&&!Ht||B.status==="needs_human"&&Ht&&Mn),Mt=B.status==="needs_human"&&Ht&&Mn,mt=On??[],oa=Mt&&mt.length>0,We=B.status==="ready"&&!Ht,Dn=(B.status==="ready"||B.status==="done"||B.status==="closed")&&!Ht,Ga=B.status==="ready"&&!Ht,Ta=Be&&Be.status==="running"&&(B.status==="developing"||B.status==="reviewing"||B.status==="repairing"),Qa=!!ot&&!Ta,ca=async()=>{w.trim()&&(await ES(a,w),j(""),d())},Un=()=>{$(B.title),H(B.description??""),P(B.acceptanceCriteria??""),X(!0)},ln=async()=>{V(!0),f(null);try{await Ds(a,{title:R.trim()||void 0,description:L.trim()||null,acceptanceCriteria:F.trim()||null}),X(!1),d()}catch(Y){se(Y)}finally{V(!1)}},Rt=async()=>{V(!0),f(null);try{await wS(a),ue(!1),d()}catch(Y){ue(!1),se(Y),d()}finally{V(!1)}},Zl=async()=>{V(!0),f(null);try{const Y=await Sv(a);I(Y.state==="admitted"?null:`Queued at position ${Y.position}${Y.waitReason?` — ${Y.waitReason}`:""}`),d()}catch(Y){se(Y)}finally{V(!1)}},hl=async()=>{V(!0),f(null);try{await kS(a),d()}catch(Y){se(Y)}finally{V(!1)}},sn=async()=>{V(!0),f(null);try{await jv(a),I(null),De(!1),d()}catch(Y){se(Y),d()}finally{V(!1)}},Hi=async(Y,je,E)=>{V(!0),f(null);try{await Ds(a,{repo:Y,developerAgentId:je,reviewerAgentId:E}),De(!1),d()}catch(ee){De(!1),se(ee),d()}finally{V(!1)}},Gl=async Y=>{V(!0),f(null);try{await MN(Y,{patchAutoMerge:je=>Ds(a,{autoMerge:je}),reportError:se,refresh:d})}finally{V(!1)}},Ql=async(Y,je)=>{V(!0),f(null);try{await Ds(a,zN(B.developerAgentId,B.reviewerAgentId,Y,je)),Nt(UN),d()}catch(E){se(E),d()}finally{V(!1)}},ml=async()=>{V(!0),f(null);try{await jS(a),u(),d()}catch(Y){se(Y)}finally{V(!1)}},zn=async()=>{V(!0),f(null);try{await Nv(a),d()}catch(Y){se(Y)}finally{V(!1)}},pl=async()=>{V(!0),f(null);try{await NS(a),ht(!1),Me("Issue closed — it will not execute. History is retained and can be found as closed work."),d()}catch(Y){se(Y)}finally{V(!1)}},Xl=async()=>{V(!0),f(null);try{await DN(a,{externalLabel:B.externalLabel},{removeIssue:_S,navigateToIssues:Y=>U("/issues",{state:{deletedNotice:Y}}),onHumanActionsChanged:u,closeConfirmation:()=>Ze(!1),reportError:Y=>se(Y),refresh:d})}finally{V(!1)}},rn=async()=>{if(confirm("Abort this workflow? The current worker will stop and the issue will close. History and evidence are kept.")){V(!0),f(null);try{await SS(a),d()}catch(Y){se(Y)}finally{V(!1)}}},$t=async(Y,je,E)=>{V(!0),f(null);try{await _v(Y,_N,je,E),u(),d()}catch(ee){se(ee)}finally{V(!1)}},ct=()=>{m||vS(a).then(x).catch(Y=>se(Y))},_t=Y=>{y[Y]||(v(je=>({...je,[Y]:{content:"",loading:!0}})),gS(a,Y).then(je=>v(E=>({...E,[Y]:{content:je.content,loading:!1}}))).catch(je=>v(E=>({...E,[Y]:{content:"",loading:!1,error:String(je)}}))))};return r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:r.jsxs("div",{className:"max-w-3xl",children:[r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-white/50 hover:text-white mb-3",children:"← Issues"}),r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-white/90",children:B.title}),r.jsxs("p",{className:"text-xs text-white/45 mt-1",children:["Owner: ",r.jsx("span",{className:"capitalize",children:B.currentOwner}),B.currentIntent?` · ${B.currentIntent}`:""]}),r.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-white/40",children:[B.prUrl&&r.jsxs("a",{href:B.prUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:["PR #",B.prNumber]}),B.externalUrl&&r.jsx("a",{href:B.externalUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:B.externalLabel??"External link"}),r.jsxs("span",{children:["Round ",B.currentRound,"/",B.maxReviewRounds]}),r.jsxs("span",{children:["Infra attempts ",B.infraAttempts,"/",B.maxInfraAttempts]}),r.jsxs("span",{title:"Wall-clock time from workflow start to completion (or now)",children:[Nd(Vl)," elapsed"]}),r.jsxs("span",{title:`${Ue.totalTokensIn} in / ${Ue.totalTokensOut} out tokens`,children:["$",Ue.totalCostUsd.toFixed(2)]}),Ra>0&&r.jsxs("span",{title:"Time spent waiting on a human, excluding autonomous processing",children:[Nd(Ra)," human wait"]}),ua>0&&r.jsxs("span",{children:[ua," intervention",ua===1?"":"s"]})]})]}),r.jsx(Mv,{status:B.status})]}),Ae&&r.jsx("div",{className:"mb-4 p-3 rounded border border-white/15 bg-white/[0.04]",children:r.jsx("p",{className:"text-sm text-white/85",children:Ae})}),r.jsx(rN,{issue:B,agents:s,canEdit:Ga,editing:ye,busy:le,onBeginEdit:()=>De(!0),onSave:(Y,je,E)=>void Hi(Y,je,E),onCancel:()=>De(!1),autoMergePolicy:l.autoMergePolicy,onToggleAutoMerge:Y=>void Gl(Y)}),B.executionContract&&r.jsx(uN,{contract:B.executionContract}),r.jsx(cN,{attachments:l.sourceAttachments}),r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/40 flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-white/45",children:"Next"}),r.jsx("p",{className:"text-sm text-white/85",children:BN(l)})]}),Ht&&r.jsx("button",{type:"button",className:"btn-ghost-danger px-3 py-1.5 text-xs shrink-0 disabled:cursor-not-allowed disabled:opacity-60",disabled:le,onClick:rn,children:"Abort workflow"})]}),$e&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5",children:[r.jsxs("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:["Queued · position ",$e.position]}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5",children:$e.waitReason??"Next up — starts as soon as the coordinator ticks"})]}),Ya&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10 flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-xs text-amber-300 font-medium uppercase tracking-wide",children:Ya.kind==="usage_capped"?"Waiting on usage cap":"Waiting on Agent Deck"}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5 break-words",children:Ya.reason}),r.jsxs("p",{className:"text-xs text-white/45 mt-0.5",children:["Wait until ",new Date(Ya.until).toLocaleString()]})]}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1.5 text-xs shrink-0 disabled:opacity-50",disabled:le,title:"Park this issue for a human — cancels the wait without touching the worktree; a resume continues with whichever agents are then set",onClick:ml,children:"Park for human"})]}),Ta&&Be&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/35 bg-cyber-teal/5 space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-cyber-teal animate-pulse","aria-hidden":!0}),r.jsx("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:"Running now"})]}),r.jsxs("p",{className:"text-sm text-white/90",children:[r.jsx("span",{className:"capitalize",children:Be.role}),Be.runtime?` · ${Be.runtime}`:"",Be.model?` · ${Be.model}`:"",` · round ${Be.round}`]}),r.jsxs("p",{className:"text-sm text-[#C4B643] truncate",title:Va??B.currentIntent??"session started",children:["Last progress: ",Va??B.currentIntent??"session started"]}),vt&&r.jsxs("p",{className:`text-xs ${Ad(vt)?"text-amber-300":"text-white/55"}`,title:_d(vt),children:["Branch tip: ",vt.tipLabel,kd(vt)]}),Va&&B.currentIntent&&!/session running/i.test(B.currentIntent)&&!EN(B.currentIntent,Va)&&r.jsx("p",{className:"text-xs text-white/45 truncate",title:B.currentIntent,children:B.currentIntent}),r.jsxs("p",{className:"text-xs text-white/45",children:["Heartbeat ",AN(Be.heartbeatAt),zs(Be.worktreePath)?` · ${zs(Be.worktreePath)}`:""]}),Be.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:Be.logPath,children:["Log: ",zs(Be.logPath)??Be.logPath]})]}),Qa&&ot&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-1.5",children:[r.jsx("p",{className:"text-xs text-red-300 font-medium uppercase tracking-wide",children:"Latest session failure"}),r.jsx("p",{className:"text-sm text-white/90 whitespace-pre-wrap break-words",children:ot.reason}),r.jsxs("p",{className:"text-xs text-white/45",children:[ot.role?r.jsx("span",{className:"capitalize",children:ot.role}):"Worker",ot.outcome?` · ${ot.outcome}`:"",` · ${new Date(ot.when).toLocaleString()}`,` · infra ${ot.infraAttempts}/${ot.maxInfraAttempts}`]}),vt&&r.jsxs("p",{className:`text-xs ${Ad(vt)?"text-amber-300":"text-white/55"}`,title:_d(vt),children:["Branch tip: ",vt.tipLabel,kd(vt)]}),ot.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:ot.logPath,children:["Log: ",zs(ot.logPath)??ot.logPath]})]}),vt&&!Ta&&!Qa&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Branch tip"}),r.jsxs("p",{className:`text-sm ${Ad(vt)?"text-amber-300":"text-white/80"}`,title:_d(vt),children:[vt.tipLabel,kd(vt)]})]}),!Ut.ok&&!Ca.some(Y=>Y.actionType==="product_scope_decision")&&r.jsx("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10",children:r.jsxs("p",{className:"text-xs text-amber-300 font-medium",children:["Not startable yet — missing: ",Ut.missing.join(", ")]})}),Ca.length>0&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-xs text-red-300 font-medium",children:"Human action needed"}),Ca.map(Y=>{const je=Y.actionType==="product_scope_decision";if(Y.actionType==="operator_verification"){const E=zj(Y),ee=W[Y.id]??"",Te=ee.trim().length>0;return r.jsx(qs,{action:Y,hideChoicesHint:!0,children:r.jsxs("div",{className:"space-y-1",children:[r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Result note (required) — paste the probe output, waiver reason, or repair note",value:ee,disabled:le,onChange:Pe=>ae(Vt=>({...Vt,[Y.id]:Pe.target.value}))}),r.jsx("div",{className:"flex flex-wrap gap-2",children:E.map(Pe=>r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs disabled:opacity-50",disabled:le||!Te,title:Te?void 0:"Enter the result note first — the server requires it",onClick:()=>$t(Y.id,Pe.choice,ee),children:Pe.label},Pe.choice))})]})},Y.id)}return je?r.jsx(qs,{action:Y,hideChoicesHint:!0,children:Ut.ok&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Decision note (optional) — shown to the next developer round",value:N[Y.id]??"",disabled:le,onChange:E=>Z(ee=>({...ee,[Y.id]:E.target.value}))}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs",disabled:le,onClick:()=>$t(Y.id,"resume",N[Y.id]),children:"Resume"})]})},Y.id):r.jsx(qs,{action:Y,disabled:le,onChoose:E=>$t(Y.id,E)},Y.id)})]}),Ln&&r.jsx("div",{className:"mb-4",children:r.jsx(Hv,{variant:"parked",agents:s,initialDeveloperId:B.developerAgentId,initialReviewerId:B.reviewerAgentId,busy:le,notice:yt,onSave:(Y,je)=>void Ql(Y,je)},`${B.developerAgentId??""}:${B.reviewerAgentId??""}`)}),oa&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5",children:[r.jsx("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:"Amended contract pending for the next snapshot"}),r.jsxs("p",{className:"text-sm text-white/80 mt-0.5",children:["Changed: ",mt.join(", "),". Resume applies the amended task to the next developer round — the running snapshot is unchanged until then."]})]}),(Za||at)&&!D&&!J&&r.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-1",children:[Za&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",onClick:Un,children:"Edit title / description / acceptance criteria"}),at&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",title:"Pull the latest title, description, and acceptance criteria from the linked Linear ticket — local edits will be replaced",onClick:()=>ue(!0),children:"Reload from Linear"})]}),at&&J&&!D&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5 space-y-2",children:[r.jsxs("p",{className:"text-sm text-white/90 font-medium",children:["Reload the latest task text from Linear",B.externalLabel?` ${B.externalLabel}`:"","?"]}),r.jsxs("p",{className:"text-sm text-white/70",children:["This replaces the local title, description, and acceptance criteria with the latest ticket text. Local edits will be lost."," ",Mt?"The workflow, PR, branch, and open scope decision are preserved — Resume applies the reloaded contract to the next snapshot.":"Repository, agents, and queue position are unchanged, and nothing is written back to Linear."]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:le,onClick:Rt,children:"Reload from Linear"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>ue(!1),children:"Cancel"})]})]}),D&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:R,onChange:Y=>$(Y.target.value),placeholder:"Title"}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:L,onChange:Y=>H(Y.target.value),placeholder:"Description"}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:F,onChange:Y=>P(Y.target.value),placeholder:"Acceptance criteria"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm",disabled:le,onClick:ln,children:"Save"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>X(!1),children:"Cancel"})]})]}),(B.status==="ready"||B.status==="needs_human"&&Ca.length===0)&&r.jsxs("div",{className:"mb-4 space-y-2",children:[an&&r.jsxs("p",{className:"text-sm text-amber-200/90",children:["Fix before Start: ",tt]}),Ne&&r.jsx("p",{className:"text-sm text-amber-200/90",children:Ne}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-2 disabled:opacity-50",disabled:!Ut.ok||le||!!an,title:an?tt:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:Zl,children:"Run next"}),r.jsx("button",{type:"button",className:"px-4 py-2 text-sm border border-cyber-teal/40 rounded text-cyber-teal hover:bg-cyber-teal/10 disabled:opacity-50",disabled:!Ut.ok||le||!!an,title:an?tt:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:sn,children:"Execute now"}),Tn?r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm border border-white/15 rounded text-white/60 hover:text-white disabled:opacity-50",disabled:le,onClick:zn,children:"Remove from queue"}):r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm border border-white/15 rounded text-white/80 hover:border-cyber-teal/50 hover:text-cyber-teal disabled:opacity-50",disabled:le||Ht,title:"Add to queue — append to the end of the admission queue; does not start anything now",onClick:hl,children:"Add to queue"})]}),Tn&&Ga&&!ye&&r.jsx("p",{className:"text-xs text-white/40",children:"Queued — edit repository / agents from the Configuration section above; position is kept."})]}),r.jsx(NN,{issueId:a}),r.jsx("div",{className:"border-t border-white/10 pt-3",children:r.jsx(xN,{events:de})}),r.jsxs("div",{className:"mt-4 flex gap-2",children:[r.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Guide this issue…",value:w,onChange:Y=>j(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&ca()}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:ca,children:"Send"})]}),(We||Dn)&&r.jsxs("details",{className:"mt-6",children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"More actions"}),r.jsxs("div",{className:"mt-2 space-y-2",children:[r.jsxs("p",{className:"text-xs text-white/45",children:[We?"Remove from queue means do not run yet — the issue stays ready and can run later. Close issue means this work is no longer needed — it will never execute, but history is kept.":"This work is finished — there is nothing left to close or abort.",Dn?" Delete from Dealer permanently removes the local issue, its history, and its files.":""]}),We&&(st?r.jsx(RN,{busy:le,onConfirm:()=>void pl(),onCancel:()=>ht(!1)}):r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/50 hover:text-red-300 underline underline-offset-2 disabled:opacity-50",disabled:le,title:"Retire this issue without running it — removes any queue entry, keeps history as closed work",onClick:()=>ht(!0),children:"Close issue"})),Dn&&(nt?r.jsx(ON,{expectedToken:CN(B),externalLabel:B.externalLabel,busy:le,onConfirm:()=>void Xl(),onCancel:()=>Ze(!1)}):r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/50 hover:text-red-300 underline underline-offset-2 disabled:opacity-50",disabled:le,title:"Permanently delete the Dealer-local issue, its history, and its files — the Linear ticket is not deleted",onClick:()=>Ze(!0),children:"Delete from Dealer"}))]})]}),r.jsxs("details",{className:"mt-6",onToggle:Y=>Y.currentTarget.open&&ct(),children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Evidence & raw trace"}),m?r.jsxs("div",{className:"mt-2 space-y-3 text-xs text-white/60",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45 mb-1",children:"Worker sessions"}),m.workerSessions.map(Y=>{const je=m.usageEvents.filter(Pe=>Pe.workerSessionId===Y.id),E=je.reduce((Pe,Vt)=>Pe+(Vt.costUsd??0),0),ee=je.reduce((Pe,Vt)=>Pe+(Vt.tokensIn??0),0),Te=je.reduce((Pe,Vt)=>Pe+(Vt.tokensOut??0),0);return r.jsxs("p",{children:[Y.role," round ",Y.round," · ",Y.status,Y.startedAt&&Y.completedAt?` · ${Nd(new Date(Y.completedAt).getTime()-new Date(Y.startedAt).getTime())}`:"",je.length>0?` · $${E.toFixed(3)} · ${ee}→${Te} tok`:""]},Y.id)}),m.workerSessions.length===0&&r.jsx("p",{className:"text-white/35",children:"None yet."})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45 mb-1",children:"Artifacts"}),m.artifacts.map(Y=>{const je=y[Y.id];return r.jsxs("details",{className:"mb-1.5",onToggle:E=>E.currentTarget.open&&Y.blobPath&&_t(Y.id),children:[r.jsxs("summary",{className:"cursor-pointer hover:text-white/80",children:[Y.kind," · ",new Date(Y.createdAt).toLocaleString()]}),r.jsxs("div",{className:"mt-1 pl-3 border-l border-white/10 space-y-1",children:[Y.contentJson&&r.jsx("pre",{className:"whitespace-pre-wrap break-words text-white/55",children:kN(Y.contentJson)}),Y.blobPath&&r.jsxs("div",{children:[r.jsxs("p",{className:"text-white/40",children:["Raw trace: ",Y.blobPath]}),(je==null?void 0:je.loading)&&r.jsx("p",{className:"text-white/35",children:"Loading trace…"}),(je==null?void 0:je.error)&&r.jsx("p",{className:"text-red-300/80",children:je.error}),je&&!je.loading&&!je.error&&r.jsx("pre",{className:"mt-1 max-h-64 overflow-y-auto whitespace-pre-wrap break-words text-white/50 bg-black/20 rounded p-2",children:je.content||"(empty)"})]}),!Y.contentJson&&!Y.blobPath&&r.jsx("p",{className:"text-white/35",children:"No content recorded."})]})]},Y.id)}),m.artifacts.length===0&&r.jsx("p",{className:"text-white/35",children:"None yet."})]})]}):r.jsx("p",{className:"text-xs text-white/40 mt-2",children:"Loading…"})]})]})})}function HN(){let a=0,l=0;return{run(s,u,d){const f=++a;return s().then(m=>{f<=l||(l=f,u(m))},m=>{f<=l||(l=f,d(m))})},invalidate(){l=a}}}function $N({issueId:a,agents:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=b.useState(!1),v=b.useRef(HN()).current,w=()=>v.run(()=>wv(a),j=>{d(j),m(null),y(!1)},j=>{const D=String(j).replace(/^Error:\s*/i,"").trim();/^not found$/i.test(D)?(y(!0),m(null),d(null)):(m(D),y(!1))});return b.useEffect(()=>{d(null),m(null),y(!1),v.invalidate(),w();const j=setInterval(()=>void w(),4e3);return()=>clearInterval(j)},[a]),x?r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:r.jsxs("div",{className:"max-w-md space-y-3",children:[r.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Issue not found"}),r.jsx("p",{className:"text-sm text-white/55",children:"No issue exists for this ID — it may have been deleted, or the link is wrong."}),r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})}):f?r.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-6 space-y-3",children:[r.jsx("p",{className:"text-red-300 text-sm",children:f}),r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]}):u?r.jsx(qN,{issueId:a,detail:u,agents:l,onHumanActionsChanged:s,refresh:w,onError:j=>m(j)},a):r.jsx("div",{className:"p-6 text-white/50 text-sm",children:"Loading…"})}function VN(){return r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:r.jsxs("div",{className:"max-w-md space-y-3",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Page not found"}),r.jsx("p",{className:"text-sm text-white/55",children:"That URL is not a destination in Agent Dealer."}),r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})})}function YN(){return r.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0 overflow-hidden","aria-hidden":!0,children:[r.jsx("div",{className:"absolute top-16 left-12",children:r.jsx("div",{className:"ambient-orb ambient-orb-a w-[26rem] h-[26rem] rounded-full bg-cyan-500/10 blur-3xl"})}),r.jsx("div",{className:"absolute bottom-20 right-12",children:r.jsx("div",{className:"ambient-orb ambient-orb-b w-[26rem] h-[26rem] rounded-full bg-pink-500/10 blur-3xl"})}),r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:r.jsx("div",{className:"ambient-orb ambient-orb-c w-[22rem] h-[22rem] rounded-full bg-blue-500/[0.07] blur-3xl"})})]})}function ZN({className:a="w-5 h-5"}){return r.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:a,"aria-hidden":!0,children:[r.jsx("circle",{cx:"6.75",cy:"6.25",r:"3.25"}),r.jsx("circle",{cx:"13.5",cy:"6.75",r:"2.85",opacity:"0.85"}),r.jsx("path",{d:"M1.75 16v-1.1c0-2.35 1.928-4.25 4.3-4.25 1.16 0 2.21.456 3 1.2.79-.744 1.84-1.2 3-1.2 2.372 0 4.3 1.9 4.3 4.25V16H1.75z"})]})}const GN="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAN5UlEQVR4AeydXagdVxmGF7loIKSpN/WHttqKktpAvWkVoRctp4gRtf4QbxRrREEb0wtRGkRovLCmKC1Y641CFGpBCtpIsVfHRvAm5KpIrMGfCCJUa8GmTWl6k+5nznlPvzOZ2Xtmz5o1a/Z8Ie/+vjU/a6351nPe/Xv22bFr185LLq9BbAZ2BP/nFeihAg5WD0X1LkNwsJyCXirgYPVSVu/UwXIGeqmAg9VLWTPsNPGUHKzEBZ/KcA7WVFY68XU6WIkLPpXhHKyprHTi63SwEhc89nDv37cndpdR+nOwopQxfScA9dDRfQGRM4O1ew+Fd3/wVtLB5WANtgTLDQxEwITI6eXoDz8dHvjrmbB2+J6ZDrFpcDlYgy9BswkAETAhcnvWnlfOBsS2G2aOlYNrOVisRsYCImBC5HVTveb5327tWjs8vGs5WFvLkVcCRMCEyO3szu/ea5tFjmMhGjm4loPFSmQkIAImRG6nBlDPvedbAZHbfeQ5uZaDxYpkICACJkRupwREwIR+c3w9fPu9+8LRb/7aHlLkOBaiMbRrOViswoACImBC5HYqVUCt/+jR4pBnz5wPqGiYm1xcy8F6c1GSZkAETIjcDj4PKHvcL574l20WuRyLxpCu5WCxAgkFRMCEyO3QTYHSOTgWUlvx2gyeITpYWo2eIxABEyK3w7UFyp5b5Vr27nAo13Kw7Cr1kAMRMCFyO0QXoNQPjoXUVhzatRwsrUTkCETAhMht9zGAsv3l6FoOll2hCDkQARMit13GBkp941hIbcUhXcvB0ip0jEAETIjcdtcXUHaM3Fwra7Bs4XLNgQiYELmdZwqgNB6OhdRWHMq1HCytQMsIRMCEyO3pKYGy4+bkWg6WXZkGORABEyK3pwwFlOaAYyG1FYdwLQdL1V8QgQiYELk93AJ16dyt4R2PXxNueXm/PSRZnotrOVgLlhyIgAmR28MtULw5/NID58LuP11ZHHLj9bcFVDQS3uBYqDxkatdysMorsNkGImBC5Jubi1AGik8b8ObwiWeOFft1c9cdR5QmjTm4loNVWnIgAiZEbnfXAaVj/vLPPwakNo6F1E4VcSxUHi+la7UDqzzTFWsDE2oLlC2Du9ZGNRysjTrU3sqliOdOnQ7c5dUePNuBY6FZWvzHsVDRSHiDY6HykKlcy8EylT91+l2mtZHy+SZEq+knBdy1gn+jH8DgKPcdfCp85AOPh4uv3symbbIfQ2nyGzA4FlIn9I/UThVxLFQeL4VrTdqxWGyAQhQfGF564XOk24RjITa6a1GFxZokWGWgHjz+sYC4C3vtws0r5Vp1CPTtWpMCqw4onIoFIKJVcC2e2fIMF3FtVjwRQdpW4cLatXScBFiLgLLVS+lad3/2urD+xIcCENg5dMnpC5gQue2Lx49/3/Odyt9LbPLY0fa1KF9psNoApULhWKhP1xJQXzhwbTHs3QeuK2KXGyACJkRu++IB/DeOngl/OPnxcOncLXbXVh7btVYSrGWA2qrwLDk7ewW9j8daV139y/Dhj34vCKjZUMV/QEBFo+UN5wETIrenCyigIseNr/jPznDFf3faw7bymK61UmB1BUoVfnLzPb9YrvX8ha+Fd960P1x19WMa4rLY1rWACJgQue0QiIAJkWsfToyu3HyjXNsVY7rWSoAVCygVmHji5LHQ1bXKd3n0WyfgQHX7tZ1jgAmRazsRiIAJkbOtrFSuNWqw+gBKC9HVtVj08l0effNsjO9gINK2muda9AdMiNyeB0TAhMjtvnKOY6G+XWuUYPUJlF2ILq718u69oQoe+mf7v9/+CdJtAhhkN9IGJkRu9wERMCFyu29ensK1RgVWKqC0KMu4Ft+m95XHfh6+PFMVPLyCj4ALaSxFuRYQARMi134iEAETImdbG+FYqE/XGgVYqYGyi9TGtQQUD4Lpg0VH5FZ677EKPCACJkRuz6MvYELkdl/bvG/XyhqsIYHSQrVxLQHFx2t+9vkvhp/OVPVpThwL4VhIYyn2CZTGwLFQX66VJVg5AKUFIDZ1LY4VUP84dZpm8R1WVe4i1+KxWHFgxQ3n4U6IvOKQTpv6dK2swMoNKK1aU9fS8eVY51rv+9sPggArnwNIfQGlsXAs1IdrZQFWrkBpAYi4FndbiLaVhaPq1WsgQfYccu4OiUOqL9caFKwxAKVFx7V4O+SFHQc2NplbAEFs4nEWzwzJrZ7983nbrM0Bl9e5fvz0rtpjYu7AsVBs1xoErDEBZRcR1+JNXBbfbievcy0eiPMMr+rFUs6T6BOgfvfi7eGhr34/6DGa9vcZ+3CtpGCNFSgtahvX+tSX7iz+zg1QAZf6KMcyUDyTTAkV88GxUEzXSgLW2IGi+NIi19rzytnAg/Kv779w2eesgAjRF9E61BBAMQ8ptmv1CtYqAaUFWORaQAVcOp4oiACJF0WJussbGijmh3AsFMu1egFrFYGi+NI819IxRAsUOdt4dshjqFyAYk5STNeKCtaqA6UFmOdaHANEuBIiZ5t9NT71YyjGbyIcC8VwrShg5QFUk9LFO6bKtYAImBC5Riu/Gq/tOcZYrtUJrCkCJRisawERMCFyHTPGiGOhrq61FFhTBsrCgms99/vXKn/rxR5X9Wq83Z9bHsO1WoHlQG1HANd6+MHPBB4/ofVHfrL9gM1W3avxm7uzCzgW6uJajcByoOavPc/wEN9EA2BVR0/NteaC5UBVITJ/2/ojj1YeMDXXqgTLgapko9FGXkpw1yp9jVFkoBotxCoeNCXXqlu/wrEsUOQ82+HbV3gAV3eib6+vwKRc695DlYUowGIPQBHR3utvI7g6VGAqrrV2+J7KKhVg4UxIRwAZUttj+wpM3bUKsCgbL4oRpaG+o1zjr0KcsmttgYVjIS0ojoXU9ti+AlN2rS2wKJu7FlWIq0m41qxk5cda28DCsdDsuOI/joWKht8sVYGputY2sKicuxZViKsputZlYOFYSKXFsZDaHttXYIqudRlYlM1diyrE1dRcqxIsHAuptDgWUttj+wpMzbUqwaJs7lpUIa6m5Fq1YOFYSKXFsZDaHttXIJ1rtZ9b2zMwHr5yoOobmPl0Ry1YDMTJRMlfjVcllo+r4lqvv+1iePHO/4XX33pxqxgApV8cmQsWjoV0Jo6F1PbYvgJjdy2+8ETfXCioLFBcH1WZCxYHuGtRhbgao2tZoPg0LBWpAortaCFYOBbiYIRjIXLXchXgp5pFqTp77XD155uqjk2xrS1QmtNCsDjQXYsqxFXurrUsUKpSI7BwLKSTcCyktsf2FcjVtboCpUo0AouD3bWowtKqPDEn14oFlC60MVg4FtKJOBZS22P7CuTgWrGBUhUag8UJ7lpUIa6Gcq2+gFJ1WoGFYyGdjGMhtT22r0Bq1+obKFWgFVic5K5FFeIqhWulAkqVaQ0WjoXUAY6F1PbYvgJ9ulZqoHT1rcHiRHctqhBXsV1rKKBUlaXAwrGQOsGxkNpjiLnNMZZrDQ2U6roUWJzsrkUV4qqLa+UClCqyNFg4FlJHOBZS22P7CizjWrkBpateGiw6cNeiCnHV1LVyBUrV6AQWjoXUGY6F1PbYvgKLXCt3oHTFncCiE3ctqhBX81yLvzXd5PNQcWfUvrfOYOFYSEPjWEhtj+0rMM+16I3PcukjwBzLttzUGSwuKIpr0ZFrqwJVrjUGoHQBUcDCsZA6xbGQ2h7bVYDaHbjp/qDfgBkTULrSKGDRmbsWVegmgLrv4FMB0RNf7537XR7zrFI0sHAspEEoElLbY30FqBMwIY7i+1/R0796OOlfWmXsWIoGFhNy16IKzVUHlP0Bbd5bXkdGBYuCIF0ihUNqe9yoADXBnRBbcCdka8f2MSsqWBTCXYsqVGsKQOnK54ClQ9pFfuqQzqKYSO0pRq4fd0JcP+6EbJ3YvkqKDhbFcdeiCiFMEaiNKy/9yRNt7Br5SUTqhwIjtVc9cq24E+JacSdka8L2VVYvjkXBpuhaDhQrv6HewOKnE20Ms3G3QOHVXqXIdeFOiOvCnZC9frZPSb2BRRFX3bUcKFa5Wr2CxU8s0tAsBFJ7rJFrwJ0Q14A7IXutbB+L+phnr2Ax4VVyLQeKFW2m3sHipxhpOiwOUnsMkfniToj54k7IXhfbXW9WoHewGGqsruVAsXrLKQlY/GQjTZEFQ2rnFpkb7oSYG+6E7DWw3VVfgSRgMfwYXOuTdxwJx7/7/63PQwETcqBYwXZKBhaLgzQ9XAGpPWQUUHfdfiQwR2BC5EPOa8xjJwOLIpVd68Ybhv3b09kCRbFGrqRg4QBINcMhlKeMDlT/1U4KFpdTdi0Wme0pxFg8hgJoAOfuDpGnGH9KYyQHi0VEKjKLrLyv6ED1Vdn6fpODxVRSuZYDRbWH0SBg4VhIlxzbtSxQJ04eCwfvf0vwuzxVO00cBCwurQ/XqgLqyWeOMZwrcQUGAwvHQrreLq7VP1CapcemFRgMLCbY1bUcKKqYpwYFC8dCKk1T13KgVLF846BgUZY2ruVAUbFxaHCwcCykclW5lgOl6ownDg4WpapzLQeK6oxTWYCFYyGVENfSWy96HcpfNlB1xhGzAItSlV1rAVCc4sq4AtmAhWMhBypjWlpMLRuwmDNvu/hdHpUYv7ICa/zl9CtQBRwsVcJj1Ao4WFHL6Z2pAg6WKuExagWigRV1Vt7Z6CvgYI1+CfO8AAcrz3UZ/awcrNEvYZ4X4GDluS6jn5WDNfolzPMCHKw81yXjWTWb2hsAAAD//0DhVxwAAAAGSURBVAMA8NLI/5AoLlwAAAAASUVORK5CYII=";function QN({className:a="",size:l=36}){return r.jsx("img",{src:GN,alt:"",width:l,height:l,className:`shrink-0 object-contain ${a}`,"aria-hidden":!0,draggable:!1})}const Tu={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},du="5H",fu="1W",XN=new Set(["claude_code","codex_local","muse_code"]),hy="billing_cycle",$v="1M",IN=new Set(qt.options),my={critical:"font-medium text-red-300",warning:"font-medium text-yellow-300",normal:"font-medium text-white/75"};function KN(a){return{fiveHour:a.find(l=>l.criticalRole==="five_hour")??null,weekly:a.find(l=>l.criticalRole==="weekly")??null}}function Vv(a,l,s){if(a.unavailableReason!==null)return a.unavailableReason;if(a.remainingPercent===null||a.source==="unavailable")return s??"missing";if(a.resetAt!==null){const u=Date.parse(a.resetAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(a.freshUntil!==null){const u=Date.parse(a.freshUntil);if(!Number.isFinite(u)||u<=l)return"stale"}if(a.expiresAt!==null){const u=Date.parse(a.expiresAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(a.observedAt){const u=Date.parse(a.observedAt);if(!Number.isFinite(u)||u>l+6e4)return"stale"}return s??"missing"}function py(a,l,s,u,d=null){if(rv(a,l)){const m=Math.round(a.remainingPercent??0),x=a.resetAt?`, resets ${new Date(a.resetAt).toLocaleString()}`:"",y=d?`, ${d}`:"";return`${u}: ${m}% available (${100-m}% used${y}${x})`}const f=Ev(a);return f!==null?`${u}: N/A (${f})`:`${u}: N/A (${Tu[Vv(a,l,s)]})`}function Qd(a,l,s,u,d,f=null){if(rv(a,s)){const x=a.remainingPercent??0;return{key:a.windowKey,label:d,kind:"known",remaining:Math.round(x),rawRemaining:x,detail:py(a,s,l.unavailableReason,d,f),isCritical:u}}const m=Vv(a,s,l.unavailableReason);return{key:a.windowKey,label:d,kind:"unknown",reason:m,detail:py(a,s,l.unavailableReason,d,f),isCritical:u}}function xy(a,l){const s=l.unavailableReason??"missing";return{key:`missing:${a}`,label:a,kind:"unknown",reason:s,detail:`${a}: N/A (${Tu[s]})`,isCritical:!0}}function JN(a,l,s){return Qd(a,l,s,!0,$v,"current billing cycle")}function Ed(a,l,s){return{key:a,label:l,kind:"known",remaining:0,rawRemaining:0,detail:`${l}: 0% available (${Zu(s)})`,isCritical:!0}}function Rd(a,l,s){const u="capped window not identified";return{runtime:a,runtimeKey:l,windows:[{key:"capped",label:"capped",kind:"capped",detail:u,isCritical:!0}],exhausted:!0,activeCap:s,detail:u}}function FN(a,l=Date.now()){return a.runtimes.map(s=>{const u=ia(s.runtime),d=s.runtime,f=kv(s,l);if(s.runtime==="cursor_local"){const m=s.windows.find(y=>y.windowKey===hy)??null;if(f!==null&&f.windowRole!=="billing_cycle")return Rd(u,d,f);if(f===null&&m===null)return{runtime:u,runtimeKey:d,windows:[],exhausted:!1,activeCap:null,detail:`N/A (${Tu[s.unavailableReason??"missing"]})`};const x=f!==null?Ed((m==null?void 0:m.windowKey)??hy,$v,f):JN(m,s,l);return{runtime:u,runtimeKey:d,windows:[x],exhausted:x.kind==="known"&&x.rawRemaining===0,activeCap:f,detail:x.detail}}if(XN.has(s.runtime)){if(f!==null&&f.windowRole!=="five_hour"&&f.windowRole!=="weekly")return Rd(u,d,f);const{fiveHour:m,weekly:x}=KN(s.windows),y=(f==null?void 0:f.windowRole)==="five_hour"?Ed((m==null?void 0:m.windowKey)??`missing:${du}`,du,f):m!==null?Qd(m,s,l,!0,du):xy(du,s),v=(f==null?void 0:f.windowRole)==="weekly"?Ed((x==null?void 0:x.windowKey)??`missing:${fu}`,fu,f):x!==null?Qd(x,s,l,!0,fu):xy(fu,s),w=[y,v],j=w.some(X=>X.kind==="known"&&X.rawRemaining===0),D=w.map(X=>X.detail).join("; ");return{runtime:u,runtimeKey:d,windows:w,exhausted:j,activeCap:f,detail:D}}return f!==null?Rd(u,d,f):{runtime:u,runtimeKey:d,windows:[],exhausted:!1,activeCap:null,detail:`N/A (${Tu[s.unavailableReason??"missing"]})`}})}function yy(a){return a.activeCap!==null?`${a.runtime} ${Zu(a.activeCap)}: ${a.detail}`:a.exhausted?`${a.runtime} exhausted — a capacity window is at 0%: ${a.detail}`:`${a.runtime}: ${a.detail}`}function WN({state:a,nowMs:l}){if(a.status==="loading")return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":"loading",title:"Agent capacity is loading",className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-2 gap-y-1 whitespace-nowrap text-xs text-white/40",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),r.jsx("span",{"aria-live":"polite",children:"loading…"})]});if(a.status==="unavailable")return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":"unavailable",title:"Agent capacity is unavailable — the capacity read failed",className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-2 gap-y-1 whitespace-nowrap text-xs text-white/40",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),r.jsx("span",{children:"unavailable"})]});const s=FN(a.data,l),u=s.length===0||s.every(d=>!d.windows.some(f=>f.kind==="known"));return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":u?"unknown":"ready",title:s.length===0?"Agent capacity: no runtime accounts reported":s.map(yy).join(" · "),className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),s.length===0?r.jsx("span",{className:"whitespace-nowrap text-white/35",children:"N/A"}):s.map(d=>{const f=d.windows.some(m=>m.kind==="known");return r.jsxs("span",{"data-testid":`topbar-capacity-${d.runtime}`,"data-known":f?"true":"false","data-exhausted":d.exhausted?"true":"false",title:yy(d),role:"group","aria-label":`${IN.has(d.runtimeKey)?d.runtime:"Unknown runtime"} capacity`,className:d.exhausted?"inline-flex items-center gap-1.5 whitespace-nowrap rounded border border-red-400/40 bg-red-500/10 px-1.5 py-0.5":"inline-flex items-center gap-1.5 whitespace-nowrap",children:[r.jsx(Tv,{runtime:d.runtimeKey,className:"h-4 w-4 shrink-0"}),d.windows.length===0?r.jsx("span",{className:"text-white/35",children:"N/A"}):r.jsx("span",{className:"inline-flex flex-col leading-tight",children:d.windows.map(m=>m.kind==="capped"?r.jsx("span",{"data-window":"capped","data-window-known":"false",className:"inline-flex items-center gap-1 whitespace-nowrap",children:r.jsx("span",{"data-severity":"critical",className:my.critical,children:m.label})},m.key):r.jsxs("span",{"data-window":m.label,"data-window-known":m.kind==="known"?"true":"false",className:"inline-flex items-center gap-1 whitespace-nowrap tabular-nums",children:[r.jsx("span",{className:"text-white/40",children:m.label}),m.kind==="known"?(()=>{const x=Av(m.rawRemaining);return r.jsxs("span",{"data-severity":x,className:my[x],children:[m.remaining,"%"]})})():r.jsx("span",{className:"text-white/35",children:"N/A"})]},m.key))})]},d.runtime)})]})}const vy=5e3;function Cd({isActive:a}){return`font-ui-display px-3 py-2 text-base rounded ${a?"bg-cyber-teal/20 text-cyber-teal":"text-white/60 hover:text-white"}`}function PN({agents:a,onHumanActionsChanged:l}){const{issueId:s}=Xb();return s?r.jsx($N,{issueId:s,agents:a,onHumanActionsChanged:l},s):r.jsx(zy,{to:"/issues",replace:!0})}function e_({openHumanActionCount:a,agentCount:l,agentIssueCount:s,capacity:u={status:"loading"}}){return r.jsxs("header",{className:"px-6 py-3 border-b border-white/10 flex flex-wrap gap-4 items-center justify-between glass-header shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-6",children:[r.jsxs(sa,{to:"/issues",className:"flex items-center gap-3 text-left rounded hover:opacity-90 transition-opacity focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45","aria-label":"AgentDealer — go to Issues",title:"AgentDealer — go to Issues",children:[r.jsx(QN,{size:40}),r.jsx("h1",{className:"font-mono text-xl font-bold sm:text-2xl",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDealer"})]}),r.jsxs("nav",{className:"flex gap-1",children:[r.jsxs(pu,{to:"/issues",className:Cd,children:["Issues",a>0&&r.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-0.5 font-mono text-xs leading-none bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded tabular-nums border border-red-400/30 align-middle",title:`${a} open human action${a===1?"":"s"}`,children:[r.jsx(Ru,{className:"w-3 h-3 shrink-0"}),a]})]}),r.jsx(pu,{to:"/reports/execution",className:Cd,children:"Reports"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 min-w-0",children:[r.jsx(WN,{state:u}),r.jsxs(pu,{to:"/agents",className:({isActive:d})=>`${Cd({isActive:d})} inline-flex items-center gap-1.5 transition-colors`,"aria-label":"Agents",title:"Agents",children:[r.jsx(ZN,{className:"w-6 h-6 shrink-0"}),r.jsx("span",{children:"Agents"}),l>0&&r.jsx("span",{className:"font-mono text-xs leading-none bg-white/10 text-white/55 px-1.5 py-0.5 rounded tabular-nums border border-white/10",title:`${l} configured agent${l===1?"":"s"}`,children:l}),s>0&&r.jsxs("span",{className:"inline-flex items-center gap-0.5 font-mono text-xs leading-none bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded tabular-nums border border-red-400/30",title:`${s} need${s===1?"s":""} attention`,children:[r.jsx(Ru,{className:"w-3 h-3 shrink-0"}),s]})]})]})]})}function t_(){const[a,l]=b.useState([]),[s,u]=b.useState(0),[d,f]=b.useState(!1),[m,x]=b.useState([]),[y,v]=b.useState({status:"loading"}),w=b.useCallback(()=>{uS().then(({agents:R,issueCount:$})=>{l(R),u($)}).catch(console.error),bv().then(R=>f(R.connected)).catch(()=>f(!1)),gv().then(R=>v({status:"ready",data:R})).catch(()=>v({status:"unavailable"}))},[]),j=b.useCallback(()=>CS().then(x).catch(()=>{}),[]);b.useEffect(()=>{w();const R=setInterval(w,vy);return()=>clearInterval(R)},[w]),b.useEffect(()=>{j();const R=setInterval(()=>void j(),vy);return()=>clearInterval(R)},[j]);const D=m.length,X=a.length;return r.jsxs(r.Fragment,{children:[r.jsx(YN,{}),r.jsxs("div",{className:"relative z-10 min-h-screen flex flex-col",children:[r.jsx(e_,{openHumanActionCount:D,agentCount:X,agentIssueCount:s,capacity:y}),r.jsx("main",{className:"flex-1 flex overflow-hidden",children:r.jsxs(u1,{children:[r.jsx(Ll,{path:"/",element:r.jsx(zy,{to:"/issues",replace:!0})}),r.jsx(Ll,{path:"/issues",element:r.jsx(Xj,{agents:a,humanActions:m,onHumanActionsChanged:j})}),r.jsx(Ll,{path:"/issues/:issueId",element:r.jsx(PN,{agents:a,onHumanActionsChanged:j})}),r.jsx(Ll,{path:"/agents",element:r.jsx(aj,{agents:a,agentDeckOnline:d,onRefresh:w})}),r.jsx(Ll,{path:"/reports/execution",element:r.jsx(lN,{})}),r.jsx(Ll,{path:"*",element:r.jsx(VN,{})})]})})]})]})}function a_(){return typeof document>"u"?Promise.resolve():document.fonts.load('13px "Monaco"').then(()=>{}).catch(()=>{})}a_();rb.createRoot(document.getElementById("root")).render(r.jsx(b.StrictMode,{children:r.jsx(L1,{children:r.jsx(t_,{})})}));
|