agent-dealer 1.3.2 → 1.3.3
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/agent-health.test.js +52 -0
- package/bundle/server/dist/capacity/service.js +66 -6
- package/bundle/server/dist/capacity/service.test.js +220 -0
- package/bundle/server/dist/db/index.js +8 -0
- package/bundle/server/dist/db/schema.sql +5 -1
- package/bundle/server/dist/repository/runtime-availability.js +29 -11
- package/bundle/server/dist/runners/usage-cap.js +66 -15
- package/bundle/server/dist/runners/usage-cap.test.js +96 -2
- package/bundle/server/package.json +2 -2
- package/bundle/server/static-ui/assets/index-B_pNUDRY.js +64 -0
- package/bundle/server/static-ui/index.html +1 -1
- package/bundle/shared/dist/runtime-capacity.d.ts +85 -0
- package/bundle/shared/dist/runtime-capacity.js +19 -0
- package/bundle/shared/package.json +1 -1
- package/package.json +1 -1
- package/bundle/server/static-ui/assets/index-DQ5ivcyg.js +0 -64
|
@@ -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:{}},Cs={};/**
|
|
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 rx;function F0(){if(rx)return Cs;rx=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 Cs.Fragment=l,Cs.jsx=s,Cs.jsxs=s,Cs}var ux;function W0(){return ux||(ux=1,td.exports=F0()),td.exports}var r=W0(),ad={exports:{}},ge={};/**
|
|
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 ox;function P0(){if(ox)return ge;ox=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 C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,L={};function H(N,Y,W){this.props=N,this.context=Y,this.refs=L,this.updater=W||C}H.prototype.isReactComponent={},H.prototype.setState=function(N,Y){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,Y,"setState")},H.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function F(){}F.prototype=H.prototype;function P(N,Y,W){this.props=N,this.context=Y,this.refs=L,this.updater=W||C}var ne=P.prototype=new F;ne.constructor=P,$(ne,H.prototype),ne.isPureReactComponent=!0;var V=Array.isArray;function _e(){}var I={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function Ue(N,Y,W){var te=W.ref;return{$$typeof:a,type:N,key:Y,ref:te!==void 0?te:null,props:W}}function gt(N,Y){return Ue(N.type,Y,N.props)}function At(N){return typeof N=="object"&&N!==null&&N.$$typeof===a}function rt(N){var Y={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(W){return Y[W]})}var mt=/\/+/g;function nt(N,Y){return typeof N=="object"&&N!==null&&N.key!=null?rt(""+N.key):Y.toString(36)}function Ge(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(_e,_e):(N.status="pending",N.then(function(Y){N.status==="pending"&&(N.status="fulfilled",N.value=Y)},function(Y){N.status==="pending"&&(N.status="rejected",N.reason=Y)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function U(N,Y,W,te,re){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),Y,W,te,re)}}if(de)return re=re(N),de=te===""?"."+nt(N,0):te,V(re)?(W="",de!=null&&(W=de.replace(mt,"$&/")+"/"),U(re,Y,W,"",function(Bt){return Bt})):re!=null&&(At(re)&&(re=gt(re,W+(re.key==null||N&&N.key===re.key?"":(""+re.key).replace(mt,"$&/")+"/")+de)),Y.push(re)),1;de=0;var Qe=te===""?".":te+":";if(V(N))for(var ze=0;ze<N.length;ze++)te=N[ze],B=Qe+nt(te,ze),de+=U(te,Y,W,B,re);else if(ze=X(N),typeof ze=="function")for(N=ze.call(N),ze=0;!(te=N.next()).done;)te=te.value,B=Qe+nt(te,ze++),de+=U(te,Y,W,B,re);else if(B==="object"){if(typeof N.then=="function")return U(Ge(N),Y,W,te,re);throw Y=String(N),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return de}function J(N,Y,W){if(N==null)return N;var te=[],re=0;return U(N,te,"","",function(B){return Y.call(W,B,re++)}),te}function ue(N){if(N._status===-1){var Y=N._result;Y=Y(),Y.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=Y)}if(N._status===1)return N._result.default;throw N._result}var Ce=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=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(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},De={map:J,forEach:function(N,Y,W){J(N,function(){Y.apply(this,arguments)},W)},count:function(N){var Y=0;return J(N,function(){Y++}),Y},toArray:function(N){return J(N,function(Y){return Y})||[]},only:function(N){if(!At(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ge.Activity=j,ge.Children=De,ge.Component=H,ge.Fragment=s,ge.Profiler=d,ge.PureComponent=P,ge.StrictMode=u,ge.Suspense=y,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ge.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},ge.cache=function(N){return function(){return N.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(N,Y,W){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var te=$({},N.props),re=N.key;if(Y!=null)for(B in Y.key!==void 0&&(re=""+Y.key),Y)!ye.call(Y,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&Y.ref===void 0||(te[B]=Y[B]);var B=arguments.length-2;if(B===1)te.children=W;else if(1<B){for(var de=Array(B),Qe=0;Qe<B;Qe++)de[Qe]=arguments[Qe+2];te.children=de}return Ue(N.type,re,te)},ge.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},ge.createElement=function(N,Y,W){var te,re={},B=null;if(Y!=null)for(te in Y.key!==void 0&&(B=""+Y.key),Y)ye.call(Y,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(re[te]=Y[te]);var de=arguments.length-2;if(de===1)re.children=W;else if(1<de){for(var Qe=Array(de),ze=0;ze<de;ze++)Qe[ze]=arguments[ze+2];re.children=Qe}if(N&&N.defaultProps)for(te in de=N.defaultProps,de)re[te]===void 0&&(re[te]=de[te]);return Ue(N,B,re)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(N){return{$$typeof:x,render:N}},ge.isValidElement=At,ge.lazy=function(N){return{$$typeof:w,_payload:{_status:-1,_result:N},_init:ue}},ge.memo=function(N,Y){return{$$typeof:v,type:N,compare:Y===void 0?null:Y}},ge.startTransition=function(N){var Y=I.T,W={};I.T=W;try{var te=N(),re=I.S;re!==null&&re(W,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(_e,Ce)}catch(B){Ce(B)}finally{Y!==null&&W.types!==null&&(Y.types=W.types),I.T=Y}},ge.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ge.use=function(N){return I.H.use(N)},ge.useActionState=function(N,Y,W){return I.H.useActionState(N,Y,W)},ge.useCallback=function(N,Y){return I.H.useCallback(N,Y)},ge.useContext=function(N){return I.H.useContext(N)},ge.useDebugValue=function(){},ge.useDeferredValue=function(N,Y){return I.H.useDeferredValue(N,Y)},ge.useEffect=function(N,Y){return I.H.useEffect(N,Y)},ge.useEffectEvent=function(N){return I.H.useEffectEvent(N)},ge.useId=function(){return I.H.useId()},ge.useImperativeHandle=function(N,Y,W){return I.H.useImperativeHandle(N,Y,W)},ge.useInsertionEffect=function(N,Y){return I.H.useInsertionEffect(N,Y)},ge.useLayoutEffect=function(N,Y){return I.H.useLayoutEffect(N,Y)},ge.useMemo=function(N,Y){return I.H.useMemo(N,Y)},ge.useOptimistic=function(N,Y){return I.H.useOptimistic(N,Y)},ge.useReducer=function(N,Y,W){return I.H.useReducer(N,Y,W)},ge.useRef=function(N){return I.H.useRef(N)},ge.useState=function(N){return I.H.useState(N)},ge.useSyncExternalStore=function(N,Y,W){return I.H.useSyncExternalStore(N,Y,W)},ge.useTransition=function(){return I.H.useTransition()},ge.version="19.2.7",ge}var cx;function Kd(){return cx||(cx=1,ad.exports=P0()),ad.exports}var b=Kd(),nd={exports:{}},Rs={},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 dx;function eb(){return dx||(dx=1,(function(a){function l(U,J){var ue=U.length;U.push(J);e:for(;0<ue;){var Ce=ue-1>>>1,De=U[Ce];if(0<d(De,J))U[Ce]=J,U[ue]=De,ue=Ce;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 Ce=0,De=U.length,N=De>>>1;Ce<N;){var Y=2*(Ce+1)-1,W=U[Y],te=Y+1,re=U[te];if(0>d(W,ue))te<De&&0>d(re,W)?(U[Ce]=re,U[te]=ue,Ce=te):(U[Ce]=W,U[Y]=ue,Ce=Y);else if(te<De&&0>d(re,ue))U[Ce]=re,U[te]=ue,Ce=te;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,C=!1,$=!1,L=!1,H=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function ne(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,ne(U),!C)if(s(y)!==null)C=!0,_e||(_e=!0,rt());else{var J=s(v);J!==null&&Ge(V,J.startTime-U)}}var _e=!1,I=-1,ye=5,Ue=-1;function gt(){return L?!0:!(a.unstable_now()-Ue<ye)}function At(){if(L=!1,_e){var U=a.unstable_now();Ue=U;var J=!0;try{e:{C=!1,$&&($=!1,F(I),I=-1),X=!0;var ue=D;try{t:{for(ne(U),j=s(y);j!==null&&!(j.expirationTime>U&>());){var Ce=j.callback;if(typeof Ce=="function"){j.callback=null,D=j.priorityLevel;var De=Ce(j.expirationTime<=U);if(U=a.unstable_now(),typeof De=="function"){j.callback=De,ne(U),J=!0;break t}j===s(y)&&u(y),ne(U)}else u(y);j=s(y)}if(j!==null)J=!0;else{var N=s(v);N!==null&&Ge(V,N.startTime-U),J=!1}}break e}finally{j=null,D=ue,X=!1}J=void 0}}finally{J?rt():_e=!1}}}var rt;if(typeof P=="function")rt=function(){P(At)};else if(typeof MessageChannel<"u"){var mt=new MessageChannel,nt=mt.port2;mt.port1.onmessage=At,rt=function(){nt.postMessage(null)}}else rt=function(){H(At,0)};function Ge(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 Ce=a.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Ce+ue:Ce):ue=Ce,U){case 1:var De=-1;break;case 2:De=250;break;case 5:De=1073741823;break;case 4:De=1e4;break;default:De=5e3}return De=ue+De,U={id:w++,callback:J,priorityLevel:U,startTime:ue,expirationTime:De,sortIndex:-1},ue>Ce?(U.sortIndex=ue,l(v,U),s(y)===null&&U===s(v)&&($?(F(I),I=-1):$=!0,Ge(V,ue-Ce))):(U.sortIndex=De,l(y,U),C||X||(C=!0,_e||(_e=!0,rt()))),U},a.unstable_shouldYield=gt,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 fx;function tb(){return fx||(fx=1,ld.exports=eb()),ld.exports}var sd={exports:{}},zt={};/**
|
|
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 hx;function ab(){if(hx)return zt;hx=1;var a=Kd();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 zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,zt.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)},zt.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()}},zt.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))},zt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},zt.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})}},zt.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)},zt.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})}},zt.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)},zt.requestFormReset=function(y){u.d.r(y)},zt.unstable_batchedUpdates=function(y,v){return y(v)},zt.useFormState=function(y,v,w){return m.H.useFormState(y,v,w)},zt.useFormStatus=function(){return m.H.useHostTransitionStatus()},zt.version="19.2.7",zt}var mx;function nb(){if(mx)return sd.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(),sd.exports=ab(),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 px;function lb(){if(px)return Rs;px=1;var a=tb(),l=Kd(),s=nb();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"),C=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"),ne=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),_e=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),Ue=Symbol.for("react.activity"),gt=Symbol.for("react.memo_cache_sentinel"),At=Symbol.iterator;function rt(e){return e===null||typeof e!="object"?null:(e=At&&e[At]||e["@@iterator"],typeof e=="function"?e:null)}var mt=Symbol.for("react.client.reference");function nt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===mt?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 _e:return"SuspenseList";case Ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case P:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case ne: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 Ge=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},Ce=[],De=-1;function N(e){return{current:e}}function Y(e){0>De||(e.current=Ce[De],Ce[De]=null,De--)}function W(e,t){De++,Ce[De]=e.current,e.current=t}var te=N(null),re=N(null),B=N(null),de=N(null);function Qe(e,t){switch(W(B,t),W(re,e),W(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Rp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Rp(t),e=Tp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(te),W(te,e)}function ze(){Y(te),Y(re),Y(B)}function Bt(e){e.memoizedState!==null&&W(de,e);var t=te.current,n=Tp(t,e.type);t!==n&&(W(re,e),W(te,n))}function Ra(e){re.current===e&&(Y(te),Y(re)),de.current===e&&(Y(de),_s._currentValue=ue)}var ua,Ya;function qe(e){if(ua===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ua=t&&t[1]||"",Ya=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ua+e+Ya}var Va=!1;function ct(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:"")?qe(n):""}function bt(e,t){switch(e.tag){case 26:case 27:case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return e.child!==t&&t!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return qe("Activity");default:return""}}function Rn(e){try{var t="",n=null;do t+=bt(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var Ye=Object.prototype.hasOwnProperty,Za=a.unstable_scheduleCallback,Tn=a.unstable_cancelCallback,an=a.unstable_shouldYield,nn=a.unstable_requestPaint,tt=a.unstable_now,dl=a.unstable_getCurrentPriorityLevel,ke=a.unstable_ImmediatePriority,fl=a.unstable_UserBlockingPriority,Ga=a.unstable_NormalPriority,On=a.unstable_LowPriority,Yt=a.unstable_IdlePriority,Yl=a.log,qi=a.unstable_setDisableYieldValue,Qa=null,at=null;function Ut(e){if(typeof Yl=="function"&&qi(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Qa,e)}catch{}}var pt=Math.clz32?Math.clz32:Ln,oa=Math.log,Pe=Math.LN2;function Ln(e){return e>>>=0,e===0?32:31-(oa(e)/Pe|0)|0}var Xa=256,Ta=262144,Oa=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 Mn(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 Tt(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 hl(){var e=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),e}function ml(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-pt(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&&Vl(e,i,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Vl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-pt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function Zl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-pt(n),o=1<<i;o&t|e[i]&t&&(e[i]|=t),n&=~o}}function pl(e,t){var n=t&-t;return n=(n&42)!==0?1:Dn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Dn(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 xl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gl(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:ex(e.type))}function La(e,t){var n=J.p;try{return J.p=e,t()}finally{J.p=n}}var da=Math.random().toString(36).slice(2),dt="__reactFiber$"+da,wt="__reactProps$"+da,Z="__reactContainer$"+da,Se="__reactEvents$"+da,lt="__reactListeners$"+da,E="__reactHandles$"+da,le="__reactResources$"+da,ve="__reactMarker$"+da;function xt(e){delete e[dt],delete e[wt],delete e[Se],delete e[lt],delete e[E]}function Ql(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Z]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bp(e);e!==null;){if(n=e[dt])return n;e=Bp(e)}return t}e=n,n=e.parentNode}return null}function Xl(e){if(e=e[dt]||e[Z]){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 Il(e){var t=e[le];return t||(t=e[le]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[ve]=!0}var vf=new Set,gf={};function yl(e,t){Kl(e,t),Kl(e+"Capture",t)}function Kl(e,t){for(gf[e]=t,e=0;e<t.length;e++)vf.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]*$"),bf={},wf={};function Vv(e){return Ye.call(wf,e)?!0:Ye.call(bf,e)?!1:Yv.test(e)?wf[e]=!0:(bf[e]=!0,!1)}function Qs(e,t,n){if(Vv(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 Xs(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 rn(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 fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zv(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=Sf(e)?"checked":"value";e._valueTracker=Zv(e,t,""+e[t])}}function jf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Sf(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Is(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Gv=/[\n"\\]/g;function ha(e){return e.replace(Gv,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=""+fa(t)):e.value!==""+fa(t)&&(e.value=""+fa(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Ku(e,h,fa(t)):n!=null?Ku(e,h,fa(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=""+fa(g):e.removeAttribute("name")}function Nf(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?""+fa(n):"",t=t!=null?""+fa(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"&&Is(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Jl(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=""+fa(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 _f(e,t,n){if(t!=null&&(t=""+fa(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+fa(n):""}function kf(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(u(92));if(Ge(i)){if(1<i.length)throw Error(u(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=fa(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Xu(e)}function Fl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qv=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 Af(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||Qv.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ef(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&&Af(e,o,i)}else for(var c in t)t.hasOwnProperty(c)&&Af(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 Xv=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"]]),Iv=/^[\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 Ks(e){return Iv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function un(){}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 Wl=null,Pl=null;function Cf(e){var t=Xl(e);if(t&&(e=t.stateNode)){var n=e[wt]||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="'+ha(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var o=i[wt]||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&&jf(i)}break e;case"textarea":_f(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Jl(e,!!n.multiple,t,!1)}}}var Pu=!1;function Rf(e,t,n){if(Pu)return e(t,n);Pu=!0;try{var i=e(t);return i}finally{if(Pu=!1,(Wl!==null||Pl!==null)&&(Ur(),Wl&&(t=Wl,e=Pl,Pl=Wl=null,Cf(t),e)))for(t=0;t<e.length;t++)Cf(e[t])}}function Yi(e,t){var n=e.stateNode;if(n===null)return null;var i=n[wt]||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 on=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eo=!1;if(on)try{var Vi={};Object.defineProperty(Vi,"passive",{get:function(){eo=!0}}),window.addEventListener("test",Vi,Vi),window.removeEventListener("test",Vi,Vi)}catch{eo=!1}var Un=null,to=null,Js=null;function Tf(){if(Js)return Js;var e,t=to,n=t.length,i,o="value"in Un?Un.value:Un.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 Js=o.slice(e,1<i?1-i:void 0)}function Fs(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 Ws(){return!0}function Of(){return!1}function Vt(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)?Ws:Of,this.isPropagationStopped=Of,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=Ws)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ws)},persist:function(){},isPersistent:Ws}),t}var vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ps=Vt(vl),Zi=j({},vl,{view:0,detail:0}),Kv=Vt(Zi),ao,no,Gi,er=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}}),Lf=Vt(er),Jv=j({},er,{dataTransfer:0}),Fv=Vt(Jv),Wv=j({},Zi,{relatedTarget:0}),lo=Vt(Wv),Pv=j({},vl,{animationName:0,elapsedTime:0,pseudoElement:0}),eg=Vt(Pv),tg=j({},vl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ag=Vt(tg),ng=j({},vl,{data:0}),Mf=Vt(ng),lg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ig={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"},sg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sg[e])?!!t[e]:!1}function io(){return rg}var ug=j({},Zi,{key:function(e){if(e.key){var t=lg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ig[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"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),og=Vt(ug),cg=j({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Df=Vt(cg),dg=j({},Zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:io}),fg=Vt(dg),hg=j({},vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),mg=Vt(hg),pg=j({},er,{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}),xg=Vt(pg),yg=j({},vl,{newState:0,oldState:0}),vg=Vt(yg),gg=[9,13,27,32],so=on&&"CompositionEvent"in window,Qi=null;on&&"documentMode"in document&&(Qi=document.documentMode);var bg=on&&"TextEvent"in window&&!Qi,Uf=on&&(!so||Qi&&8<Qi&&11>=Qi),zf=" ",Bf=!1;function qf(e,t){switch(e){case"keyup":return gg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ei=!1;function wg(e,t){switch(e){case"compositionend":return Hf(t);case"keypress":return t.which!==32?null:(Bf=!0,zf);case"textInput":return e=t.data,e===zf&&Bf?null:e;default:return null}}function Sg(e,t){if(ei)return e==="compositionend"||!so&&qf(e,t)?(e=Tf(),Js=to=Un=null,ei=!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 Uf&&t.locale!=="ko"?null:t.data;default:return null}}var jg={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 $f(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jg[e.type]:t==="textarea"}function Yf(e,t,n,i){Wl?Pl?Pl.push(i):Pl=[i]:Wl=i,t=Vr(t,"onChange"),0<t.length&&(n=new Ps("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Xi=null,Ii=null;function Ng(e){Np(e,0)}function tr(e){var t=$i(e);if(jf(t))return e}function Vf(e,t){if(e==="change")return t}var Zf=!1;if(on){var ro;if(on){var uo="oninput"in document;if(!uo){var Gf=document.createElement("div");Gf.setAttribute("oninput","return;"),uo=typeof Gf.oninput=="function"}ro=uo}else ro=!1;Zf=ro&&(!document.documentMode||9<document.documentMode)}function Qf(){Xi&&(Xi.detachEvent("onpropertychange",Xf),Ii=Xi=null)}function Xf(e){if(e.propertyName==="value"&&tr(Ii)){var t=[];Yf(t,Ii,e,Wu(e)),Rf(Ng,t)}}function _g(e,t,n){e==="focusin"?(Qf(),Xi=t,Ii=n,Xi.attachEvent("onpropertychange",Xf)):e==="focusout"&&Qf()}function kg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tr(Ii)}function Ag(e,t){if(e==="click")return tr(t)}function Eg(e,t){if(e==="input"||e==="change")return tr(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(!Ye.call(t,o)||!Ft(e[o],t[o]))return!1}return!0}function If(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kf(e,t){var n=If(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=If(n)}}function Jf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ff(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Is(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Is(e.document)}return t}function 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 Rg=on&&"documentMode"in document&&11>=document.documentMode,ti=null,co=null,Ji=null,fo=!1;function Wf(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fo||ti==null||ti!==Is(i)||(i=ti,"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=Vr(co,"onSelect"),0<i.length&&(t=new Ps("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ti)))}function gl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ai={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionrun:gl("Transition","TransitionRun"),transitionstart:gl("Transition","TransitionStart"),transitioncancel:gl("Transition","TransitionCancel"),transitionend:gl("Transition","TransitionEnd")},ho={},Pf={};on&&(Pf=document.createElement("div").style,"AnimationEvent"in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),"TransitionEvent"in window||delete ai.transitionend.transition);function bl(e){if(ho[e])return ho[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pf)return ho[e]=t[n];return e}var eh=bl("animationend"),th=bl("animationiteration"),ah=bl("animationstart"),Tg=bl("transitionrun"),Og=bl("transitionstart"),Lg=bl("transitioncancel"),nh=bl("transitionend"),lh=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 Ma(e,t){lh.set(e,t),yl(t,[e])}var ar=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)},ma=[],ni=0,po=0;function nr(){for(var e=ni,t=po=ni=0;t<e;){var n=ma[t];ma[t++]=null;var i=ma[t];ma[t++]=null;var o=ma[t];ma[t++]=null;var c=ma[t];if(ma[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&&ih(n,o,c)}}function lr(e,t,n,i){ma[ni++]=e,ma[ni++]=t,ma[ni++]=n,ma[ni++]=i,po|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function xo(e,t,n,i){return lr(e,t,n,i),ir(e)}function wl(e,t){return lr(e,null,null,t),ir(e)}function ih(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-pt(n),e=c.hiddenUpdates,i=e[o],i===null?e[o]=[t]:i.push(t),t.lane=n|536870912),c):null}function ir(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 li={};function Mg(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 Mg(e,t,n,i)}function yo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cn(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 sh(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 sr(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=q0(e,n,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ue:return e=Wt(31,n,t,o),e.elementType=Ue,e.lanes=c,e;case $:return Sl(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 _e:return e=Wt(19,n,t,o),e.elementType=_e,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 ne: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 Sl(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 rh(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 uh=new WeakMap;function pa(e,t){if(typeof e=="object"&&e!==null){var n=uh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Rn(t)},uh.set(e,t),t)}return{value:e,source:t,stack:Rn(t)}}var ii=[],si=0,rr=null,Fi=0,xa=[],ya=0,zn=null,Ia=1,Ka="";function dn(e,t){ii[si++]=Fi,ii[si++]=rr,rr=e,Fi=t}function oh(e,t,n){xa[ya++]=Ia,xa[ya++]=Ka,xa[ya++]=zn,zn=e;var i=Ia;e=Ka;var o=32-pt(i)-1;i&=~(1<<o),n+=1;var c=32-pt(t)+o;if(30<c){var h=o-o%5;c=(i&(1<<h)-1).toString(32),i>>=h,o-=h,Ia=1<<32-pt(t)+o|n<<o|i,Ka=c+e}else Ia=1<<c|n<<o|i,Ka=e}function bo(e){e.return!==null&&(dn(e,1),oh(e,1,0))}function wo(e){for(;e===rr;)rr=ii[--si],ii[si]=null,Fi=ii[--si],ii[si]=null;for(;e===zn;)zn=xa[--ya],xa[ya]=null,Ka=xa[--ya],xa[ya]=null,Ia=xa[--ya],xa[ya]=null}function ch(e,t){xa[ya++]=Ia,xa[ya++]=Ka,xa[ya++]=zn,Ia=t.id,Ka=t.overflow,zn=e}var Ot=null,it=null,Le=!1,Bn=null,va=!1,So=Error(u(519));function qn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wi(pa(t,e)),So}function dh(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[dt]=e,t[wt]=i,n){case"dialog":Ee("cancel",t),Ee("close",t);break;case"iframe":case"object":case"embed":Ee("load",t);break;case"video":case"audio":for(n=0;n<bs.length;n++)Ee(bs[n],t);break;case"source":Ee("error",t);break;case"img":case"image":case"link":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"input":Ee("invalid",t),Nf(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),kf(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||Ep(t.textContent,n)?(i.popover!=null&&(Ee("beforetoggle",t),Ee("toggle",t)),i.onScroll!=null&&Ee("scroll",t),i.onScrollEnd!=null&&Ee("scrollend",t),i.onClick!=null&&(t.onclick=un),t=!0):t=!1,t||qn(e,!0)}function fh(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:Ot=Ot.return}}function ri(e){if(e!==Ot)return!1;if(!Le)return fh(e),Le=!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&&it&&qn(e),fh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));it=zp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));it=zp(e)}else t===27?(t=it,Pn(e.type)?(e=Gc,Gc=null,it=e):it=t):it=Ot?ba(e.stateNode.nextSibling):null;return!0}function jl(){it=Ot=null,Le=!1}function jo(){var e=Bn;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Bn=null),e}function Wi(e){Bn===null?Bn=[e]:Bn.push(e)}var No=N(null),Nl=null,fn=null;function Hn(e,t,n){W(No,t._currentValue),t._currentValue=n}function hn(e){e._currentValue=No.current,Y(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 ui(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 ur(e){for(e=e.firstContext;e!==null;){if(!Ft(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _l(e){Nl=e,fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return hh(Nl,e)}function or(e,t){return Nl===null&&_l(e),hh(e,t)}function hh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fn===null){if(e===null)throw Error(u(308));fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fn=fn.next=t;return n}var Dg=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()})}},Ug=a.unstable_scheduleCallback,zg=a.unstable_NormalPriority,St={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ao(){return{controller:new Dg,data:new Map,refCount:0}}function Pi(e){e.refCount--,e.refCount===0&&Ug(zg,function(){e.controller.abort()})}var es=null,Eo=0,oi=0,ci=null;function Bg(e,t){if(es===null){var n=es=[];Eo=0,oi=Tc(),ci={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Eo++,t.then(mh,mh),t}function mh(){if(--Eo===0&&es!==null){ci!==null&&(ci.status="fulfilled");var e=es;es=null,oi=0,ci=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qg(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 ph=U.S;U.S=function(e,t){Wm=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Bg(e,t),ph!==null&&ph(e,t)};var kl=N(null);function Co(){var e=kl.current;return e!==null?e:et.pooledCache}function cr(e,t){t===null?W(kl,kl.current):W(kl,t.pool)}function xh(){var e=Co();return e===null?null:{parent:St._currentValue,pool:e}}var di=Error(u(460)),Ro=Error(u(474)),dr=Error(u(542)),fr={then:function(){}};function yh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(un,un),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bh(e),e;default:if(typeof t.status=="string")t.then(un,un);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,bh(e),e}throw El=t,di}}function Al(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(El=n,di):n}}var El=null;function gh(){if(El===null)throw Error(u(459));var e=El;return El=null,e}function bh(e){if(e===di||e===dr)throw Error(u(483))}var fi=null,ts=0;function hr(e){var t=ts;return ts+=1,fi===null&&(fi=[]),vh(fi,e,t)}function as(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mr(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 wh(e){function t(k,_){if(e){var R=k.deletions;R===null?(k.deletions=[_],k.flags|=16):R.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=cn(k,_),k.index=0,k.sibling=null,k}function c(k,_,R){return k.index=R,e?(R=k.alternate,R!==null?(R=R.index,R<_?(k.flags|=67108866,_):R):(k.flags|=67108866,_)):(k.flags|=1048576,_)}function h(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function g(k,_,R,G){return _===null||_.tag!==6?(_=vo(R,k.mode,G),_.return=k,_):(_=o(_,R),_.return=k,_)}function S(k,_,R,G){var fe=R.type;return fe===$?q(k,_,R.props.children,G,R.key):_!==null&&(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&Al(fe)===_.type)?(_=o(_,R.props),as(_,R),_.return=k,_):(_=sr(R.type,R.key,R.props,null,k.mode,G),as(_,R),_.return=k,_)}function T(k,_,R,G){return _===null||_.tag!==4||_.stateNode.containerInfo!==R.containerInfo||_.stateNode.implementation!==R.implementation?(_=go(R,k.mode,G),_.return=k,_):(_=o(_,R.children||[]),_.return=k,_)}function q(k,_,R,G,fe){return _===null||_.tag!==7?(_=Sl(R,k.mode,G,fe),_.return=k,_):(_=o(_,R),_.return=k,_)}function Q(k,_,R){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=vo(""+_,k.mode,R),_.return=k,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case X:return R=sr(_.type,_.key,_.props,null,k.mode,R),as(R,_),R.return=k,R;case C:return _=go(_,k.mode,R),_.return=k,_;case ye:return _=Al(_),Q(k,_,R)}if(Ge(_)||rt(_))return _=Sl(_,k.mode,R,null),_.return=k,_;if(typeof _.then=="function")return Q(k,hr(_),R);if(_.$$typeof===P)return Q(k,or(k,_),R);mr(k,_)}return null}function O(k,_,R,G){var fe=_!==null?_.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return fe!==null?null:g(k,_,""+R,G);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case X:return R.key===fe?S(k,_,R,G):null;case C:return R.key===fe?T(k,_,R,G):null;case ye:return R=Al(R),O(k,_,R,G)}if(Ge(R)||rt(R))return fe!==null?null:q(k,_,R,G,null);if(typeof R.then=="function")return O(k,_,hr(R),G);if(R.$$typeof===P)return O(k,_,or(k,R),G);mr(k,R)}return null}function M(k,_,R,G,fe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return k=k.get(R)||null,g(_,k,""+G,fe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case X:return k=k.get(G.key===null?R:G.key)||null,S(_,k,G,fe);case C:return k=k.get(G.key===null?R:G.key)||null,T(_,k,G,fe);case ye:return G=Al(G),M(k,_,R,G,fe)}if(Ge(G)||rt(G))return k=k.get(R)||null,q(_,k,G,fe,null);if(typeof G.then=="function")return M(k,_,R,hr(G),fe);if(G.$$typeof===P)return M(k,_,R,or(_,G),fe);mr(_,G)}return null}function se(k,_,R,G){for(var fe=null,He=null,oe=_,je=_=0,Te=null;oe!==null&&je<R.length;je++){oe.index>je?(Te=oe,oe=null):Te=oe.sibling;var $e=O(k,oe,R[je],G);if($e===null){oe===null&&(oe=Te);break}e&&oe&&$e.alternate===null&&t(k,oe),_=c($e,_,je),He===null?fe=$e:He.sibling=$e,He=$e,oe=Te}if(je===R.length)return n(k,oe),Le&&dn(k,je),fe;if(oe===null){for(;je<R.length;je++)oe=Q(k,R[je],G),oe!==null&&(_=c(oe,_,je),He===null?fe=oe:He.sibling=oe,He=oe);return Le&&dn(k,je),fe}for(oe=i(oe);je<R.length;je++)Te=M(oe,k,je,R[je],G),Te!==null&&(e&&Te.alternate!==null&&oe.delete(Te.key===null?je:Te.key),_=c(Te,_,je),He===null?fe=Te:He.sibling=Te,He=Te);return e&&oe.forEach(function(ll){return t(k,ll)}),Le&&dn(k,je),fe}function me(k,_,R,G){if(R==null)throw Error(u(151));for(var fe=null,He=null,oe=_,je=_=0,Te=null,$e=R.next();oe!==null&&!$e.done;je++,$e=R.next()){oe.index>je?(Te=oe,oe=null):Te=oe.sibling;var ll=O(k,oe,$e.value,G);if(ll===null){oe===null&&(oe=Te);break}e&&oe&&ll.alternate===null&&t(k,oe),_=c(ll,_,je),He===null?fe=ll:He.sibling=ll,He=ll,oe=Te}if($e.done)return n(k,oe),Le&&dn(k,je),fe;if(oe===null){for(;!$e.done;je++,$e=R.next())$e=Q(k,$e.value,G),$e!==null&&(_=c($e,_,je),He===null?fe=$e:He.sibling=$e,He=$e);return Le&&dn(k,je),fe}for(oe=i(oe);!$e.done;je++,$e=R.next())$e=M(oe,k,je,$e.value,G),$e!==null&&(e&&$e.alternate!==null&&oe.delete($e.key===null?je:$e.key),_=c($e,_,je),He===null?fe=$e:He.sibling=$e,He=$e);return e&&oe.forEach(function(J0){return t(k,J0)}),Le&&dn(k,je),fe}function We(k,_,R,G){if(typeof R=="object"&&R!==null&&R.type===$&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case X:e:{for(var fe=R.key;_!==null;){if(_.key===fe){if(fe=R.type,fe===$){if(_.tag===7){n(k,_.sibling),G=o(_,R.props.children),G.return=k,k=G;break e}}else if(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&Al(fe)===_.type){n(k,_.sibling),G=o(_,R.props),as(G,R),G.return=k,k=G;break e}n(k,_);break}else t(k,_);_=_.sibling}R.type===$?(G=Sl(R.props.children,k.mode,G,R.key),G.return=k,k=G):(G=sr(R.type,R.key,R.props,null,k.mode,G),as(G,R),G.return=k,k=G)}return h(k);case C:e:{for(fe=R.key;_!==null;){if(_.key===fe)if(_.tag===4&&_.stateNode.containerInfo===R.containerInfo&&_.stateNode.implementation===R.implementation){n(k,_.sibling),G=o(_,R.children||[]),G.return=k,k=G;break e}else{n(k,_);break}else t(k,_);_=_.sibling}G=go(R,k.mode,G),G.return=k,k=G}return h(k);case ye:return R=Al(R),We(k,_,R,G)}if(Ge(R))return se(k,_,R,G);if(rt(R)){if(fe=rt(R),typeof fe!="function")throw Error(u(150));return R=fe.call(R),me(k,_,R,G)}if(typeof R.then=="function")return We(k,_,hr(R),G);if(R.$$typeof===P)return We(k,_,or(k,R),G);mr(k,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,_!==null&&_.tag===6?(n(k,_.sibling),G=o(_,R),G.return=k,k=G):(n(k,_),G=vo(R,k.mode,G),G.return=k,k=G),h(k)):n(k,_)}return function(k,_,R,G){try{ts=0;var fe=We(k,_,R,G);return fi=null,fe}catch(oe){if(oe===di||oe===dr)throw oe;var He=Wt(29,oe,null,k.mode);return He.lanes=G,He.return=k,He}finally{}}}var Cl=wh(!0),Sh=wh(!1),$n=!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 Yn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Vn(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=ir(e),ih(e,null,n),t}return lr(e,i,t,n),ir(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,Zl(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=ci;if(e!==null)throw e}}function is(e,t,n,i){Mo=!1;var o=e.updateQueue;$n=!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?(Re&O)===O:(i&O)===O){O!==0&&O===oi&&(Mo=!0),q!==null&&(q=q.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var se=e,me=g;O=t;var We=n;switch(me.tag){case 1:if(se=me.payload,typeof se=="function"){Q=se.call(We,Q,O);break e}Q=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=me.payload,O=typeof se=="function"?se.call(We,Q,O):se,O==null)break e;Q=j({},Q,O);break e;case 2:$n=!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),In|=h,e.lanes=h,e.memoizedState=Q}}function jh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Nh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jh(n[e],t)}var hi=N(null),pr=N(0);function _h(e,t){e=Sn,W(pr,e),W(hi,t),Sn=e|t.baseLanes}function Do(){W(pr,Sn),W(hi,hi.current)}function Uo(){Sn=pr.current,Y(hi),Y(pr)}var Pt=N(null),ga=null;function Zn(e){var t=e.alternate;W(yt,yt.current&1),W(Pt,e),ga===null&&(t===null||hi.current!==null||t.memoizedState!==null)&&(ga=e)}function zo(e){W(yt,yt.current),W(Pt,e),ga===null&&(ga=e)}function kh(e){e.tag===22?(W(yt,yt.current),W(Pt,e),ga===null&&(ga=e)):Gn()}function Gn(){W(yt,yt.current),W(Pt,Pt.current)}function ea(e){Y(Pt),ga===e&&(ga=null),Y(yt)}var yt=N(0);function xr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Vc(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 mn=0,be=null,Je=null,jt=null,yr=!1,mi=!1,Rl=!1,vr=0,ss=0,pi=null,Hg=0;function ft(){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 mn=c,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?om:ec,Rl=!1,c=n(i,o),Rl=!1,mi&&(c=Eh(t,n,i,o)),Ah(e),c}function Ah(e){U.H=os;var t=Je!==null&&Je.next!==null;if(mn=0,jt=Je=be=null,yr=!1,ss=0,pi=null,t)throw Error(u(300));e===null||Nt||(e=e.dependencies,e!==null&&ur(e)&&(Nt=!0))}function Eh(e,t,n,i){be=e;var o=0;do{if(mi&&(pi=null),ss=0,mi=!1,25<=o)throw Error(u(301));if(o+=1,jt=Je=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=cm,c=t(n,i)}while(mi);return c}function $g(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?rs(t):t,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(be.flags|=1024),t}function Ho(){var e=vr!==0;return vr=0,e}function $o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Yo(e){if(yr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yr=!1}mn=0,jt=Je=be=null,mi=!1,ss=vr=0,pi=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?be.memoizedState=jt=e:jt=jt.next=e,jt}function vt(){if(Je===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=jt===null?be.memoizedState:jt.next;if(t!==null)jt=t,Je=e;else{if(e===null)throw be.alternate===null?Error(u(467)):Error(u(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},jt===null?be.memoizedState=jt=e:jt=jt.next=e}return jt}function gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=ss;return ss+=1,pi===null&&(pi=[]),e=vh(pi,e,t),t=be,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?om:ec),e}function br(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return rs(e);if(e.$$typeof===P)return Lt(e)}throw Error(u(438,String(e)))}function Vo(e){var t=null,n=be.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=be.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=gr(),be.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]=gt;return t.index++,n}function pn(e,t){return typeof t=="function"?t(e):t}function wr(e){var t=vt();return Zo(t,Je,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?(Re&Q)===Q:(mn&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===oi&&(q=!0);else if((mn&O)===O){T=T.next,O===oi&&(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,be.lanes|=O,In|=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,be.lanes|=Q,In|=Q;T=T.next}while(T!==null&&T!==t);if(S===null?h=c:S.next=g,!Ft(c,e.memoizedState)&&(Nt=!0,q&&(n=ci,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=vt(),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)||(Nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function Ch(e,t,n){var i=be,o=vt(),c=Le;if(c){if(n===void 0)throw Error(u(407));n=n()}else n=t();var h=!Ft((Je||o).memoizedState,n);if(h&&(o.memoizedState=n,Nt=!0),o=o.queue,Io(Oh.bind(null,i,o,e),[e]),o.getSnapshot!==t||h||jt!==null&&jt.memoizedState.tag&1){if(i.flags|=2048,xi(9,{destroy:void 0},Th.bind(null,i,o,n,t),null),et===null)throw Error(u(349));c||(mn&127)!==0||Rh(i,t,n)}return n}function Rh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t=gr(),be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Th(e,t,n,i){t.value=n,t.getSnapshot=i,Lh(t)&&Mh(e)}function Oh(e,t,n){return n(function(){Lh(t)&&Mh(e)})}function Lh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ft(e,n)}catch{return!0}}function Mh(e){var t=wl(e,2);t!==null&&It(t,e,2)}function Qo(e){var t=qt();if(typeof e=="function"){var n=e;if(e=n(),Rl){Ut(!0);try{n()}finally{Ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:e},t}function Dh(e,t,n,i){return e.baseState=n,Zo(e,Je,typeof i=="function"?i:pn)}function Yg(e,t,n,i,o){if(Nr(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,Uh(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Uh(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),zh(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),zh(e,t,c)}catch(T){Xo(e,t,T)}}function zh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Bh(e,t,i)},function(i){return Xo(e,t,i)}):Bh(e,t,n)}function Bh(e,t,n){t.status="fulfilled",t.value=n,qh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Uh(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,qh(t),t=t.next;while(t!==i)}e.action=null}function qh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hh(e,t){return t}function $h(e,t){if(Le){var n=et.formState;if(n!==null){e:{var i=be;if(Le){if(it){t:{for(var o=it,c=va;o.nodeType!==8;){if(!c){o=null;break t}if(o=ba(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){it=ba(o.nextSibling),i=o.data==="F!";break e}}qn(i)}i=!1}i&&(t=n[0])}}return n=qt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hh,lastRenderedState:t},n.queue=i,n=sm.bind(null,be,i),i.dispatch=n,i=Qo(!1),c=Po.bind(null,be,!1,i.queue),i=qt(),o={state:t,dispatch:null,action:e,pending:null},i.queue=o,n=Yg.bind(null,be,o,c,n),o.dispatch=n,i.memoizedState=e,[t,n,!1]}function Yh(e){var t=vt();return Vh(t,Je,e)}function Vh(e,t,n){if(t=Zo(e,t,Hh)[0],e=wr(pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=rs(t)}catch(h){throw h===di?dr:h}else i=t;t=vt();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(be.flags|=2048,xi(9,{destroy:void 0},Vg.bind(null,o,n),null)),[i,c,e]}function Vg(e,t){e.action=t}function Zh(e){var t=vt(),n=Je;if(n!==null)return Vh(t,n,e);vt(),t=t.memoizedState,n=vt();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function xi(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=be.updateQueue,t===null&&(t=gr(),be.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 Gh(){return vt().memoizedState}function Sr(e,t,n,i){var o=qt();be.flags|=e,o.memoizedState=xi(1|t,{destroy:void 0},n,i===void 0?null:i)}function jr(e,t,n,i){var o=vt();i=i===void 0?null:i;var c=o.memoizedState.inst;Je!==null&&i!==null&&Bo(i,Je.memoizedState.deps)?o.memoizedState=xi(t,c,n,i):(be.flags|=e,o.memoizedState=xi(1|t,c,n,i))}function Qh(e,t){Sr(8390656,8,e,t)}function Io(e,t){jr(2048,8,e,t)}function Zg(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=gr(),be.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Xh(e){var t=vt().memoizedState;return Zg({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Ih(e,t){return jr(4,2,e,t)}function Kh(e,t){return jr(4,4,e,t)}function Jh(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 Fh(e,t,n){n=n!=null?n.concat([e]):null,jr(4,4,Jh.bind(null,t,e),n)}function Ko(){}function Wh(e,t){var n=vt();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 Ph(e,t){var n=vt();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Bo(t,i[1]))return i[0];if(i=e(),Rl){Ut(!0);try{e()}finally{Ut(!1)}}return n.memoizedState=[i,t],i}function Jo(e,t,n){return n===void 0||(mn&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=ep(),be.lanes|=e,In|=e,n)}function em(e,t,n,i){return Ft(n,t)?n:hi.current!==null?(e=Jo(e,n,i),Ft(e,t)||(Nt=!0),e):(mn&42)===0||(mn&1073741824)!==0&&(Re&261930)===0?(Nt=!0,e.memoizedState=n):(e=ep(),be.lanes|=e,In|=e,t)}function tm(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=qg(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 Gg(){}function Fo(e,t,n,i){if(e.tag!==5)throw Error(u(476));var o=am(e).queue;tm(e,o,t,ue,n===null?Gg:function(){return nm(e),n(i)})}function am(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:pn,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nm(e){var t=am(e);t.next===null&&(t=e.alternate.memoizedState),us(e,t.next.queue,{},na())}function Wo(){return Lt(_s)}function lm(){return vt().memoizedState}function im(){return vt().memoizedState}function Qg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=na();e=Yn(n);var i=Vn(t,e,n);i!==null&&(It(i,t,n),ns(i,t,n)),t={cache:Ao()},e.payload=t;return}t=t.return}}function Xg(e,t,n){var i=na();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Nr(e)?rm(t,n):(n=xo(e,t,n,i),n!==null&&(It(n,e,i),um(n,t,i)))}function sm(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(Nr(e))rm(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 lr(e,t,o,0),et===null&&nr(),!1}catch{}finally{}if(n=xo(e,t,o,i),n!==null)return It(n,e,i),um(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},Nr(e)){if(t)throw Error(u(479))}else t=xo(e,n,i,2),t!==null&&It(t,e,2)}function Nr(e){var t=e.alternate;return e===be||t!==null&&t===be}function rm(e,t){mi=yr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function um(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Zl(e,n)}}var os={readContext:Lt,use:br,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};os.useEffectEvent=ft;var om={readContext:Lt,use:br,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Qh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Sr(4194308,4,Jh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sr(4194308,4,e,t)},useInsertionEffect:function(e,t){Sr(4,2,e,t)},useMemo:function(e,t){var n=qt();t=t===void 0?null:t;var i=e();if(Rl){Ut(!0);try{e()}finally{Ut(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=qt();if(n!==void 0){var o=n(t);if(Rl){Ut(!0);try{n(t)}finally{Ut(!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=Xg.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qo(e);var t=e.queue,n=sm.bind(null,be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ko,useDeferredValue:function(e,t){var n=qt();return Jo(n,e,t)},useTransition:function(){var e=Qo(!1);return e=tm.bind(null,be,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=be,o=qt();if(Le){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),et===null)throw Error(u(349));(Re&127)!==0||Rh(i,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,Qh(Oh.bind(null,i,c,e),[e]),i.flags|=2048,xi(9,{destroy:void 0},Th.bind(null,i,c,n,t),null),n},useId:function(){var e=qt(),t=et.identifierPrefix;if(Le){var n=Ka,i=Ia;n=(i&~(1<<32-pt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=vr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Hg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Wo,useFormState:$h,useActionState:$h,useOptimistic:function(e){var t=qt();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,be,!0,n),n.dispatch=t,[e,t]},useMemoCache:Vo,useCacheRefresh:function(){return qt().memoizedState=Qg.bind(null,be)},useEffectEvent:function(e){var t=qt(),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:Lt,use:br,useCallback:Wh,useContext:Lt,useEffect:Io,useImperativeHandle:Fh,useInsertionEffect:Ih,useLayoutEffect:Kh,useMemo:Ph,useReducer:wr,useRef:Gh,useState:function(){return wr(pn)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=vt();return em(n,Je.memoizedState,e,t)},useTransition:function(){var e=wr(pn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:rs(e),t]},useSyncExternalStore:Ch,useId:lm,useHostTransitionStatus:Wo,useFormState:Yh,useActionState:Yh,useOptimistic:function(e,t){var n=vt();return Dh(n,Je,e,t)},useMemoCache:Vo,useCacheRefresh:im};ec.useEffectEvent=Xh;var cm={readContext:Lt,use:br,useCallback:Wh,useContext:Lt,useEffect:Io,useImperativeHandle:Fh,useInsertionEffect:Ih,useLayoutEffect:Kh,useMemo:Ph,useReducer:Go,useRef:Gh,useState:function(){return Go(pn)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=vt();return Je===null?Jo(n,e,t):em(n,Je.memoizedState,e,t)},useTransition:function(){var e=Go(pn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:rs(e),t]},useSyncExternalStore:Ch,useId:lm,useHostTransitionStatus:Wo,useFormState:Zh,useActionState:Zh,useOptimistic:function(e,t){var n=vt();return Je!==null?Dh(n,Je,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Vo,useCacheRefresh:im};cm.useEffectEvent=Xh;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=Yn(i);o.payload=t,n!=null&&(o.callback=n),t=Vn(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=Yn(i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Vn(e,o,i),t!==null&&(It(t,e,i),ns(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=na(),i=Yn(n);i.tag=2,t!=null&&(i.callback=t),t=Vn(e,i,n),t!==null&&(It(t,e,n),ns(t,e,n))}};function dm(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 fm(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 Tl(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 hm(e){ar(e)}function mm(e){console.error(e)}function pm(e){ar(e)}function _r(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function xm(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=Yn(n),n.tag=3,n.payload={element:null},n.callback=function(){_r(e,t)},n}function ym(e){return e=Yn(e),e.tag=3,e}function vm(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(){xm(t,n,i)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){xm(t,n,i),typeof o!="function"&&(Kn===null?Kn=new Set([this]):Kn.add(this));var g=i.stack;this.componentDidCatch(i.value,{componentStack:g!==null?g:""})})}function Ig(e,t,n,i,o){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&ui(t,n,o,!0),n=Pt.current,n!==null){switch(n.tag){case 31:case 13:return ga===null?zr():n.alternate===null&&ht===0&&(ht=3),n.flags&=-257,n.flags|=65536,n.lanes=o,i===fr?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===fr?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),zr(),!1}if(Le)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(pa(e,n)))):(i!==So&&(t=Error(u(423),{cause:i}),Wi(pa(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,i=pa(i,n),o=nc(e.stateNode,i,o),Lo(e,o),ht!==4&&(ht=2)),!1;var c=Error(u(520),{cause:i});if(c=pa(c,n),ys===null?ys=[c]:ys.push(c),ht!==4&&(ht=2),t===null)return!0;i=pa(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"&&(Kn===null||!Kn.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=ym(o),vm(o,e,n,i),Lo(n,o),!1}n=n.return}while(n!==null);return!1}var lc=Error(u(461)),Nt=!1;function Mt(e,t,n,i){t.child=e===null?Sh(t,null,n,i):Cl(t,e.child,n,i)}function gm(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 _l(t),i=qo(e,t,n,h,c,o),g=Ho(),e!==null&&!Nt?($o(e,t,o),xn(e,t,o)):(Le&&g&&bo(t),t.flags|=1,Mt(e,t,i,o),t.child)}function bm(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,wm(e,t,c,i,o)):(e=sr(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 xn(e,t,o)}return t.flags|=1,e=cn(c,i),e.ref=t.ref,e.return=t,t.child=e}function wm(e,t,n,i,o){if(e!==null){var c=e.memoizedProps;if(Ki(c,i)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=i=c,fc(e,o))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,xn(e,t,o)}return ic(e,t,n,i,o)}function Sm(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 jm(e,t,c,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cr(t,c!==null?c.cachePool:null),c!==null?_h(t,c):Do(),kh(t);else return i=t.lanes=536870912,jm(e,t,c!==null?c.baseLanes|n:n,n,i)}else c!==null?(cr(t,c.cachePool),_h(t,c),Gn(),t.memoizedState=null):(e!==null&&cr(t,null),Do(),Gn());return Mt(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 jm(e,t,n,i,o){var c=Co();return c=c===null?null:{parent:St._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&cr(t,null),Do(),kh(t),e!==null&&ui(e,t,i,!0),t.childLanes=o,null}function kr(e,t){return t=Er({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nm(e,t,n){return Cl(t,e.child,null,n),e=kr(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Kg(e,t,n){var i=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(i.mode==="hidden")return e=kr(t,i),t.lanes=536870912,cs(null,e);if(zo(t),(e=it)?(e=Up(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zn!==null?{id:Ia,overflow:Ka}:null,retryLane:536870912,hydrationErrors:null},n=rh(e),n.return=t,t.child=n,Ot=t,it=null)):e=null,e===null)throw qn(t);return t.lanes=536870912,null}return kr(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=Nm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Nt||ui(e,t,n,!1),o=(n&e.childLanes)!==0,Nt||o){if(i=et,i!==null&&(h=pl(i,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,wl(e,h),It(i,e,h),lc;zr(),t=Nm(e,t,n)}else e=c.treeContext,it=ba(h.nextSibling),Ot=t,Le=!0,Bn=null,va=!1,e!==null&&ch(t,e),t=kr(t,i),t.flags|=4096;return t}return e=cn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ar(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 _l(t),n=qo(e,t,n,i,void 0,o),i=Ho(),e!==null&&!Nt?($o(e,t,o),xn(e,t,o)):(Le&&i&&bo(t),t.flags|=1,Mt(e,t,n,o),t.child)}function _m(e,t,n,i,o,c){return _l(t),t.updateQueue=null,n=Eh(t,i,n,o),Ah(e),i=Ho(),e!==null&&!Nt?($o(e,t,c),xn(e,t,c)):(Le&&i&&bo(t),t.flags|=1,Mt(e,t,n,c),t.child)}function km(e,t,n,i,o){if(_l(t),t.stateNode===null){var c=li,h=n.contextType;typeof h=="object"&&h!==null&&(c=Lt(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?Lt(h):li,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=Tl(n,g);c.props=S;var T=c.context,q=n.contextType;h=li,typeof q=="object"&&q!==null&&(h=Lt(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)&&fm(t,c,i,h),$n=!1;var O=t.memoizedState;c.state=O,is(t,i,c,o),ls(),T=t.memoizedState,g||O!==T||$n?(typeof Q=="function"&&(tc(t,n,Q,i),T=t.memoizedState),(S=$n||dm(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=Tl(n,h),c.props=q,Q=t.pendingProps,O=c.context,T=n.contextType,S=li,typeof T=="object"&&T!==null&&(S=Lt(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)&&fm(t,c,i,S),$n=!1,O=t.memoizedState,c.state=O,is(t,i,c,o),ls();var M=t.memoizedState;h!==Q||O!==M||$n||e!==null&&e.dependencies!==null&&ur(e.dependencies)?(typeof g=="function"&&(tc(t,n,g,i),M=t.memoizedState),(q=$n||dm(t,n,q,i,O,M,S)||e!==null&&e.dependencies!==null&&ur(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,Ar(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=Cl(t,e.child,null,o),t.child=Cl(t,null,n,o)):Mt(e,t,n,o),t.memoizedState=c.state,e=t.child):e=xn(e,t,o),e}function Am(e,t,n,i){return jl(),t.flags|=256,Mt(e,t,n,i),t.child}var sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rc(e){return{baseLanes:e,cachePool:xh()}}function uc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=aa),e}function Em(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:(yt.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(o?Zn(t):Gn(),(e=it)?(e=Up(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zn!==null?{id:Ia,overflow:Ka}:null,retryLane:536870912,hydrationErrors:null},n=rh(e),n.return=t,t.child=n,Ot=t,it=null)):e=null,e===null)throw qn(t);return Zc(e)?t.lanes=32:t.lanes=536870912,null}var g=i.children;return i=i.fallback,o?(Gn(),o=t.mode,g=Er({mode:"hidden",children:g},o),i=Sl(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)):(Zn(t),oc(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(c)t.flags&256?(Zn(t),t.flags&=-257,t=cc(e,t,n)):t.memoizedState!==null?(Gn(),t.child=e.child,t.flags|=128,t=null):(Gn(),g=i.fallback,o=t.mode,i=Er({mode:"visible",children:i.children},o),g=Sl(g,o,n,null),g.flags|=2,i.return=t,g.return=t,i.sibling=g,t.child=i,Cl(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(Zn(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(Nt||ui(e,t,n,!1),h=(n&e.childLanes)!==0,Nt||h){if(h=et,h!==null&&(i=pl(h,n),i!==0&&i!==S.retryLane))throw S.retryLane=i,wl(e,i),It(h,e,i),lc;Vc(g)||zr(),t=cc(e,t,n)}else Vc(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,it=ba(g.nextSibling),Ot=t,Le=!0,Bn=null,va=!1,e!==null&&ch(t,e),t=oc(t,i.children),t.flags|=4096);return t}return o?(Gn(),g=i.fallback,o=t.mode,S=e.child,T=S.sibling,i=cn(S,{mode:"hidden",children:i.children}),i.subtreeFlags=S.subtreeFlags&65011712,T!==null?g=cn(T,g):(g=Sl(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=St._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=xh(),g={baseLanes:g.baseLanes|n,cachePool:o}),i.memoizedState=g,i.childLanes=uc(e,h,n),t.memoizedState=sc,cs(e.child,i)):(Zn(t),n=e.child,e=n.sibling,n=cn(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=Er({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Er(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function cc(e,t,n){return Cl(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cm(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 Rm(e,t,n){var i=t.pendingProps,o=i.revealOrder,c=i.tail;i=i.children;var h=yt.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,W(yt,h),Mt(e,t,i,n),i=Le?Fi:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cm(e,n,t);else if(e.tag===19)Cm(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&&xr(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&&xr(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 xn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),In|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ui(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=cn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cn(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&&ur(e)))}function Jg(e,t,n){switch(t.tag){case 3:Qe(t,t.stateNode.containerInfo),Hn(t,St,e.memoizedState.cache),jl();break;case 27:case 5:Bt(t);break;case 4:Qe(t,t.stateNode.containerInfo);break;case 10:Hn(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?(Zn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Em(e,t,n):(Zn(t),e=xn(e,t,n),e!==null?e.sibling:null);Zn(t);break;case 19:var o=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(ui(e,t,n,!1),i=(n&t.childLanes)!==0),o){if(i)return Rm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),W(yt,yt.current),i)break;return null;case 22:return t.lanes=0,Sm(e,t,n,t.pendingProps);case 24:Hn(t,St,e.memoizedState.cache)}return xn(e,t,n)}function Tm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!fc(e,n)&&(t.flags&128)===0)return Nt=!1,Jg(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,Le&&(t.flags&1048576)!==0&&oh(t,Fi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Al(t.elementType),t.type=e,typeof e=="function")yo(e)?(i=Tl(e,i),t.tag=1,t=km(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===ne){t.tag=11,t=gm(null,t,e,i,n);break e}else if(o===I){t.tag=14,t=bm(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=Tl(i,t.pendingProps),km(e,t,i,o,n);case 3:e:{if(Qe(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,Hn(t,St,i),i!==c.cache&&ko(t,[St],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=Am(e,t,i,n);break e}else if(i!==o){o=pa(Error(u(424)),t),Wi(o),t=Am(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(it=ba(e.firstChild),Ot=t,Le=!0,Bn=null,va=!0,n=Sh(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(jl(),i===o){t=xn(e,t,n);break e}Mt(e,t,i,n)}t=t.child}return t;case 26:return Ar(e,t),e===null?(n=Yp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,i=Zr(B.current).createElement(n),i[dt]=t,i[wt]=e,Dt(i,n,e),Ct(i),t.stateNode=i):t.memoizedState=Yp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bt(t),e===null&&Le&&(i=t.stateNode=qp(t.type,t.pendingProps,B.current),Ot=t,va=!0,o=it,Pn(t.type)?(Gc=o,it=ba(i.firstChild)):it=o),Mt(e,t,t.pendingProps.children,n),Ar(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((o=i=it)&&(i=k0(i,t.type,t.pendingProps,va),i!==null?(t.stateNode=i,Ot=t,it=ba(i.firstChild),va=!1,o=!0):o=!1),o||qn(t)),Bt(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,$g,null,null,n),_s._currentValue=o),Ar(e,t),Mt(e,t,i,n),t.child;case 6:return e===null&&Le&&((e=n=it)&&(n=A0(n,t.pendingProps,va),n!==null?(t.stateNode=n,Ot=t,it=null,e=!0):e=!1),e||qn(t)),null;case 13:return Em(e,t,n);case 4:return Qe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Cl(t,null,i,n):Mt(e,t,i,n),t.child;case 11:return gm(e,t,t.type,t.pendingProps,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Hn(t,t.type,i.value),Mt(e,t,i.children,n),t.child;case 9:return o=t.type._context,i=t.pendingProps.children,_l(t),o=Lt(o),i=i(o),t.flags|=1,Mt(e,t,i,n),t.child;case 14:return bm(e,t,t.type,t.pendingProps,n);case 15:return wm(e,t,t.type,t.pendingProps,n);case 19:return Rm(e,t,n);case 31:return Kg(e,t,n);case 22:return Sm(e,t,n,t.pendingProps);case 24:return _l(t),i=Lt(St),e===null?(o=Co(),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),Hn(t,St,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),Hn(t,St,i)):(i=c.cache,Hn(t,St,i),i!==o.cache&&ko(t,[St],n,!0))),Mt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function yn(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(lp())e.flags|=8192;else throw El=fr,Ro}else e.flags&=-16777217}function Om(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xp(t))if(lp())e.flags|=8192;else throw El=fr,Ro}function Cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hl():536870912,e.lanes|=t,bi|=t)}function ds(e,t){if(!Le)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 st(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 Fg(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 st(t),null;case 1:return st(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),hn(St),ze(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ri(t)?yn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,jo())),st(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(yn(t),c!==null?(st(t),Om(t,c)):(st(t),hc(t,o,null,i,n))):c?c!==e.memoizedState?(yn(t),st(t),Om(t,c)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&yn(t),st(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&&yn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return st(t),null}e=te.current,ri(t)?dh(t):(e=qp(o,i,n),t.stateNode=e,yn(t))}return st(t),null;case 5:if(Ra(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&yn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return st(t),null}if(c=te.current,ri(t))dh(t);else{var h=Zr(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[dt]=t,c[wt]=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(Dt(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&&yn(t)}}return st(t),hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&yn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=B.current,ri(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,o=Ot,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Ep(e.nodeValue,n)),e||qn(t,!0)}else e=Zr(e).createTextNode(i),e[dt]=t,t.stateNode=e}return st(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=ri(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[dt]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(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 st(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=ri(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[dt]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(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),st(t),null);case 4:return ze(),e===null&&Dc(t.stateNode.containerInfo),st(t),null;case 10:return hn(t.type),st(t),null;case 19:if(Y(yt),i=t.memoizedState,i===null)return st(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)ds(i,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=xr(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;)sh(n,e),n=n.sibling;return W(yt,yt.current&1|2),Le&&dn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&tt()>Mr&&(t.flags|=128,o=!0,ds(i,!1),t.lanes=4194304)}else{if(!o)if(e=xr(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&&!Le)return st(t),null}else 2*tt()-i.renderingStartTime>Mr&&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=yt.current,W(yt,o?n&1|2:n&1),Le&&dn(t,i.treeForkCount),e):(st(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&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(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&&Y(kl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),hn(St),st(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Wg(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 hn(St),ze(),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));jl()}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));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(yt),null;case 4:return ze(),null;case 10:return hn(t.type),null;case 22:case 23:return ea(t),Uo(),e!==null&&Y(kl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hn(St),null;case 25:return null;default:return null}}function Lm(e,t){switch(wo(t),t.tag){case 3:hn(St),ze();break;case 26:case 27:case 5:Ra(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:Y(yt);break;case 10:hn(t.type);break;case 22:case 23:ea(t),Uo(),e!==null&&Y(kl);break;case 24:hn(St)}}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){Ie(t,t.return,g)}}function Qn(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){Ie(o,S,q)}}}i=i.next}while(i!==c)}}catch(q){Ie(t,t.return,q)}}function Mm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Nh(t,n)}catch(i){Ie(e,e.return,i)}}}function Dm(e,t,n){n.props=Tl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Ie(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){Ie(e,t,o)}}function Ja(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(o){Ie(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){Ie(e,t,o)}else n.current=null}function Um(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){Ie(e,e.return,o)}}function mc(e,t,n){try{var i=e.stateNode;b0(i,e.type,n,t),i[wt]=t}catch(o){Ie(e,e.return,o)}}function zm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pn(e.type)||e.tag===4}function pc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zm(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&&Pn(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=un));else if(i!==4&&(i===27&&Pn(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 Rr(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&&Pn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Rr(e,t,n),e=e.sibling;e!==null;)Rr(e,t,n),e=e.sibling}function Bm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Dt(t,i,n),t[dt]=e,t[wt]=n}catch(c){Ie(e,e.return,c)}}var vn=!1,_t=!1,yc=!1,qm=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Pg(e,t){if(e=e.containerInfo,Bc=Fr,e=Ff(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},Fr=!1,Rt=t;Rt!==null;)if(t=Rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Rt=e;else for(;Rt!==null;){switch(t=Rt,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 se=Tl(n.type,o);e=i.getSnapshotBeforeUpdate(se,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(me){Ie(n,n.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Yc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Yc(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,Rt=e;break}Rt=t.return}}function Hm(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:bn(e,n),i&4&&fs(5,n);break;case 1:if(bn(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Ie(n,n.return,h)}else{var o=Tl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Ie(n,n.return,h)}}i&64&&Mm(n),i&512&&hs(n,n.return);break;case 3:if(bn(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{Nh(e,t)}catch(h){Ie(n,n.return,h)}}break;case 27:t===null&&i&4&&Bm(n);case 26:case 5:bn(e,n),t===null&&i&4&&Um(n),i&512&&hs(n,n.return);break;case 12:bn(e,n);break;case 31:bn(e,n),i&4&&Vm(e,n);break;case 13:bn(e,n),i&4&&Zm(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=u0.bind(null,n),E0(e,n))));break;case 22:if(i=n.memoizedState!==null||vn,!i){t=t!==null&&t.memoizedState!==null||_t,o=vn;var c=_t;vn=i,(_t=t)&&!c?wn(e,n,(n.subtreeFlags&8772)!==0):bn(e,n),vn=o,_t=c}break;case 30:break;default:bn(e,n)}}function $m(e){var t=e.alternate;t!==null&&(e.alternate=null,$m(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(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 ut=null,Zt=!1;function gn(e,t,n){for(n=n.child;n!==null;)Ym(e,t,n),n=n.sibling}function Ym(e,t,n){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Qa,n)}catch{}switch(n.tag){case 26:_t||Ja(n,t),gn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_t||Ja(n,t);var i=ut,o=Zt;Pn(n.type)&&(ut=n.stateNode,Zt=!1),gn(e,t,n),Ss(n.stateNode),ut=i,Zt=o;break;case 5:_t||Ja(n,t);case 6:if(i=ut,o=Zt,ut=null,gn(e,t,n),ut=i,Zt=o,ut!==null)if(Zt)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(n.stateNode)}catch(c){Ie(n,t,c)}else try{ut.removeChild(n.stateNode)}catch(c){Ie(n,t,c)}break;case 18:ut!==null&&(Zt?(e=ut,Mp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ei(e)):Mp(ut,n.stateNode));break;case 4:i=ut,o=Zt,ut=n.stateNode.containerInfo,Zt=!0,gn(e,t,n),ut=i,Zt=o;break;case 0:case 11:case 14:case 15:Qn(2,n,t),_t||Qn(4,n,t),gn(e,t,n);break;case 1:_t||(Ja(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Dm(n,t,i)),gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:_t=(i=_t)||n.memoizedState!==null,gn(e,t,n),_t=i;break;default:gn(e,t,n)}}function Vm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ei(e)}catch(n){Ie(t,t.return,n)}}}function Zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ei(e)}catch(n){Ie(t,t.return,n)}}function e0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qm),t;default:throw Error(u(435,e.tag))}}function Tr(e,t){var n=e0(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var o=o0.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(Pn(g.type)){ut=g.stateNode,Zt=!1;break e}break;case 5:ut=g.stateNode,Zt=!1;break e;case 3:case 4:ut=g.stateNode.containerInfo,Zt=!0;break e}g=g.return}if(ut===null)throw Error(u(160));Ym(c,h,o),ut=null,Zt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Gm(t,e),t=t.sibling}var Da=null;function Gm(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&&(Qn(3,e,e.return),fs(3,e),Qn(5,e,e.return));break;case 1:Gt(t,e),Qt(e),i&512&&(_t||n===null||Ja(n,n.return)),i&64&&vn&&(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=Da;if(Gt(t,e),Qt(e),i&512&&(_t||n===null||Ja(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[ve]||c[dt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(i),o.head.insertBefore(c,o.querySelector("head > title"))),Dt(c,i,n),c[dt]=e,Ct(c),i=c;break e;case"link":var h=Gp("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),Dt(c,i,n),o.head.appendChild(c);break;case"meta":if(h=Gp("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),Dt(c,i,n),o.head.appendChild(c);break;default:throw Error(u(468,i))}c[dt]=e,Ct(c),i=c}e.stateNode=i}else Qp(o,e.type,e.stateNode);else e.stateNode=Zp(o,i,e.memoizedProps);else c!==i?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,i===null?Qp(o,e.type,e.stateNode):Zp(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&&(_t||n===null||Ja(n,n.return)),n!==null&&i&4&&mc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Gt(t,e),Qt(e),i&512&&(_t||n===null||Ja(n,n.return)),e.flags&32){o=e.stateNode;try{Fl(o,"")}catch(se){Ie(e,e.return,se)}}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(se){Ie(e,e.return,se)}}break;case 3:if(Xr=null,o=Da,Da=Gr(t.containerInfo),Gt(t,e),Da=o,Qt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ei(t.containerInfo)}catch(se){Ie(e,e.return,se)}yc&&(yc=!1,Qm(e));break;case 4:i=Da,Da=Gr(e.stateNode.containerInfo),Gt(t,e),Qt(e),Da=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,Tr(e,i)));break;case 13:Gt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Lr=tt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Tr(e,i)));break;case 22:o=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,T=vn,q=_t;if(vn=T||o,_t=q||S,Gt(t,e),_t=q,vn=T,Qt(e),i&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||S||vn||_t||Ol(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(se){Ie(S,S.return,se)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(se){Ie(S,S.return,se)}}}else if(t.tag===18){if(n===null){S=t;try{var M=S.stateNode;o?Dp(M,!0):Dp(S.stateNode,!1)}catch(se){Ie(S,S.return,se)}}}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,Tr(e,n))));break;case 19:Gt(t,e),Qt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Tr(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(zm(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);Rr(e,c,o);break;case 5:var h=n.stateNode;n.flags&32&&(Fl(h,""),n.flags&=-33);var g=pc(e);Rr(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){Ie(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Qm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Hm(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qn(4,t,t.return),Ol(t);break;case 1:Ja(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Dm(t,t.return,n),Ol(t);break;case 27:Ss(t.stateNode);case 26:case 5:Ja(t,t.return),Ol(t);break;case 22:t.memoizedState===null&&Ol(t);break;case 30:Ol(t);break;default:Ol(t)}e=e.sibling}}function wn(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:wn(o,c,n),fs(4,c);break;case 1:if(wn(o,c,n),i=c,o=i.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(T){Ie(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++)jh(S[o],g)}catch(T){Ie(i,i.return,T)}}n&&h&64&&Mm(c),hs(c,c.return);break;case 27:Bm(c);case 26:case 5:wn(o,c,n),n&&i===null&&h&4&&Um(c),hs(c,c.return);break;case 12:wn(o,c,n);break;case 31:wn(o,c,n),n&&h&4&&Vm(o,c);break;case 13:wn(o,c,n),n&&h&4&&Zm(o,c);break;case 22:c.memoizedState===null&&wn(o,c,n),hs(c,c.return);break;case 30:break;default:wn(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 Ua(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xm(e,t,n,i),t=t.sibling}function Xm(e,t,n,i){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Ua(e,t,n,i),o&2048&&fs(9,t);break;case 1:Ua(e,t,n,i);break;case 3:Ua(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){Ua(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){Ie(t,t.return,S)}}else Ua(e,t,n,i);break;case 31:Ua(e,t,n,i);break;case 13:Ua(e,t,n,i);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Ua(e,t,n,i):ms(e,t):c._visibility&2?Ua(e,t,n,i):(c._visibility|=2,yi(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),o&2048&&vc(h,t);break;case 24:Ua(e,t,n,i),o&2048&&gc(t.alternate,t);break;default:Ua(e,t,n,i)}}function yi(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:yi(c,h,g,S,o),fs(8,h);break;case 23:break;case 22:var q=h.stateNode;h.memoizedState!==null?q._visibility&2?yi(c,h,g,S,o):ms(c,h):(q._visibility|=2,yi(c,h,g,S,o)),o&&T&2048&&vc(h.alternate,h);break;case 24:yi(c,h,g,S,o),o&&T&2048&&gc(h.alternate,h);break;default:yi(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 vi(e,t,n){if(e.subtreeFlags&ps)for(e=e.child;e!==null;)Im(e,t,n),e=e.sibling}function Im(e,t,n){switch(e.tag){case 26:vi(e,t,n),e.flags&ps&&e.memoizedState!==null&&H0(n,Da,e.memoizedState,e.memoizedProps);break;case 5:vi(e,t,n);break;case 3:case 4:var i=Da;Da=Gr(e.stateNode.containerInfo),vi(e,t,n),Da=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ps,ps=16777216,vi(e,t,n),ps=i):vi(e,t,n));break;default:vi(e,t,n)}}function Km(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];Rt=i,Fm(i,e)}Km(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jm(e),e=e.sibling}function Jm(e){switch(e.tag){case 0:case 11:case 15:xs(e),e.flags&2048&&Qn(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,Or(e)):xs(e);break;default:xs(e)}}function Or(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];Rt=i,Fm(i,e)}Km(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qn(8,t,t.return),Or(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Or(t));break;default:Or(t)}e=e.sibling}}function Fm(e,t){for(;Rt!==null;){var n=Rt;switch(n.tag){case 0:case 11:case 15:Qn(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,Rt=i;else e:for(n=e;Rt!==null;){i=Rt;var o=i.sibling,c=i.return;if($m(i),i===n){Rt=null;break e}if(o!==null){o.return=c,Rt=o;break e}Rt=c}}}var t0={getCacheForType:function(e){var t=Lt(St),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Lt(St).controller.signal}},a0=typeof WeakMap=="function"?WeakMap:Map,Ve=0,et=null,Ae=null,Re=0,Xe=0,ta=null,Xn=!1,gi=!1,bc=!1,Sn=0,ht=0,In=0,Ll=0,wc=0,aa=0,bi=0,ys=null,Xt=null,Sc=!1,Lr=0,Wm=0,Mr=1/0,Dr=null,Kn=null,Et=0,Jn=null,wi=null,jn=0,jc=0,Nc=null,Pm=null,vs=0,_c=null;function na(){return(Ve&2)!==0&&Re!==0?Re&-Re:U.T!==null?Tc():Gl()}function ep(){if(aa===0)if((Re&536870912)===0||Le){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&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(Si(e,0),Fn(e,Re,aa,!1)),sn(e,n),((Ve&2)===0||e!==et)&&(e===et&&((Ve&2)===0&&(Ll|=n),ht===4&&Fn(e,Re,aa,!1)),Fa(e))}function tp(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?i0(e,t):Ac(e,t,!0),c=i;do{if(o===0){gi&&!i&&Fn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!n0(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&&(Si(g,h).flags|=256),h=Ac(g,h,!1),h!==2){if(bc&&!S){g.errorRecoveryDisabledLanes|=c,Ll|=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){Si(e,0),Fn(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:Fn(i,t,aa,!Xn);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=Lr+300-tt(),10<o)){if(Fn(i,t,aa,!Xn),Mn(i,0,!0)!==0)break e;jn=t,i.timeoutHandle=Op(ap.bind(null,i,n,Xt,Dr,Sc,t,aa,Ll,bi,Xn,c,"Throttled",-0,0),o);break e}ap(i,n,Xt,Dr,Sc,t,aa,Ll,bi,Xn,c,null,-0,0)}}break}while(!0);Fa(e)}function ap(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:un},Im(t,c,Q);var se=(c&62914560)===c?Lr-tt():(c&4194048)===c?Wm-tt():0;if(se=$0(Q,se),se!==null){jn=c,e.cancelPendingCommit=se(cp.bind(null,e,t,c,n,i,o,h,g,S,q,Q,null,O,M)),Fn(e,c,h,!T);return}}cp(e,t,c,n,i,o,h,g,S)}function n0(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 Fn(e,t,n,i){t&=~wc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var o=t;0<o;){var c=31-pt(o),h=1<<c;i[c]=-1,o&=~h}n!==0&&Vl(e,n,t)}function Ur(){return(Ve&6)===0?(gs(0),!1):!0}function kc(){if(Ae!==null){if(Xe===0)var e=Ae.return;else e=Ae,fn=Nl=null,Yo(e),fi=null,ts=0,e=Ae;for(;e!==null;)Lm(e.alternate,e),e=e.return;Ae=null}}function Si(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,j0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jn=0,kc(),et=e,Ae=n=cn(e.current,null),Re=t,Xe=0,ta=null,Xn=!1,gi=ln(e,t),bc=!1,bi=aa=wc=Ll=In=ht=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-pt(i),c=1<<o;t|=e[o],i&=~c}return Sn=t,nr(),n}function np(e,t){be=null,U.H=os,t===di||t===dr?(t=gh(),Xe=3):t===Ro?(t=gh(),Xe=4):Xe=t===lc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Ae===null&&(ht=1,_r(e,pa(t,e.current)))}function lp(){var e=Pt.current;return e===null?!0:(Re&4194048)===Re?ga===null:(Re&62914560)===Re||(Re&536870912)!==0?e===ga:!1}function ip(){var e=U.H;return U.H=os,e===null?os:e}function sp(){var e=U.A;return U.A=t0,e}function zr(){ht=4,Xn||(Re&4194048)!==Re&&Pt.current!==null||(gi=!0),(In&134217727)===0&&(Ll&134217727)===0||et===null||Fn(et,Re,aa,!1)}function Ac(e,t,n){var i=Ve;Ve|=2;var o=ip(),c=sp();(et!==e||Re!==t)&&(Dr=null,Si(e,t)),t=!1;var h=ht;e:do try{if(Xe!==0&&Ae!==null){var g=Ae,S=ta;switch(Xe){case 8:kc(),h=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var T=Xe;if(Xe=0,ta=null,ji(e,g,S,T),n&&gi){h=0;break e}break;default:T=Xe,Xe=0,ta=null,ji(e,g,S,T)}}l0(),h=ht;break}catch(q){np(e,q)}while(!0);return t&&e.shellSuspendCounter++,fn=Nl=null,Ve=i,U.H=o,U.A=c,Ae===null&&(et=null,Re=0,nr()),h}function l0(){for(;Ae!==null;)rp(Ae)}function i0(e,t){var n=Ve;Ve|=2;var i=ip(),o=sp();et!==e||Re!==t?(Dr=null,Mr=tt()+500,Si(e,t)):gi=ln(e,t);e:do try{if(Xe!==0&&Ae!==null){t=Ae;var c=ta;t:switch(Xe){case 1:Xe=0,ta=null,ji(e,t,c,1);break;case 2:case 9:if(yh(c)){Xe=0,ta=null,up(t);break}t=function(){Xe!==2&&Xe!==9||et!==e||(Xe=7),Fa(e)},c.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:yh(c)?(Xe=0,ta=null,up(t)):(Xe=0,ta=null,ji(e,t,c,7));break;case 5:var h=null;switch(Ae.tag){case 26:h=Ae.memoizedState;case 5:case 27:var g=Ae;if(h?Xp(h):g.stateNode.complete){Xe=0,ta=null;var S=g.sibling;if(S!==null)Ae=S;else{var T=g.return;T!==null?(Ae=T,Br(T)):Ae=null}break t}}Xe=0,ta=null,ji(e,t,c,5);break;case 6:Xe=0,ta=null,ji(e,t,c,6);break;case 8:kc(),ht=6;break e;default:throw Error(u(462))}}s0();break}catch(q){np(e,q)}while(!0);return fn=Nl=null,U.H=i,U.A=o,Ve=n,Ae!==null?0:(et=null,Re=0,nr(),ht)}function s0(){for(;Ae!==null&&!an();)rp(Ae)}function rp(e){var t=Tm(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?Br(e):Ae=t}function up(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_m(n,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=_m(n,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:Yo(t);default:Lm(n,t),t=Ae=sh(t,Sn),t=Tm(n,t,Sn)}e.memoizedProps=e.pendingProps,t===null?Br(e):Ae=t}function ji(e,t,n,i){fn=Nl=null,Yo(t),fi=null,ts=0;var o=t.return;try{if(Ig(e,o,t,n,Re)){ht=1,_r(e,pa(n,e.current)),Ae=null;return}}catch(c){if(o!==null)throw Ae=o,c;ht=1,_r(e,pa(n,e.current)),Ae=null;return}t.flags&32768?(Le||i===1?e=!0:gi||(Re&536870912)!==0?e=!1:(Xn=e=!0,(i===2||i===9||i===3||i===6)&&(i=Pt.current,i!==null&&i.tag===13&&(i.flags|=16384))),op(t,e)):Br(t)}function Br(e){var t=e;do{if((t.flags&32768)!==0){op(t,Xn);return}e=t.return;var n=Fg(t.alternate,t,Sn);if(n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ht===0&&(ht=5)}function op(e,t){do{var n=Wg(e.alternate,e);if(n!==null){n.flags&=32767,Ae=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=n}while(e!==null);ht=6,Ae=null}function cp(e,t,n,i,o,c,h,g,S){e.cancelPendingCommit=null;do qr();while(Et!==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&&(Ae=et=null,Re=0),wi=t,Jn=e,jn=n,jc=c,Nc=o,Pm=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,c0(Ga,function(){return pp(),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{Pg(e,t,n)}finally{Ve=h,J.p=o,U.T=i}}Et=1,dp(),fp(),hp()}}function dp(){if(Et===1){Et=0;var e=Jn,t=wi,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{Gm(t,e);var c=qc,h=Ff(e.containerInfo),g=c.focusedElem,S=c.selectionRange;if(h!==g&&g&&g.ownerDocument&&Jf(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(),se=g.textContent.length,me=Math.min(S.start,se),We=S.end===void 0?me:Math.min(S.end,se);!M.extend&&me>We&&(h=We,We=me,me=h);var k=Kf(g,me),_=Kf(g,We);if(k&&_&&(M.rangeCount!==1||M.anchorNode!==k.node||M.anchorOffset!==k.offset||M.focusNode!==_.node||M.focusOffset!==_.offset)){var R=Q.createRange();R.setStart(k.node,k.offset),M.removeAllRanges(),me>We?(M.addRange(R),M.extend(_.node,_.offset)):(R.setEnd(_.node,_.offset),M.addRange(R))}}}}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}}Fr=!!Bc,qc=Bc=null}finally{Ve=o,J.p=i,U.T=n}}e.current=t,Et=2}}function fp(){if(Et===2){Et=0;var e=Jn,t=wi,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{Hm(e,t.alternate,t)}finally{Ve=o,J.p=i,U.T=n}}Et=3}}function hp(){if(Et===4||Et===3){Et=0,nn();var e=Jn,t=wi,n=jn,i=Pm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Et=5:(Et=0,wi=Jn=null,mp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Kn=null),xl(n),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Qa,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}}(jn&3)!==0&&qr(),Fa(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===_c?vs++:(vs=0,_c=e):vs=0,gs(0)}}function mp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pi(t)))}function qr(){return dp(),fp(),hp(),pp()}function pp(){if(Et!==5)return!1;var e=Jn,t=jc;jc=0;var n=xl(jn),i=U.T,o=J.p;try{J.p=32>n?32:n,U.T=null,n=Nc,Nc=null;var c=Jn,h=jn;if(Et=0,wi=Jn=null,jn=0,(Ve&6)!==0)throw Error(u(331));var g=Ve;if(Ve|=4,Jm(c.current),Xm(c,c.current,h,n),Ve=g,gs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Qa,c)}catch{}return!0}finally{J.p=o,U.T=i,mp(e,t)}}function xp(e,t,n){t=pa(n,t),t=nc(e.stateNode,t,2),e=Vn(e,t,2),e!==null&&(sn(e,2),Fa(e))}function Ie(e,t,n){if(e.tag===3)xp(e,e,n);else for(;t!==null;){if(t.tag===3){xp(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kn===null||!Kn.has(i))){e=pa(n,e),n=ym(2),i=Vn(t,n,2),i!==null&&(vm(n,i,t,e),sn(i,2),Fa(i));break}}t=t.return}}function Ec(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new a0;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=r0.bind(null,e,t,n),t.then(e,e))}function r0(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Re&n)===n&&(ht===4||ht===3&&(Re&62914560)===Re&&300>tt()-Lr?(Ve&2)===0&&Si(e,0):wc|=n,bi===Re&&(bi=0)),Fa(e)}function yp(e,t){t===0&&(t=hl()),e=wl(e,t),e!==null&&(sn(e,t),Fa(e))}function u0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yp(e,n)}function o0(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),yp(e,n)}function c0(e,t){return Za(e,t)}var Hr=null,Ni=null,Cc=!1,$r=!1,Rc=!1,Wn=0;function Fa(e){e!==Ni&&e.next===null&&(Ni===null?Hr=Ni=e:Ni=Ni.next=e),$r=!0,Cc||(Cc=!0,f0())}function gs(e,t){if(!Rc&&$r){Rc=!0;do for(var n=!1,i=Hr;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-pt(42|e)+1)-1,c&=o&~(h&~g),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,wp(i,c))}else c=Re,c=Mn(i,i===et?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||ln(i,c)||(n=!0,wp(i,c));i=i.next}while(n);Rc=!1}}function d0(){vp()}function vp(){$r=Cc=!1;var e=0;Wn!==0&&S0()&&(e=Wn);for(var t=tt(),n=null,i=Hr;i!==null;){var o=i.next,c=gp(i,t);c===0?(i.next=null,n===null?Hr=o:n.next=o,o===null&&(Ni=n)):(n=i,(e!==0||(c&3)!==0)&&($r=!0)),i=o}Et!==0&&Et!==5||gs(e),Wn!==0&&(Wn=0)}function gp(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-pt(c),g=1<<h,S=o[h];S===-1?((g&n)===0||(g&i)!==0)&&(o[h]=Tt(g,t)):S<=t&&(e.expiredLanes|=g),c&=~g}if(t=et,n=Re,n=Mn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Tn(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&&Tn(i),xl(n)){case 2:case 8:n=fl;break;case 32:n=Ga;break;case 268435456:n=Yt;break;default:n=Ga}return i=bp.bind(null,e),n=Za(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&Tn(i),e.callbackPriority=2,e.callbackNode=null,2}function bp(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(qr()&&e.callbackNode!==n)return null;var i=Re;return i=Mn(e,e===et?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(tp(e,i,t),gp(e,tt()),e.callbackNode!=null&&e.callbackNode===n?bp.bind(null,e):null)}function wp(e,t){if(qr())return null;tp(e,t,!0)}function f0(){N0(function(){(Ve&6)!==0?Za(ke,d0):vp()})}function Tc(){if(Wn===0){var e=oi;e===0&&(e=Xa,Xa<<=1,(Xa&261888)===0&&(Xa=256)),Wn=e}return Wn}function Sp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ks(""+e)}function jp(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 h0(e,t,n,i,o){if(t==="submit"&&n&&n.stateNode===o){var c=Sp((o[wt]||null).action),h=i.submitter;h&&(t=(t=h[wt]||null)?Sp(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var g=new Ps("action","action",null,i,o);e.push({event:g,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Wn!==0){var S=h?jp(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?jp(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],m0=Lc.toLowerCase(),p0=Lc[0].toUpperCase()+Lc.slice(1);Ma(m0,"on"+p0)}Ma(eh,"onAnimationEnd"),Ma(th,"onAnimationIteration"),Ma(ah,"onAnimationStart"),Ma("dblclick","onDoubleClick"),Ma("focusin","onFocus"),Ma("focusout","onBlur"),Ma(Tg,"onTransitionRun"),Ma(Og,"onTransitionStart"),Ma(Lg,"onTransitionCancel"),Ma(nh,"onTransitionEnd"),Kl("onMouseEnter",["mouseout","mouseover"]),Kl("onMouseLeave",["mouseout","mouseover"]),Kl("onPointerEnter",["pointerout","pointerover"]),Kl("onPointerLeave",["pointerout","pointerover"]),yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yl("onBeforeInput",["compositionend","keypress","textInput","paste"]),yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yl("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(" "),x0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bs));function Np(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){ar(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){ar(q)}o.currentTarget=null,c=S}}}}function Ee(e,t){var n=t[Se];n===void 0&&(n=t[Se]=new Set);var i=e+"__bubble";n.has(i)||(_p(t,e,2,!1),n.add(i))}function Mc(e,t,n){var i=0;t&&(i|=4),_p(n,e,i,t)}var Yr="_reactListening"+Math.random().toString(36).slice(2);function Dc(e){if(!e[Yr]){e[Yr]=!0,vf.forEach(function(n){n!=="selectionchange"&&(x0.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 _p(e,t,n,i){switch(ex(t)){case 2:var o=Z0;break;case 8:o=G0;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=Ql(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}Rf(function(){var T=c,q=Wu(n),Q=[];e:{var O=lh.get(e);if(O!==void 0){var M=Ps,se=e;switch(e){case"keypress":if(Fs(n)===0)break e;case"keydown":case"keyup":M=og;break;case"focusin":se="focus",M=lo;break;case"focusout":se="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=Lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=Fv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=fg;break;case eh:case th:case ah:M=eg;break;case nh:M=mg;break;case"scroll":case"scrollend":M=Kv;break;case"wheel":M=xg;break;case"copy":case"cut":case"paste":M=ag;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=Df;break;case"toggle":case"beforetoggle":M=vg}var me=(t&4)!==0,We=!me&&(e==="scroll"||e==="scrollend"),k=me?O!==null?O+"Capture":null:O;me=[];for(var _=T,R;_!==null;){var G=_;if(R=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||R===null||k===null||(G=Yi(_,k),G!=null&&me.push(ws(_,G,R))),We)break;_=_.return}0<me.length&&(O=new M(O,se,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&&(se=n.relatedTarget||n.fromElement)&&(Ql(se)||se[Z]))break e;if((M||O)&&(O=q.window===q?q:(O=q.ownerDocument)?O.defaultView||O.parentWindow:window,M?(se=n.relatedTarget||n.toElement,M=T,se=se?Ql(se):null,se!==null&&(We=f(se),me=se.tag,se!==We||me!==5&&me!==27&&me!==6)&&(se=null)):(M=null,se=T),M!==se)){if(me=Lf,G="onMouseLeave",k="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(me=Df,G="onPointerLeave",k="onPointerEnter",_="pointer"),We=M==null?O:$i(M),R=se==null?O:$i(se),O=new me(G,_+"leave",M,n,q),O.target=We,O.relatedTarget=R,G=null,Ql(q)===T&&(me=new me(k,_+"enter",se,n,q),me.target=R,me.relatedTarget=We,G=me),We=G,M&&se)t:{for(me=y0,k=M,_=se,R=0,G=k;G;G=me(G))R++;G=0;for(var fe=_;fe;fe=me(fe))G++;for(;0<R-G;)k=me(k),R--;for(;0<G-R;)_=me(_),G--;for(;R--;){if(k===_||_!==null&&k===_.alternate){me=k;break t}k=me(k),_=me(_)}me=null}else me=null;M!==null&&kp(Q,O,M,me,!1),se!==null&&We!==null&&kp(Q,We,se,me,!0)}}e:{if(O=T?$i(T):window,M=O.nodeName&&O.nodeName.toLowerCase(),M==="select"||M==="input"&&O.type==="file")var He=Vf;else if($f(O))if(Zf)He=Eg;else{He=kg;var oe=_g}else M=O.nodeName,!M||M.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?T&&Ju(T.elementType)&&(He=Vf):He=Ag;if(He&&(He=He(e,T))){Yf(Q,He,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":($f(oe)||oe.contentEditable==="true")&&(ti=oe,co=T,Ji=null);break;case"focusout":Ji=co=ti=null;break;case"mousedown":fo=!0;break;case"contextmenu":case"mouseup":case"dragend":fo=!1,Wf(Q,n,q);break;case"selectionchange":if(Rg)break;case"keydown":case"keyup":Wf(Q,n,q)}var je;if(so)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else ei?qf(e,n)&&(Te="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Te="onCompositionStart");Te&&(Uf&&n.locale!=="ko"&&(ei||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&ei&&(je=Tf()):(Un=q,to="value"in Un?Un.value:Un.textContent,ei=!0)),oe=Vr(T,Te),0<oe.length&&(Te=new Mf(Te,e,null,n,q),Q.push({event:Te,listeners:oe}),je?Te.data=je:(je=Hf(n),je!==null&&(Te.data=je)))),(je=bg?wg(e,n):Sg(e,n))&&(Te=Vr(T,"onBeforeInput"),0<Te.length&&(oe=new Mf("onBeforeInput","beforeinput",null,n,q),Q.push({event:oe,listeners:Te}),oe.data=je)),h0(Q,e,T,n,q)}Np(Q,t)})}function ws(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vr(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=Yi(e,n),o!=null&&i.unshift(ws(e,o,c)),o=Yi(e,t),o!=null&&i.push(ws(e,o,c))),e.tag===3)return i;e=e.return}return[]}function y0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kp(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=Yi(n,c),T!=null&&h.unshift(ws(n,T,S))):o||(T=Yi(n,c),T!=null&&h.push(ws(n,T,S)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var v0=/\r\n?/g,g0=/\u0000|\uFFFD/g;function Ap(e){return(typeof e=="string"?e:""+e).replace(v0,`
|
|
49
|
+
`).replace(g0,"")}function Ep(e,t){return t=Ap(t),Ap(e)===t}function Fe(e,t,n,i,o,c){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Fl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Fl(e,""+i);break;case"className":Xs(e,"class",i);break;case"tabIndex":Xs(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Xs(e,n,i);break;case"style":Ef(e,i,c);break;case"data":if(t!=="object"){Xs(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=Ks(""+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"&&Fe(e,t,"name",o.name,o,null),Fe(e,t,"formEncType",o.formEncType,o,null),Fe(e,t,"formMethod",o.formMethod,o,null),Fe(e,t,"formTarget",o.formTarget,o,null)):(Fe(e,t,"encType",o.encType,o,null),Fe(e,t,"method",o.method,o,null),Fe(e,t,"target",o.target,o,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Ks(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=un);break;case"onScroll":i!=null&&Ee("scroll",e);break;case"onScrollEnd":i!=null&&Ee("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=Ks(""+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":Ee("beforetoggle",e),Ee("toggle",e),Qs(e,"popover",i);break;case"xlinkActuate":rn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":rn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":rn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":rn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":rn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":rn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":rn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":rn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":rn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Qs(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=Xv.get(n)||n,Qs(e,n,i))}}function zc(e,t,n,i,o,c){switch(n){case"style":Ef(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"?Fl(e,i):(typeof i=="number"||typeof i=="bigint")&&Fl(e,""+i);break;case"onScroll":i!=null&&Ee("scroll",e);break;case"onScrollEnd":i!=null&&Ee("scrollend",e);break;case"onClick":i!=null&&(e.onclick=un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gf.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[wt]||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,""):Qs(e,n,i)}}}function Dt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",e),Ee("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:Fe(e,t,c,h,n,null)}}o&&Fe(e,t,"srcSet",n.srcSet,n,null),i&&Fe(e,t,"src",n.src,n,null);return;case"input":Ee("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:Fe(e,t,i,q,n,null)}}Nf(e,c,g,S,T,h,o,!1);return;case"select":Ee("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:Fe(e,t,o,g,n,null)}t=c,n=h,e.multiple=!!i,t!=null?Jl(e,!!i,t,!1):n!=null&&Jl(e,!!i,n,!0);return;case"textarea":Ee("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:Fe(e,t,h,g,n,null)}kf(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:Fe(e,t,S,i,n,null)}return;case"dialog":Ee("beforetoggle",e),Ee("toggle",e),Ee("cancel",e),Ee("close",e);break;case"iframe":case"object":Ee("load",e);break;case"video":case"audio":for(i=0;i<bs.length;i++)Ee(bs[i],e);break;case"image":Ee("error",e),Ee("load",e);break;case"details":Ee("toggle",e);break;case"embed":case"source":case"link":Ee("error",e),Ee("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:Fe(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&&Fe(e,t,g,i,n,null))}function b0(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)||Fe(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&&Fe(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)||Fe(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&&Fe(e,t,o,c,i,S)}t=g,n=h,i=M,O!=null?Jl(e,!!n,O,!1):!!i!=!!n&&(t!=null?Jl(e,!!n,t,!0):Jl(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:Fe(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&&Fe(e,t,h,o,i,c)}_f(e,O,M);return;case"option":for(var se in n)if(O=n[se],n.hasOwnProperty(se)&&O!=null&&!i.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:Fe(e,t,se,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:Fe(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)&&Fe(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:Fe(e,t,T,O,i,M)}return;default:if(Ju(t)){for(var We in n)O=n[We],n.hasOwnProperty(We)&&O!==void 0&&!i.hasOwnProperty(We)&&zc(e,t,We,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)&&Fe(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||Fe(e,t,Q,O,i,M)}function Cp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w0(){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&&Cp(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&&Cp(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 Zr(e){return e.nodeType===9?e:e.ownerDocument}function Rp(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 Tp(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 S0(){var e=window.event;return e&&e.type==="popstate"?e===$c?!1:($c=e,!0):($c=null,!1)}var Op=typeof setTimeout=="function"?setTimeout:void 0,j0=typeof clearTimeout=="function"?clearTimeout:void 0,Lp=typeof Promise=="function"?Promise:void 0,N0=typeof queueMicrotask=="function"?queueMicrotask:typeof Lp<"u"?function(e){return Lp.resolve(null).then(e).catch(_0)}:Op;function _0(e){setTimeout(function(){throw e})}function Pn(e){return e==="head"}function Mp(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),Ei(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[ve]||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);Ei(t)}function Dp(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 Yc(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":Yc(n),xt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function k0(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[ve])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=ba(e.nextSibling),e===null)break}return null}function A0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ba(e.nextSibling),e===null))return null;return e}function Up(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ba(e.nextSibling),e===null))return null;return e}function Vc(e){return e.data==="$?"||e.data==="$~"}function Zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function E0(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 ba(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 zp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ba(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Bp(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 qp(e,t,n){switch(t=Zr(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]);xt(e)}var wa=new Map,Hp=new Set;function Gr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Nn=J.d;J.d={f:C0,r:R0,D:T0,C:O0,L:L0,m:M0,X:U0,S:D0,M:z0};function C0(){var e=Nn.f(),t=Ur();return e||t}function R0(e){var t=Xl(e);t!==null&&t.tag===5&&t.type==="form"?nm(t):Nn.r(e)}var _i=typeof document>"u"?null:document;function $p(e,t,n){var i=_i;if(i&&typeof t=="string"&&t){var o=ha(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Hp.has(o)||(Hp.add(o),e={rel:e,crossOrigin:n,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),Dt(t,"link",e),Ct(t),i.head.appendChild(t)))}}function T0(e){Nn.D(e),$p("dns-prefetch",e,null)}function O0(e,t){Nn.C(e,t),$p("preconnect",e,t)}function L0(e,t,n){Nn.L(e,t,n);var i=_i;if(i&&e&&t){var o='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+ha(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+ha(n.imageSizes)+'"]')):o+='[href="'+ha(e)+'"]';var c=o;switch(t){case"style":c=ki(e);break;case"script":c=Ai(e)}wa.has(c)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),wa.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(js(c))||t==="script"&&i.querySelector(Ns(c))||(t=i.createElement("link"),Dt(t,"link",e),Ct(t),i.head.appendChild(t)))}}function M0(e,t){Nn.m(e,t);var n=_i;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+ha(i)+'"][href="'+ha(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ai(e)}if(!wa.has(c)&&(e=j({rel:"modulepreload",href:e},t),wa.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"),Dt(i,"link",e),Ct(i),n.head.appendChild(i)}}}function D0(e,t,n){Nn.S(e,t,n);var i=_i;if(i&&e){var o=Il(i).hoistableStyles,c=ki(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=wa.get(c))&&Qc(e,n);var S=h=i.createElement("link");Ct(S),Dt(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,Qr(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:g},o.set(c,h)}}}function U0(e,t){Nn.X(e,t);var n=_i;if(n&&e){var i=Il(n).hoistableScripts,o=Ai(e),c=i.get(o);c||(c=n.querySelector(Ns(o)),c||(e=j({src:e,async:!0},t),(t=wa.get(o))&&Xc(e,t),c=n.createElement("script"),Ct(c),Dt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function z0(e,t){Nn.M(e,t);var n=_i;if(n&&e){var i=Il(n).hoistableScripts,o=Ai(e),c=i.get(o);c||(c=n.querySelector(Ns(o)),c||(e=j({src:e,async:!0,type:"module"},t),(t=wa.get(o))&&Xc(e,t),c=n.createElement("script"),Ct(c),Dt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Yp(e,t,n,i){var o=(o=B.current)?Gr(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=ki(n.href),n=Il(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=ki(n.href);var c=Il(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),wa.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},wa.set(e,n),c||B0(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=Ai(n),n=Il(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 ki(e){return'href="'+ha(e)+'"'}function js(e){return'link[rel="stylesheet"]['+e+"]"}function Vp(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function B0(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}),Dt(t,"link",n),Ct(t),e.head.appendChild(t))}function Ai(e){return'[src="'+ha(e)+'"]'}function Ns(e){return"script[async]"+e}function Zp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ha(n.href)+'"]');if(i)return t.instance=i,Ct(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"),Ct(i),Dt(i,"style",o),Qr(i,n.precedence,e),t.instance=i;case"stylesheet":o=ki(n.href);var c=e.querySelector(js(o));if(c)return t.state.loading|=4,t.instance=c,Ct(c),c;i=Vp(n),(o=wa.get(o))&&Qc(i,o),c=(e.ownerDocument||e).createElement("link"),Ct(c);var h=c;return h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Dt(c,"link",i),t.state.loading|=4,Qr(c,n.precedence,e),t.instance=c;case"script":return c=Ai(n.src),(o=e.querySelector(Ns(c)))?(t.instance=o,Ct(o),o):(i=n,(o=wa.get(c))&&(i=j({},n),Xc(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),Ct(o),Dt(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,Qr(i,n.precedence,e));return t.instance}function Qr(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 Xr=null;function Gp(e,t,n){if(Xr===null){var i=new Map,o=Xr=new Map;o.set(n,i)}else o=Xr,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[ve]||c[dt]||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 Qp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function q0(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 Xp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function H0(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=ki(i.href),c=t.querySelector(js(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ir.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Ct(c);return}c=t.ownerDocument||t,i=Vp(i),(o=wa.get(o))&&Qc(i,o),c=c.createElement("link"),Ct(c);var h=c;h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Dt(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=Ir.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ic=0;function $0(e,t){return e.stylesheets&&e.count===0&&Jr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Jr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ic===0&&(Ic=62500*w0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Jr(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 Ir(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Kr=null;function Jr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Kr=new Map,t.forEach(Y0,e),Kr=null,Ir.call(e))}function Y0(e,t){if(!(t.state.loading&4)){var n=Kr.get(e);if(n)var i=n.get(null);else{n=new Map,Kr.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=Ir.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 V0(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=ml(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ml(0),this.hiddenUpdates=ml(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 Ip(e,t,n,i,o,c,h,g,S,T,q,Q){return e=new V0(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 Kp(e){return e?(e=li,e):li}function Jp(e,t,n,i,o,c){o=Kp(o),i.context===null?i.context=o:i.pendingContext=o,i=Yn(t),i.payload={element:n},c=c===void 0?null:c,c!==null&&(i.callback=c),n=Vn(e,i,t),n!==null&&(It(n,e,t),ns(n,e,t))}function Fp(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){Fp(e,t),(e=e.alternate)&&Fp(e,t)}function Wp(e){if(e.tag===13||e.tag===31){var t=wl(e,67108864);t!==null&&It(t,e,67108864),Kc(e,67108864)}}function Pp(e){if(e.tag===13||e.tag===31){var t=na();t=Dn(t);var n=wl(e,t);n!==null&&It(n,e,t),Kc(e,t)}}var Fr=!0;function Z0(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 G0(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(Fr){var o=Fc(i);if(o===null)Uc(e,t,i,Wr,n),tx(e,i);else if(X0(o,e,t,n,i))i.stopPropagation();else if(tx(e,i),t&4&&-1<Q0.indexOf(e)){for(;o!==null;){var c=Xl(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-pt(h);g.entanglements[1]|=S,h&=~S}Fa(c),(Ve&6)===0&&(Mr=tt()+500,gs(0))}}break;case 31:case 13:g=wl(c,2),g!==null&&It(g,c,2),Ur(),Kc(c,2)}if(c=Fc(i),c===null&&Uc(e,t,i,Wr,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 Wr=null;function Wc(e){if(Wr=null,e=Ql(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 Wr=e,null}function ex(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(dl()){case ke:return 2;case fl:return 8;case Ga:case On:return 32;case Yt:return 268435456;default:return 32}default:return 32}}var Pc=!1,el=null,tl=null,al=null,ks=new Map,As=new Map,nl=[],Q0="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 tx(e,t){switch(e){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":al=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=Xl(t),t!==null&&Wp(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function X0(e,t,n,i,o){switch(t){case"focusin":return el=Es(el,e,t,n,i,o),!0;case"dragenter":return tl=Es(tl,e,t,n,i,o),!0;case"mouseover":return al=Es(al,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 ax(e){var t=Ql(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,La(e.priority,function(){Pp(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,La(e.priority,function(){Pp(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 Pr(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=Xl(n),t!==null&&Wp(t),e.blockedOn=n,!1;t.shift()}return!0}function nx(e,t,n){Pr(e)&&n.delete(t)}function I0(){Pc=!1,el!==null&&Pr(el)&&(el=null),tl!==null&&Pr(tl)&&(tl=null),al!==null&&Pr(al)&&(al=null),ks.forEach(nx),As.forEach(nx)}function eu(e,t){e.blockedOn===t&&(e.blockedOn=null,Pc||(Pc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,I0)))}var tu=null;function lx(e){tu!==e&&(tu=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){tu===e&&(tu=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=Xl(n);c!==null&&(e.splice(t,3),t-=3,Fo(c,{pending:!0,data:o,method:n.method,action:i},i,o))}}))}function Ei(e){function t(S){return eu(S,e)}el!==null&&eu(el,e),tl!==null&&eu(tl,e),al!==null&&eu(al,e),ks.forEach(t),As.forEach(t);for(var n=0;n<nl.length;n++){var i=nl[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<nl.length&&(n=nl[0],n.blockedOn===null);)ax(n),n.blockedOn===null&&nl.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[wt]||null;if(typeof c=="function")h||lx(n);else if(h){var g=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[wt]||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),lx(n)}}}function ix(){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}au.prototype.render=ed.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,i=na();Jp(n,i,e,t,null,null)},au.prototype.unmount=ed.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jp(e.current,2,null,e,null,null),Ur(),t[Z]=null}};function au(e){this._internalRoot=e}au.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<nl.length&&t!==0&&t<nl[n].priority;n++);nl.splice(n,0,e),n===0&&ax(e)}};var sx=l.version;if(sx!=="19.2.7")throw Error(u(527,sx,"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 K0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nu.isDisabled&&nu.supportsFiber)try{Qa=nu.inject(K0),at=nu}catch{}}return Rs.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,i="",o=hm,c=mm,h=pm;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=Ip(e,1,!1,null,null,n,i,null,o,c,h,ix),e[Z]=t.current,Dc(e),new ed(t)},Rs.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var i=!1,o="",c=hm,h=mm,g=pm,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=Ip(e,1,!0,t,n??null,i,o,S,c,h,g,ix),t.context=Kp(null),n=t.current,i=na(),i=Dn(i),o=Yn(i),o.callback=null,Vn(n,o,i),n=i,t.current.lanes=n,sn(t,n),Fa(t),e[Z]=t.current,Dc(e),new au(t)},Rs.version="19.2.7",Rs}var xx;function ib(){if(xx)return nd.exports;xx=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=lb(),nd.exports}var sb=ib();/**
|
|
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 Jd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,gy=/^[\\/]{2}/;function rb(a,l){return l+a.replace(/\\/g,"/")}var yx="popstate";function vx(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function ub(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 Od("",{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 cb(l,s,null,a)}function ot(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Aa(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function ob(){return Math.random().toString(36).substring(2,10)}function gx(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 Od(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||ob(),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 cb(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=vx(L)?L:Od($.location,L,H);v=w()+1;let P=gx(F,v),ne=$.createHref(F.mask||F);try{m.pushState(P,"",ne)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(ne)}f&&y&&y({action:x,location:$.location,delta:1})}function X(L,H){x="REPLACE";let F=vx(L)?L:Od($.location,L,H);v=w();let P=gx(F,v),ne=$.createHref(F.mask||F);m.replaceState(P,"",ne),f&&y&&y({action:x,location:$.location,delta:0})}function C(L){return db(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(yx,j),y=L,()=>{d.removeEventListener(yx,j),y=null}},createHref(L){return l(d,L)},createURL:C,encodeLocation(L){let H=C(L);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:D,replace:X,go(L){return m.go(L)}};return $}function db(a,l,s=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),ot(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 fb(a,l,s,!1)}function fb(a,l,s,u,d){let f=typeof l=="string"?Ui(l):l,m=En(f.pathname||"/",s);if(m==null)return null;let x=hb(a),y=null,v=Nb(m);for(let w=0;y==null&&w<x.length;++w)y=jb(x[w],v,u);return y}function hb(a){let l=wy(a);return mb(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;ot(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=qa([u,w.relativePath]),D=s.concat(w);m.children&&m.children.length>0&&(ot(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:wb(j,m.index),routesMeta:D.map((X,C)=>{let[$,L]=Ny(X.relativePath,X.caseSensitive,C===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 mb(a){a.sort((l,s)=>l.score!==s.score?s.score-l.score:Sb(l.routesMeta.map(u=>u.childrenIndex),s.routesMeta.map(u=>u.childrenIndex)))}var pb=/^:[\w-]+$/,xb=3,yb=2,vb=1,gb=10,bb=-2,bx=a=>a==="*";function wb(a,l){let s=a.split("/"),u=s.length;return s.some(bx)&&(u+=bb),l&&(u+=yb),s.filter(d=>!bx(d)).reduce((d,f)=>d+(pb.test(f)?xb:f===""?vb:gb),u)}function Sb(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 jb(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:qa([f,D.pathname]),pathnameBase:Ab(qa([f,D.pathnameBase])),route:X}),D.pathnameBase!=="/"&&(f=qa([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 C=x[D]||"";m=Li(f.slice(0,f.length-C.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){Aa(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 Nb(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Aa(!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 En(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 _b(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=wx(s.substring(1),"/"):f=wx(s,l)):f=l,{pathname:f,search:Eb(u),hash:Cb(d)}}function wx(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 kb(a){return a.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function Fd(a){let l=kb(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},ot(!d.pathname||!d.pathname.includes("?"),rd("?","pathname","search",d)),ot(!d.pathname||!d.pathname.includes("#"),rd("#","pathname","hash",d)),ot(!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=_b(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,"/"),qa=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 Ab=a=>Li(a).replace(/^\/*/,"/"),Eb=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Cb=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Rb=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 Tb(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Ob(a){let l=a.map(s=>s.route.path).filter(Boolean);return qa(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"||!Jd.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(rb(s,f.protocol)):new URL(s),x=En(m.pathname,l);m.origin===f.origin&&x!=null?s=x+m.search+m.hash:d=!0}catch{Aa(!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 Sx=new URL("http://localhost");function Wd(a){if(a.createURL)return a.createURL("/");try{return new URL(a.createHref("/"),Sx)}catch{return Sx}}function ud(a,l){return a.origin===l.origin&&(a.origin!=="null"||a.protocol===l.protocol&&a.host===l.host)}function Lb(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 Pd(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||!Lb(a,d)||!ud(d,f)))throw new Error("External navigation is not allowed")}var Ey=["POST","PUT","PATCH","DELETE"];new Set(Ey);var Mb=["GET",...Ey];new Set(Mb);var Db=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Ub(a){try{return Db.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 Cy=b.createContext(!1);function zb(){return b.useContext(Cy)}var Ry=b.createContext({isTransitioning:!1});Ry.displayName="ViewTransition";var Bb=b.createContext(new Map);Bb.displayName="Fetchers";var qb=b.createContext(null);qb.displayName="Await";var ra=b.createContext(null);ra.displayName="Navigation";var Vs=b.createContext(null);Vs.displayName="Location";var $a=b.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var ef=b.createContext(null);ef.displayName="RouteError";var Ty="REACT_ROUTER_ERROR",Hb="REDIRECT",$b="ROUTE_ERROR_RESPONSE";function Yb(a){if(a.startsWith(`${Ty}:${Hb}:{`))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 Vb(a){if(a.startsWith(`${Ty}:${$b}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new Rb(l.status,l.statusText,l.data)}catch{}}function Zb(a,{relative:l}={}){ot(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}=Zs(a,{relative:l}),x=f;return s!=="/"&&(x=f==="/"?s:qa([s,f])),u.createHref({pathname:x,search:m,hash:d})}function Bi(){return b.useContext(Vs)!=null}function Ea(){return ot(Bi(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Vs).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($a);return a?l1():Gb()}function Gb(){ot(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($a),{pathname:d}=Ea(),f=JSON.stringify(Fd(u)),m=b.useRef(!1);return Ly(()=>{m.current=!0}),b.useCallback((y,v={})=>{if(Aa(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:qa([l,w.pathname])),Pd(typeof y=="string"?y:Dl(y),s.createHref(w),Wd(s),"reject"),(v.replace?s.replace:s.push)(w,v.state,v)},[l,s,f,d,a])}b.createContext(null);function Qb(){let{matches:a}=b.useContext($a),l=a[a.length-1];return(l==null?void 0:l.params)??{}}function Zs(a,{relative:l}={}){let{matches:s}=b.useContext($a),{pathname:u}=Ea(),d=JSON.stringify(Fd(s));return b.useMemo(()=>Ou(a,JSON.parse(d),u,l==="path"),[a,d,u,l])}function Xb(a,l){return My(a,l)}function My(a,l,s){var L;ot(Bi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=b.useContext(ra),{matches:d}=b.useContext($a),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=Ea(),j;if(l){let H=typeof l=="string"?Ui(l):l;ot(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 C=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});Aa(v||C!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),Aa(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${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 $=Wb(C&&C.map(H=>Object.assign({},H,{params:Object.assign({},m,H.params),pathname:qa([y,u.encodeLocation?u.encodeLocation(H.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?y:qa([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(Vs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...j},navigationType:"POP"}},$):$}function Ib(){let a=n1(),l=Tb(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 Kb=b.createElement(Ib,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=Vb(a.digest);s&&(a=s)}let l=a!==void 0?b.createElement($a.Provider,{value:this.props.routeContext},b.createElement(ef.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?b.createElement(Jb,{error:a},l):l}};Dy.contextType=Cy;var od=new WeakMap;function Jb({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(Pd(d.location,x,Wd(u),"allow-explicit"),Ub(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 Fb({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($a.Provider,{value:a},s)}function Wb(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);ot(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,C=j.route.loader&&!D.hasOwnProperty(j.route.id)&&(!X||X[j.route.id]===void 0);if(j.route.lazy||C){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:Ob(u.matches),errorInfo:j})}:void 0;return d.reduceRight((w,j,D)=>{let X,C=!1,$=null,L=null;u&&(X=f&&j.route.id?f[j.route.id]:void 0,$=j.route.errorElement||Kb,m&&(x<0&&D===0?(Uy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,L=null):x===D&&(C=!0,L=j.route.hydrateFallbackElement||null)));let H=l.concat(d.slice(0,D+1)),F=()=>{let P;return X?P=$:C?P=L:j.route.Component?P=b.createElement(j.route.Component,null):j.route.element?P=j.route.element:P=w,b.createElement(Fb,{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 tf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pb(a){let l=b.useContext(zi);return ot(l,tf(a)),l}function e1(a){let l=b.useContext(Lu);return ot(l,tf(a)),l}function t1(a){let l=b.useContext($a);return ot(l,tf(a)),l}function af(a){let l=t1(a),s=l.matches[l.matches.length-1];return ot(s.route.id,`${a} can only be used on routes that contain a unique "id"`),s.route.id}function a1(){return af("useRouteId")}function n1(){var u;let a=b.useContext(ef),l=e1("useRouteError"),s=af("useRouteError");return a!==void 0?a:(u=l.errors)==null?void 0:u[s]}function l1(){let{router:a}=Pb("useNavigate"),l=af("useNavigate"),s=b.useRef(!1);return Ly(()=>{s.current=!0}),b.useCallback(async(d,f={})=>{Aa(s.current,Oy),s.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:l,...f}))},[a,l])}var jx={};function Uy(a,l,s){!l&&!jx[a]&&(jx[a]=!0,Aa(!1,s))}b.memo(i1);function i1({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}){ot(Bi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:f}=b.useContext(ra);Aa(!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($a),{pathname:x}=Ea(),y=Mu(),v=Ou(a,Fd(m),x,u==="path");Pd(typeof a=="string"?a:Dl(a),f.createHref(v),Wd(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 Ml(a){ot(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function s1({basename:a="/",children:l=null,location:s,navigationType:u="POP",navigator:d,static:f=!1,useTransitions:m}){ot(!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:C}=s,$=b.useMemo(()=>{let L=En(v,x);return L==null?null:{location:{pathname:L,search:w,hash:j,state:D,key:X,mask:C},navigationType:u}},[x,v,w,j,D,X,u,C]);return Aa($!=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(Vs.Provider,{children:l,value:$}))}function r1({children:a,location:l}){return Xb(Ld(a),l)}function Ld(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,Ld(u.props.children,f));return}ot(u.type===Ml,`[${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>`),ot(!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=Ld(u.props.children,f)),s.push(m)}),s}var fu="get",hu="application/x-www-form-urlencoded";function Du(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function u1(a){return Du(a)&&a.tagName.toLowerCase()==="button"}function o1(a){return Du(a)&&a.tagName.toLowerCase()==="form"}function c1(a){return Du(a)&&a.tagName.toLowerCase()==="input"}function d1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function f1(a,l){return a.button===0&&(!l||l==="_self")&&!d1(a)}function Md(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 h1(a,l){let s=Md(a);return l&&l.forEach((u,d)=>{s.has(d)||l.getAll(d).forEach(f=>{s.append(d,f)})}),s}var lu=null;function m1(){if(lu===null)try{new FormData(document.createElement("form"),0),lu=!1}catch{lu=!0}return lu}var p1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function cd(a){return a!=null&&!p1.has(a)?(Aa(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hu}"`),null):a}function x1(a,l){let s,u,d,f,m;if(o1(a)){let x=a.getAttribute("action");u=x?En(x,l):null,s=a.getAttribute("method")||fu,d=cd(a.getAttribute("enctype"))||hu,f=new FormData(a)}else if(u1(a)||c1(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?En(y,l):null,s=a.getAttribute("formmethod")||x.getAttribute("method")||fu,d=cd(a.getAttribute("formenctype"))||cd(x.getAttribute("enctype"))||hu,f=new FormData(x,a),!m1()){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=fu,u=null,d=hu,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 nf(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&&En(d.pathname,l)==="/"?d.pathname=`${Li(l)}/_root.${u}`:d.pathname=`${Li(d.pathname)}.${u}`,d}async function y1(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 v1(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 g1(a,l,s){let u=await Promise.all(a.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await y1(f,s);return m.links?m.links():[]}return[]}));return j1(u.flat(1).filter(v1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Nx(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 b1(a,l,{includeHydrateFallback:s}={}){return w1(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 w1(a){return[...new Set(a)]}function S1(a){let l={},s=Object.keys(a).sort();for(let u of s)l[u]=a[u];return l}function j1(a,l){let s=new Set;return new Set(l),a.reduce((u,d)=>{let f=JSON.stringify(S1(d));return s.has(f)||(s.add(f),u.push({key:f,link:d})),u},[])}function lf(){let a=b.useContext(zi);return nf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function N1(){let a=b.useContext(Lu);return nf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var sf=b.createContext(void 0);sf.displayName="FrameworkContext";function Uu(){let a=b.useContext(sf);return nf(a,"You must render this element inside a <HydratedRouter> element"),a}function _1(a,l){let s=b.useContext(sf),[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)},C=()=>{d(!1),m(!1)};return s?a!=="intent"?[f,D,{}]:[f,D,{onFocus:Ts(x,X),onBlur:Ts(y,C),onMouseEnter:Ts(v,X),onMouseLeave:Ts(w,C),onTouchStart:Ts(j,X)}]:[!1,D,{}]}function Ts(a,l){return s=>{a&&a(s),s.defaultPrevented||l(s)}}function k1({page:a,...l}){let s=zb(),{nonce:u}=Uu(),{router:d}=lf(),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(E1,{page:a,matches:f,...l}):b.createElement(C1,{page:a,matches:f,...l})):null}function A1(a){let{manifest:l,routeModules:s}=Uu(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return g1(a,l,s).then(m=>{f||d(m)}),()=>{f=!0}},[a,l,s]),u}function E1({page:a,matches:l,...s}){let u=Ea(),{future:d}=Uu(),{basename:f}=lf(),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=Ea(),{future:d,manifest:f,routeModules:m}=Uu(),{basename:x}=lf(),{loaderData:y,matches:v}=N1(),w=b.useMemo(()=>Nx(a,l,v,f,u,"data"),[a,l,v,f,u]),j=b.useMemo(()=>Nx(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 ne;let P=f.routes[F.route.id];!P||!P.hasLoader||(!w.some(V=>V.route.id===F.route.id)&&F.route.id in y&&((ne=m[F.route.id])!=null&&ne.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(()=>b1(j,f),[j,f]),C=A1(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})),C.map(({key:$,link:L})=>b.createElement("link",{key:$,nonce:s.nonce,...L,crossOrigin:L.crossOrigin??s.crossOrigin})))}function R1(...a){return l=>{a.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var T1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{T1&&(window.__reactRouterVersion="7.18.4")}catch{}function O1({basename:a,children:l,useTransitions:s,window:u}){let d=b.useRef();d.current==null&&(d.current=ub({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(s1,{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,...C},$){let{basename:L,navigator:H,useTransitions:F}=b.useContext(ra),P=typeof w=="string"&&Jd.test(w),ne=Ay(w,L);w=ne.to;let V=Zb(w,{relative:d}),_e=Ea(),I=null;if(x){let Ge=Ou(x,[],_e.mask?_e.mask.pathname:"/",!0);L!=="/"&&(Ge.pathname=Ge.pathname==="/"?L:qa([L,Ge.pathname])),I=H.createHref(Ge)}let[ye,Ue,gt]=_1(u,C),At=D1(w,{replace:m,mask:x,state:y,target:v,preventScrollReset:j,relative:d,viewTransition:D,defaultShouldRevalidate:X,useTransitions:F});function rt(Ge){l&&l(Ge),Ge.defaultPrevented||At(Ge)}let mt=!(ne.isExternal||f),nt=b.createElement("a",{...C,...gt,href:(mt?I:void 0)||ne.absoluteURL||V,onClick:mt?rt:l,ref:R1($,Ue),target:v,"data-discover":!P&&s==="render"?"true":void 0});return ye&&!P?b.createElement(b.Fragment,null,nt,b.createElement(k1,{page:V})):nt});sa.displayName="Link";var mu=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=Zs(m,{relative:v.relative}),D=Ea(),X=b.useContext(Lu),{navigator:C,basename:$}=b.useContext(ra),L=X!=null&&H1(j)&&x===!0,H=C.encodeLocation?C.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=En(P,$)||P);const ne=H!=="/"&&H.endsWith("/")?H.length-1:H.length;let V=F===H||!d&&F.startsWith(H)&&F.charAt(ne)==="/",_e=P!=null&&(P===H||!d&&P.startsWith(H)&&P.charAt(H.length)==="/"),I={isActive:V,isPending:_e,isTransitioning:L},ye=V?l:void 0,Ue;typeof u=="function"?Ue=u(I):Ue=[u,V?"active":null,_e?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let gt=typeof f=="function"?f(I):f;return b.createElement(sa,{...v,"aria-current":ye,className:Ue,ref:w,style:gt,to:m,viewTransition:x},typeof y=="function"?y(I):y)});mu.displayName="NavLink";var L1=b.forwardRef(({discover:a="render",fetcherKey:l,navigate:s,reloadDocument:u,replace:d,state:f,method:m=fu,action:x,onSubmit:y,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D,...X},C)=>{let{useTransitions:$}=b.useContext(ra),L=B1(),H=q1(x,{relative:v}),F=m.toLowerCase()==="get"?"get":"post",P=typeof x=="string"&&Jd.test(x),ne=V=>{if(y&&y(V),V.defaultPrevented)return;V.preventDefault();let _e=V.nativeEvent.submitter,I=(_e==null?void 0:_e.getAttribute("formmethod"))||m,ye=()=>L(_e||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:C,method:F,action:H,onSubmit:u?y:ne,...X,"data-discover":!P&&a==="render"?"true":void 0})});L1.displayName="Form";function M1(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 ot(l,M1(a)),l}function D1(a,{target:l,replace:s,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y,useTransitions:v}={}){let w=Mu(),j=Ea(),D=Zs(a,{relative:m});return b.useCallback(X=>{if(f1(X,l)){X.preventDefault();let C=s!==void 0?s:Dl(j)===Dl(D),$=()=>w(a,{replace:C,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){Aa(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(Md(a)),s=b.useRef(!1),u=Ea(),d=b.useMemo(()=>h1(u.search,s.current?null:l.current),[u.search]),f=Mu(),m=b.useCallback((x,y)=>{const v=Md(typeof x=="function"?x(new URLSearchParams(d)):x);s.current=!0,f("?"+v,y)},[f,d]);return[d,m]}var U1=0,z1=()=>`__${String(++U1)}__`;function B1(){let{router:a}=qy("useSubmit"),{basename:l}=b.useContext(ra),s=a1(),u=a.fetch,d=a.navigate;return b.useCallback(async(f,m={})=>{let{action:x,method:y,encType:v,formData:w,body:j}=x1(f,l);if(m.navigate===!1){let D=m.fetcherKey||z1();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 q1(a,{relative:l}={}){let{basename:s}=b.useContext(ra),u=b.useContext($a);ot(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...Zs(a||".",{relative:l})},m=Ea();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:qa([s,f.pathname])),Dl(f)}function H1(a,{relative:l}={}){let s=b.useContext(Ry);ot(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=Zs(a,{relative:l});if(!s.isTransitioning)return!1;let f=En(s.currentLocation.pathname,u)||s.currentLocation.pathname,m=En(s.nextLocation.pathname,u)||s.nextLocation.pathname;return yu(d.pathname,m)!=null||yu(d.pathname,f)!=null}var Be;(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})(Be||(Be={}));var _x;(function(a){a.mergeShapes=(l,s)=>({...l,...s})})(_x||(_x={}));const ie=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rl=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=Be.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,Be.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 Dd=(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,Be.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:s=`Unrecognized key(s) in object: ${Be.joinValues(a.keys,", ")}`;break;case K.invalid_union:s="Invalid input";break;case K.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Be.joinValues(a.options)}`;break;case K.invalid_enum_value:s=`Invalid enum value. Expected ${Be.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}"`:Be.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,Be.assertNever(a)}return{message:s}};let $1=Dd;function Y1(){return $1}const V1=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 ee(a,l){const s=Y1(),u=V1({issueData:l,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,s,s===Dd?void 0:Dd].filter(d=>!!d)});a.common.issues.push(u)}class Ht{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 Ht.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}),Ca=a=>({status:"valid",value:a}),kx=a=>a.status==="aborted",Ax=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 tn{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 Ex=(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 Ne(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 Oe{get description(){return this._def.description}_getType(l){return rl(l.data)}_getOrReturnCtx(l,s){return s||{common:l.parent.common,data:l.data,parsedType:rl(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}_processInputParams(l){return{status:new Ht,ctx:{common:l.parent.common,data:l.data,parsedType:rl(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:rl(l)},d=this._parseSync({data:l,path:u.path,parent:u});return Ex(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:rl(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:rl(l)},d=this._parse({data:l,path:u.path,parent:u}),f=await(vu(d)?d:Promise.resolve(d));return Ex(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 An.create(this,this._def)}nullable(){return $l.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return en.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({...Ne(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:l}})}default(l){const s=typeof l=="function"?l:()=>l;return new _u({...Ne(this._def),innerType:this,defaultValue:s,typeName:xe.ZodDefault})}brand(){return new Zy({typeName:xe.ZodBranded,type:this,...Ne(this._def)})}catch(l){const s=typeof l=="function"?l:()=>l;return new ku({...Ne(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 uf.create(this,l)}readonly(){return Au.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z1=/^c[^\s-]{8,}$/i,G1=/^[0-9a-z]+$/,Q1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,X1=/^[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,I1=/^[a-z0-9_-]{21}$/i,K1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,J1=/^[-+]?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)?)??$/,F1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dd;const P1=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,tw=/^(([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]))$/,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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lw=/^([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])))",iw=new RegExp(`^${$y}$`);function Yy(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 sw(a){return new RegExp(`^${Yy(a)}$`)}function rw(a){let l=`${$y}T${Yy(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 uw(a,l){return!!((l==="v4"||!l)&&P1.test(a)||(l==="v6"||!l)&&tw.test(a))}function ow(a,l){if(!K1.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 cw(a,l){return!!((l==="v4"||!l)&&ew.test(a)||(l==="v6"||!l)&&aw.test(a))}class Wa extends Oe{_parse(l){if(this._def.coerce&&(l.data=String(l.data)),this._getType(l)!==ie.string){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:ie.string,received:f.parsedType}),pe}const u=new Ht;let d;for(const f of this._def.checks)if(f.kind==="min")l.data.length<f.value&&(d=this._getOrReturnCtx(l,d),ee(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),ee(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?ee(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):x&&ee(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")F1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"email",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")dd||(dd=new RegExp(W1,"u")),dd.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"emoji",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")X1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"uuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")I1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"nanoid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")Z1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"cuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")G1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"cuid2",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")Q1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(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),ee(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),ee(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),ee(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),ee(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),ee(d,{code:K.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?rw(f).test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?iw.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?sw(f).test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?J1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"duration",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?uw(l.data,f.version)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"ip",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?ow(l.data,f.alg)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"jwt",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?cw(l.data,f.version)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"cidr",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?nw.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"base64",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?lw.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"base64url",code:K.invalid_string,message:f.message}),u.dirty()):Be.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 Wa({...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 Wa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wa({...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}}Wa.create=a=>new Wa({checks:[],typeName:xe.ZodString,coerce:(a==null?void 0:a.coerce)??!1,...Ne(a)});function dw(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 Oe{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 ee(f,{code:K.invalid_type,expected:ie.number,received:f.parsedType}),pe}let u;const d=new Ht;for(const f of this._def.checks)f.kind==="int"?Be.isInteger(l.data)||(u=this._getOrReturnCtx(l,u),ee(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),ee(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),ee(u,{code:K.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="multipleOf"?dw(l.data,f.value)!==0&&(u=this._getOrReturnCtx(l,u),ee(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),ee(u,{code:K.not_finite,message:f.message}),d.dirty()):Be.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"&&Be.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,...Ne(a)});class zl extends Oe{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 Ht;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),ee(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),ee(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),ee(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):Be.assertNever(f);return{status:d.value,value:l.data}}_getInvalidInput(l){const s=this._getOrReturnCtx(l);return ee(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,...Ne(a)});class gu extends Oe{_parse(l){if(this._def.coerce&&(l.data=!!l.data),this._getType(l)!==ie.boolean){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:ie.boolean,received:u.parsedType}),pe}return Ca(l.data)}}gu.create=a=>new gu({typeName:xe.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...Ne(a)});class Di extends Oe{_parse(l){if(this._def.coerce&&(l.data=new Date(l.data)),this._getType(l)!==ie.date){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:ie.date,received:f.parsedType}),pe}if(Number.isNaN(l.data.getTime())){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_date}),pe}const u=new Ht;let d;for(const f of this._def.checks)f.kind==="min"?l.data.getTime()<f.value&&(d=this._getOrReturnCtx(l,d),ee(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),ee(d,{code:K.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):Be.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,...Ne(a)});class Cx extends Oe{_parse(l){if(this._getType(l)!==ie.symbol){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:ie.symbol,received:u.parsedType}),pe}return Ca(l.data)}}Cx.create=a=>new Cx({typeName:xe.ZodSymbol,...Ne(a)});class Ud extends Oe{_parse(l){if(this._getType(l)!==ie.undefined){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:ie.undefined,received:u.parsedType}),pe}return Ca(l.data)}}Ud.create=a=>new Ud({typeName:xe.ZodUndefined,...Ne(a)});class zd extends Oe{_parse(l){if(this._getType(l)!==ie.null){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:ie.null,received:u.parsedType}),pe}return Ca(l.data)}}zd.create=a=>new zd({typeName:xe.ZodNull,...Ne(a)});class Rx extends Oe{constructor(){super(...arguments),this._any=!0}_parse(l){return Ca(l.data)}}Rx.create=a=>new Rx({typeName:xe.ZodAny,...Ne(a)});class Bd extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(l){return Ca(l.data)}}Bd.create=a=>new Bd({typeName:xe.ZodUnknown,...Ne(a)});class cl extends Oe{_parse(l){const s=this._getOrReturnCtx(l);return ee(s,{code:K.invalid_type,expected:ie.never,received:s.parsedType}),pe}}cl.create=a=>new cl({typeName:xe.ZodNever,...Ne(a)});class Tx extends Oe{_parse(l){if(this._getType(l)!==ie.undefined){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:ie.void,received:u.parsedType}),pe}return Ca(l.data)}}Tx.create=a=>new Tx({typeName:xe.ZodVoid,...Ne(a)});class en extends Oe{_parse(l){const{ctx:s,status:u}=this._processInputParams(l),d=this._def;if(s.parsedType!==ie.array)return ee(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)&&(ee(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&&(ee(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&&(ee(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 tn(s,m,s.path,x)))).then(m=>Ht.mergeArray(u,m));const f=[...s.data].map((m,x)=>d.type._parseSync(new tn(s,m,s.path,x)));return Ht.mergeArray(u,f)}get element(){return this._def.type}min(l,s){return new en({...this._def,minLength:{value:l,message:ce.toString(s)}})}max(l,s){return new en({...this._def,maxLength:{value:l,message:ce.toString(s)}})}length(l,s){return new en({...this._def,exactLength:{value:l,message:ce.toString(s)}})}nonempty(l){return this.min(1,l)}}en.create=(a,l)=>new en({type:a,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Ne(l)});function Ri(a){if(a instanceof kt){const l={};for(const s in a.shape){const u=a.shape[s];l[s]=An.create(Ri(u))}return new kt({...a._def,shape:()=>l})}else return a instanceof en?new en({...a._def,type:Ri(a.element)}):a instanceof An?An.create(Ri(a.unwrap())):a instanceof $l?$l.create(Ri(a.unwrap())):a instanceof Bl?Bl.create(a.items.map(l=>Ri(l))):a}class kt extends Oe{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=Be.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 ee(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 cl&&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 tn(d,j,d.path,v)),alwaysSet:v in d.data})}if(this._def.catchall instanceof cl){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&&(ee(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 tn(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=>Ht.mergeObjectSync(u,v)):Ht.mergeObjectSync(u,y)}get shape(){return this._def.shape()}strict(l){return ce.errToObj,new kt({...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 kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(l){return new kt({...this._def,shape:()=>({...this._def.shape(),...l})})}merge(l){return new kt({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 kt({...this._def,catchall:l})}pick(l){const s={};for(const u of Be.objectKeys(l))l[u]&&this.shape[u]&&(s[u]=this.shape[u]);return new kt({...this._def,shape:()=>s})}omit(l){const s={};for(const u of Be.objectKeys(this.shape))l[u]||(s[u]=this.shape[u]);return new kt({...this._def,shape:()=>s})}deepPartial(){return Ri(this)}partial(l){const s={};for(const u of Be.objectKeys(this.shape)){const d=this.shape[u];l&&!l[u]?s[u]=d:s[u]=d.optional()}return new kt({...this._def,shape:()=>s})}required(l){const s={};for(const u of Be.objectKeys(this.shape))if(l&&!l[u])s[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof An;)f=f._def.innerType;s[u]=f}return new kt({...this._def,shape:()=>s})}keyof(){return Vy(Be.objectKeys(this.shape))}}kt.create=(a,l)=>new kt({shape:()=>a,unknownKeys:"strip",catchall:cl.create(),typeName:xe.ZodObject,...Ne(l)});kt.strictCreate=(a,l)=>new kt({shape:()=>a,unknownKeys:"strict",catchall:cl.create(),typeName:xe.ZodObject,...Ne(l)});kt.lazycreate=(a,l)=>new kt({shape:a,unknownKeys:"strip",catchall:cl.create(),typeName:xe.ZodObject,...Ne(l)});class bu extends Oe{_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 ee(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 ee(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,...Ne(l)});const kn=a=>a instanceof Hd?kn(a.schema):a instanceof Hl?kn(a.innerType()):a instanceof ju?[a.value]:a instanceof ql?a.options:a instanceof $d?Be.objectValues(a.enum):a instanceof _u?kn(a._def.innerType):a instanceof Ud?[void 0]:a instanceof zd?[null]:a instanceof An?[void 0,...kn(a.unwrap())]:a instanceof $l?[null,...kn(a.unwrap())]:a instanceof Zy||a instanceof Au?kn(a.unwrap()):a instanceof ku?kn(a._def.innerType):[];class rf extends Oe{_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==ie.object)return ee(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}):(ee(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=kn(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 rf({typeName:xe.ZodDiscriminatedUnion,discriminator:l,options:s,optionsMap:d,...Ne(u)})}}function qd(a,l){const s=rl(a),u=rl(l);if(a===l)return{valid:!0,data:a};if(s===ie.object&&u===ie.object){const d=Be.objectKeys(l),f=Be.objectKeys(a).filter(x=>d.indexOf(x)!==-1),m={...a,...l};for(const x of f){const y=qd(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=qd(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 Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l),d=(f,m)=>{if(kx(f)||kx(m))return pe;const x=qd(f.value,m.value);return x.valid?((Ax(f)||Ax(m))&&s.dirty(),{status:s.value,value:x.data}):(ee(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,...Ne(s)});class Bl extends Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==ie.array)return ee(u,{code:K.invalid_type,expected:ie.array,received:u.parsedType}),pe;if(u.data.length<this._def.items.length)return ee(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&&(ee(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 tn(u,m,u.path,x)):null}).filter(m=>!!m);return u.common.async?Promise.all(f).then(m=>Ht.mergeArray(s,m)):Ht.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,...Ne(l)})};class Su extends Oe{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 ee(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 tn(u,x,u.path,x)),value:m._parse(new tn(u,u.data[x],u.path,x)),alwaysSet:x in u.data});return u.common.async?Ht.mergeObjectAsync(s,d):Ht.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(l,s,u){return s instanceof Oe?new Su({keyType:l,valueType:s,typeName:xe.ZodRecord,...Ne(u)}):new Su({keyType:Wa.create(),valueType:l,typeName:xe.ZodRecord,...Ne(s)})}}class Ox extends Oe{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 ee(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 tn(u,x,u.path,[v,"key"])),value:f._parse(new tn(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}}}}Ox.create=(a,l,s)=>new Ox({valueType:l,keyType:a,typeName:xe.ZodMap,...Ne(s)});class qs extends Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==ie.set)return ee(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&&(ee(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&&(ee(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 tn(u,y,u.path,v)));return u.common.async?Promise.all(x).then(y=>m(y)):m(x)}min(l,s){return new qs({...this._def,minSize:{value:l,message:ce.toString(s)}})}max(l,s){return new qs({...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)}}qs.create=(a,l)=>new qs({valueType:a,minSize:null,maxSize:null,typeName:xe.ZodSet,...Ne(l)});class Hd extends Oe{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})}}Hd.create=(a,l)=>new Hd({getter:a,typeName:xe.ZodLazy,...Ne(l)});class ju extends Oe{_parse(l){if(l.data!==this._def.value){const s=this._getOrReturnCtx(l);return ee(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,...Ne(l)});function Vy(a,l){return new ql({values:a,typeName:xe.ZodEnum,...Ne(l)})}class ql extends Oe{_parse(l){if(typeof l.data!="string"){const s=this._getOrReturnCtx(l),u=this._def.values;return ee(s,{expected:Be.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 ee(s,{received:s.data,code:K.invalid_enum_value,options:u}),pe}return Ca(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=Vy;class $d extends Oe{_parse(l){const s=Be.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(l);if(u.parsedType!==ie.string&&u.parsedType!==ie.number){const d=Be.objectValues(s);return ee(u,{expected:Be.joinValues(d),received:u.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(Be.getValidEnumValues(this._def.values))),!this._cache.has(l.data)){const d=Be.objectValues(s);return ee(u,{received:u.data,code:K.invalid_enum_value,options:d}),pe}return Ca(l.data)}get enum(){return this._def.values}}$d.create=(a,l)=>new $d({values:a,typeName:xe.ZodNativeEnum,...Ne(l)});class Nu extends Oe{unwrap(){return this._def.type}_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==ie.promise&&s.common.async===!1)return ee(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 Ca(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,...Ne(l)});class Hl extends Oe{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=>{ee(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);Be.assertNever(d)}}Hl.create=(a,l,s)=>new Hl({schema:a,typeName:xe.ZodEffects,effect:l,...Ne(s)});Hl.createWithPreprocess=(a,l,s)=>new Hl({schema:l,effect:{type:"preprocess",transform:a},typeName:xe.ZodEffects,...Ne(s)});class An extends Oe{_parse(l){return this._getType(l)===ie.undefined?Ca(void 0):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}An.create=(a,l)=>new An({innerType:a,typeName:xe.ZodOptional,...Ne(l)});class $l extends Oe{_parse(l){return this._getType(l)===ie.null?Ca(null):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}$l.create=(a,l)=>new $l({innerType:a,typeName:xe.ZodNullable,...Ne(l)});class _u extends Oe{_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,...Ne(l)});class ku extends Oe{_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,...Ne(l)});class Lx extends Oe{_parse(l){if(this._getType(l)!==ie.nan){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:ie.nan,received:u.parsedType}),pe}return{status:"valid",value:l.data}}}Lx.create=a=>new Lx({typeName:xe.ZodNaN,...Ne(a)});class Zy extends Oe{_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 uf extends Oe{_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 uf({in:l,out:s,typeName:xe.ZodPipeline})}}class Au extends Oe{_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,...Ne(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=Wa.create,A=Ul.create;zl.create;const Me=gu.create;Di.create;const Gy=Bd.create;cl.create;const ae=en.create,z=kt.create,fw=bu.create,Qy=rf.create;wu.create;Bl.create;const Hs=Su.create,ka=ju.create,he=ql.create;Nu.create;An.create;$l.create;const Mx={string:(a=>Wa.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}))},hw=pe,mw=p().regex(/^github\.com\/[^/]+\/[^/]+$/,"Expected github.com/<owner>/<repo>"),pw=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;function xw(a){const l=a.trim();return l?!!(l.startsWith("/")||l.startsWith("~")||l.startsWith(".")||/^[A-Za-z]:[\\/]/.test(l)||l.startsWith("\\\\")):!1}function of(a){const l=a.trim();if(!l)throw new Error("Repository is required");if(xw(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=pw.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=mw.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 of(a).identity}catch(s){return l.addIssue({code:K.custom,message:s.message}),hw}}),Iy="repo:",yw=he(["resolved","unresolved","conflict","invalid"]),vw=z({status:yw,repository:p().optional(),sourceLabel:p().optional(),labels:ae(p()).optional(),error:p().optional()});function gw(a){return a?a.filter(l=>l.toLowerCase().startsWith(Iy)):[]}const bw=100,ww=z({label:p(),repository:p()});z({mappings:ae(ww).max(bw+1)});function Ky(a){const l=gw(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:of(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 $t=he(["claude_code","cursor_local","codex_local","muse_code"]),Ha=z({maxTurns:A().positive().nullable().optional(),maxBudgetUsd:A().positive().nullable().optional()}),Fy=z({plan:Ha.optional(),execute:Ha.optional(),reflect:Ha.optional()});function pu(a){if(!(a!=null&&a.trim()))return null;try{const l=Ha.parse(JSON.parse(a));return l.maxTurns==null&&l.maxBudgetUsd==null?null:l}catch{return null}}function Sw(a){return!a||a.maxTurns==null&&a.maxBudgetUsd==null?null:JSON.stringify(a)}const cf=he(["developer","reviewer","legacy"]),jw=he(["queued","running","done","failed","timed_out","cancelled"]);z({id:p().uuid(),issueId:p().uuid(),role:cf,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:$t.nullable(),model:p().nullable(),budgetJson:p().nullable(),worktreePath:p().nullable(),inputSha:p().nullable(),status:jw,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:cf,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:$t.nullable(),model:p().nullable().optional(),budgetJson:p().nullable().optional(),inputSha:p().nullable().optional(),metadataJson:p().nullable().optional(),profileSnapshotJson:p().nullable().optional()});const Nw=z({worktreeWrite:Me(),publishReview:Me(),outboundMutation:Me(),resolveHumanAction:Me()}),Wy=z({worktreeWrite:Me().optional(),outboundMutation:Me().optional()}).strict(),zu=he(["low","medium","high"]);z({version:ka(1),agentId:p().nullable(),role:cf,runtime:$t.nullable(),model:p().nullable(),effort:zu.nullable().default(null),budgetJson:p().nullable(),permissionPolicy:Nw,deckId:p().nullable(),purpose:p().nullable(),capturedAt:p()});const Py="auto",_w="muse-spark-1.3-contributor",kw=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()}),Aw=z({id:p().uuid(),name:p(),runtime:$t,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:Me(),createdAt:p(),updatedAt:p()}),ev=Aw.extend({healthy:Me(),issues:ae(kw)});z({name:p().min(1),runtime:$t,deckId:p().uuid(),defaultModel:p().nullable().optional(),defaultEffort:zu.nullable().optional(),defaultBudget:Ha.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Wy.nullable().optional()});z({name:p().min(1).optional(),runtime:$t.optional(),deckId:p().uuid().nullable().optional(),defaultModel:p().nullable().optional(),defaultEffort:zu.nullable().optional(),defaultBudget:Ha.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Wy.nullable().optional()});z({agents:ae(ev),issueCount:A()});function Dx(a){return a.defaultModel??a.defaultExecuteModel??a.defaultPlanModel??null}function Ew(a){const l=pu(a.defaultBudgetJson)??pu(a.defaultExecuteBudgetJson)??pu(a.defaultPlanBudgetJson);return Sw(l)}const Cw=he(["slack_message","email","service_tool_call"]),Rw=z({target:p().min(1).max(120),body:p().min(1).max(4e3)}),Tw=z({serviceName:p().min(1).max(120),toolName:p().min(1).max(120),arguments:Hs(Gy())}),Ow=z({actionType:Cw,summary:Rw,toolCall:Tw}),Lw=he(["pending","sent","rejected"]);z({draft:Ow,status:Lw,sentAt:p().optional(),rejectedAt:p().optional(),bodyMismatch:Me().optional(),deliveryAttempts:A().int().min(0).default(0)});z({draftArtifactId:p().uuid(),sentAt:p(),toolResult:Hs(Gy()),permalink:p().url().optional()});const Mw=z({failure_summary:p().min(1),user_feedback_excerpt:p().min(1),corrected_output_hint:p().optional()}),Dw=Qy("op",[z({op:ka("add_item"),section:p().min(1),text:p().min(1)}),z({op:ka("amend_item"),section:p().min(1),anchor:p().min(1),text:p().min(1)}),z({op:ka("remove_item"),section:p().min(1),anchor:p().min(1)}),z({op:ka("set_triggers"),triggers:ae(p())}),z({op:ka("rewrite_body"),text:p()})]);z({rationale:p().min(1),ops:ae(Dw).min(1),evidence:Mw.optional()});const Uw="v1",tv=he(["feature","bug fix","refactor","investigation","split child"]);tv.options;const zw=z({text:p(),evidence:p().nullable()}),Bw=z({version:ka(Uw),executionMode:tv,nonGoals:ae(p()),exitPredicate:p(),onePrStoppingPoint:p(),acceptanceCriteria:ae(zw)}),av={executionMode:"Builder execution mode",nonGoals:"Non-goals",exitPredicate:"Exit predicate",onePrStoppingPoint:"One-PR stopping point",acceptanceCriteria:"Acceptance criteria"},qw=Object.keys(av);function Hw(a){return a.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}Object.fromEntries(qw.map(a=>[Hw(av[a]),a]));const $w=he(["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"]),Yw=he(["human","developer","reviewer","system"]),nv=he(["manual","linear","agent"]),Vw=z({id:p().uuid(),source:nv,externalId:p().nullable(),externalLabel:p().nullable(),externalUrl:p().nullable(),title:p(),description:p().nullable(),acceptanceCriteria:p().nullable(),executionContract:Bw.nullable().optional(),repo:p(),baseBranch:p(),status:$w,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:Me(),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:Me().default(!1),source:nv.default("manual"),externalId:p().optional(),externalLabel:p().optional(),externalUrl:p().optional(),enqueue:Me().default(!0),linearAttachments:ae(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:Me().optional()});const Ux={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(Ux).filter(a=>Ux[a].length===0);const Zw=he(["enqueued","already_queued","not_queued"]);Vw.extend({created:Me(),queue:Zw,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 Gw=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"]),Qw=he(["task","infrastructure","unknown"]),Xw=he(["high","medium","low"]),Iw=he(["outcome_kind","session_error","spawn_log","workflow_event","recovery"]),Kw=he(["exact","inferred"]),Yd=z({code:Gw,domain:Qw,primary:Me(),confidence:Xw,evidenceSource:Iw,occurredAt:p().nullable(),eventCursor:A().int().nullable(),rawReason:p(),sessionId:p().nullable(),logPath:p().nullable(),eventId:p().nullable(),eventType:p().nullable(),quality:Kw}),Jw=he(["commit","verification_receipt","branch_pushed"]),Fw=he(["sampler","salvage","session_end"]),df=he(["worktree","commit","verification_receipt","publish_only"]);z({kind:Jw,observedSha:p().nullable(),observedAt:p(),origin:Fw.nullable(),inputSha:p().nullable(),samplingPrecisionMs:A().int().nullable(),branch:p().nullable()});z({kinds:ae(df),retryReason:p().nullable()});const Ww=he(["done","closed","migrated"]);z({id:p().uuid(),issueId:p().uuid(),workflowVersion:p(),startedAt:p(),completedAt:p().nullable(),outcome:Ww.nullable()});const Pw=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:Pw,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 e2=he(["product_scope_decision","policy_escalation","attempts_exhausted","final_review","deck_interaction_required","reflection_interaction_required","outbound_delivery_interaction_required","muse_capability","operator_verification"]),t2=he(["open","resolved"]);z({id:p().uuid(),issueId:p().uuid().nullable(),runId:p().uuid().nullable(),workflowInstanceId:p().uuid().nullable(),actionType:e2,reason:p(),question:p(),evidenceJson:p().nullable(),responseOptionsJson:p().nullable(),continuationPreviewJson:p().nullable(),requestId:p().nullable(),status:t2,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 a2(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 ff(a){return Bu(a.evidenceJson)??{}}function qu(a){const s=ff(a).pushDivergence;return!s||typeof s!="object"?null:s}function n2(a){const s=ff(a).worktreeBlocker;return!!s&&typeof s=="object"&&typeof s.fingerprint=="string"}function l2(a){return ff(a).mergeFailure===!0}function lv(a){const l=Bu(a.continuationPreviewJson);return typeof(l==null?void 0:l.resumeRole)=="string"?l.resumeRole:null}const i2=/worktree|unpushed|uncommitted|dirty|preserved|non-fast-forward|diverged|already used by|recovery:|force-with-lease/i,s2=/could not be pushed|non-fast-forward|rejected.*push|push.*rejected/i,r2=/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 u2(a){const s=iv(a).head.replace(/\s+/g," ").trim(),u=s.match(/^(.+?[.!?])(\s|$)/);return(u?u[1]:s).trim()}const o2=/(?:~|\/(?:[^/\s\\:"'*?<>|][^/\s\\:"'*?<>|]*))+(?:\/[^/\s\\:"'*?<>|]+)*/g;function c2(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(o2)){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 zx(a){return a.length>12?a.slice(0,12):a}function d2(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 f2(a){return a==="close"||a==="reject"||a==="abort"}function il(a){return a.length===0?null:a.some(l=>l.choice==="push_with_lease")?"push_with_lease":(a.find(l=>!f2(l.choice))??a[0]).choice}function h2(a){if(a.actionType!=="policy_escalation")return"other";if(l2(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 s2.test(s)?"unpushed":lv(a)==="reviewer"?"reviewer-retry":r2.test(s)?"dirty-worktree":n2(a)||/already used by worktree/i.test(s)||/worktree/i.test(s)&&/Recovery:/.test(s)?"worktree-conflict":"ordinary-escalation"}const m2="Resume safely";function sv(a){const l=h2(a),s=a2(a),{commands:u}=iv(a.reason),d=c2(a),f=d2(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 ${zx(y.localSha)} against remote ${zx(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:il(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:il(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:il(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:il(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:il(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:il(s),details:x};case"ordinary-escalation":{const y=u2(a.reason),v=!i2.test(`${a.reason}
|
|
63
|
+
${a.question}`),w=v?s.map(j=>j.choice==="resume"&&j.label==="Resume development"?{...j,label:m2}: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:il(w),details:x}}case"other":default:return{kind:"other",title:a.question,context:null,safeResume:!1,displayOptions:s,primaryChoice:il(s),details:x}}}const p2=he(["blocking","non_blocking"]),x2=he(["open","resolved","recurring","superseded"]);z({id:p().uuid(),issueId:p().uuid(),fingerprint:p(),severity:p2,title:p(),rationale:p(),evidenceRef:p().nullable(),file:p().nullable(),line:A().int().nullable(),status:x2,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 y2=z({available:ka(!0)}),v2=z({available:ka(!1),until:p(),reason:p()});Qy("available",[y2,v2]);const hf=he(["supported_protocol","observed_event","experimental_api","unavailable"]),Hu=he(["unsupported","missing","expired","unparsable","stale"]),g2=he(["five_hour","weekly"]),b2=z({message:p().min(1),consecutiveFailures:A().int().positive(),firstFailureAt:p(),lastFailureAt:p()}),w2=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:hf,unavailableReason:Hu.nullable(),unavailableDetail:b2.nullable().optional(),criticalRole:g2.nullable()}),S2=he(["five_hour","weekly","billing_cycle"]),j2=z({unavailableUntil:p(),reason:p(),windowRole:S2.nullable()}),N2=z({runtime:$t,windows:ae(w2),unavailableReason:Hu.nullable(),activeCap:j2.nullable().optional()});z({runtimes:ae(N2),generatedAt:p()});z({configured:Me(),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:hf,unavailableReason:Hu.nullable(),observedAt:p().nullable(),generatedAt:p()});z({enabled:Me(),configured:Me(),cycleLabel:p().nullable(),cycleStart:p().nullable(),cycleEnd:p().nullable(),usageValue:A().nullable(),usageUnit:p().nullable(),remainingPercent:A().min(0).max(100).nullable(),source:hf,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 _2=he(["queued","admitted","removed"]),k2=z({id:p().uuid(),issueId:p().uuid(),position:A().int(),enqueuedAt:p(),state:_2,waitReason:p().nullable(),waitReasonAt:p().nullable()});k2.extend({title:p().optional(),issueStatus:p().optional()});z({issueId:p().uuid()});const A2=fw([ka("top"),ka("bottom"),z({before:p().uuid()}).strict(),z({after:p().uuid()}).strict()]);z({to:A2});const Vd=5;z({maxActiveIssues:A().int().min(1).max(Vd)});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:ae(A().int().min(1)),overCap:Me()});const la=he(["exact","inferred","unavailable"]),$u=z({quality:la,reasons:ae(p())}),uv=he(["queue_wait","coordinator_setup","agent_process","coordinator_validation_publish","coordinator_work"]),zs=z({phase:uv,startMs:A().int().nullable(),endMs:A().int().nullable(),durationMs:A().int().nullable(),quality:la,reasons:ae(p()),sessionId:p().nullable(),startCursor:A().int().nullable(),endCursor:A().int().nullable()}),E2=$u.extend({phase:uv,durationMs:A().int().nullable(),rawCount:A().int(),known:A().int(),total:A().int()}),ov=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:ae(p()),category:p().nullable(),sessionId:p().nullable()}),Jt=$u.extend({value:A().nullable(),known:A().int(),total:A().int()}),Pa=$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:Me(),setup:zs,agentProcess:zs,validationPublish:zs,spawnEnvelopeMs:A().int().nullable(),spawnEnvelopeQuality:la,spawnEnvelopeReasons:ae(p()),failureCauses:ae(Yd),reuseKinds:ae(df).optional(),silence:ae(ov),silenceQuality:la,silenceReasons:ae(p()),tokensIn:A().int().nullable(),tokensOut:A().int().nullable(),costUsd:A().nullable(),usageDurationMs:A().int().nullable(),usageQuality:la,usageReasons:ae(p())}),R2=z({kind:p().nullable(),observedSha:p().nullable(),msSinceWorkflowStart:A().int().nullable(),quality:la,reasons:ae(p())}),T2=z({attempts:A().int(),retries:A().int(),cold:A().int(),reused:A().int(),unknown:A().int(),publishOnly:A().int(),reuseRate:A().nullable(),preservedKinds:ae(df).optional(),quality:la,reasons:ae(p())}),O2=z({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:la,reasons:ae(p())});z({issueId:p(),elapsed:zs,rawIntervals:ae(zs),unionedDurations:ae(E2),exclusiveTotalMs:A().int().nullable(),exclusiveTotalQuality:la,exclusiveTotalReasons:ae(p()),nested:ae(ov),attempts:ae(C2),primaryFailure:Yd.nullable(),primaryFailureQuality:la,primaryFailureReasons:ae(p()),consequenceCauses:ae(Yd),waste:z({failedAttempts:A().int(),publishOnlyAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),firstCheckpoint:R2,retry:T2,reviewer:O2,humanWaitMs:A().int().nullable(),humanWaitQuality:la,humanWaitReasons:ae(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:Pa});z({window:z({from:p(),to:p(),defaultApplied:Me()}),pagination:z({limit:A().int(),offset:A().int(),totalIssues:A().int()}),issueIds:ae(p()),phaseWallTime:Hs(p(),Pa),attemptSuccess:fd,issueSuccess:fd,primaryFailures:ae(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:Pa,retryReuse:fd,reviewer:z({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:la,reasons:ae(p())}),humanInterventions:z({totalActions:A().int(),issuesWithIntervention:A().int(),humanWaitMs:Pa}),byRole:ae(hd),byRuntime:ae(hd),byModel:ae(hd),coverage:z({duration:Jt,tokens:Jt,cost:Jt})});const L2=100,cv=25,dv=5,M2=he(["developer","reviewer","legacy"]),D2=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"]),U2=he(["task","infrastructure","unknown"]);z({from:p().optional(),to:p().optional(),repo:p().optional(),role:M2.optional(),runtime:p().optional(),model:p().optional(),status:p().optional(),page:Mx.number().int().min(1).default(1),limit:Mx.number().int().min(1).max(L2).default(cv)});const fv=he(["exact","inferred","unavailable"]),Sa=z({sum:A().nullable(),known:A().int().min(0),total:A().int().min(0),quality:fv,reasons:ae(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:Pa,spawnEnvelopeMs:Pa,retryRate:A().nullable(),tokensIn:Sa,tokensOut:Sa,costUsd:Sa,durationMs:Sa,failedDurationMs:Sa,failedTokensIn:Sa,failedTokensOut:Sa,failedCostUsd:Sa}),z2=z({code:D2,domain:U2,count:A().int().min(0),share:A().nullable(),issueIds:ae(p()),issueTotal:A().int().min(0)}),B2=z({id:p(),title:p(),status:p(),repo:p(),attempts:A().int().min(0),updatedAt:p()}),q2=z({window:z({from:p(),to:p()}),filters:z({repo:p().nullable(),role:p().nullable(),runtime:p().nullable(),model:p().nullable(),status:ae(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:fv,interventions:A().int().min(0),avgReviewerRounds:A().nullable(),reviewedIssues:A().int().min(0),changeRequestRate:A().nullable(),sessionWallMs:Pa,spawnEnvelopeMs:Pa,checkpointMs:Pa,phaseWallMs:ae(z({phase:p(),stat:Pa})),failedDurationMs:Sa,failedTokensIn:Sa,failedTokensOut:Sa,failedCostUsd:Sa}),byRole:ae(md),byRuntime:ae(md),byModel:ae(md),failures:ae(z2),issues:ae(B2),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:Me(),partialReasons:ae(p())})});function hv(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(cv)||l.set(s,d))}return l.sort(),l.toString()}function sl(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 mv(a){return a<dv?`n=${a} (sparse)`:`n=${a}`}function Zd(a){return a<dv}function Bx(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)} (${mv(a.n)})`}function Ms(a){return`$${a.toFixed(2)}`}function Ke(a){return a.toLocaleString("en-US")}function H2(a){if(!Number.isFinite(a))return Ke(a);const l=Math.abs(a);if(l<1e3)return Ke(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 Yu(a){return a===null||!Number.isFinite(a)?"Unavailable":`${(a*100).toFixed(1)}%`}const $2=he(["queued","plan_pending","plan_approved","running","review","done","failed","cancelled"]),pv=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"]),Vu=he(["plan","execute","reflect","qa"]),xv=he(["retry","approve"]);z({patchId:p(),playbookId:p().optional(),playbookTitle:p().optional(),rationale:p().optional(),status:ka("proposed"),trigger:xv,dashboardUrl:p().optional()});z({status:he(["pending","completed","failed","skipped"]),trigger:xv,error:p().optional()});const V2=z({type:he(["system","human","context","thinking","assistant","tool","rate_limit","result"]),text:p(),toolName:p().optional()});z({phase:Vu,runtime:$t,entries:ae(V2)});const Z2=z({phase:Vu,runtime:$t,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()}),G2=z({label:p(),usage:Z2,maxTurns:A().optional(),maxBudgetUsd:A().optional()});z({lines:ae(G2),total:z({totalCostUsd:A(),inputTokens:A(),outputTokens:A(),durationMs:A(),numTurns:A()})});z({phase:Vu,runtime:$t,sessionId:p()});z({phase:Vu,exitCode:A(),resultText:p().optional(),isError:Me().optional(),blocker:z({summary:p().optional()}).optional()});z({path:p(),title:p(),markdown:p()});z({markdown:p(),sessionId:p().optional()});const Q2=he(["manual","linear"]);z({id:p(),title:p(),description:p().optional(),url:p().optional()});const _n=z({id:p().uuid(),source:Q2,externalId:p().nullable(),externalLabel:p().nullable(),taskCategory:pv,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:$t.nullable(),planModel:p().nullable(),executeModel:p().nullable(),status:$2,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:pv.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:$t,deckId:p().uuid().optional(),playbookId:p().optional(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:Fy.optional()});z({planMarkdown:p(),approve:Me().default(!1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),planBudget:Ha.nullable().optional(),executeBudget:Ha.nullable().optional()});z({runtime:$t.optional(),deckId:p().uuid().optional(),playbookId:p().optional(),executeModel:p().nullable().optional(),executeBudget:Ha.nullable().optional()});z({feedback:p().min(1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),executeBudget:Ha.nullable().optional()});z({outboundBody:p().min(1).max(4e3).optional()});const X2=z({id:p(),identifier:p(),title:p(),description:p().optional(),url:p(),state:p().optional(),labels:ae(p()).optional(),teamId:p().optional(),branchName:p().optional(),repoResolution:vw.optional(),attachments:ae(Jy).optional()});z({stateFilter:ae(p()),teamId:p().nullable(),assigneeMe:Me(),syncEnabled:Me()});const Gd=z({stateFilter:ae(p().min(1)).min(1),teamId:p().nullable(),assigneeMe:Me()});Gd.extend({persisted:Gd,envOverrides:z({stateFilter:Me(),teamId:Me()})});Gd.partial();const I2=z({id:p(),name:p(),key:p().optional()}),K2=z({name:p(),type:p().optional(),teamId:p().optional()});z({teams:ae(I2),workflowStates:ae(K2),viewer:z({id:p(),name:p(),email:p().optional()}).nullable()});z({candidates:ae(X2),hasMore:Me()});z({host:p(),port:A().int().min(1).max(65535),envOverride:Me()});const J2=he(["UNAUTHORIZED","DECK_UNAVAILABLE"]);z({connected:Me(),apiUrl:p(),mcpUrl:p(),deckCount:A().optional(),envOverride:Me(),error:p().optional(),deckAccessError:J2.optional(),deckAccessErrorMessage:p().optional()});z({agentId:p().uuid().optional(),autoAgent:Me().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:Ha.nullable().optional(),feedback:p().optional(),editedMarkdown:p().optional()});const F2=z({id:p(),label:p()});z({runtime:$t,models:ae(F2),source:he(["live","fallback"])});z({planReviewCount:A(),resultReviewCount:A(),maxConcurrent:A(),planningActiveRuns:ae(_n),planningQueuedRuns:ae(_n),runningRuns:ae(_n),waitingExecution:ae(_n),resultReviewRuns:ae(_n),recentDone:ae(_n),awaitingPlanReview:ae(_n),awaitingAnswerRuns:ae(_n),openQuestionCounts:Hs(p(),A()),pendingSendCounts:Hs(p(),A()),sentRunIds:ae(p()).optional(),autoApprovedRunIds:ae(p()),runs:ae(_n),agentDeckOnline:Me(),agents:ae(ev),agentIssueCount:A()});const yv=new Map,pd=new Map;function Qd(a){return yv.get(a)??null}function W2(a,l){l.models.length!==0&&yv.set(a,l)}function P2(a,l){const s=Qd(a);if(s)return Promise.resolve(s);const u=pd.get(a);if(u)return u;const d=l().then(f=>(W2(a,f),f)).finally(()=>pd.delete(a));return pd.set(a,d),d}const we="";async function Ze(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 eS(){const a=await fetch(`${we}/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 tS(a){const l=await fetch(`${we}/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 aS(){const a=await fetch(`${we}/api/intake/linear/config`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function nS(a){const l=await fetch(`${we}/api/intake/linear/config`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function lS(){const a=await fetch(`${we}/api/intake/linear/metadata`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function iS(){const a=await fetch(`${we}/api/settings/repository-mappings`);if(!a.ok)throw new Error(await Ze(a));return(await a.json()).mappings??[]}async function sS(a){const l=await fetch(`${we}/api/settings/repository-mappings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mappings:a})});if(!l.ok)throw new Error(await Ze(l));return(await l.json()).mappings??[]}async function rS(){const a=await fetch(`${we}/api/agents`);if(!a.ok)throw new Error("Failed to fetch agents");return a.json()}async function uS(a){const l=await fetch(`${we}/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 oS(a,l){const s=await fetch(`${we}/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 cS(a){const l=await fetch(`${we}/api/agents/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await l.text())}async function dS(a,l){return P2(a,async()=>{const u=await fetch(`${we}/api/runtimes/${a}/models`);if(!u.ok)throw new Error(await u.text());return u.json()})}async function vv(){const a=await fetch(`${we}/api/runtime-capacity`);if(!a.ok)throw new Error(await a.text());return a.json()}async function gv(){const a=await fetch(`${we}/api/agent-deck/status`);if(!a.ok)throw new Error(await a.text());return a.json()}async function fS(){const a=await fetch(`${we}/api/host-power`);if(!a.ok)throw new Error(await a.text());return a.json()}async function hS(){try{const a=await fetch(`${we}/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 qx(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(`${we}/api/issues?${l.toString()}`);if(!u.ok)throw new Error(await Ze(u));const d=await u.json();return typeof d.total=="number"?d.total:0}async function mS(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(`${we}/api/issues?${l.toString()}`);if(!s.ok)throw new Error(await Ze(s));return s.json()}async function pS(){const a=await fetch(`${we}/api/issues/recent-repos`);if(!a.ok)throw new Error(await Ze(a));return(await a.json()).repos??[]}async function bv(a){const l=await fetch(`${we}/api/issues/${a}`);if(!l.ok)throw new Error(await Ze(l));return l.json()}async function xS(a){const l=await fetch(`${we}/api/issues/${a}/execution-analysis`);if(!l.ok)throw new Error(await Ze(l));return l.json()}async function yS(a){const l=await fetch(`${we}/api/issues/${a}/evidence`);if(!l.ok)throw new Error(await Ze(l));return l.json()}async function vS(a,l){const s=await fetch(`${we}/api/issues/${a}/artifacts/${l}/trace`);if(!s.ok)throw new Error(await Ze(s));return s.json()}async function gS(a){const l=await fetch(`${we}/api/issues`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function xu(a,l){const s=await fetch(`${we}/api/issues/${a}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await Ze(s));return s.json()}async function bS(a){const l=await fetch(`${we}/api/issues/${a}/reload-source`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function wv(a){const l=await fetch(`${we}/api/issues/${a}/start`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function Sv(a){const l=await fetch(`${we}/api/issues/${a}/execute`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function wS(a,l="web"){const s=await fetch(`${we}/api/issues/${a}/abort`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:l})});if(!s.ok)throw new Error(await Ze(s));return s.json()}async function SS(a){const l=await fetch(`${we}/api/issues/${a}/park`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function jS(a,l="web"){const s=await fetch(`${we}/api/issues/${a}/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({closedBy:l})});if(!s.ok)throw new Error(await Ze(s));return s.json()}async function NS(a){const l=await fetch(`${we}/api/issues/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function _S(a){const l=await fetch(`${we}/api/queue`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:a})});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function jv(a){const l=await fetch(`${we}/api/queue/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function iu(a,l){const s=await fetch(`${we}/api/queue/${a}/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({to:l})});if(!s.ok)throw new Error(await Ze(s));return s.json()}async function xd(){const a=await fetch(`${we}/api/queue`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function kS(){const a=await fetch(`${we}/api/queue/status`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function AS(a){const l=await fetch(`${we}/api/queue/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxActiveIssues:a})});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function ES(a,l){const s=await fetch(`${we}/api/issues/${a}/guidance`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({markdown:l})});if(!s.ok)throw new Error(await Ze(s));return s.json()}async function CS(a){const l=hv(a),s=await fetch(`${we}/api/execution-report${l?`?${l}`:""}`);if(!s.ok)throw new Error(await Ze(s));const u=await s.json(),d=q2.safeParse(u);if(!d.success)throw new Error(`Unexpected report shape: ${d.error.message}`);return d.data}async function RS(){const a=await fetch(`${we}/api/human-actions`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function Nv(a,l,s,u){const d=await fetch(`${we}/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 Ze(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=Qd(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=Qd(a);if(L){v(L.models),j(L.source),X(!1);return}X(!0),dS(a).then(H=>{v(H.models),j(H.source)}).catch(()=>v([])).finally(()=>X(!1))},[a]);const C=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 (${C})`:D?"Loading models…":`Default (${C})`;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(()=>{hS().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"?_w:"",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 Yx(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=pu(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 su(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(()=>{gv().then(w=>u(w.mcpUrl)).catch(()=>u(null))},[l]);const d=su(a,"claude_code"),f=su(a,"cursor_local"),m=su(a,"codex_local"),x=a.some(w=>w.runtime==="muse_code")?su(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 _v(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 kv(a){return a<10?"critical":a<30?"warning":"normal"}function Av(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 mf={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},Vx={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 Ev(a,l,null);const d=s??"missing";return{key:u,label:l,kind:"unknown",reason:d,title:`${l}: N/A (${mf[d]})`}}function Ev(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 (${Av(a)??mf[u]})`}}function yd(a,l,s){return{key:a,label:l,kind:"known",remaining:0,rawRemaining:0,title:`${l}: 0% remaining, ${Zu(s)}`}}function vd(a,l){return{key:"capped",label:"capped",kind:"capped",title:`${ia(a)} ${Zu(l)}`}}function qS(a,l=Date.now()){const s=_v(a,l);if(a.runtime==="cursor_local"){const u=a.windows.find(d=>d.windowKey===Zx)??null;return s!==null?s.windowRole==="billing_cycle"?[yd((u==null?void 0:u.windowKey)??Zx,Gx,s)]:[vd(a.runtime,s)]:u===null?[]:[Ev(u,Gx,"current billing cycle")]}if(BS.has(a.runtime)){if(s!==null&&s.windowRole!=="five_hour"&&s.windowRole!=="weekly")return[vd(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"?yd((u==null?void 0:u.windowKey)??"missing-5H",Qx,s):Ix(u,Qx,a.unavailableReason,"missing-5H"),(s==null?void 0:s.windowRole)==="weekly"?yd((d==null?void 0:d.windowKey)??"missing-1W",Xx,s):Ix(d,Xx,a.unavailableReason,"missing-1W")]}return s!==null?[vd(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:Vx.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=kv(a.rawRemaining);return r.jsxs("span",{"data-severity":s,className:Vx[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 (${mf[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 YS({refreshTick:a}){const[l,s]=b.useState(null);return b.useEffect(()=>{let u=!1;return vv().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[a]),l?r.jsx($S,{data:l}):null}const VS="agent-dealer:host-power-sleep-notice-dismissed:";function Cv(a){return`${VS}${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=()=>{fS().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 Rv({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 ru=()=>({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(ru()),[v,w]=b.useState(!1),[j,D]=b.useState(null),[X,C]=b.useState(""),[$,L]=b.useState(ru()),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:Yx(x.defaultBudget),purpose:x.purpose.trim()||null,permissionPolicy:Hx(x)};await uS(ye),m(""),y(ru()),d(!1),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},F=I=>{D(I.id),C(I.name),L({runtime:I.runtime,deckId:I.deckId??"",purpose:I.purpose??"",defaultModel:Dx(I)??"",defaultEffort:I.defaultEffort??"",defaultBudget:DS(Ew(I)),...LS(I.permissionPolicyJson)})},P=()=>{D(null),L(ru())},ne=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:Yx($.defaultBudget),purpose:$.purpose.trim()||null,permissionPolicy:Hx($)};await oS(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 cS(I.id),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},_e=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",_e>0&&r.jsxs("span",{className:"text-red-400 ml-2",children:["· ",_e," need",_e===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(YS,{}),r.jsx(QS,{})]}),r.jsx("div",{className:"space-y-3 mb-6",children:a.map(I=>{const ye=Dx(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(Rv,{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:Ue=>C(Ue.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:()=>ne(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((Ue,gt)=>r.jsxs("li",{children:["· ",Ue.message]},gt))})]})]}),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 of(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 gd=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"],oj={q:"",status:"",repo:"",needsAttention:!1},Tv=["latest"],pf="latest",xf="desc";function Gs(a){return a.startsWith("?")?a.slice(1):a}function Fx(a){var s,u,d;const l=new URLSearchParams(Gs(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(Gs(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&&Tv.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??pf}function Ov(a){return Qu(a).direction??xf}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!==pf&&l.set("sort",a.sort),a.direction!==void 0&&a.direction!==xf&&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(Gs(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(Gs(a));return l===pf?s.delete("sort"):s.set("sort",l),s.delete("page"),s.sort(),s.toString()}function xj(a){const l=new URLSearchParams(Gs(a)),s=Ov(a)==="asc"?"desc":"asc";return s===xf?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 Lv({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:Tv.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 Mv="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 Dv(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function _j(a=Dv()){try{return(a==null?void 0:a.getItem(Mv))==="1"}catch{return!1}}function kj(a=Dv()){try{a==null||a.setItem(Mv,"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 Uv({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 Cj(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 Rj({recentRepos:a=[],initialMappings:l,loadMappings:s=iS,saveMappings:u=sS,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,C]=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((ne,V)=>V===H?{...ne,...F}:ne))},L=async()=>{w(null),D(null);const H=Cj(f);if(H){w(H);return}C(!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{C(!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(Uv,{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((ne,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 bd(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=aS,loadMetadata:u=lS,saveConfig:d=nS,onSaved:f,onClose:m}){var re;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,C]=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,ne]=b.useState(l!==void 0),[V,_e]=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),[Ue,gt]=b.useState(null),[At,rt]=b.useState(!1),[mt,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??""),C(de.persisted.assigneeMe),L(de.persisted.stateFilter),_e(null),F(!0))}).catch(de=>{B&&(y(null),_e(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),ne(!0))}).catch(de=>{B&&(w(null),ye(String(de)),ne(!0))}),()=>{B=!1}},[l,u]),b.useEffect(()=>{if(!v)return;const B=bd(v.workflowStates,j||null);L(de=>ty(de,B))},[v,j]);const Ge=b.useMemo(()=>bd((v==null?void 0:v.workflowStates)??[],j||null),[v,j]),U=Ge.length>0?Ge:$,J=!!(x!=null&&x.envOverrides.teamId),ue=!!(x!=null&&x.envOverrides.stateFilter),Ce=J||ue,De=H&&P,N=Oj(x,At),Y=B=>{L(de=>de.some(ze=>ze.toLowerCase()===B.toLowerCase())?de.filter(ze=>ze.toLowerCase()!==B.toLowerCase()):[...de,B])},W=async()=>{if(nt(null),gt(null),!x){nt("Saved filters are unavailable — reload before saving");return}if($.length===0){nt("Select at least one workflow status");return}rt(!0);try{const B=bd((v==null?void 0:v.workflowStates)??[],j.trim()||null),de=ty($,B);if(de.length===0){nt("Select at least one workflow status"),rt(!1);return}const Qe=await d({stateFilter:de,teamId:j.trim()||null,assigneeMe:X});y(Qe),D(Qe.persisted.teamId??""),C(Qe.persisted.assigneeMe),L(Qe.persisted.stateFilter),gt(Qe.envOverrides.stateFilter||Qe.envOverrides.teamId?"Saved locally — env still overrides the disabled controls":"Saved"),f==null||f()}catch(B){nt(String(B))}finally{rt(!1)}},te=V||I||mt;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"})]}),De?r.jsxs(r.Fragment,{children:[Ce&&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:()=>C(!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:()=>C(!0),className:"accent-[#C4B643]"}),"Assigned to me",(re=v==null?void 0:v.viewer)!=null&&re.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(Qe=>Qe.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:()=>Y(B),className:"accent-[#C4B643]","aria-label":`Status ${B}`}),B]},B)})})]}),te&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"linear-filters-error",children:te}),Ue&&r.jsx("p",{className:"text-xs text-teal-200/80","data-testid":"linear-filters-notice",children:Ue}),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:At?"Saving…":"Save"})})]}):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"})]})}function zv(a){return a.issues.some(l=>l.code==="usage_capped")}function Bv(a){return[...a].sort((l,s)=>Number(s.healthy)-Number(l.healthy))}function ol(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 zv(a)&&s.push("USAGE CAPPED"),s.length>0?`${l} — ${s.join(" · ")}`:l}function Eu(a){var l;return a?a.healthy?zv(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 qv({agents:a,initialDeveloperId:l,initialReviewerId:s,busy:u,onSave:d,onCancel:f,variant:m="queued",notice:x=null}){var P,ne;const[y,v]=b.useState(l??""),[w,j]=b.useState(s??""),D=Bv(a),X=a.find(V=>V.id===y),C=a.find(V=>V.id===w),$=Eu(X),L=Eu(C),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:ol(V),children:(V.healthy?"● ":"○ ")+ol(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:C?`${C.name} · ${ia(C.runtime)}${C.healthy?" · healthy":` · ${((ne=C.issues[0])==null?void 0:ne.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:ol(V),children:(V.healthy?"● ":"○ ")+ol(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 Cu({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 Bs({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(Cu,{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(Bs,{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(Bs,{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)})})]})}const $j="web";function Yj(a){if(typeof a!="object"||a===null)return null;const l=a.deletedNotice;return typeof l=="string"&&l.length>0?l:null}function Vj(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 Zj({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)),[C,$]=b.useState(!1),L=ey(w),[H,F]=b.useState(!1),[P,ne]=b.useState(!1),[V,_e]=b.useState(!1),[I,ye]=b.useState("manual"),[Ue,gt]=b.useState([]),[At,rt]=b.useState(!1),[mt,nt]=b.useState(""),Ge=b.useRef(mt);Ge.current=mt;const[U,J]=b.useState(""),[ue,Ce]=b.useState(!1),[De,N]=b.useState([]),[Y,W]=b.useState(""),[te,re]=b.useState(""),[B,de]=b.useState("main"),[Qe,ze]=b.useState(""),[Bt,Ra]=b.useState(""),[ua,Ya]=b.useState(""),[qe,Va]=b.useState(""),[ct,bt]=b.useState(!0),[Rn,Ye]=b.useState(null),Za=Ea(),Tn=Yj(Za.state),[an,nn]=b.useState(!1),[tt,dl]=b.useState([]),[ke,fl]=b.useState(null),[Ga,On]=b.useState(!1),[Yt,Yl]=b.useState(null),[qi,Qa]=b.useState(()=>_j()),[at,Ut]=b.useState(null),[pt,oa]=b.useState(null),Pe=Ue.find(E=>E.id===mt)??null,Ln=I==="linear"&&Pe!=null,Xa=sj(I,Pe),Ta=Jx({title:Y,repo:te,developerAgentId:ua,reviewerAgentId:qe}),Oa=E=>{mS(E).then(d).catch(le=>Ye(String(le)))},ca=()=>{qx([...gd]).then(Yl).catch(()=>{})},Mn=()=>{kj(),Qa(!0)},ln=Nj({historyTotal:Yt,filtersActive:L,dismissed:qi}),Tt=()=>{Oa(j.current),xd().then(dl).catch(()=>{}),kS().then(fl).catch(()=>{}),ca()},hl=async E=>{On(!0),Ye(null);try{const le=await AS(E);fl(le),Tt()}catch(le){Ye(String(le))}finally{On(!1)}},ml=async E=>{oa(E),Ye(null);try{const le=await bv(E);Ut({issueId:E,developerAgentId:le.issue.developerAgentId,reviewerAgentId:le.issue.reviewerAgentId})}catch(le){Ye(String(le))}finally{oa(null)}},sn=async(E,le)=>{if(at){oa(at.issueId);try{await xu(at.issueId,{developerAgentId:E,reviewerAgentId:le}),Ut(null),Tt()}catch(ve){Ut(null),Ye(String(ve)),Tt()}finally{oa(null)}}},Hi=async E=>{oa(E),Ye(null);try{await wv(E),Tt()}catch(le){Ye(String(le))}finally{oa(null)}},Vl=async E=>{oa(E),Ye(null);try{await Sv(E),Tt()}catch(le){Ye(String(le)),Tt()}finally{oa(null)}},Zl=E=>{const le=mj(v,E);y(le?Object.fromEntries(new URLSearchParams(le)):{})},pl=()=>{X(oj),y({})},Dn=E=>{const le=hj(v,E);y(le?Object.fromEntries(new URLSearchParams(le)):{})},xl=E=>{const le=pj(v,E);y(le?Object.fromEntries(new URLSearchParams(le)):{})},Gl=()=>{const E=xj(v);y(E?Object.fromEntries(new URLSearchParams(E)):{})},La=E=>X(le=>({...le,...E})),da=async(E,le,ve)=>{m(E),Ye(null);try{await Nv(E,$j,le,ve),s(),Tt()}catch(xt){Ye(String(xt))}finally{m(null)}};b.useEffect(()=>{X(Fx(v))},[v]),b.useEffect(()=>{Oa(j.current),xd().then(dl).catch(()=>{}),qx([...gd]).then(Yl).catch(()=>{});const E=setInterval(()=>{Oa(j.current),xd().then(dl).catch(()=>{})},5e3);return()=>clearInterval(E)},[v]);const dt=()=>{eS().then(E=>{rt(E.hasMore),gt(le=>rj(le,E.candidates,Ge.current))}).catch(E=>Ye(`Linear inbox: ${String(E)}`))};b.useEffect(()=>{H&&(pS().then(N).catch(()=>N([])),I==="linear"&&dt())},[H,I]),b.useEffect(()=>{Pe&&(W(`${Pe.identifier}: ${Pe.title}`),ze(Pe.description??""),Ra(""),re(E=>ij(E,Pe)))},[Pe]);const wt=()=>{W(""),re(""),ze(""),Ra(""),nt(""),J(""),bt(!0),de("main")},Z=E=>{gt(le=>uj(le,E).candidates),nt(E.id),J(E.identifier)},Se=async()=>{const E=U.trim();if(!E){Ye("Paste a Linear id (e.g. NOT-103) or issue URL");return}Ce(!0),Ye(null);try{const le=await tS(E);Z(le)}catch(le){Ye(`Linear lookup: ${String(le)}`)}finally{Ce(!1)}},lt=async()=>{if(!Jx({title:Y,repo:te,developerAgentId:ua,reviewerAgentId:qe})){Ye("Title, GitHub repository, developer, and reviewer are required");return}try{await gS({title:Y.trim(),repo:te.trim(),baseBranch:B.trim()||"main",description:Qe.trim()||void 0,acceptanceCriteria:Bt.trim()||void 0,developerAgentId:ua,reviewerAgentId:qe,maxReviewRounds:3,maxInfraAttempts:3,autoMerge:ct,source:I==="linear"&&Pe?"linear":"manual",externalId:Pe==null?void 0:Pe.id,externalLabel:Pe==null?void 0:Pe.identifier,externalUrl:Pe==null?void 0:Pe.url,linearAttachments:Pe==null?void 0:Pe.attachments}),F(!1),wt(),Tt()}catch(E){Ye(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"})]}),Rn&&r.jsx("p",{className:"text-sm text-red-300 mb-3",children:Rn}),Tn&&!an&&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:Tn}),r.jsx("button",{type:"button",className:"font-ui-display shrink-0 text-xs text-white/50 hover:text-white",onClick:()=>nn(!0),children:"Dismiss"})]}),ln&&r.jsx(Aj,{agents:a,onStartIssue:()=>F(!0),onDismiss:Mn}),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 → ",ct?"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(),Se())}}),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 Se(),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:()=>_e(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:mt,onChange:E=>{const le=E.target.value;nt(le);const ve=Ue.find(xt=>xt.id===le);ve&&J(ve.identifier)},children:[r.jsx("option",{value:"",children:"Select an issue…"}),Ue.map(E=>r.jsxs("option",{value:E.id,children:[E.identifier,": ",E.title]},E.id))]}),V&&r.jsx(Lj,{onClose:()=>_e(!1),onSaved:dt}),At&&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:Y,disabled:Ln,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:Qe,disabled:Ln,onChange:E=>ze(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:Bt,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:()=>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.jsx(Uv,{value:te,onChange:re,recentRepos:De}),P&&r.jsx(Rj,{recentRepos:De,onClose:()=>ne(!1)}),Xa&&r.jsx("p",{className:"text-xs text-amber-200/80","data-testid":"repo-label-warning",children:Xa})]}),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=>Ya(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:qe,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:ct,onChange:E=>bt(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:lt,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),wt()},children:"Cancel"})]})]}),tt.length>0?r.jsxs("div",{className:"mb-4 rounded border border-cyber-teal/25 bg-cyber-teal/5",children:[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:ke?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[ke.active," active · ",ke.waiting," waiting · limit"," ",ke.limit,ke.overCap?" · over capacity":""]}),ke.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",{className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/80 disabled:opacity-50",value:ke.options.includes(ke.maxActiveIssues)?ke.maxActiveIssues:ke.limit,disabled:Ga,title:ke.ceiling<Vd?`Capped by the worker/spawn ceiling (${ke.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:E=>void hl(Number(E.target.value)),children:ke.options.map(E=>r.jsx("option",{value:E,children:E},E))})]}):r.jsxs("span",{title:`Capped by the worker/spawn ceiling (${ke.ceiling})`,children:["max ",ke.ceiling]})]}):r.jsxs("span",{children:[tt.length," waiting · sequential"]})})]}),r.jsx("div",{className:"divide-y divide-white/5",children:tt.map((E,le)=>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:pt===E.issueId,title:"Change the developer/reviewer agents — keeps queue position and rechecks the wait reason",onClick:()=>void ml(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:pt===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:pt===E.issueId,title:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:()=>void Vl(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:le===0,title:"Move to top",onClick:()=>{iu(E.issueId,"top").then(Tt).catch(ve=>Ye(String(ve)))},children:"Top"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===0,title:"Move up",onClick:()=>{const ve=tt[le-1];ve&&iu(E.issueId,{before:ve.issueId}).then(Tt).catch(xt=>Ye(String(xt)))},children:"↑"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===tt.length-1,title:"Move down",onClick:()=>{const ve=tt[le+1];ve&&iu(E.issueId,{after:ve.issueId}).then(Tt).catch(xt=>Ye(String(xt)))},children:"↓"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===tt.length-1,title:"Move to bottom",onClick:()=>{iu(E.issueId,"bottom").then(Tt).catch(ve=>Ye(String(ve)))},children:"Bottom"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-white",onClick:()=>{jv(E.issueId).then(Tt).catch(ve=>Ye(String(ve)))},children:"Remove"})]})]}),(at==null?void 0:at.issueId)===E.issueId&&r.jsx("div",{className:"px-4 pb-3 pl-12",children:r.jsx(qv,{agents:a,initialDeveloperId:at.developerAgentId,initialReviewerId:at.reviewerAgentId,busy:pt===E.issueId,onSave:(ve,xt)=>void sn(ve,xt),onCancel:()=>Ut(null)})})]},E.id))})]}):ke?r.jsxs("p",{"data-testid":"admission-idle-status",className:"mb-4 text-xs text-white/35 tabular-nums",children:["Admission: ",ke.active," active · ",ke.waiting," waiting · limit"," ",ke.limit,ke.overCap?" · over capacity":"",ke.options.length>0&&r.jsxs("label",{className:"ml-2 inline-flex items-center gap-1",children:[r.jsx("span",{children:"limit"}),r.jsx("select",{className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/60 disabled:opacity-50",value:ke.options.includes(ke.maxActiveIssues)?ke.maxActiveIssues:ke.limit,disabled:Ga,title:ke.ceiling<Vd?`Capped by the worker/spawn ceiling (${ke.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:E=>void hl(Number(E.target.value)),children:ke.options.map(E=>r.jsx("option",{value:E,children:E},E))})]})]}):null,r.jsx(Hj,{actions:l,busyActionId:f,onResolve:(E,le,ve)=>void da(E,le,ve)}),r.jsxs("div",{className:"mb-4 rounded border border-white/10 bg-panel-elevated/60",children:[r.jsxs("button",{type:"button","aria-expanded":C,"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:C?"▾":"▸"}),r.jsx("span",{className:"font-ui-display",children:C?"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"})]}),C&&r.jsx("form",{id:"issues-filter-form","aria-label":"Issues filters",className:"px-4 pb-4",onSubmit:E=>{E.preventDefault(),Zl(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=>La({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=>La({status:E.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),gd.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=>La({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=>La({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:pl,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:pl,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:Ov(v),onSortChange:xl,onToggleDirection:Gl}),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 le=tt.find(ve=>ve.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(Cu,{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}),le!=null&&le.waitReason?r.jsx("p",{className:"text-xs text-amber-200/80 truncate",title:le.waitReason,children:le.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}),le&&r.jsxs("span",{className:"text-xs px-2 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal shrink-0",title:le.waitReason??"Next up for admission",children:["Queued #",le.position]}),r.jsx(Lv,{status:E.status}),r.jsx("span",{className:"text-xs text-white/35 shrink-0 w-16 text-right",children:Vj(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:()=>Dn(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:()=>Dn(u.page+1),children:"Next"})]})]})]})}const Gj=["developer","reviewer","legacy"],ay=["claude_code","cursor_local","codex_local"],Qj=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"];function Ti(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:mv(a.n),sampleTitle:`Sample size ${a.n}${Zd(a.n)?" — fewer than 5 observations, compare with care":""}`,sparse:Zd(a.n)}}function ja(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?H2(a.sum):u,f=a.known<a.total;return{available:!0,valueText:d,exactText:s!=null&&s.compact?u:null,noteText:f?`${Ke(a.known)}/${Ke(a.total)} known`:null,noteTitle:f?"Partial sample — missing provider metadata is excluded, never zero":null,incomplete:f}}function $s(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:Yu(a),evidenceCounts:`${Ke(Math.round(a*l))}/${Ke(l)}`,evidenceNoun:s,title:`Exact share over ${l} ${s}`}}function ny(a,l,s){const u=$s(a,l,s);return u.available?{text:`${u.valueText} (${u.evidenceCounts} ${u.evidenceNoun})`,title:u.title}:{text:u.valueText,title:u.title}}function wd(a){const l=ny(a.issueSuccess,a.issueSuccessDenominator,"closed"),s=ny(a.attemptSuccess,a.attemptSuccessDenominator,"terminal attempts");return{key:a.key,issuesText:Ke(a.issues),attemptsText:Ke(a.attempts),issueSuccessText:l.text,issueSuccessTitle:l.title,attemptSuccessText:s.text,attemptSuccessTitle:s.title,issueSuccessDisplay:$s(a.issueSuccess,a.issueSuccessDenominator,"closed"),attemptSuccessDisplay:$s(a.attemptSuccess,a.attemptSuccessDenominator,"terminal attempts"),wallText:Bx(a.sessionWallMs,Kt),envelopeText:Bx(a.spawnEnvelopeMs,Kt),retryText:a.retryRate===null?"N/A":Yu(a.retryRate),retryTitle:"Extra attempts after a terminal attempt in the same issue/role/round ÷ attempts",tokensInText:sl(a.tokensIn,Ke),tokensOutText:sl(a.tokensOut,Ke),costText:sl(a.costUsd,Ms),costIncomplete:a.costUsd.known<a.costUsd.total,durationText:sl(a.durationMs,Kt),failedCostText:sl(a.failedCostUsd,Ms),failedTokensText:`${sl(a.failedTokensIn,Ke)} in · ${sl(a.failedTokensOut,Ke)} out`,failedDurationText:sl(a.failedDurationMs,Kt),wall:Ti(a.sessionWallMs,Kt),envelope:Ti(a.spawnEnvelopeMs,Kt),tokensIn:ja(a.tokensIn,Ke,{compact:!0}),tokensOut:ja(a.tokensOut,Ke,{compact:!0}),cost:ja(a.costUsd,Ms),duration:ja(a.durationMs,Kt),failedCost:ja(a.failedCostUsd,Ms),failedTokensIn:ja(a.failedTokensIn,Ke,{compact:!0}),failedTokensOut:ja(a.failedTokensOut,Ke,{compact:!0}),failedDuration:ja(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&&Zd(a.attempts)}}function Xj(a,l){const s=a.code==="unknown";return{code:a.code,domain:a.domain,countText:Ke(a.count),shareText:a.share===null?"N/A":Yu(a.share),shareTitle:l>0?`${Ke(a.count)} of ${Ke(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 Ij(a){const l=a.reduce((s,u)=>s+u.count,0);return a.map(s=>Xj(s,l))}function Kj(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 Jj(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 Fj(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 Wj(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 Sd(a){return a===null?"N/A":Yu(a)}function za({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 Ru({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 Ds({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 Na({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 jd({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(Ru,{display:d.issueSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.attemptSuccessTitle,children:r.jsx(Ru,{display:d.attemptSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Ds,{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(Na,{display:d.tokensIn,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{display:d.tokensOut,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{display:d.cost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{display:d.duration,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{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(Na,{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(Na,{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(Na,{display:d.failedDuration,compact:!0})})]},d.key))})]})})}const Pj={fromDate:"",toDate:"",repo:"",role:"",runtime:"",model:"",status:""};function eN({loading:a,error:l,report:s,onRetry:u,cohortLink:d}){const f=(s==null?void 0:s.summary)??null,m=b.useMemo(()=>s?Ij(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(za,{label:"Issue success",value:r.jsx(Ru,{display:$s(f.issueSuccess,f.closedIssues,"closed")}),valueTitle:`done / (done + closed), denominator ${f.closedIssues}`,note:`${Ke(f.issues)} issues · ${Ke(f.closedIssues)} closed`}),r.jsx(za,{label:"Attempt success",value:r.jsx(Ru,{display:$s(f.attemptSuccess,f.terminalAttempts,"terminal")}),valueTitle:`done sessions / terminal sessions, denominator ${f.terminalAttempts}`,note:`${Ke(f.attempts)} attempts · ${Ke(f.terminalAttempts)} terminal`}),r.jsx(za,{label:"Retry rate",value:Sd(f.retryRate),valueTitle:`${f.retryExtraAttempts} extra attempts after a terminal attempt in the same issue/role/round ÷ ${f.attempts} attempts`,note:`Reuse rate ${Sd(f.reuseRate)} over ${Ke(f.reuseDenominator)} reviewer sessions with input SHA`}),r.jsx(za,{label:"Human wait",value:Kt(f.humanWaitMs),note:`${Ke(f.interventions)} interventions`}),r.jsx(za,{label:"Session wall P50/P95",value:r.jsx(Ds,{display:Ti(f.sessionWallMs,Kt)}),note:"Session bookkeeping proxy — never CLI runtime"}),r.jsx(za,{label:"Spawn envelope P50/P95",value:r.jsx(Ds,{display:Ti(f.spawnEnvelopeMs,Kt)}),note:"Coordinator-measured; includes slot wait + post-exit work"}),r.jsx(za,{label:"Checkpoint latency P50/P95",value:r.jsx(Ds,{display:Ti(f.checkpointMs,Kt)}),note:"Session start → first heartbeat"}),r.jsx(za,{label:"Reviewer rounds (avg)",value:f.avgReviewerRounds===null?"N/A":f.avgReviewerRounds.toFixed(1),note:`Change-request rate ${Sd(f.changeRequestRate)} over ${Ke(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(za,{label:"Failed cost",value:r.jsx(Na,{display:ja(f.failedCostUsd,Ms)})}),r.jsx(za,{label:"Failed tokens",value:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx(Na,{display:ja(f.failedTokensIn,Ke,{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(Na,{display:ja(f.failedTokensOut,Ke,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"out"})]})}),r.jsx(za,{label:"Failed runtime",value:r.jsx(Na,{display:ja(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(Ds,{display:Ti(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(jd,{caption:"By role",dimension:"role",rows:s.byRole.map(wd),cohortLink:d}),r.jsx(jd,{caption:"By runtime",dimension:"runtime",rows:s.byRuntime.map(wd),cohortLink:d}),r.jsx(jd,{caption:"By model",dimension:"model",rows:s.byModel.map(wd),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"," ",Ke(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:Kj(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 tN(){const[a,l]=Hy(),s=a.toString(),u=b.useMemo(()=>Jj(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),CS(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 C=L=>{const H=hv(Wj(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(),C(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"}),Gj.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"}),Qj.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(Pj),l({})},children:"Reset"})]})]})}),r.jsx(eN,{loading:y,error:w,report:m,onRetry:()=>X(L=>L+1),cohortLink:(L,H)=>Fj(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 aN({agents:a,initialRepo:l,initialDeveloperId:s,initialReviewerId:u,busy:d,onSave:f,onCancel:m}){var P,ne;const[x,y]=b.useState(l),[v,w]=b.useState(s??""),[j,D]=b.useState(u??""),X=Bv(a),C=a.find(V=>V.id===v),$=a.find(V=>V.id===j),L=Eu(C),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:C?`${C.name} · ${ia(C.runtime)}${C.healthy?" · healthy":` · ${((P=C.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:ol(V),children:(V.healthy?"● ":"○ ")+ol(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":` · ${((ne=$.issues[0])==null?void 0:ne.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:ol(V),children:(V.healthy?"● ":"○ ")+ol(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 nN({issue:a,agents:l,canEdit:s,editing:u,busy:d,onBeginEdit:f,onSave:m,onCancel:x}){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)]}),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(aN,{agents:l,initialRepo:a.repo,initialDeveloperId:a.developerAgentId,initialReviewerId:a.reviewerAgentId,busy:d,onSave:m,onCancel:x})]})}function lN({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 iN(a){return a===void 0?"unknown size":`${a.toLocaleString("en-US")} bytes`}function sN({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:[" ","· ",iN(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 uu(a){return a==="developer"?"Developer":a==="reviewer"?"Reviewer":"Worker"}const Nd={"issue.created":()=>"Issue created","issue.reassigned":()=>"Configuration updated","issue.source_reloaded":()=>"Task text reloaded from Linear","workflow.started":()=>"Workflow started","worker.started":a=>`${uu(a.actorType)} started${a.round?` (round ${a.round})`:""}`,"worker.completed":a=>`${uu(a.actorType)} finished${a.round?` (round ${a.round})`:""}`,"worker.failed":a=>`${uu(a.actorType)} failed${a.round?` (round ${a.round})`:""}`,"worker.deferred":a=>{var l;return((l=Oi(a.payloadJson))==null?void 0:l.outcome)==="deck_unavailable"?`Waiting for Agent Deck${a.round?` (round ${a.round})`:""}`:`${uu(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=Oi(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 Oi(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}const rN={approved:"text-cyber-teal",changes_requested:"text-amber-300",escalated:"text-red-300"};function uN({e:a}){var l;if(a.type==="pull_request.opened"||a.type==="pull_request.updated"){const s=Oi(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=Oi(a.payloadJson);return s?r.jsxs("span",{className:"text-sm",children:[r.jsx("span",{className:rN[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=Oi(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=Oi(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 oN(a){var l;return((l=Nd[a.type])==null?void 0:l.call(Nd,a))??a.type}const oy={human:"You",system:"System",developer:"Developer",reviewer:"Reviewer"},cN={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 dN(a){return a.actorRef?`${oy[a.actorType]} · ${a.actorRef}`:oy[a.actorType]}function fN({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 ${cN[l.actorType]}`,children:dN(l)}),r.jsx("span",{className:"text-sm text-white/80",children:oN(l)}),r.jsx(uN,{e:l})]},l.id))})}function Ba(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 hN(a){return a==null||!Number.isFinite(a)?null:`$${a.toFixed(2)}`}const mN={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"},Xd={worktree:"worktree",commit:"commit",verification_receipt:"verification receipt",publish_only:"publish-only result"},pN=new Set(["failed","timed_out","error"]);function yf(a){return a.replace(/_/g," ")}function Ys(a,l){const s=`Evidence quality: ${a}`;return l.length>0?`${s} — ${l.join(", ")}`:s}function _a({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 ul({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 ou({covered:a,format:l,unit:s}){if(a.value==null)return r.jsx(ul,{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(_a,{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: ",yf(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 xN({interval:a}){const l=dy[a.category??"unknown"]??dy.unknown,s=Ba(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(ul,{reasons:a.reasons})}),r.jsx(_a,{quality:a.quality,reasons:a.reasons})]})}function yN({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 ${Xd[s]??s} instead of starting cold.`,children:["reused ",Xd[s]??s]},s))})}function vN({attempt:a,isRetry:l}){const s=Ba(a.setup.durationMs),u=Ba(a.agentProcess.durationMs),d=Ba(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(yN,{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(_a,{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(_a,{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(_a,{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=>yf(m.code)).join(", ")]})]})}function gN({analysis:a}){const l=Ba(a.elapsed.durationMs),s=Ba(a.exclusiveTotalMs),u=Ba(a.firstCheckpoint.msSinceWorkflowStart),d=a.nested.filter(C=>C.kind!=="unexplained_silence"),f=a.attempts.flatMap(C=>C.silence),m=a.attempts.length>0&&a.attempts.every(C=>C.silence.length===0&&C.silenceQuality==="unavailable"),x=a.attempts.filter(C=>C.silence.length===0&&C.silenceQuality==="unavailable"),y=a.waste.failedAttempts>0||a.waste.publishOnlyAttempts>0||a.attempts.some(C=>C.failureCauses.length>0||pN.has(C.status)),v=Ba(a.humanWaitMs),w=a.retry.reuseRate==null?null:`${Math.round(a.retry.reuseRate*100)}% reused`,D=(a.retry.preservedKinds??[]).map(C=>Xd[C]??C),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(ul,{reasons:a.elapsed.reasons}),r.jsx(_a,{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(ul,{reasons:a.exclusiveTotalReasons}),r.jsx(_a,{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(C=>{const $=Ba(C.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:mN[C.phase]??C.phase}),r.jsx("span",{className:"text-white/85 tabular-nums",children:$??r.jsx(ul,{reasons:C.reasons})}),r.jsx(_a,{quality:C.quality,reasons:C.reasons}),C.known<C.total&&r.jsxs("span",{className:"text-[11px] text-white/60",children:["(known ",C.known," of ",C.total,")"]})]},C.phase)})}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums mt-1",children:["Human wait ",v??r.jsx(ul,{reasons:a.humanWaitReasons}),r.jsx(_a,{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((C,$)=>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:["↳ ",C.kind==="human_wait"?"Human wait":C.category??C.kind]})," ",Ba(C.durationMs)??r.jsx(ul,{reasons:C.reasons}),r.jsx(_a,{quality:C.quality,reasons:C.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((C,$)=>r.jsx(vN,{attempt:C,isRetry:$>0},C.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((C,$)=>r.jsx(fy,{cause:C,primary:!1},`${C.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(ou,{covered:a.waste.runtimeMs,format:C=>Ba(Math.round(C))??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt input tokens over known values only",children:["In ",r.jsx(ou,{covered:a.waste.tokensIn,format:C=>cy(C)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt output tokens over known values only",children:["Out ",r.jsx(ou,{covered:a.waste.tokensOut,format:C=>cy(C)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt known cost over known values only",children:["Cost ",r.jsx(ou,{covered:a.waste.costUsd,format:C=>hN(C)??"?",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?yf(a.firstCheckpoint.kind):"Checkpoint",a.firstCheckpoint.observedSha?` · ${a.firstCheckpoint.observedSha.slice(0,12)}`:"",u?` · ${u} after workflow start`:"",r.jsx(_a,{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(ul,{reasons:a.retry.reasons}),r.jsx(_a,{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((C,$)=>r.jsx(xN,{interval:C},$))}),x.length>0&&r.jsx("ul",{"aria-label":"Attempts with unknown silence",className:"mt-1",children:x.map(C=>r.jsxs("li",{className:"text-[11px] text-white/60 italic py-0.5",children:["Silence unknown for attempt ",C.sessionId.length>12?`${C.sessionId.slice(0,8)}…`:C.sessionId," —"," ",C.silenceReasons.join(", ")||"no silence evidence recorded"]},C.sessionId))})]})]})]})}function bN({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 xS(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(gN,{analysis:l})]})}const wN="web";function SN(a){try{const l=JSON.parse(a);return typeof l.text=="string"?l.text:JSON.stringify(l,null,2)}catch{return a}}function _d(a){const l=Math.floor(a/6e4);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function jN(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 Us(a){if(!a)return null;const l=a.split(/[/\\]/).filter(Boolean);return l.length<=2?a:l.slice(-2).join("/")}function kd(a){var l;return[a.branch,a.tipLabel,(l=a.worktree)!=null&&l.path?Us(a.worktree.path):null].filter(Boolean).join(" · ")}function Ad(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 Ed(a){var l;return!!(a.restartRisk||(l=a.worktree)!=null&&l.preserved)}function NN(a,l){return!a||!l?!1:a===l?!0:a.includes(l)}function _N({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 kN(a){return a.externalLabel??a.id}function AN(a,l){return a===l}function EN({expectedToken:a,externalLabel:l,busy:s,onConfirm:u,onCancel:d}){const[f,m]=b.useState(""),x=AN(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 CN(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 RN(a,l,s){try{const u=await s.removeIssue(a),d=CN({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 TN="Agents updated. Resume to continue with the new agents.";function ON(a,l,s,u){const d={};return s!==(a??"")&&(d.developerAgentId=s),u!==(l??"")&&(d.reviewerAgentId=u),d}function LN(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 MN({issueId:a,detail:l,agents:s,onHumanActionsChanged:u,refresh:d,onError:f}){var wt;const[m,x]=b.useState(null),[y,v]=b.useState({}),[w,j]=b.useState(""),[D,X]=b.useState(!1),[C,$]=b.useState(""),[L,H]=b.useState(""),[F,P]=b.useState(""),[ne,V]=b.useState(!1),[_e,I]=b.useState(null),[ye,Ue]=b.useState(!1),[gt,At]=b.useState(null),[rt,mt]=b.useState(!1),[nt,Ge]=b.useState(!1),U=Mu(),[J,ue]=b.useState(!1),[Ce,De]=b.useState(null),[N,Y]=b.useState({}),[W,te]=b.useState({}),re=Z=>f(String(Z)),{issue:B,timeline:de,humanActions:Qe,usageSummary:ze,readiness:Bt,humanWaitMs:Ra,interventionCount:ua,latestWorkflowInstance:Ya,activeWorkerSession:qe,liveProgress:Va,latestSessionFailure:ct,branchTipStatus:bt,queued:Rn,queueEntry:Ye,capWait:Za,pendingSnapshotChangedFields:Tn}=l,an=s.find(Z=>Z.id===B.developerAgentId),nn=an&&!an.healthy,tt=((wt=an==null?void 0:an.issues[0])==null?void 0:wt.message)??"Developer agent is unhealthy",dl=Ya?new Date(Ya.completedAt??Date.now()).getTime()-new Date(Ya.startedAt).getTime():0,ke=Qe.filter(Z=>Z.status==="open"),fl=B.status==="needs_human"&&ke.some(Z=>Z.actionType==="attempts_exhausted"||Z.actionType==="policy_escalation"),Ga=(qe==null?void 0:qe.status)==="running",On=ke.some(Z=>Z.actionType==="product_scope_decision"),Yt=Ya!=null&&Ya.completedAt===null,Yl=Bt.ok===!1||On&&!Ga,qi=B.status==="ready"&&!Yt,Qa=Yl||qi,at=B.source==="linear"&&!Ga&&(B.status==="ready"&&!Yt||B.status==="needs_human"&&Yt&&On),Ut=B.status==="needs_human"&&Yt&&On,pt=Tn??[],oa=Ut&&pt.length>0,Pe=B.status==="ready"&&!Yt,Ln=(B.status==="ready"||B.status==="done"||B.status==="closed")&&!Yt,Xa=B.status==="ready"&&!Yt,Ta=qe&&qe.status==="running"&&(B.status==="developing"||B.status==="reviewing"||B.status==="repairing"),Oa=!!ct&&!Ta,ca=async()=>{w.trim()&&(await ES(a,w),j(""),d())},Mn=()=>{$(B.title),H(B.description??""),P(B.acceptanceCriteria??""),X(!0)},ln=async()=>{V(!0),f(null);try{await xu(a,{title:C.trim()||void 0,description:L.trim()||null,acceptanceCriteria:F.trim()||null}),X(!1),d()}catch(Z){re(Z)}finally{V(!1)}},Tt=async()=>{V(!0),f(null);try{await bS(a),ue(!1),d()}catch(Z){ue(!1),re(Z),d()}finally{V(!1)}},hl=async()=>{V(!0),f(null);try{const Z=await wv(a);I(Z.state==="admitted"?null:`Queued at position ${Z.position}${Z.waitReason?` — ${Z.waitReason}`:""}`),d()}catch(Z){re(Z)}finally{V(!1)}},ml=async()=>{V(!0),f(null);try{await _S(a),d()}catch(Z){re(Z)}finally{V(!1)}},sn=async()=>{V(!0),f(null);try{await Sv(a),I(null),Ue(!1),d()}catch(Z){re(Z),d()}finally{V(!1)}},Hi=async(Z,Se,lt)=>{V(!0),f(null);try{await xu(a,{repo:Z,developerAgentId:Se,reviewerAgentId:lt}),Ue(!1),d()}catch(E){Ue(!1),re(E),d()}finally{V(!1)}},Vl=async(Z,Se)=>{V(!0),f(null);try{await xu(a,ON(B.developerAgentId,B.reviewerAgentId,Z,Se)),At(TN),d()}catch(lt){re(lt),d()}finally{V(!1)}},Zl=async()=>{V(!0),f(null);try{await SS(a),u(),d()}catch(Z){re(Z)}finally{V(!1)}},pl=async()=>{V(!0),f(null);try{await jv(a),d()}catch(Z){re(Z)}finally{V(!1)}},Dn=async()=>{V(!0),f(null);try{await jS(a),mt(!1),De("Issue closed — it will not execute. History is retained and can be found as closed work."),d()}catch(Z){re(Z)}finally{V(!1)}},xl=async()=>{V(!0),f(null);try{await RN(a,{externalLabel:B.externalLabel},{removeIssue:NS,navigateToIssues:Z=>U("/issues",{state:{deletedNotice:Z}}),onHumanActionsChanged:u,closeConfirmation:()=>Ge(!1),reportError:Z=>re(Z),refresh:d})}finally{V(!1)}},Gl=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 wS(a),d()}catch(Z){re(Z)}finally{V(!1)}}},La=async(Z,Se,lt)=>{V(!0),f(null);try{await Nv(Z,wN,Se,lt),u(),d()}catch(E){re(E)}finally{V(!1)}},da=()=>{m||yS(a).then(x).catch(Z=>re(Z))},dt=Z=>{y[Z]||(v(Se=>({...Se,[Z]:{content:"",loading:!0}})),vS(a,Z).then(Se=>v(lt=>({...lt,[Z]:{content:Se.content,loading:!1}}))).catch(Se=>v(lt=>({...lt,[Z]:{content:"",loading:!1,error:String(Se)}}))))};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:[_d(dl)," elapsed"]}),r.jsxs("span",{title:`${ze.totalTokensIn} in / ${ze.totalTokensOut} out tokens`,children:["$",ze.totalCostUsd.toFixed(2)]}),Ra>0&&r.jsxs("span",{title:"Time spent waiting on a human, excluding autonomous processing",children:[_d(Ra)," human wait"]}),ua>0&&r.jsxs("span",{children:[ua," intervention",ua===1?"":"s"]})]})]}),r.jsx(Lv,{status:B.status})]}),Ce&&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:Ce})}),r.jsx(nN,{issue:B,agents:s,canEdit:Xa,editing:ye,busy:ne,onBeginEdit:()=>Ue(!0),onSave:(Z,Se,lt)=>void Hi(Z,Se,lt),onCancel:()=>Ue(!1)}),B.executionContract&&r.jsx(lN,{contract:B.executionContract}),r.jsx(sN,{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:LN(l)})]}),Yt&&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:ne,onClick:Gl,children:"Abort workflow"})]}),Ye&&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 ",Ye.position]}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5",children:Ye.waitReason??"Next up — starts as soon as the coordinator ticks"})]}),Za&&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:Za.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:Za.reason}),r.jsxs("p",{className:"text-xs text-white/45 mt-0.5",children:["Wait until ",new Date(Za.until).toLocaleString()]})]}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1.5 text-xs shrink-0 disabled:opacity-50",disabled:ne,title:"Park this issue for a human — cancels the wait without touching the worktree; a resume continues with whichever agents are then set",onClick:Zl,children:"Park for human"})]}),Ta&&qe&&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:qe.role}),qe.runtime?` · ${qe.runtime}`:"",qe.model?` · ${qe.model}`:"",` · round ${qe.round}`]}),r.jsxs("p",{className:"text-sm text-[#C4B643] truncate",title:Va??B.currentIntent??"session started",children:["Last progress: ",Va??B.currentIntent??"session started"]}),bt&&r.jsxs("p",{className:`text-xs ${Ed(bt)?"text-amber-300":"text-white/55"}`,title:kd(bt),children:["Branch tip: ",bt.tipLabel,Ad(bt)]}),Va&&B.currentIntent&&!/session running/i.test(B.currentIntent)&&!NN(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 ",jN(qe.heartbeatAt),Us(qe.worktreePath)?` · ${Us(qe.worktreePath)}`:""]}),qe.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:qe.logPath,children:["Log: ",Us(qe.logPath)??qe.logPath]})]}),Oa&&ct&&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:ct.reason}),r.jsxs("p",{className:"text-xs text-white/45",children:[ct.role?r.jsx("span",{className:"capitalize",children:ct.role}):"Worker",ct.outcome?` · ${ct.outcome}`:"",` · ${new Date(ct.when).toLocaleString()}`,` · infra ${ct.infraAttempts}/${ct.maxInfraAttempts}`]}),bt&&r.jsxs("p",{className:`text-xs ${Ed(bt)?"text-amber-300":"text-white/55"}`,title:kd(bt),children:["Branch tip: ",bt.tipLabel,Ad(bt)]}),ct.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:ct.logPath,children:["Log: ",Us(ct.logPath)??ct.logPath]})]}),bt&&!Ta&&!Oa&&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 ${Ed(bt)?"text-amber-300":"text-white/80"}`,title:kd(bt),children:[bt.tipLabel,Ad(bt)]})]}),!Bt.ok&&!ke.some(Z=>Z.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: ",Bt.missing.join(", ")]})}),ke.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"}),ke.map(Z=>{const Se=Z.actionType==="product_scope_decision";if(Z.actionType==="operator_verification"){const lt=zj(Z),E=W[Z.id]??"",le=E.trim().length>0;return r.jsx(Bs,{action:Z,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:E,disabled:ne,onChange:ve=>te(xt=>({...xt,[Z.id]:ve.target.value}))}),r.jsx("div",{className:"flex flex-wrap gap-2",children:lt.map(ve=>r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs disabled:opacity-50",disabled:ne||!le,title:le?void 0:"Enter the result note first — the server requires it",onClick:()=>La(Z.id,ve.choice,E),children:ve.label},ve.choice))})]})},Z.id)}return Se?r.jsx(Bs,{action:Z,hideChoicesHint:!0,children:Bt.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[Z.id]??"",disabled:ne,onChange:lt=>Y(E=>({...E,[Z.id]:lt.target.value}))}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs",disabled:ne,onClick:()=>La(Z.id,"resume",N[Z.id]),children:"Resume"})]})},Z.id):r.jsx(Bs,{action:Z,disabled:ne,onChoose:lt=>La(Z.id,lt)},Z.id)})]}),fl&&r.jsx("div",{className:"mb-4",children:r.jsx(qv,{variant:"parked",agents:s,initialDeveloperId:B.developerAgentId,initialReviewerId:B.reviewerAgentId,busy:ne,notice:gt,onSave:(Z,Se)=>void Vl(Z,Se)},`${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: ",pt.join(", "),". Resume applies the amended task to the next developer round — the running snapshot is unchanged until then."]})]}),(Qa||at)&&!D&&!J&&r.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-1",children:[Qa&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",onClick:Mn,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."," ",Ut?"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:ne,onClick:Tt,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:C,onChange:Z=>$(Z.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:Z=>H(Z.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:Z=>P(Z.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:ne,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"&&ke.length===0)&&r.jsxs("div",{className:"mb-4 space-y-2",children:[nn&&r.jsxs("p",{className:"text-sm text-amber-200/90",children:["Fix before Start: ",tt]}),_e&&r.jsx("p",{className:"text-sm text-amber-200/90",children:_e}),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:!Bt.ok||ne||!!nn,title:nn?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:hl,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:!Bt.ok||ne||!!nn,title:nn?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"}),Rn?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:ne,onClick:pl,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:ne||Yt,title:"Add to queue — append to the end of the admission queue; does not start anything now",onClick:ml,children:"Add to queue"})]}),Rn&&Xa&&!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(bN,{issueId:a}),r.jsx("div",{className:"border-t border-white/10 pt-3",children:r.jsx(fN,{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:Z=>j(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&ca()}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:ca,children:"Send"})]}),(Pe||Ln)&&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:[Pe?"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.",Ln?" Delete from Dealer permanently removes the local issue, its history, and its files.":""]}),Pe&&(rt?r.jsx(_N,{busy:ne,onConfirm:()=>void Dn(),onCancel:()=>mt(!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:ne,title:"Retire this issue without running it — removes any queue entry, keeps history as closed work",onClick:()=>mt(!0),children:"Close issue"})),Ln&&(nt?r.jsx(EN,{expectedToken:kN(B),externalLabel:B.externalLabel,busy:ne,onConfirm:()=>void xl(),onCancel:()=>Ge(!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:ne,title:"Permanently delete the Dealer-local issue, its history, and its files — the Linear ticket is not deleted",onClick:()=>Ge(!0),children:"Delete from Dealer"}))]})]}),r.jsxs("details",{className:"mt-6",onToggle:Z=>Z.currentTarget.open&&da(),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(Z=>{const Se=m.usageEvents.filter(ve=>ve.workerSessionId===Z.id),lt=Se.reduce((ve,xt)=>ve+(xt.costUsd??0),0),E=Se.reduce((ve,xt)=>ve+(xt.tokensIn??0),0),le=Se.reduce((ve,xt)=>ve+(xt.tokensOut??0),0);return r.jsxs("p",{children:[Z.role," round ",Z.round," · ",Z.status,Z.startedAt&&Z.completedAt?` · ${_d(new Date(Z.completedAt).getTime()-new Date(Z.startedAt).getTime())}`:"",Se.length>0?` · $${lt.toFixed(3)} · ${E}→${le} tok`:""]},Z.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(Z=>{const Se=y[Z.id];return r.jsxs("details",{className:"mb-1.5",onToggle:lt=>lt.currentTarget.open&&Z.blobPath&&dt(Z.id),children:[r.jsxs("summary",{className:"cursor-pointer hover:text-white/80",children:[Z.kind," · ",new Date(Z.createdAt).toLocaleString()]}),r.jsxs("div",{className:"mt-1 pl-3 border-l border-white/10 space-y-1",children:[Z.contentJson&&r.jsx("pre",{className:"whitespace-pre-wrap break-words text-white/55",children:SN(Z.contentJson)}),Z.blobPath&&r.jsxs("div",{children:[r.jsxs("p",{className:"text-white/40",children:["Raw trace: ",Z.blobPath]}),(Se==null?void 0:Se.loading)&&r.jsx("p",{className:"text-white/35",children:"Loading trace…"}),(Se==null?void 0:Se.error)&&r.jsx("p",{className:"text-red-300/80",children:Se.error}),Se&&!Se.loading&&!Se.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:Se.content||"(empty)"})]}),!Z.contentJson&&!Z.blobPath&&r.jsx("p",{className:"text-white/35",children:"No content recorded."})]})]},Z.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 DN({issueId:a,agents:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=b.useState(!1),v=()=>bv(a).then(w=>{d(w),m(null),y(!1)}).catch(w=>{const j=String(w).replace(/^Error:\s*/i,"").trim();/^not found$/i.test(j)?(y(!0),m(null),d(null)):(m(j),y(!1))});return b.useEffect(()=>{d(null),m(null),y(!1),v();const w=setInterval(v,4e3);return()=>clearInterval(w)},[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(MN,{issueId:a,detail:u,agents:l,onHumanActionsChanged:s,refresh:v,onError:w=>m(w)},a):r.jsx("div",{className:"p-6 text-white/50 text-sm",children:"Loading…"})}function UN(){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 zN(){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 BN({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 qN="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 HN({className:a="",size:l=36}){return r.jsx("img",{src:qN,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"},cu="5H",du="1W",$N=new Set(["claude_code","codex_local","muse_code"]),hy="billing_cycle",Hv="1M",YN=new Set($t.options),my={critical:"font-medium text-red-300",warning:"font-medium text-yellow-300",normal:"font-medium text-white/75"};function VN(a){return{fiveHour:a.find(l=>l.criticalRole==="five_hour")??null,weekly:a.find(l=>l.criticalRole==="weekly")??null}}function $v(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=Av(a);return f!==null?`${u}: N/A (${f})`:`${u}: N/A (${Tu[$v(a,l,s)]})`}function Id(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=$v(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 ZN(a,l,s){return Id(a,l,s,!0,Hv,"current billing cycle")}function Cd(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 GN(a,l=Date.now()){return a.runtimes.map(s=>{const u=ia(s.runtime),d=s.runtime,f=_v(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?Cd((m==null?void 0:m.windowKey)??hy,Hv,f):ZN(m,s,l);return{runtime:u,runtimeKey:d,windows:[x],exhausted:x.kind==="known"&&x.rawRemaining===0,activeCap:f,detail:x.detail}}if($N.has(s.runtime)){if(f!==null&&f.windowRole!=="five_hour"&&f.windowRole!=="weekly")return Rd(u,d,f);const{fiveHour:m,weekly:x}=VN(s.windows),y=(f==null?void 0:f.windowRole)==="five_hour"?Cd((m==null?void 0:m.windowKey)??`missing:${cu}`,cu,f):m!==null?Id(m,s,l,!0,cu):xy(cu,s),v=(f==null?void 0:f.windowRole)==="weekly"?Cd((x==null?void 0:x.windowKey)??`missing:${du}`,du,f):x!==null?Id(x,s,l,!0,du):xy(du,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 QN({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=GN(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":`${YN.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(Rv,{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=kv(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 Td({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 XN({agents:a,onHumanActionsChanged:l}){const{issueId:s}=Qb();return s?r.jsx(DN,{issueId:s,agents:a,onHumanActionsChanged:l},s):r.jsx(zy,{to:"/issues",replace:!0})}function IN({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(HN,{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(mu,{to:"/issues",className:Td,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(Cu,{className:"w-3 h-3 shrink-0"}),a]})]}),r.jsx(mu,{to:"/reports/execution",className:Td,children:"Reports"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 min-w-0",children:[r.jsx(QN,{state:u}),r.jsxs(mu,{to:"/agents",className:({isActive:d})=>`${Td({isActive:d})} inline-flex items-center gap-1.5 transition-colors`,"aria-label":"Agents",title:"Agents",children:[r.jsx(BN,{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(Cu,{className:"w-3 h-3 shrink-0"}),s]})]})]})]})}function KN(){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(()=>{rS().then(({agents:C,issueCount:$})=>{l(C),u($)}).catch(console.error),gv().then(C=>f(C.connected)).catch(()=>f(!1)),vv().then(C=>v({status:"ready",data:C})).catch(()=>v({status:"unavailable"}))},[]),j=b.useCallback(()=>RS().then(x).catch(()=>{}),[]);b.useEffect(()=>{w();const C=setInterval(w,vy);return()=>clearInterval(C)},[w]),b.useEffect(()=>{j();const C=setInterval(()=>void j(),vy);return()=>clearInterval(C)},[j]);const D=m.length,X=a.length;return r.jsxs(r.Fragment,{children:[r.jsx(zN,{}),r.jsxs("div",{className:"relative z-10 min-h-screen flex flex-col",children:[r.jsx(IN,{openHumanActionCount:D,agentCount:X,agentIssueCount:s,capacity:y}),r.jsx("main",{className:"flex-1 flex overflow-hidden",children:r.jsxs(r1,{children:[r.jsx(Ml,{path:"/",element:r.jsx(zy,{to:"/issues",replace:!0})}),r.jsx(Ml,{path:"/issues",element:r.jsx(Zj,{agents:a,humanActions:m,onHumanActionsChanged:j})}),r.jsx(Ml,{path:"/issues/:issueId",element:r.jsx(XN,{agents:a,onHumanActionsChanged:j})}),r.jsx(Ml,{path:"/agents",element:r.jsx(aj,{agents:a,agentDeckOnline:d,onRefresh:w})}),r.jsx(Ml,{path:"/reports/execution",element:r.jsx(tN,{})}),r.jsx(Ml,{path:"*",element:r.jsx(UN,{})})]})})]})]})}function JN(){return typeof document>"u"?Promise.resolve():document.fonts.load('13px "Monaco"').then(()=>{}).catch(()=>{})}JN();sb.createRoot(document.getElementById("root")).render(r.jsx(b.StrictMode,{children:r.jsx(O1,{children:r.jsx(KN,{})})}));
|