agent-dealer 1.2.2 → 1.2.4

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.
Files changed (34) hide show
  1. package/bundle/server/dist/capacity/claude-events.js +27 -10
  2. package/bundle/server/dist/capacity/claude-local-cache.js +794 -0
  3. package/bundle/server/dist/capacity/claude-local-cache.test.js +524 -0
  4. package/bundle/server/dist/capacity/cursor-individual-credentials.js +203 -16
  5. package/bundle/server/dist/capacity/cursor-individual-credentials.test.js +186 -2
  6. package/bundle/server/dist/capacity/cursor-individual.js +69 -2
  7. package/bundle/server/dist/capacity/cursor-individual.test.js +268 -2
  8. package/bundle/server/dist/capacity/muse-host.js +778 -0
  9. package/bundle/server/dist/capacity/muse-host.test.js +480 -0
  10. package/bundle/server/dist/capacity/muse-lifecycle.test.js +96 -0
  11. package/bundle/server/dist/capacity/muse-probe.js +250 -0
  12. package/bundle/server/dist/capacity/muse-probe.test.js +183 -0
  13. package/bundle/server/dist/capacity/muse.js +320 -63
  14. package/bundle/server/dist/capacity/muse.test.js +8 -51
  15. package/bundle/server/dist/coordinator/muse-spawn.js +143 -1
  16. package/bundle/server/dist/index.js +15 -2
  17. package/bundle/server/dist/routes/index.js +25 -9
  18. package/bundle/server/dist/routes/runtime-capacity.test.js +20 -7
  19. package/bundle/server/dist/runners/muse-code-jsonl.js +7 -1
  20. package/bundle/server/dist/runners/muse-serve-session.js +314 -0
  21. package/bundle/server/dist/runners/muse-serve-session.test.js +325 -0
  22. package/bundle/server/package.json +2 -2
  23. package/bundle/server/static-ui/assets/codex-YZSpL-SB.png +0 -0
  24. package/bundle/server/static-ui/assets/{index-DUYzboWh.css → index-CYqRh_-S.css} +1 -1
  25. package/bundle/server/static-ui/assets/index-UO4lHZw4.js +60 -0
  26. package/bundle/server/static-ui/assets/muse-CtdcC6ve.svg +33 -0
  27. package/bundle/server/static-ui/index.html +2 -2
  28. package/bundle/shared/package.json +1 -1
  29. package/dist/doctor.d.ts +72 -0
  30. package/dist/doctor.js +235 -1
  31. package/dist/doctor.test.d.ts +1 -0
  32. package/dist/doctor.test.js +276 -0
  33. package/package.json +1 -1
  34. package/bundle/server/static-ui/assets/index-0GDYfbaM.js +0 -60
@@ -1,60 +0,0 @@
1
- (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.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 Do={exports:{}},ms={};/**
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 $p;function c0(){if($p)return ms;$p=1;var n=Symbol.for("react.transitional.element"),i=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 y in d)y!=="key"&&(f[y]=d[y])}else f=d;return d=f.ref,{$$typeof:n,type:u,key:m,ref:d!==void 0?d:null,props:f}}return ms.Fragment=i,ms.jsx=s,ms.jsxs=s,ms}var Vp;function o0(){return Vp||(Vp=1,Do.exports=c0()),Do.exports}var c=o0(),Lo={exports:{}},ye={};/**
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 Yp;function d0(){if(Yp)return ye;Yp=1;var n=Symbol.for("react.transitional.element"),i=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"),y=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),D=Symbol.iterator;function Q(N){return N===null||typeof N!="object"?null:(N=D&&N[D]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,L={};function B(N,q,X){this.props=N,this.context=q,this.refs=L,this.updater=X||T}B.prototype.isReactComponent={},B.prototype.setState=function(N,q){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,q,"setState")},B.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function Z(){}Z.prototype=B.prototype;function W(N,q,X){this.props=N,this.context=q,this.refs=L,this.updater=X||T}var fe=W.prototype=new Z;fe.constructor=W,V(fe,B.prototype),fe.isPureReactComponent=!0;var J=Array.isArray;function ke(){}var I={H:null,A:null,T:null,S:null},ge=Object.prototype.hasOwnProperty;function Ve(N,q,X){var ee=X.ref;return{$$typeof:n,type:N,key:q,ref:ee!==void 0?ee:null,props:X}}function vt(N,q){return Ve(N.type,q,N.props)}function ft(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function et(N){var q={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(X){return q[X]})}var Tt=/\/+/g;function Fe(N,q){return typeof N=="object"&&N!==null&&N.key!=null?et(""+N.key):q.toString(36)}function re(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(ke,ke):(N.status="pending",N.then(function(q){N.status==="pending"&&(N.status="fulfilled",N.value=q)},function(q){N.status==="pending"&&(N.status="rejected",N.reason=q)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function U(N,q,X,ee,ie){var ue=typeof N;(ue==="undefined"||ue==="boolean")&&(N=null);var Ne=!1;if(N===null)Ne=!0;else switch(ue){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(N.$$typeof){case n:case i:Ne=!0;break;case b:return Ne=N._init,U(Ne(N._payload),q,X,ee,ie)}}if(Ne)return ie=ie(N),Ne=ee===""?"."+Fe(N,0):ee,J(ie)?(X="",Ne!=null&&(X=Ne.replace(Tt,"$&/")+"/"),U(ie,q,X,"",function(Gt){return Gt})):ie!=null&&(ft(ie)&&(ie=vt(ie,X+(ie.key==null||N&&N.key===ie.key?"":(""+ie.key).replace(Tt,"$&/")+"/")+Ne)),q.push(ie)),1;Ne=0;var ut=ee===""?".":ee+":";if(J(N))for(var Ue=0;Ue<N.length;Ue++)ee=N[Ue],ue=ut+Fe(ee,Ue),Ne+=U(ee,q,X,ue,ie);else if(Ue=Q(N),typeof Ue=="function")for(N=Ue.call(N),Ue=0;!(ee=N.next()).done;)ee=ee.value,ue=ut+Fe(ee,Ue++),Ne+=U(ee,q,X,ue,ie);else if(ue==="object"){if(typeof N.then=="function")return U(re(N),q,X,ee,ie);throw q=String(N),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function F(N,q,X){if(N==null)return N;var ee=[],ie=0;return U(N,ee,"","",function(ue){return q.call(X,ue,ie++)}),ee}function ce(N){if(N._status===-1){var q=N._result;q=q(),q.then(function(X){(N._status===0||N._status===-1)&&(N._status=1,N._result=X)},function(X){(N._status===0||N._status===-1)&&(N._status=2,N._result=X)}),N._status===-1&&(N._status=0,N._result=q)}if(N._status===1)return N._result.default;throw N._result}var je=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Me={map:F,forEach:function(N,q,X){F(N,function(){q.apply(this,arguments)},X)},count:function(N){var q=0;return F(N,function(){q++}),q},toArray:function(N){return F(N,function(q){return q})||[]},only:function(N){if(!ft(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ye.Activity=_,ye.Children=Me,ye.Component=B,ye.Fragment=s,ye.Profiler=d,ye.PureComponent=W,ye.StrictMode=u,ye.Suspense=v,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ye.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},ye.cache=function(N){return function(){return N.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(N,q,X){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ee=V({},N.props),ie=N.key;if(q!=null)for(ue in q.key!==void 0&&(ie=""+q.key),q)!ge.call(q,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&q.ref===void 0||(ee[ue]=q[ue]);var ue=arguments.length-2;if(ue===1)ee.children=X;else if(1<ue){for(var Ne=Array(ue),ut=0;ut<ue;ut++)Ne[ut]=arguments[ut+2];ee.children=Ne}return Ve(N.type,ie,ee)},ye.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},ye.createElement=function(N,q,X){var ee,ie={},ue=null;if(q!=null)for(ee in q.key!==void 0&&(ue=""+q.key),q)ge.call(q,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ie[ee]=q[ee]);var Ne=arguments.length-2;if(Ne===1)ie.children=X;else if(1<Ne){for(var ut=Array(Ne),Ue=0;Ue<Ne;Ue++)ut[Ue]=arguments[Ue+2];ie.children=ut}if(N&&N.defaultProps)for(ee in Ne=N.defaultProps,Ne)ie[ee]===void 0&&(ie[ee]=Ne[ee]);return Ve(N,ue,ie)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(N){return{$$typeof:y,render:N}},ye.isValidElement=ft,ye.lazy=function(N){return{$$typeof:b,_payload:{_status:-1,_result:N},_init:ce}},ye.memo=function(N,q){return{$$typeof:g,type:N,compare:q===void 0?null:q}},ye.startTransition=function(N){var q=I.T,X={};I.T=X;try{var ee=N(),ie=I.S;ie!==null&&ie(X,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(ke,je)}catch(ue){je(ue)}finally{q!==null&&X.types!==null&&(q.types=X.types),I.T=q}},ye.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ye.use=function(N){return I.H.use(N)},ye.useActionState=function(N,q,X){return I.H.useActionState(N,q,X)},ye.useCallback=function(N,q){return I.H.useCallback(N,q)},ye.useContext=function(N){return I.H.useContext(N)},ye.useDebugValue=function(){},ye.useDeferredValue=function(N,q){return I.H.useDeferredValue(N,q)},ye.useEffect=function(N,q){return I.H.useEffect(N,q)},ye.useEffectEvent=function(N){return I.H.useEffectEvent(N)},ye.useId=function(){return I.H.useId()},ye.useImperativeHandle=function(N,q,X){return I.H.useImperativeHandle(N,q,X)},ye.useInsertionEffect=function(N,q){return I.H.useInsertionEffect(N,q)},ye.useLayoutEffect=function(N,q){return I.H.useLayoutEffect(N,q)},ye.useMemo=function(N,q){return I.H.useMemo(N,q)},ye.useOptimistic=function(N,q){return I.H.useOptimistic(N,q)},ye.useReducer=function(N,q,X){return I.H.useReducer(N,q,X)},ye.useRef=function(N){return I.H.useRef(N)},ye.useState=function(N){return I.H.useState(N)},ye.useSyncExternalStore=function(N,q,X){return I.H.useSyncExternalStore(N,q,X)},ye.useTransition=function(){return I.H.useTransition()},ye.version="19.2.7",ye}var Zp;function Nd(){return Zp||(Zp=1,Lo.exports=d0()),Lo.exports}var w=Nd(),Uo={exports:{}},ps={},zo={exports:{}},Bo={};/**
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 Gp;function f0(){return Gp||(Gp=1,(function(n){function i(U,F){var ce=U.length;U.push(F);e:for(;0<ce;){var je=ce-1>>>1,Me=U[je];if(0<d(Me,F))U[je]=F,U[ce]=Me,ce=je;else break e}}function s(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var F=U[0],ce=U.pop();if(ce!==F){U[0]=ce;e:for(var je=0,Me=U.length,N=Me>>>1;je<N;){var q=2*(je+1)-1,X=U[q],ee=q+1,ie=U[ee];if(0>d(X,ce))ee<Me&&0>d(ie,X)?(U[je]=ie,U[ee]=ce,je=ee):(U[je]=X,U[q]=ce,je=q);else if(ee<Me&&0>d(ie,ce))U[je]=ie,U[ee]=ce,je=ee;else break e}}return F}function d(U,F){var ce=U.sortIndex-F.sortIndex;return ce!==0?ce:U.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,y=m.now();n.unstable_now=function(){return m.now()-y}}var v=[],g=[],b=1,_=null,D=3,Q=!1,T=!1,V=!1,L=!1,B=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function fe(U){for(var F=s(g);F!==null;){if(F.callback===null)u(g);else if(F.startTime<=U)u(g),F.sortIndex=F.expirationTime,i(v,F);else break;F=s(g)}}function J(U){if(V=!1,fe(U),!T)if(s(v)!==null)T=!0,ke||(ke=!0,et());else{var F=s(g);F!==null&&re(J,F.startTime-U)}}var ke=!1,I=-1,ge=5,Ve=-1;function vt(){return L?!0:!(n.unstable_now()-Ve<ge)}function ft(){if(L=!1,ke){var U=n.unstable_now();Ve=U;var F=!0;try{e:{T=!1,V&&(V=!1,Z(I),I=-1),Q=!0;var ce=D;try{t:{for(fe(U),_=s(v);_!==null&&!(_.expirationTime>U&&vt());){var je=_.callback;if(typeof je=="function"){_.callback=null,D=_.priorityLevel;var Me=je(_.expirationTime<=U);if(U=n.unstable_now(),typeof Me=="function"){_.callback=Me,fe(U),F=!0;break t}_===s(v)&&u(v),fe(U)}else u(v);_=s(v)}if(_!==null)F=!0;else{var N=s(g);N!==null&&re(J,N.startTime-U),F=!1}}break e}finally{_=null,D=ce,Q=!1}F=void 0}}finally{F?et():ke=!1}}}var et;if(typeof W=="function")et=function(){W(ft)};else if(typeof MessageChannel<"u"){var Tt=new MessageChannel,Fe=Tt.port2;Tt.port1.onmessage=ft,et=function(){Fe.postMessage(null)}}else et=function(){B(ft,0)};function re(U,F){I=B(function(){U(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.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"):ge=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return D},n.unstable_next=function(U){switch(D){case 1:case 2:case 3:var F=3;break;default:F=D}var ce=D;D=F;try{return U()}finally{D=ce}},n.unstable_requestPaint=function(){L=!0},n.unstable_runWithPriority=function(U,F){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ce=D;D=U;try{return F()}finally{D=ce}},n.unstable_scheduleCallback=function(U,F,ce){var je=n.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?je+ce:je):ce=je,U){case 1:var Me=-1;break;case 2:Me=250;break;case 5:Me=1073741823;break;case 4:Me=1e4;break;default:Me=5e3}return Me=ce+Me,U={id:b++,callback:F,priorityLevel:U,startTime:ce,expirationTime:Me,sortIndex:-1},ce>je?(U.sortIndex=ce,i(g,U),s(v)===null&&U===s(g)&&(V?(Z(I),I=-1):V=!0,re(J,ce-je))):(U.sortIndex=Me,i(v,U),T||Q||(T=!0,ke||(ke=!0,et()))),U},n.unstable_shouldYield=vt,n.unstable_wrapCallback=function(U){var F=D;return function(){var ce=D;D=F;try{return U.apply(this,arguments)}finally{D=ce}}}})(Bo)),Bo}var Qp;function h0(){return Qp||(Qp=1,zo.exports=f0()),zo.exports}var qo={exports:{}},Rt={};/**
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 Xp;function m0(){if(Xp)return Rt;Xp=1;var n=Nd();function i(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+v+"; visit "+g+" 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(i(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(v,g,b){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:_==null?null:""+_,children:v,containerInfo:g,implementation:b}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Rt.createPortal=function(v,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(i(299));return f(v,g,null,b)},Rt.flushSync=function(v){var g=m.T,b=u.p;try{if(m.T=null,u.p=2,v)return v()}finally{m.T=g,u.p=b,u.d.f()}},Rt.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(v,g))},Rt.prefetchDNS=function(v){typeof v=="string"&&u.d.D(v)},Rt.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var b=g.as,_=y(b,g.crossOrigin),D=typeof g.integrity=="string"?g.integrity:void 0,Q=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?u.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:_,integrity:D,fetchPriority:Q}):b==="script"&&u.d.X(v,{crossOrigin:_,integrity:D,fetchPriority:Q,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Rt.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=y(g.as,g.crossOrigin);u.d.M(v,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(v)},Rt.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,_=y(b,g.crossOrigin);u.d.L(v,b,{crossOrigin:_,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Rt.preloadModule=function(v,g){if(typeof v=="string")if(g){var b=y(g.as,g.crossOrigin);u.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(v)},Rt.requestFormReset=function(v){u.d.r(v)},Rt.unstable_batchedUpdates=function(v,g){return v(g)},Rt.useFormState=function(v,g,b){return m.H.useFormState(v,g,b)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.7",Rt}var Kp;function p0(){if(Kp)return qo.exports;Kp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),qo.exports=m0(),qo.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 Jp;function x0(){if(Jp)return ps;Jp=1;var n=h0(),i=Nd(),s=p0();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a: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 y(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 v(e){if(f(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,l=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(l=r.return,l!==null){a=l;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return v(r),e;if(o===l)return v(r),t;o=o.sibling}throw Error(u(188))}if(a.return!==l.return)a=r,l=o;else{for(var h=!1,x=r.child;x;){if(x===a){h=!0,a=r,l=o;break}if(x===l){h=!0,l=r,a=o;break}x=x.sibling}if(!h){for(x=o.child;x;){if(x===a){h=!0,a=o,l=r;break}if(x===l){h=!0,l=o,a=r;break}x=x.sibling}if(!h)throw Error(u(189))}}if(a.alternate!==l)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var _=Object.assign,D=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),W=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),Ve=Symbol.for("react.activity"),vt=Symbol.for("react.memo_cache_sentinel"),ft=Symbol.iterator;function et(e){return e===null||typeof e!="object"?null:(e=ft&&e[ft]||e["@@iterator"],typeof e=="function"?e:null)}var Tt=Symbol.for("react.client.reference");function Fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Tt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case B:return"Profiler";case L:return"StrictMode";case J:return"Suspense";case ke:return"SuspenseList";case Ve:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case W:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case fe: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:Fe(e.type)||"Memo";case ge:t=e._payload,e=e._init;try{return Fe(e(t))}catch{}}return null}var re=Array.isArray,U=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},je=[],Me=-1;function N(e){return{current:e}}function q(e){0>Me||(e.current=je[Me],je[Me]=null,Me--)}function X(e,t){Me++,je[Me]=e.current,e.current=t}var ee=N(null),ie=N(null),ue=N(null),Ne=N(null);function ut(e,t){switch(X(ue,t),X(ie,e),X(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=op(t),e=dp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ee),X(ee,e)}function Ue(){q(ee),q(ie),q(ue)}function Gt(e){e.memoizedState!==null&&X(Ne,e);var t=ee.current,a=dp(t,e.type);t!==a&&(X(ie,e),X(ee,a))}function ta(e){ie.current===e&&(q(ee),q(ie)),Ne.current===e&&(q(Ne),os._currentValue=ce)}var yn,wa;function De(e){if(yn===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);yn=t&&t[1]||"",wa=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+yn+e+wa}var jt=!1;function Ya(e,t){if(!e||jt)return"";jt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(M){var k=M}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(M){k=M}e.call(Y.prototype)}}else{try{throw Error()}catch(M){k=M}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(M){if(M&&k&&typeof M.stack=="string")return[M.stack,k.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),h=o[0],x=o[1];if(h&&x){var S=h.split(`
44
- `),R=x.split(`
45
- `);for(r=l=0;l<S.length&&!S[l].includes("DetermineComponentFrameRoot");)l++;for(;r<R.length&&!R[r].includes("DetermineComponentFrameRoot");)r++;if(l===S.length||r===R.length)for(l=S.length-1,r=R.length-1;1<=l&&0<=r&&S[l]!==R[r];)r--;for(;1<=l&&0<=r;l--,r--)if(S[l]!==R[r]){if(l!==1||r!==1)do if(l--,r--,0>r||S[l]!==R[r]){var z=`
46
- `+S[l].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=l&&0<=r);break}}}finally{jt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?De(a):""}function ct(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De("Lazy");case 13:return e.child!==t&&t!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Ya(e.type,!1);case 11:return Ya(e.type.render,!1);case 1:return Ya(e.type,!0);case 31:return De("Activity");default:return""}}function Za(e){try{var t="",a=null;do t+=ct(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
47
- Error generating stack: `+l.message+`
48
- `+l.stack}}var vn=Object.prototype.hasOwnProperty,Ga=n.unstable_scheduleCallback,Mt=n.unstable_cancelCallback,gn=n.unstable_shouldYield,bn=n.unstable_requestPaint,tt=n.unstable_now,it=n.unstable_getCurrentPriorityLevel,Fn=n.unstable_ImmediatePriority,Wn=n.unstable_UserBlockingPriority,Qa=n.unstable_NormalPriority,Pn=n.unstable_LowPriority,gt=n.unstable_IdlePriority,Si=n.log,ji=n.unstable_setDisableYieldValue,Ma=null,G=null;function be(e){if(typeof Si=="function"&&ji(e),G&&typeof G.setStrictMode=="function")try{G.setStrictMode(Ma,e)}catch{}}var qe=Math.clz32?Math.clz32:Dt,wn=Math.log,Al=Math.LN2;function Dt(e){return e>>>=0,e===0?32:31-(wn(e)/Al|0)|0}var aa=256,el=262144,El=4194304;function Da(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 Cl(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var r=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~o,l!==0?r=Da(l):(h&=x,h!==0?r=Da(h):a||(a=x&~e,a!==0&&(r=Da(a))))):(x=l&~o,x!==0?r=Da(x):h!==0?r=Da(h):a||(a=l&~e,a!==0&&(r=Da(a)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:r}function O(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oe(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 Je(){var e=El;return El<<=1,(El&62914560)===0&&(El=4194304),e}function Sa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ni(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Fy(e,t,a,l,r,o){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var x=e.entanglements,S=e.expirationTimes,R=e.hiddenUpdates;for(a=h&~a;0<a;){var z=31-qe(a),Y=1<<z;x[z]=0,S[z]=-1;var k=R[z];if(k!==null)for(R[z]=null,z=0;z<k.length;z++){var M=k[z];M!==null&&(M.lane&=-536870913)}a&=~Y}l!==0&&Gd(e,l,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(h&~t))}function Gd(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-qe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Qd(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-qe(a),r=1<<l;r&t|e[l]&t&&(e[l]|=t),a&=~r}}function Xd(e,t){var a=t&-t;return a=(a&42)!==0?1:Su(a),(a&(e.suspendedLanes|t))!==0?0:a}function Su(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 ju(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kd(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Dp(e.type))}function Jd(e,t){var a=F.p;try{return F.p=e,t()}finally{F.p=a}}var Sn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Sn,Lt="__reactProps$"+Sn,Rl="__reactContainer$"+Sn,Nu="__reactEvents$"+Sn,Wy="__reactListeners$"+Sn,Py="__reactHandles$"+Sn,Id="__reactResources$"+Sn,_i="__reactMarker$"+Sn;function _u(e){delete e[Nt],delete e[Lt],delete e[Nu],delete e[Wy],delete e[Py]}function Tl(e){var t=e[Nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Rl]||a[Nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=vp(e);e!==null;){if(a=e[Nt])return a;e=vp(e)}return t}e=a,a=e.parentNode}return null}function kl(e){if(e=e[Nt]||e[Rl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ai(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Ol(e){var t=e[Id];return t||(t=e[Id]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[_i]=!0}var Fd=new Set,Wd={};function tl(e,t){Ml(e,t),Ml(e+"Capture",t)}function Ml(e,t){for(Wd[e]=t,e=0;e<t.length;e++)Fd.add(t[e])}var ev=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]*$"),Pd={},ef={};function tv(e){return vn.call(ef,e)?!0:vn.call(Pd,e)?!1:ev.test(e)?ef[e]=!0:(Pd[e]=!0,!1)}function Ts(e,t,a){if(tv(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ks(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Xa(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function na(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function av(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var r=l.get,o=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(h){a=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Au(e){if(!e._valueTracker){var t=tf(e)?"checked":"value";e._valueTracker=av(e,t,""+e[t])}}function af(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=tf(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Os(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 nv=/[\n"\\]/g;function la(e){return e.replace(nv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Eu(e,t,a,l,r,o,h,x){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=""+na(t)):e.value!==""+na(t)&&(e.value=""+na(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Cu(e,h,na(t)):a!=null?Cu(e,h,na(a)):l!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+na(x):e.removeAttribute("name")}function nf(e,t,a,l,r,o,h,x){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Au(e);return}a=a!=null?""+na(a):"",t=t!=null?""+na(t):a,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??r,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Au(e)}function Cu(e,t,a){t==="number"&&Os(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Dl(e,t,a,l){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&l&&(e[a].defaultSelected=!0)}else{for(a=""+na(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,l&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function lf(e,t,a){if(t!=null&&(t=""+na(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+na(a):""}function sf(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(u(92));if(re(l)){if(1<l.length)throw Error(u(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=na(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Au(e)}function Ll(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var lv=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 rf(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||lv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function uf(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var r in t)l=t[r],t.hasOwnProperty(r)&&a[r]!==l&&rf(e,r,l)}else for(var o in t)t.hasOwnProperty(o)&&rf(e,o,t[o])}function Ru(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var iv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),sv=/^[\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 Ms(e){return sv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ka(){}var Tu=null;function ku(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ul=null,zl=null;function cf(e){var t=kl(e);if(t&&(e=t.stateNode)){var a=e[Lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Eu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+la(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var r=l[Lt]||null;if(!r)throw Error(u(90));Eu(l,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&af(l)}break e;case"textarea":lf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Dl(e,!!a.multiple,t,!1)}}}var Ou=!1;function of(e,t,a){if(Ou)return e(t,a);Ou=!0;try{var l=e(t);return l}finally{if(Ou=!1,(Ul!==null||zl!==null)&&(br(),Ul&&(t=Ul,e=zl,zl=Ul=null,cf(t),e)))for(t=0;t<e.length;t++)cf(e[t])}}function Ei(e,t){var a=e.stateNode;if(a===null)return null;var l=a[Lt]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var Ja=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mu=!1;if(Ja)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){Mu=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{Mu=!1}var jn=null,Du=null,Ds=null;function df(){if(Ds)return Ds;var e,t=Du,a=t.length,l,r="value"in jn?jn.value:jn.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var h=a-e;for(l=1;l<=h&&t[a-l]===r[o-l];l++);return Ds=r.slice(e,1<l?1-l:void 0)}function Ls(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Us(){return!0}function ff(){return!1}function Ut(e){function t(a,l,r,o,h){this._reactName=a,this._targetInst=r,this.type=l,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(a=e[x],this[x]=a?a(o):o[x]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Us:ff,this.isPropagationStopped=ff,this}return _(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Us)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Us)},persist:function(){},isPersistent:Us}),t}var al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zs=Ut(al),Ri=_({},al,{view:0,detail:0}),rv=Ut(Ri),Lu,Uu,Ti,Bs=_({},Ri,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bu,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!==Ti&&(Ti&&e.type==="mousemove"?(Lu=e.screenX-Ti.screenX,Uu=e.screenY-Ti.screenY):Uu=Lu=0,Ti=e),Lu)},movementY:function(e){return"movementY"in e?e.movementY:Uu}}),hf=Ut(Bs),uv=_({},Bs,{dataTransfer:0}),cv=Ut(uv),ov=_({},Ri,{relatedTarget:0}),zu=Ut(ov),dv=_({},al,{animationName:0,elapsedTime:0,pseudoElement:0}),fv=Ut(dv),hv=_({},al,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mv=Ut(hv),pv=_({},al,{data:0}),mf=Ut(pv),xv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yv={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"},vv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vv[e])?!!t[e]:!1}function Bu(){return gv}var bv=_({},Ri,{key:function(e){if(e.key){var t=xv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ls(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bu,charCode:function(e){return e.type==="keypress"?Ls(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ls(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wv=Ut(bv),Sv=_({},Bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pf=Ut(Sv),jv=_({},Ri,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bu}),Nv=Ut(jv),_v=_({},al,{propertyName:0,elapsedTime:0,pseudoElement:0}),Av=Ut(_v),Ev=_({},Bs,{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}),Cv=Ut(Ev),Rv=_({},al,{newState:0,oldState:0}),Tv=Ut(Rv),kv=[9,13,27,32],qu=Ja&&"CompositionEvent"in window,ki=null;Ja&&"documentMode"in document&&(ki=document.documentMode);var Ov=Ja&&"TextEvent"in window&&!ki,xf=Ja&&(!qu||ki&&8<ki&&11>=ki),yf=" ",vf=!1;function gf(e,t){switch(e){case"keyup":return kv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bl=!1;function Mv(e,t){switch(e){case"compositionend":return bf(t);case"keypress":return t.which!==32?null:(vf=!0,yf);case"textInput":return e=t.data,e===yf&&vf?null:e;default:return null}}function Dv(e,t){if(Bl)return e==="compositionend"||!qu&&gf(e,t)?(e=df(),Ds=Du=jn=null,Bl=!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 xf&&t.locale!=="ko"?null:t.data;default:return null}}var Lv={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 wf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lv[e.type]:t==="textarea"}function Sf(e,t,a,l){Ul?zl?zl.push(l):zl=[l]:Ul=l,t=Er(t,"onChange"),0<t.length&&(a=new zs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Oi=null,Mi=null;function Uv(e){lp(e,0)}function qs(e){var t=Ai(e);if(af(t))return e}function jf(e,t){if(e==="change")return t}var Nf=!1;if(Ja){var Hu;if(Ja){var $u="oninput"in document;if(!$u){var _f=document.createElement("div");_f.setAttribute("oninput","return;"),$u=typeof _f.oninput=="function"}Hu=$u}else Hu=!1;Nf=Hu&&(!document.documentMode||9<document.documentMode)}function Af(){Oi&&(Oi.detachEvent("onpropertychange",Ef),Mi=Oi=null)}function Ef(e){if(e.propertyName==="value"&&qs(Mi)){var t=[];Sf(t,Mi,e,ku(e)),of(Uv,t)}}function zv(e,t,a){e==="focusin"?(Af(),Oi=t,Mi=a,Oi.attachEvent("onpropertychange",Ef)):e==="focusout"&&Af()}function Bv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qs(Mi)}function qv(e,t){if(e==="click")return qs(t)}function Hv(e,t){if(e==="input"||e==="change")return qs(t)}function $v(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:$v;function Di(e,t){if(Qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var r=a[l];if(!vn.call(t,r)||!Qt(e[r],t[r]))return!1}return!0}function Cf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rf(e,t){var a=Cf(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Cf(a)}}function Tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Os(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Os(e.document)}return t}function Vu(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 Vv=Ja&&"documentMode"in document&&11>=document.documentMode,ql=null,Yu=null,Li=null,Zu=!1;function Of(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Zu||ql==null||ql!==Os(l)||(l=ql,"selectionStart"in l&&Vu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Li&&Di(Li,l)||(Li=l,l=Er(Yu,"onSelect"),0<l.length&&(t=new zs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=ql)))}function nl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Hl={animationend:nl("Animation","AnimationEnd"),animationiteration:nl("Animation","AnimationIteration"),animationstart:nl("Animation","AnimationStart"),transitionrun:nl("Transition","TransitionRun"),transitionstart:nl("Transition","TransitionStart"),transitioncancel:nl("Transition","TransitionCancel"),transitionend:nl("Transition","TransitionEnd")},Gu={},Mf={};Ja&&(Mf=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function ll(e){if(Gu[e])return Gu[e];if(!Hl[e])return e;var t=Hl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Mf)return Gu[e]=t[a];return e}var Df=ll("animationend"),Lf=ll("animationiteration"),Uf=ll("animationstart"),Yv=ll("transitionrun"),Zv=ll("transitionstart"),Gv=ll("transitioncancel"),zf=ll("transitionend"),Bf=new Map,Qu="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(" ");Qu.push("scrollEnd");function ja(e,t){Bf.set(e,t),tl(t,[e])}var Hs=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)},ia=[],$l=0,Xu=0;function $s(){for(var e=$l,t=Xu=$l=0;t<e;){var a=ia[t];ia[t++]=null;var l=ia[t];ia[t++]=null;var r=ia[t];ia[t++]=null;var o=ia[t];if(ia[t++]=null,l!==null&&r!==null){var h=l.pending;h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r}o!==0&&qf(a,r,o)}}function Vs(e,t,a,l){ia[$l++]=e,ia[$l++]=t,ia[$l++]=a,ia[$l++]=l,Xu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Ku(e,t,a,l){return Vs(e,t,a,l),Ys(e)}function il(e,t){return Vs(e,null,null,t),Ys(e)}function qf(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,l=o.alternate,l!==null&&(l.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,r&&t!==null&&(r=31-qe(a),e=o.hiddenUpdates,l=e[r],l===null?e[r]=[t]:l.push(t),t.lane=a|536870912),o):null}function Ys(e){if(50<ns)throw ns=0,no=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vl={};function Qv(e,t,a,l){this.tag=e,this.key=a,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,a,l){return new Qv(e,t,a,l)}function Ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ia(e,t){var a=e.alternate;return a===null?(a=Xt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Hf(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zs(e,t,a,l,r,o){var h=0;if(l=e,typeof e=="function")Ju(e)&&(h=1);else if(typeof e=="string")h=Fg(e,a,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ve:return e=Xt(31,a,t,r),e.elementType=Ve,e.lanes=o,e;case V:return sl(a.children,r,o,t);case L:h=8,r|=24;break;case B:return e=Xt(12,a,t,r|2),e.elementType=B,e.lanes=o,e;case J:return e=Xt(13,a,t,r),e.elementType=J,e.lanes=o,e;case ke:return e=Xt(19,a,t,r),e.elementType=ke,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:h=10;break e;case Z:h=9;break e;case fe:h=11;break e;case I:h=14;break e;case ge:h=16,l=null;break e}h=29,a=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=Xt(h,a,t,r),t.elementType=e,t.type=l,t.lanes=o,t}function sl(e,t,a,l){return e=Xt(7,e,l,t),e.lanes=a,e}function Iu(e,t,a){return e=Xt(6,e,null,t),e.lanes=a,e}function $f(e){var t=Xt(18,null,null,0);return t.stateNode=e,t}function Fu(e,t,a){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vf=new WeakMap;function sa(e,t){if(typeof e=="object"&&e!==null){var a=Vf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Za(t)},Vf.set(e,t),t)}return{value:e,source:t,stack:Za(t)}}var Yl=[],Zl=0,Gs=null,Ui=0,ra=[],ua=0,Nn=null,La=1,Ua="";function Fa(e,t){Yl[Zl++]=Ui,Yl[Zl++]=Gs,Gs=e,Ui=t}function Yf(e,t,a){ra[ua++]=La,ra[ua++]=Ua,ra[ua++]=Nn,Nn=e;var l=La;e=Ua;var r=32-qe(l)-1;l&=~(1<<r),a+=1;var o=32-qe(t)+r;if(30<o){var h=r-r%5;o=(l&(1<<h)-1).toString(32),l>>=h,r-=h,La=1<<32-qe(t)+r|a<<r|l,Ua=o+e}else La=1<<o|a<<r|l,Ua=e}function Wu(e){e.return!==null&&(Fa(e,1),Yf(e,1,0))}function Pu(e){for(;e===Gs;)Gs=Yl[--Zl],Yl[Zl]=null,Ui=Yl[--Zl],Yl[Zl]=null;for(;e===Nn;)Nn=ra[--ua],ra[ua]=null,Ua=ra[--ua],ra[ua]=null,La=ra[--ua],ra[ua]=null}function Zf(e,t){ra[ua++]=La,ra[ua++]=Ua,ra[ua++]=Nn,La=t.id,Ua=t.overflow,Nn=e}var _t=null,We=null,Oe=!1,_n=null,ca=!1,ec=Error(u(519));function An(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zi(sa(t,e)),ec}function Gf(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[Nt]=e,t[Lt]=l,a){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(a=0;a<is.length;a++)Ae(is[a],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),nf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),sf(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||up(t.textContent,a)?(l.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),l.onScroll!=null&&Ae("scroll",t),l.onScrollEnd!=null&&Ae("scrollend",t),l.onClick!=null&&(t.onclick=Ka),t=!0):t=!1,t||An(e,!0)}function Qf(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:_t=_t.return}}function Gl(e){if(e!==_t)return!1;if(!Oe)return Qf(e),Oe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||go(e.type,e.memoizedProps)),a=!a),a&&We&&An(e),Qf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));We=yp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));We=yp(e)}else t===27?(t=We,Hn(e.type)?(e=No,No=null,We=e):We=t):We=_t?da(e.stateNode.nextSibling):null;return!0}function rl(){We=_t=null,Oe=!1}function tc(){var e=_n;return e!==null&&(Ht===null?Ht=e:Ht.push.apply(Ht,e),_n=null),e}function zi(e){_n===null?_n=[e]:_n.push(e)}var ac=N(null),ul=null,Wa=null;function En(e,t,a){X(ac,t._currentValue),t._currentValue=a}function Pa(e){e._currentValue=ac.current,q(ac)}function nc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function lc(e,t,a,l){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var h=r.child;o=o.firstContext;e:for(;o!==null;){var x=o;o=r;for(var S=0;S<t.length;S++)if(x.context===t[S]){o.lanes|=a,x=o.alternate,x!==null&&(x.lanes|=a),nc(o.return,a,e),l||(h=null);break e}o=x.next}}else if(r.tag===18){if(h=r.return,h===null)throw Error(u(341));h.lanes|=a,o=h.alternate,o!==null&&(o.lanes|=a),nc(h,a,e),h=null}else h=r.child;if(h!==null)h.return=r;else for(h=r;h!==null;){if(h===e){h=null;break}if(r=h.sibling,r!==null){r.return=h.return,h=r;break}h=h.return}r=h}}function Ql(e,t,a,l){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var h=r.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var x=r.type;Qt(r.pendingProps.value,h.value)||(e!==null?e.push(x):e=[x])}}else if(r===Ne.current){if(h=r.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(os):e=[os])}r=r.return}e!==null&&lc(t,e,a,l),t.flags|=262144}function Qs(e){for(e=e.firstContext;e!==null;){if(!Qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function cl(e){ul=e,Wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function At(e){return Xf(ul,e)}function Xs(e,t){return ul===null&&cl(e),Xf(e,t)}function Xf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Wa===null){if(e===null)throw Error(u(308));Wa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wa=Wa.next=t;return a}var Xv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Kv=n.unstable_scheduleCallback,Jv=n.unstable_NormalPriority,ht={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ic(){return{controller:new Xv,data:new Map,refCount:0}}function Bi(e){e.refCount--,e.refCount===0&&Kv(Jv,function(){e.controller.abort()})}var qi=null,sc=0,Xl=0,Kl=null;function Iv(e,t){if(qi===null){var a=qi=[];sc=0,Xl=co(),Kl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return sc++,t.then(Kf,Kf),t}function Kf(){if(--sc===0&&qi!==null){Kl!==null&&(Kl.status="fulfilled");var e=qi;qi=null,Xl=0,Kl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fv(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(l.status="rejected",l.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),l}var Jf=U.S;U.S=function(e,t){Om=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Iv(e,t),Jf!==null&&Jf(e,t)};var ol=N(null);function rc(){var e=ol.current;return e!==null?e:Ie.pooledCache}function Ks(e,t){t===null?X(ol,ol.current):X(ol,t.pool)}function If(){var e=rc();return e===null?null:{parent:ht._currentValue,pool:e}}var Jl=Error(u(460)),uc=Error(u(474)),Js=Error(u(542)),Is={then:function(){}};function Ff(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Wf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ka,Ka),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,eh(e),e;default:if(typeof t.status=="string")t.then(Ka,Ka);else{if(e=Ie,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=l}},function(l){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,eh(e),e}throw fl=t,Jl}}function dl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fl=a,Jl):a}}var fl=null;function Pf(){if(fl===null)throw Error(u(459));var e=fl;return fl=null,e}function eh(e){if(e===Jl||e===Js)throw Error(u(483))}var Il=null,Hi=0;function Fs(e){var t=Hi;return Hi+=1,Il===null&&(Il=[]),Wf(Il,e,t)}function $i(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ws(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 th(e){function t(A,j){if(e){var C=A.deletions;C===null?(A.deletions=[j],A.flags|=16):C.push(j)}}function a(A,j){if(!e)return null;for(;j!==null;)t(A,j),j=j.sibling;return null}function l(A){for(var j=new Map;A!==null;)A.key!==null?j.set(A.key,A):j.set(A.index,A),A=A.sibling;return j}function r(A,j){return A=Ia(A,j),A.index=0,A.sibling=null,A}function o(A,j,C){return A.index=C,e?(C=A.alternate,C!==null?(C=C.index,C<j?(A.flags|=67108866,j):C):(A.flags|=67108866,j)):(A.flags|=1048576,j)}function h(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function x(A,j,C,H){return j===null||j.tag!==6?(j=Iu(C,A.mode,H),j.return=A,j):(j=r(j,C),j.return=A,j)}function S(A,j,C,H){var de=C.type;return de===V?z(A,j,C.props.children,H,C.key):j!==null&&(j.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ge&&dl(de)===j.type)?(j=r(j,C.props),$i(j,C),j.return=A,j):(j=Zs(C.type,C.key,C.props,null,A.mode,H),$i(j,C),j.return=A,j)}function R(A,j,C,H){return j===null||j.tag!==4||j.stateNode.containerInfo!==C.containerInfo||j.stateNode.implementation!==C.implementation?(j=Fu(C,A.mode,H),j.return=A,j):(j=r(j,C.children||[]),j.return=A,j)}function z(A,j,C,H,de){return j===null||j.tag!==7?(j=sl(C,A.mode,H,de),j.return=A,j):(j=r(j,C),j.return=A,j)}function Y(A,j,C){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Iu(""+j,A.mode,C),j.return=A,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Q:return C=Zs(j.type,j.key,j.props,null,A.mode,C),$i(C,j),C.return=A,C;case T:return j=Fu(j,A.mode,C),j.return=A,j;case ge:return j=dl(j),Y(A,j,C)}if(re(j)||et(j))return j=sl(j,A.mode,C,null),j.return=A,j;if(typeof j.then=="function")return Y(A,Fs(j),C);if(j.$$typeof===W)return Y(A,Xs(A,j),C);Ws(A,j)}return null}function k(A,j,C,H){var de=j!==null?j.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return de!==null?null:x(A,j,""+C,H);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Q:return C.key===de?S(A,j,C,H):null;case T:return C.key===de?R(A,j,C,H):null;case ge:return C=dl(C),k(A,j,C,H)}if(re(C)||et(C))return de!==null?null:z(A,j,C,H,null);if(typeof C.then=="function")return k(A,j,Fs(C),H);if(C.$$typeof===W)return k(A,j,Xs(A,C),H);Ws(A,C)}return null}function M(A,j,C,H,de){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return A=A.get(C)||null,x(j,A,""+H,de);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case Q:return A=A.get(H.key===null?C:H.key)||null,S(j,A,H,de);case T:return A=A.get(H.key===null?C:H.key)||null,R(j,A,H,de);case ge:return H=dl(H),M(A,j,C,H,de)}if(re(H)||et(H))return A=A.get(C)||null,z(j,A,H,de,null);if(typeof H.then=="function")return M(A,j,C,Fs(H),de);if(H.$$typeof===W)return M(A,j,C,Xs(j,H),de);Ws(j,H)}return null}function ae(A,j,C,H){for(var de=null,ze=null,le=j,we=j=0,Ce=null;le!==null&&we<C.length;we++){le.index>we?(Ce=le,le=null):Ce=le.sibling;var Be=k(A,le,C[we],H);if(Be===null){le===null&&(le=Ce);break}e&&le&&Be.alternate===null&&t(A,le),j=o(Be,j,we),ze===null?de=Be:ze.sibling=Be,ze=Be,le=Ce}if(we===C.length)return a(A,le),Oe&&Fa(A,we),de;if(le===null){for(;we<C.length;we++)le=Y(A,C[we],H),le!==null&&(j=o(le,j,we),ze===null?de=le:ze.sibling=le,ze=le);return Oe&&Fa(A,we),de}for(le=l(le);we<C.length;we++)Ce=M(le,A,we,C[we],H),Ce!==null&&(e&&Ce.alternate!==null&&le.delete(Ce.key===null?we:Ce.key),j=o(Ce,j,we),ze===null?de=Ce:ze.sibling=Ce,ze=Ce);return e&&le.forEach(function(Gn){return t(A,Gn)}),Oe&&Fa(A,we),de}function me(A,j,C,H){if(C==null)throw Error(u(151));for(var de=null,ze=null,le=j,we=j=0,Ce=null,Be=C.next();le!==null&&!Be.done;we++,Be=C.next()){le.index>we?(Ce=le,le=null):Ce=le.sibling;var Gn=k(A,le,Be.value,H);if(Gn===null){le===null&&(le=Ce);break}e&&le&&Gn.alternate===null&&t(A,le),j=o(Gn,j,we),ze===null?de=Gn:ze.sibling=Gn,ze=Gn,le=Ce}if(Be.done)return a(A,le),Oe&&Fa(A,we),de;if(le===null){for(;!Be.done;we++,Be=C.next())Be=Y(A,Be.value,H),Be!==null&&(j=o(Be,j,we),ze===null?de=Be:ze.sibling=Be,ze=Be);return Oe&&Fa(A,we),de}for(le=l(le);!Be.done;we++,Be=C.next())Be=M(le,A,we,Be.value,H),Be!==null&&(e&&Be.alternate!==null&&le.delete(Be.key===null?we:Be.key),j=o(Be,j,we),ze===null?de=Be:ze.sibling=Be,ze=Be);return e&&le.forEach(function(u0){return t(A,u0)}),Oe&&Fa(A,we),de}function Ke(A,j,C,H){if(typeof C=="object"&&C!==null&&C.type===V&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Q:e:{for(var de=C.key;j!==null;){if(j.key===de){if(de=C.type,de===V){if(j.tag===7){a(A,j.sibling),H=r(j,C.props.children),H.return=A,A=H;break e}}else if(j.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ge&&dl(de)===j.type){a(A,j.sibling),H=r(j,C.props),$i(H,C),H.return=A,A=H;break e}a(A,j);break}else t(A,j);j=j.sibling}C.type===V?(H=sl(C.props.children,A.mode,H,C.key),H.return=A,A=H):(H=Zs(C.type,C.key,C.props,null,A.mode,H),$i(H,C),H.return=A,A=H)}return h(A);case T:e:{for(de=C.key;j!==null;){if(j.key===de)if(j.tag===4&&j.stateNode.containerInfo===C.containerInfo&&j.stateNode.implementation===C.implementation){a(A,j.sibling),H=r(j,C.children||[]),H.return=A,A=H;break e}else{a(A,j);break}else t(A,j);j=j.sibling}H=Fu(C,A.mode,H),H.return=A,A=H}return h(A);case ge:return C=dl(C),Ke(A,j,C,H)}if(re(C))return ae(A,j,C,H);if(et(C)){if(de=et(C),typeof de!="function")throw Error(u(150));return C=de.call(C),me(A,j,C,H)}if(typeof C.then=="function")return Ke(A,j,Fs(C),H);if(C.$$typeof===W)return Ke(A,j,Xs(A,C),H);Ws(A,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,j!==null&&j.tag===6?(a(A,j.sibling),H=r(j,C),H.return=A,A=H):(a(A,j),H=Iu(C,A.mode,H),H.return=A,A=H),h(A)):a(A,j)}return function(A,j,C,H){try{Hi=0;var de=Ke(A,j,C,H);return Il=null,de}catch(le){if(le===Jl||le===Js)throw le;var ze=Xt(29,le,null,A.mode);return ze.lanes=H,ze.return=A,ze}finally{}}}var hl=th(!0),ah=th(!1),Cn=!1;function cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oc(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 Rn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tn(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(He&2)!==0){var r=l.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),l.pending=t,t=Ys(e),qf(e,null,a),t}return Vs(e,l,t,a),Ys(e)}function Vi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Qd(e,a)}}function dc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=h:o=o.next=h,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var fc=!1;function Yi(){if(fc){var e=Kl;if(e!==null)throw e}}function Zi(e,t,a,l){fc=!1;var r=e.updateQueue;Cn=!1;var o=r.firstBaseUpdate,h=r.lastBaseUpdate,x=r.shared.pending;if(x!==null){r.shared.pending=null;var S=x,R=S.next;S.next=null,h===null?o=R:h.next=R,h=S;var z=e.alternate;z!==null&&(z=z.updateQueue,x=z.lastBaseUpdate,x!==h&&(x===null?z.firstBaseUpdate=R:x.next=R,z.lastBaseUpdate=S))}if(o!==null){var Y=r.baseState;h=0,z=R=S=null,x=o;do{var k=x.lane&-536870913,M=k!==x.lane;if(M?(Ee&k)===k:(l&k)===k){k!==0&&k===Xl&&(fc=!0),z!==null&&(z=z.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ae=e,me=x;k=t;var Ke=a;switch(me.tag){case 1:if(ae=me.payload,typeof ae=="function"){Y=ae.call(Ke,Y,k);break e}Y=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=me.payload,k=typeof ae=="function"?ae.call(Ke,Y,k):ae,k==null)break e;Y=_({},Y,k);break e;case 2:Cn=!0}}k=x.callback,k!==null&&(e.flags|=64,M&&(e.flags|=8192),M=r.callbacks,M===null?r.callbacks=[k]:M.push(k))}else M={lane:k,tag:x.tag,payload:x.payload,callback:x.callback,next:null},z===null?(R=z=M,S=Y):z=z.next=M,h|=k;if(x=x.next,x===null){if(x=r.shared.pending,x===null)break;M=x,x=M.next,M.next=null,r.lastBaseUpdate=M,r.shared.pending=null}}while(!0);z===null&&(S=Y),r.baseState=S,r.firstBaseUpdate=R,r.lastBaseUpdate=z,o===null&&(r.shared.lanes=0),Ln|=h,e.lanes=h,e.memoizedState=Y}}function nh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function lh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)nh(a[e],t)}var Fl=N(null),Ps=N(0);function ih(e,t){e=cn,X(Ps,e),X(Fl,t),cn=e|t.baseLanes}function hc(){X(Ps,cn),X(Fl,Fl.current)}function mc(){cn=Ps.current,q(Fl),q(Ps)}var Kt=N(null),oa=null;function kn(e){var t=e.alternate;X(ot,ot.current&1),X(Kt,e),oa===null&&(t===null||Fl.current!==null||t.memoizedState!==null)&&(oa=e)}function pc(e){X(ot,ot.current),X(Kt,e),oa===null&&(oa=e)}function sh(e){e.tag===22?(X(ot,ot.current),X(Kt,e),oa===null&&(oa=e)):On()}function On(){X(ot,ot.current),X(Kt,Kt.current)}function Jt(e){q(Kt),oa===e&&(oa=null),q(ot)}var ot=N(0);function er(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||So(a)||jo(a)))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 en=0,ve=null,Qe=null,mt=null,tr=!1,Wl=!1,ml=!1,ar=0,Gi=0,Pl=null,Wv=0;function st(){throw Error(u(321))}function xc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Qt(e[a],t[a]))return!1;return!0}function yc(e,t,a,l,r,o){return en=o,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Yh:Oc,ml=!1,o=a(l,r),ml=!1,Wl&&(o=uh(t,a,l,r)),rh(e),o}function rh(e){U.H=Ki;var t=Qe!==null&&Qe.next!==null;if(en=0,mt=Qe=ve=null,tr=!1,Gi=0,Pl=null,t)throw Error(u(300));e===null||pt||(e=e.dependencies,e!==null&&Qs(e)&&(pt=!0))}function uh(e,t,a,l){ve=e;var r=0;do{if(Wl&&(Pl=null),Gi=0,Wl=!1,25<=r)throw Error(u(301));if(r+=1,mt=Qe=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=Zh,o=t(a,l)}while(Wl);return o}function Pv(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Qi(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(ve.flags|=1024),t}function vc(){var e=ar!==0;return ar=0,e}function gc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function bc(e){if(tr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}tr=!1}en=0,mt=Qe=ve=null,Wl=!1,Gi=ar=0,Pl=null}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?ve.memoizedState=mt=e:mt=mt.next=e,mt}function dt(){if(Qe===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=mt===null?ve.memoizedState:mt.next;if(t!==null)mt=t,Qe=e;else{if(e===null)throw ve.alternate===null?Error(u(467)):Error(u(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},mt===null?ve.memoizedState=mt=e:mt=mt.next=e}return mt}function nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qi(e){var t=Gi;return Gi+=1,Pl===null&&(Pl=[]),e=Wf(Pl,e,t),t=ve,(mt===null?t.memoizedState:mt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Yh:Oc),e}function lr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qi(e);if(e.$$typeof===W)return At(e)}throw Error(u(438,String(e)))}function wc(e){var t=null,a=ve.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=ve.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=nr(),ve.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=vt;return t.index++,a}function tn(e,t){return typeof t=="function"?t(e):t}function ir(e){var t=dt();return Sc(t,Qe,e)}function Sc(e,t,a){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=a;var r=e.baseQueue,o=l.pending;if(o!==null){if(r!==null){var h=r.next;r.next=o.next,o.next=h}t.baseQueue=r=o,l.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var x=h=null,S=null,R=t,z=!1;do{var Y=R.lane&-536870913;if(Y!==R.lane?(Ee&Y)===Y:(en&Y)===Y){var k=R.revertLane;if(k===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),Y===Xl&&(z=!0);else if((en&k)===k){R=R.next,k===Xl&&(z=!0);continue}else Y={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},S===null?(x=S=Y,h=o):S=S.next=Y,ve.lanes|=k,Ln|=k;Y=R.action,ml&&a(o,Y),o=R.hasEagerState?R.eagerState:a(o,Y)}else k={lane:Y,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},S===null?(x=S=k,h=o):S=S.next=k,ve.lanes|=Y,Ln|=Y;R=R.next}while(R!==null&&R!==t);if(S===null?h=o:S.next=x,!Qt(o,e.memoizedState)&&(pt=!0,z&&(a=Kl,a!==null)))throw a;e.memoizedState=o,e.baseState=h,e.baseQueue=S,l.lastRenderedState=o}return r===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function jc(e){var t=dt(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var l=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var h=r=r.next;do o=e(o,h.action),h=h.next;while(h!==r);Qt(o,t.memoizedState)||(pt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,l]}function ch(e,t,a){var l=ve,r=dt(),o=Oe;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var h=!Qt((Qe||r).memoizedState,a);if(h&&(r.memoizedState=a,pt=!0),r=r.queue,Ac(fh.bind(null,l,r,e),[e]),r.getSnapshot!==t||h||mt!==null&&mt.memoizedState.tag&1){if(l.flags|=2048,ei(9,{destroy:void 0},dh.bind(null,l,r,a,t),null),Ie===null)throw Error(u(349));o||(en&127)!==0||oh(l,t,a)}return a}function oh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ve.updateQueue,t===null?(t=nr(),ve.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function dh(e,t,a,l){t.value=a,t.getSnapshot=l,hh(t)&&mh(e)}function fh(e,t,a){return a(function(){hh(t)&&mh(e)})}function hh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Qt(e,a)}catch{return!0}}function mh(e){var t=il(e,2);t!==null&&$t(t,e,2)}function Nc(e){var t=kt();if(typeof e=="function"){var a=e;if(e=a(),ml){be(!0);try{a()}finally{be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:e},t}function ph(e,t,a,l){return e.baseState=a,Sc(e,Qe,typeof l=="function"?l:tn)}function eg(e,t,a,l,r){if(ur(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){o.listeners.push(h)}};U.T!==null?a(!0):o.isTransition=!1,l(o),a=t.pending,a===null?(o.next=t.pending=o,xh(t,o)):(o.next=a.next,t.pending=a.next=o)}}function xh(e,t){var a=t.action,l=t.payload,r=e.state;if(t.isTransition){var o=U.T,h={};U.T=h;try{var x=a(r,l),S=U.S;S!==null&&S(h,x),yh(e,t,x)}catch(R){_c(e,t,R)}finally{o!==null&&h.types!==null&&(o.types=h.types),U.T=o}}else try{o=a(r,l),yh(e,t,o)}catch(R){_c(e,t,R)}}function yh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){vh(e,t,l)},function(l){return _c(e,t,l)}):vh(e,t,a)}function vh(e,t,a){t.status="fulfilled",t.value=a,gh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,xh(e,a)))}function _c(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,gh(t),t=t.next;while(t!==l)}e.action=null}function gh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bh(e,t){return t}function wh(e,t){if(Oe){var a=Ie.formState;if(a!==null){e:{var l=ve;if(Oe){if(We){t:{for(var r=We,o=ca;r.nodeType!==8;){if(!o){r=null;break t}if(r=da(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){We=da(r.nextSibling),l=r.data==="F!";break e}}An(l)}l=!1}l&&(t=a[0])}}return a=kt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bh,lastRenderedState:t},a.queue=l,a=Hh.bind(null,ve,l),l.dispatch=a,l=Nc(!1),o=kc.bind(null,ve,!1,l.queue),l=kt(),r={state:t,dispatch:null,action:e,pending:null},l.queue=r,a=eg.bind(null,ve,r,o,a),r.dispatch=a,l.memoizedState=e,[t,a,!1]}function Sh(e){var t=dt();return jh(t,Qe,e)}function jh(e,t,a){if(t=Sc(e,t,bh)[0],e=ir(tn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Qi(t)}catch(h){throw h===Jl?Js:h}else l=t;t=dt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(ve.flags|=2048,ei(9,{destroy:void 0},tg.bind(null,r,a),null)),[l,o,e]}function tg(e,t){e.action=t}function Nh(e){var t=dt(),a=Qe;if(a!==null)return jh(t,a,e);dt(),t=t.memoizedState,a=dt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function ei(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=ve.updateQueue,t===null&&(t=nr(),ve.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function _h(){return dt().memoizedState}function sr(e,t,a,l){var r=kt();ve.flags|=e,r.memoizedState=ei(1|t,{destroy:void 0},a,l===void 0?null:l)}function rr(e,t,a,l){var r=dt();l=l===void 0?null:l;var o=r.memoizedState.inst;Qe!==null&&l!==null&&xc(l,Qe.memoizedState.deps)?r.memoizedState=ei(t,o,a,l):(ve.flags|=e,r.memoizedState=ei(1|t,o,a,l))}function Ah(e,t){sr(8390656,8,e,t)}function Ac(e,t){rr(2048,8,e,t)}function ag(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=nr(),ve.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Eh(e){var t=dt().memoizedState;return ag({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Ch(e,t){return rr(4,2,e,t)}function Rh(e,t){return rr(4,4,e,t)}function Th(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kh(e,t,a){a=a!=null?a.concat([e]):null,rr(4,4,Th.bind(null,t,e),a)}function Ec(){}function Oh(e,t){var a=dt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&xc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Mh(e,t){var a=dt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&xc(t,l[1]))return l[0];if(l=e(),ml){be(!0);try{e()}finally{be(!1)}}return a.memoizedState=[l,t],l}function Cc(e,t,a){return a===void 0||(en&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Dm(),ve.lanes|=e,Ln|=e,a)}function Dh(e,t,a,l){return Qt(a,t)?a:Fl.current!==null?(e=Cc(e,a,l),Qt(e,t)||(pt=!0),e):(en&42)===0||(en&1073741824)!==0&&(Ee&261930)===0?(pt=!0,e.memoizedState=a):(e=Dm(),ve.lanes|=e,Ln|=e,t)}function Lh(e,t,a,l,r){var o=F.p;F.p=o!==0&&8>o?o:8;var h=U.T,x={};U.T=x,kc(e,!1,t,a);try{var S=r(),R=U.S;if(R!==null&&R(x,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var z=Fv(S,l);Xi(e,t,z,Wt(e))}else Xi(e,t,l,Wt(e))}catch(Y){Xi(e,t,{then:function(){},status:"rejected",reason:Y},Wt())}finally{F.p=o,h!==null&&x.types!==null&&(h.types=x.types),U.T=h}}function ng(){}function Rc(e,t,a,l){if(e.tag!==5)throw Error(u(476));var r=Uh(e).queue;Lh(e,r,t,ce,a===null?ng:function(){return zh(e),a(l)})}function Uh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:ce},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zh(e){var t=Uh(e);t.next===null&&(t=e.alternate.memoizedState),Xi(e,t.next.queue,{},Wt())}function Tc(){return At(os)}function Bh(){return dt().memoizedState}function qh(){return dt().memoizedState}function lg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=Rn(a);var l=Tn(t,e,a);l!==null&&($t(l,t,a),Vi(l,t,a)),t={cache:ic()},e.payload=t;return}t=t.return}}function ig(e,t,a){var l=Wt();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ur(e)?$h(t,a):(a=Ku(e,t,a,l),a!==null&&($t(a,e,l),Vh(a,t,l)))}function Hh(e,t,a){var l=Wt();Xi(e,t,a,l)}function Xi(e,t,a,l){var r={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ur(e))$h(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,x=o(h,a);if(r.hasEagerState=!0,r.eagerState=x,Qt(x,h))return Vs(e,t,r,0),Ie===null&&$s(),!1}catch{}finally{}if(a=Ku(e,t,r,l),a!==null)return $t(a,e,l),Vh(a,t,l),!0}return!1}function kc(e,t,a,l){if(l={lane:2,revertLane:co(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ur(e)){if(t)throw Error(u(479))}else t=Ku(e,a,l,2),t!==null&&$t(t,e,2)}function ur(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function $h(e,t){Wl=tr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Vh(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Qd(e,a)}}var Ki={readContext:At,use:lr,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};Ki.useEffectEvent=st;var Yh={readContext:At,use:lr,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:Ah,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,sr(4194308,4,Th.bind(null,t,e),a)},useLayoutEffect:function(e,t){return sr(4194308,4,e,t)},useInsertionEffect:function(e,t){sr(4,2,e,t)},useMemo:function(e,t){var a=kt();t=t===void 0?null:t;var l=e();if(ml){be(!0);try{e()}finally{be(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=kt();if(a!==void 0){var r=a(t);if(ml){be(!0);try{a(t)}finally{be(!1)}}}else r=t;return l.memoizedState=l.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=ig.bind(null,ve,e),[l.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=Nc(e);var t=e.queue,a=Hh.bind(null,ve,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ec,useDeferredValue:function(e,t){var a=kt();return Cc(a,e,t)},useTransition:function(){var e=Nc(!1);return e=Lh.bind(null,ve,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=ve,r=kt();if(Oe){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),Ie===null)throw Error(u(349));(Ee&127)!==0||oh(l,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Ah(fh.bind(null,l,o,e),[e]),l.flags|=2048,ei(9,{destroy:void 0},dh.bind(null,l,o,a,t),null),a},useId:function(){var e=kt(),t=Ie.identifierPrefix;if(Oe){var a=Ua,l=La;a=(l&~(1<<32-qe(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ar++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Wv++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Tc,useFormState:wh,useActionState:wh,useOptimistic:function(e){var t=kt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=kc.bind(null,ve,!0,a),a.dispatch=t,[e,t]},useMemoCache:wc,useCacheRefresh:function(){return kt().memoizedState=lg.bind(null,ve)},useEffectEvent:function(e){var t=kt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Oc={readContext:At,use:lr,useCallback:Oh,useContext:At,useEffect:Ac,useImperativeHandle:kh,useInsertionEffect:Ch,useLayoutEffect:Rh,useMemo:Mh,useReducer:ir,useRef:_h,useState:function(){return ir(tn)},useDebugValue:Ec,useDeferredValue:function(e,t){var a=dt();return Dh(a,Qe.memoizedState,e,t)},useTransition:function(){var e=ir(tn)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:ch,useId:Bh,useHostTransitionStatus:Tc,useFormState:Sh,useActionState:Sh,useOptimistic:function(e,t){var a=dt();return ph(a,Qe,e,t)},useMemoCache:wc,useCacheRefresh:qh};Oc.useEffectEvent=Eh;var Zh={readContext:At,use:lr,useCallback:Oh,useContext:At,useEffect:Ac,useImperativeHandle:kh,useInsertionEffect:Ch,useLayoutEffect:Rh,useMemo:Mh,useReducer:jc,useRef:_h,useState:function(){return jc(tn)},useDebugValue:Ec,useDeferredValue:function(e,t){var a=dt();return Qe===null?Cc(a,e,t):Dh(a,Qe.memoizedState,e,t)},useTransition:function(){var e=jc(tn)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:ch,useId:Bh,useHostTransitionStatus:Tc,useFormState:Nh,useActionState:Nh,useOptimistic:function(e,t){var a=dt();return Qe!==null?ph(a,Qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:wc,useCacheRefresh:qh};Zh.useEffectEvent=Eh;function Mc(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:_({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Dc={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Wt(),r=Rn(l);r.payload=t,a!=null&&(r.callback=a),t=Tn(e,r,l),t!==null&&($t(t,e,l),Vi(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Wt(),r=Rn(l);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=Tn(e,r,l),t!==null&&($t(t,e,l),Vi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),l=Rn(a);l.tag=2,t!=null&&(l.callback=t),t=Tn(e,l,a),t!==null&&($t(t,e,a),Vi(t,e,a))}};function Gh(e,t,a,l,r,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,h):t.prototype&&t.prototype.isPureReactComponent?!Di(a,l)||!Di(r,o):!0}function Qh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Dc.enqueueReplaceState(t,t.state,null)}function pl(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=_({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function Xh(e){Hs(e)}function Kh(e){console.error(e)}function Jh(e){Hs(e)}function cr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Ih(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Lc(e,t,a){return a=Rn(a),a.tag=3,a.payload={element:null},a.callback=function(){cr(e,t)},a}function Fh(e){return e=Rn(e),e.tag=3,e}function Wh(e,t,a,l){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=l.value;e.payload=function(){return r(o)},e.callback=function(){Ih(t,a,l)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Ih(t,a,l),typeof r!="function"&&(Un===null?Un=new Set([this]):Un.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function sg(e,t,a,l,r){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Ql(t,a,r,!0),a=Kt.current,a!==null){switch(a.tag){case 31:case 13:return oa===null?wr():a.alternate===null&&rt===0&&(rt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,l===Is?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),so(e,l,r)),!1;case 22:return a.flags|=65536,l===Is?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),so(e,l,r)),!1}throw Error(u(435,a.tag))}return so(e,l,r),wr(),!1}if(Oe)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,l!==ec&&(e=Error(u(422),{cause:l}),zi(sa(e,a)))):(l!==ec&&(t=Error(u(423),{cause:l}),zi(sa(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,l=sa(l,a),r=Lc(e.stateNode,l,r),dc(e,r),rt!==4&&(rt=2)),!1;var o=Error(u(520),{cause:l});if(o=sa(o,a),as===null?as=[o]:as.push(o),rt!==4&&(rt=2),t===null)return!0;l=sa(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Lc(a.stateNode,l,e),dc(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Un===null||!Un.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=Fh(r),Wh(r,e,a,l),dc(a,r),!1}a=a.return}while(a!==null);return!1}var Uc=Error(u(461)),pt=!1;function Et(e,t,a,l){t.child=e===null?ah(t,null,a,l):hl(t,e.child,a,l)}function Ph(e,t,a,l,r){a=a.render;var o=t.ref;if("ref"in l){var h={};for(var x in l)x!=="ref"&&(h[x]=l[x])}else h=l;return cl(t),l=yc(e,t,a,h,o,r),x=vc(),e!==null&&!pt?(gc(e,t,r),an(e,t,r)):(Oe&&x&&Wu(t),t.flags|=1,Et(e,t,l,r),t.child)}function em(e,t,a,l,r){if(e===null){var o=a.type;return typeof o=="function"&&!Ju(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,tm(e,t,o,l,r)):(e=Zs(a.type,null,l,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Zc(e,r)){var h=o.memoizedProps;if(a=a.compare,a=a!==null?a:Di,a(h,l)&&e.ref===t.ref)return an(e,t,r)}return t.flags|=1,e=Ia(o,l),e.ref=t.ref,e.return=t,t.child=e}function tm(e,t,a,l,r){if(e!==null){var o=e.memoizedProps;if(Di(o,l)&&e.ref===t.ref)if(pt=!1,t.pendingProps=l=o,Zc(e,r))(e.flags&131072)!==0&&(pt=!0);else return t.lanes=e.lanes,an(e,t,r)}return zc(e,t,a,l,r)}function am(e,t,a,l){var r=l.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(l=t.child=e.child,r=0;l!==null;)r=r|l.lanes|l.childLanes,l=l.sibling;l=r&~o}else l=0,t.child=null;return nm(e,t,o,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ks(t,o!==null?o.cachePool:null),o!==null?ih(t,o):hc(),sh(t);else return l=t.lanes=536870912,nm(e,t,o!==null?o.baseLanes|a:a,a,l)}else o!==null?(Ks(t,o.cachePool),ih(t,o),On(),t.memoizedState=null):(e!==null&&Ks(t,null),hc(),On());return Et(e,t,r,a),t.child}function Ji(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nm(e,t,a,l,r){var o=rc();return o=o===null?null:{parent:ht._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Ks(t,null),hc(),sh(t),e!==null&&Ql(e,t,l,!0),t.childLanes=r,null}function or(e,t){return t=fr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lm(e,t,a){return hl(t,e.child,null,a),e=or(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function rg(e,t,a){var l=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(l.mode==="hidden")return e=or(t,l),t.lanes=536870912,Ji(null,e);if(pc(t),(e=We)?(e=xp(e,ca),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nn!==null?{id:La,overflow:Ua}:null,retryLane:536870912,hydrationErrors:null},a=$f(e),a.return=t,t.child=a,_t=t,We=null)):e=null,e===null)throw An(t);return t.lanes=536870912,null}return or(t,l)}var o=e.memoizedState;if(o!==null){var h=o.dehydrated;if(pc(t),r)if(t.flags&256)t.flags&=-257,t=lm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(pt||Ql(e,t,a,!1),r=(a&e.childLanes)!==0,pt||r){if(l=Ie,l!==null&&(h=Xd(l,a),h!==0&&h!==o.retryLane))throw o.retryLane=h,il(e,h),$t(l,e,h),Uc;wr(),t=lm(e,t,a)}else e=o.treeContext,We=da(h.nextSibling),_t=t,Oe=!0,_n=null,ca=!1,e!==null&&Zf(t,e),t=or(t,l),t.flags|=4096;return t}return e=Ia(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function zc(e,t,a,l,r){return cl(t),a=yc(e,t,a,l,void 0,r),l=vc(),e!==null&&!pt?(gc(e,t,r),an(e,t,r)):(Oe&&l&&Wu(t),t.flags|=1,Et(e,t,a,r),t.child)}function im(e,t,a,l,r,o){return cl(t),t.updateQueue=null,a=uh(t,l,a,r),rh(e),l=vc(),e!==null&&!pt?(gc(e,t,o),an(e,t,o)):(Oe&&l&&Wu(t),t.flags|=1,Et(e,t,a,o),t.child)}function sm(e,t,a,l,r){if(cl(t),t.stateNode===null){var o=Vl,h=a.contextType;typeof h=="object"&&h!==null&&(o=At(h)),o=new a(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Dc,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},cc(t),h=a.contextType,o.context=typeof h=="object"&&h!==null?At(h):Vl,o.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(Mc(t,a,h,l),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(h=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),h!==o.state&&Dc.enqueueReplaceState(o,o.state,null),Zi(t,l,o,r),Yi(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var x=t.memoizedProps,S=pl(a,x);o.props=S;var R=o.context,z=a.contextType;h=Vl,typeof z=="object"&&z!==null&&(h=At(z));var Y=a.getDerivedStateFromProps;z=typeof Y=="function"||typeof o.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,z||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(x||R!==h)&&Qh(t,o,l,h),Cn=!1;var k=t.memoizedState;o.state=k,Zi(t,l,o,r),Yi(),R=t.memoizedState,x||k!==R||Cn?(typeof Y=="function"&&(Mc(t,a,Y,l),R=t.memoizedState),(S=Cn||Gh(t,a,S,l,k,R,h))?(z||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),o.props=l,o.state=R,o.context=h,l=S):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,oc(e,t),h=t.memoizedProps,z=pl(a,h),o.props=z,Y=t.pendingProps,k=o.context,R=a.contextType,S=Vl,typeof R=="object"&&R!==null&&(S=At(R)),x=a.getDerivedStateFromProps,(R=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(h!==Y||k!==S)&&Qh(t,o,l,S),Cn=!1,k=t.memoizedState,o.state=k,Zi(t,l,o,r),Yi();var M=t.memoizedState;h!==Y||k!==M||Cn||e!==null&&e.dependencies!==null&&Qs(e.dependencies)?(typeof x=="function"&&(Mc(t,a,x,l),M=t.memoizedState),(z=Cn||Gh(t,a,z,l,k,M,S)||e!==null&&e.dependencies!==null&&Qs(e.dependencies))?(R||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,M,S),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,M,S)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=M),o.props=l,o.state=M,o.context=S,l=z):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,dr(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=hl(t,e.child,null,r),t.child=hl(t,null,a,r)):Et(e,t,a,r),t.memoizedState=o.state,e=t.child):e=an(e,t,r),e}function rm(e,t,a,l){return rl(),t.flags|=256,Et(e,t,a,l),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:If()}}function Hc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ft),e}function um(e,t,a){var l=t.pendingProps,r=!1,o=(t.flags&128)!==0,h;if((h=o)||(h=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),h&&(r=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(r?kn(t):On(),(e=We)?(e=xp(e,ca),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nn!==null?{id:La,overflow:Ua}:null,retryLane:536870912,hydrationErrors:null},a=$f(e),a.return=t,t.child=a,_t=t,We=null)):e=null,e===null)throw An(t);return jo(e)?t.lanes=32:t.lanes=536870912,null}var x=l.children;return l=l.fallback,r?(On(),r=t.mode,x=fr({mode:"hidden",children:x},r),l=sl(l,r,a,null),x.return=t,l.return=t,x.sibling=l,t.child=x,l=t.child,l.memoizedState=qc(a),l.childLanes=Hc(e,h,a),t.memoizedState=Bc,Ji(null,l)):(kn(t),$c(t,x))}var S=e.memoizedState;if(S!==null&&(x=S.dehydrated,x!==null)){if(o)t.flags&256?(kn(t),t.flags&=-257,t=Vc(e,t,a)):t.memoizedState!==null?(On(),t.child=e.child,t.flags|=128,t=null):(On(),x=l.fallback,r=t.mode,l=fr({mode:"visible",children:l.children},r),x=sl(x,r,a,null),x.flags|=2,l.return=t,x.return=t,l.sibling=x,t.child=l,hl(t,e.child,null,a),l=t.child,l.memoizedState=qc(a),l.childLanes=Hc(e,h,a),t.memoizedState=Bc,t=Ji(null,l));else if(kn(t),jo(x)){if(h=x.nextSibling&&x.nextSibling.dataset,h)var R=h.dgst;h=R,l=Error(u(419)),l.stack="",l.digest=h,zi({value:l,source:null,stack:null}),t=Vc(e,t,a)}else if(pt||Ql(e,t,a,!1),h=(a&e.childLanes)!==0,pt||h){if(h=Ie,h!==null&&(l=Xd(h,a),l!==0&&l!==S.retryLane))throw S.retryLane=l,il(e,l),$t(h,e,l),Uc;So(x)||wr(),t=Vc(e,t,a)}else So(x)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,We=da(x.nextSibling),_t=t,Oe=!0,_n=null,ca=!1,e!==null&&Zf(t,e),t=$c(t,l.children),t.flags|=4096);return t}return r?(On(),x=l.fallback,r=t.mode,S=e.child,R=S.sibling,l=Ia(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&65011712,R!==null?x=Ia(R,x):(x=sl(x,r,a,null),x.flags|=2),x.return=t,l.return=t,l.sibling=x,t.child=l,Ji(null,l),l=t.child,x=e.child.memoizedState,x===null?x=qc(a):(r=x.cachePool,r!==null?(S=ht._currentValue,r=r.parent!==S?{parent:S,pool:S}:r):r=If(),x={baseLanes:x.baseLanes|a,cachePool:r}),l.memoizedState=x,l.childLanes=Hc(e,h,a),t.memoizedState=Bc,Ji(e.child,l)):(kn(t),a=e.child,e=a.sibling,a=Ia(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=a,t.memoizedState=null,a)}function $c(e,t){return t=fr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fr(e,t){return e=Xt(22,e,null,t),e.lanes=0,e}function Vc(e,t,a){return hl(t,e.child,null,a),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cm(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),nc(e.return,t,a)}function Yc(e,t,a,l,r,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:r,treeForkCount:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=a,h.tailMode=r,h.treeForkCount=o)}function om(e,t,a){var l=t.pendingProps,r=l.revealOrder,o=l.tail;l=l.children;var h=ot.current,x=(h&2)!==0;if(x?(h=h&1|2,t.flags|=128):h&=1,X(ot,h),Et(e,t,l,a),l=Oe?Ui:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cm(e,a,t);else if(e.tag===19)cm(e,a,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(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&er(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Yc(t,!1,r,a,o,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&er(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Yc(t,!0,a,null,o,l);break;case"together":Yc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function an(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ln|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Ql(e,t,a,!1),(a&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,a=Ia(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ia(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Qs(e)))}function ug(e,t,a){switch(t.tag){case 3:ut(t,t.stateNode.containerInfo),En(t,ht,e.memoizedState.cache),rl();break;case 27:case 5:Gt(t);break;case 4:ut(t,t.stateNode.containerInfo);break;case 10:En(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,pc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(kn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?um(e,t,a):(kn(t),e=an(e,t,a),e!==null?e.sibling:null);kn(t);break;case 19:var r=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Ql(e,t,a,!1),l=(a&t.childLanes)!==0),r){if(l)return om(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),X(ot,ot.current),l)break;return null;case 22:return t.lanes=0,am(e,t,a,t.pendingProps);case 24:En(t,ht,e.memoizedState.cache)}return an(e,t,a)}function dm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)pt=!0;else{if(!Zc(e,a)&&(t.flags&128)===0)return pt=!1,ug(e,t,a);pt=(e.flags&131072)!==0}else pt=!1,Oe&&(t.flags&1048576)!==0&&Yf(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=dl(t.elementType),t.type=e,typeof e=="function")Ju(e)?(l=pl(e,l),t.tag=1,t=sm(null,t,e,l,a)):(t.tag=0,t=zc(null,t,e,l,a));else{if(e!=null){var r=e.$$typeof;if(r===fe){t.tag=11,t=Ph(null,t,e,l,a);break e}else if(r===I){t.tag=14,t=em(null,t,e,l,a);break e}}throw t=Fe(e)||e,Error(u(306,t,""))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,r=pl(l,t.pendingProps),sm(e,t,l,r,a);case 3:e:{if(ut(t,t.stateNode.containerInfo),e===null)throw Error(u(387));l=t.pendingProps;var o=t.memoizedState;r=o.element,oc(e,t),Zi(t,l,null,a);var h=t.memoizedState;if(l=h.cache,En(t,ht,l),l!==o.cache&&lc(t,[ht],a,!0),Yi(),l=h.element,o.isDehydrated)if(o={element:l,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=rm(e,t,l,a);break e}else if(l!==r){r=sa(Error(u(424)),t),zi(r),t=rm(e,t,l,a);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(We=da(e.firstChild),_t=t,Oe=!0,_n=null,ca=!0,a=ah(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(rl(),l===r){t=an(e,t,a);break e}Et(e,t,l,a)}t=t.child}return t;case 26:return dr(e,t),e===null?(a=Sp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Oe||(a=t.type,e=t.pendingProps,l=Cr(ue.current).createElement(a),l[Nt]=t,l[Lt]=e,Ct(l,a,e),wt(l),t.stateNode=l):t.memoizedState=Sp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Gt(t),e===null&&Oe&&(l=t.stateNode=gp(t.type,t.pendingProps,ue.current),_t=t,ca=!0,r=We,Hn(t.type)?(No=r,We=da(l.firstChild)):We=r),Et(e,t,t.pendingProps.children,a),dr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((r=l=We)&&(l=Bg(l,t.type,t.pendingProps,ca),l!==null?(t.stateNode=l,_t=t,We=da(l.firstChild),ca=!1,r=!0):r=!1),r||An(t)),Gt(t),r=t.type,o=t.pendingProps,h=e!==null?e.memoizedProps:null,l=o.children,go(r,o)?l=null:h!==null&&go(r,h)&&(t.flags|=32),t.memoizedState!==null&&(r=yc(e,t,Pv,null,null,a),os._currentValue=r),dr(e,t),Et(e,t,l,a),t.child;case 6:return e===null&&Oe&&((e=a=We)&&(a=qg(a,t.pendingProps,ca),a!==null?(t.stateNode=a,_t=t,We=null,e=!0):e=!1),e||An(t)),null;case 13:return um(e,t,a);case 4:return ut(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=hl(t,null,l,a):Et(e,t,l,a),t.child;case 11:return Ph(e,t,t.type,t.pendingProps,a);case 7:return Et(e,t,t.pendingProps,a),t.child;case 8:return Et(e,t,t.pendingProps.children,a),t.child;case 12:return Et(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,En(t,t.type,l.value),Et(e,t,l.children,a),t.child;case 9:return r=t.type._context,l=t.pendingProps.children,cl(t),r=At(r),l=l(r),t.flags|=1,Et(e,t,l,a),t.child;case 14:return em(e,t,t.type,t.pendingProps,a);case 15:return tm(e,t,t.type,t.pendingProps,a);case 19:return om(e,t,a);case 31:return rg(e,t,a);case 22:return am(e,t,a,t.pendingProps);case 24:return cl(t),l=At(ht),e===null?(r=rc(),r===null&&(r=Ie,o=ic(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:l,cache:r},cc(t),En(t,ht,r)):((e.lanes&a)!==0&&(oc(e,t),Zi(t,null,null,a),Yi()),r=e.memoizedState,o=t.memoizedState,r.parent!==l?(r={parent:l,cache:l},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),En(t,ht,l)):(l=o.cache,En(t,ht,l),l!==r.cache&&lc(t,[ht],a,!0))),Et(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function nn(e){e.flags|=4}function Gc(e,t,a,l,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Bm())e.flags|=8192;else throw fl=Is,uc}else e.flags&=-16777217}function fm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ep(t))if(Bm())e.flags|=8192;else throw fl=Is,uc}function hr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Je():536870912,e.lanes|=t,li|=t)}function Ii(e,t){if(!Oe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags&65011712,l|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags,l|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function cg(e,t,a){var l=t.pendingProps;switch(Pu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Pa(ht),Ue(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?nn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tc())),Pe(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(nn(t),o!==null?(Pe(t),fm(t,o)):(Pe(t),Gc(t,r,null,l,a))):o?o!==e.memoizedState?(nn(t),Pe(t),fm(t,o)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&nn(t),Pe(t),Gc(t,r,e,l,a)),null;case 27:if(ta(t),a=ue.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return Pe(t),null}e=ee.current,Gl(t)?Gf(t):(e=gp(r,l,a),t.stateNode=e,nn(t))}return Pe(t),null;case 5:if(ta(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return Pe(t),null}if(o=ee.current,Gl(t))Gf(t);else{var h=Cr(ue.current);switch(o){case 1:o=h.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=h.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?h.createElement(r,{is:l.is}):h.createElement(r)}}o[Nt]=t,o[Lt]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.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=o;e:switch(Ct(o,r,l),r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&nn(t)}}return Pe(t),Gc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=ue.current,Gl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,r=_t,r!==null)switch(r.tag){case 27:case 5:l=r.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||up(e.nodeValue,a)),e||An(t,!0)}else e=Cr(e).createTextNode(l),e[Nt]=t,t.stateNode=e}return Pe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Gl(t),a!==null){if(e===null){if(!l)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Nt]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else a=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Pe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Gl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[Nt]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),r=!1}else r=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,r=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(r=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==r&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),hr(t,t.updateQueue),Pe(t),null);case 4:return Ue(),e===null&&mo(t.stateNode.containerInfo),Pe(t),null;case 10:return Pa(t.type),Pe(t),null;case 19:if(q(ot),l=t.memoizedState,l===null)return Pe(t),null;if(r=(t.flags&128)!==0,o=l.rendering,o===null)if(r)Ii(l,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=er(e),o!==null){for(t.flags|=128,Ii(l,!1),e=o.updateQueue,t.updateQueue=e,hr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Hf(a,e),a=a.sibling;return X(ot,ot.current&1|2),Oe&&Fa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&tt()>vr&&(t.flags|=128,r=!0,Ii(l,!1),t.lanes=4194304)}else{if(!r)if(e=er(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,hr(t,e),Ii(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!Oe)return Pe(t),null}else 2*tt()-l.renderingStartTime>vr&&a!==536870912&&(t.flags|=128,r=!0,Ii(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(e=l.last,e!==null?e.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=tt(),e.sibling=null,a=ot.current,X(ot,r?a&1|2:a&1),Oe&&Fa(t,l.treeForkCount),e):(Pe(t),null);case 22:case 23:return Jt(t),mc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),a=t.updateQueue,a!==null&&hr(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&q(ol),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pa(ht),Pe(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function og(e,t){switch(Pu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pa(ht),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ta(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(u(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(ot),null;case 4:return Ue(),null;case 10:return Pa(t.type),null;case 22:case 23:return Jt(t),mc(),e!==null&&q(ol),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pa(ht),null;case 25:return null;default:return null}}function hm(e,t){switch(Pu(t),t.tag){case 3:Pa(ht),Ue();break;case 26:case 27:case 5:ta(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:q(ot);break;case 10:Pa(t.type);break;case 22:case 23:Jt(t),mc(),e!==null&&q(ol);break;case 24:Pa(ht)}}function Fi(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var r=l.next;a=r;do{if((a.tag&e)===e){l=void 0;var o=a.create,h=a.inst;l=o(),h.destroy=l}a=a.next}while(a!==r)}}catch(x){Ze(t,t.return,x)}}function Mn(e,t,a){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var o=r.next;l=o;do{if((l.tag&e)===e){var h=l.inst,x=h.destroy;if(x!==void 0){h.destroy=void 0,r=t;var S=a,R=x;try{R()}catch(z){Ze(r,S,z)}}}l=l.next}while(l!==o)}}catch(z){Ze(t,t.return,z)}}function mm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{lh(t,a)}catch(l){Ze(e,e.return,l)}}}function pm(e,t,a){a.props=pl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ze(e,t,l)}}function Wi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(r){Ze(e,t,r)}}function za(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(r){Ze(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Ze(e,t,r)}else a.current=null}function xm(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(r){Ze(e,e.return,r)}}function Qc(e,t,a){try{var l=e.stateNode;Og(l,e.type,a,t),l[Lt]=t}catch(r){Ze(e,e.return,r)}}function ym(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hn(e.type)||e.tag===4}function Xc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ym(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&&Hn(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 Kc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ka));else if(l!==4&&(l===27&&Hn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,a),e=e.sibling;e!==null;)Kc(e,t,a),e=e.sibling}function mr(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Hn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(mr(e,t,a),e=e.sibling;e!==null;)mr(e,t,a),e=e.sibling}function vm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Ct(t,l,a),t[Nt]=e,t[Lt]=a}catch(o){Ze(e,e.return,o)}}var ln=!1,xt=!1,Jc=!1,gm=typeof WeakSet=="function"?WeakSet:Set,St=null;function dg(e,t){if(e=e.containerInfo,yo=Lr,e=kf(e),Vu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var r=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var h=0,x=-1,S=-1,R=0,z=0,Y=e,k=null;t:for(;;){for(var M;Y!==a||r!==0&&Y.nodeType!==3||(x=h+r),Y!==o||l!==0&&Y.nodeType!==3||(S=h+l),Y.nodeType===3&&(h+=Y.nodeValue.length),(M=Y.firstChild)!==null;)k=Y,Y=M;for(;;){if(Y===e)break t;if(k===a&&++R===r&&(x=h),k===o&&++z===l&&(S=h),(M=Y.nextSibling)!==null)break;Y=k,k=Y.parentNode}Y=M}a=x===-1||S===-1?null:{start:x,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(vo={focusedElem:e,selectionRange:a},Lr=!1,St=t;St!==null;)if(t=St,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,St=e;else for(;St!==null;){switch(t=St,o=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(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,l=a.stateNode;try{var ae=pl(a.type,r);e=l.getSnapshotBeforeUpdate(ae,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(me){Ze(a,a.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)wo(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wo(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,St=e;break}St=t.return}}function bm(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:rn(e,a),l&4&&Fi(5,a);break;case 1:if(rn(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Ze(a,a.return,h)}else{var r=pl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Ze(a,a.return,h)}}l&64&&mm(a),l&512&&Wi(a,a.return);break;case 3:if(rn(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{lh(e,t)}catch(h){Ze(a,a.return,h)}}break;case 27:t===null&&l&4&&vm(a);case 26:case 5:rn(e,a),t===null&&l&4&&xm(a),l&512&&Wi(a,a.return);break;case 12:rn(e,a);break;case 31:rn(e,a),l&4&&jm(e,a);break;case 13:rn(e,a),l&4&&Nm(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=bg.bind(null,a),Hg(e,a))));break;case 22:if(l=a.memoizedState!==null||ln,!l){t=t!==null&&t.memoizedState!==null||xt,r=ln;var o=xt;ln=l,(xt=t)&&!o?un(e,a,(a.subtreeFlags&8772)!==0):rn(e,a),ln=r,xt=o}break;case 30:break;default:rn(e,a)}}function wm(e){var t=e.alternate;t!==null&&(e.alternate=null,wm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_u(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 at=null,zt=!1;function sn(e,t,a){for(a=a.child;a!==null;)Sm(e,t,a),a=a.sibling}function Sm(e,t,a){if(G&&typeof G.onCommitFiberUnmount=="function")try{G.onCommitFiberUnmount(Ma,a)}catch{}switch(a.tag){case 26:xt||za(a,t),sn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:xt||za(a,t);var l=at,r=zt;Hn(a.type)&&(at=a.stateNode,zt=!1),sn(e,t,a),rs(a.stateNode),at=l,zt=r;break;case 5:xt||za(a,t);case 6:if(l=at,r=zt,at=null,sn(e,t,a),at=l,zt=r,at!==null)if(zt)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(a.stateNode)}catch(o){Ze(a,t,o)}else try{at.removeChild(a.stateNode)}catch(o){Ze(a,t,o)}break;case 18:at!==null&&(zt?(e=at,mp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),fi(e)):mp(at,a.stateNode));break;case 4:l=at,r=zt,at=a.stateNode.containerInfo,zt=!0,sn(e,t,a),at=l,zt=r;break;case 0:case 11:case 14:case 15:Mn(2,a,t),xt||Mn(4,a,t),sn(e,t,a);break;case 1:xt||(za(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&pm(a,t,l)),sn(e,t,a);break;case 21:sn(e,t,a);break;case 22:xt=(l=xt)||a.memoizedState!==null,sn(e,t,a),xt=l;break;default:sn(e,t,a)}}function jm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(a){Ze(t,t.return,a)}}}function Nm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(a){Ze(t,t.return,a)}}function fg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gm),t;default:throw Error(u(435,e.tag))}}function pr(e,t){var a=fg(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var r=wg.bind(null,e,l);l.then(r,r)}})}function Bt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var r=a[l],o=e,h=t,x=h;e:for(;x!==null;){switch(x.tag){case 27:if(Hn(x.type)){at=x.stateNode,zt=!1;break e}break;case 5:at=x.stateNode,zt=!1;break e;case 3:case 4:at=x.stateNode.containerInfo,zt=!0;break e}x=x.return}if(at===null)throw Error(u(160));Sm(o,h,r),at=null,zt=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_m(t,e),t=t.sibling}var Na=null;function _m(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Bt(t,e),qt(e),l&4&&(Mn(3,e,e.return),Fi(3,e),Mn(5,e,e.return));break;case 1:Bt(t,e),qt(e),l&512&&(xt||a===null||za(a,a.return)),l&64&&ln&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var r=Na;if(Bt(t,e),qt(e),l&512&&(xt||a===null||za(a,a.return)),l&4){var o=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(l){case"title":o=r.getElementsByTagName("title")[0],(!o||o[_i]||o[Nt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(l),r.head.insertBefore(o,r.querySelector("head > title"))),Ct(o,l,a),o[Nt]=e,wt(o),l=o;break e;case"link":var h=_p("link","href",r).get(l+(a.href||""));if(h){for(var x=0;x<h.length;x++)if(o=h[x],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){h.splice(x,1);break t}}o=r.createElement(l),Ct(o,l,a),r.head.appendChild(o);break;case"meta":if(h=_p("meta","content",r).get(l+(a.content||""))){for(x=0;x<h.length;x++)if(o=h[x],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){h.splice(x,1);break t}}o=r.createElement(l),Ct(o,l,a),r.head.appendChild(o);break;default:throw Error(u(468,l))}o[Nt]=e,wt(o),l=o}e.stateNode=l}else Ap(r,e.type,e.stateNode);else e.stateNode=Np(r,l,e.memoizedProps);else o!==l?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,l===null?Ap(r,e.type,e.stateNode):Np(r,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Bt(t,e),qt(e),l&512&&(xt||a===null||za(a,a.return)),a!==null&&l&4&&Qc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Bt(t,e),qt(e),l&512&&(xt||a===null||za(a,a.return)),e.flags&32){r=e.stateNode;try{Ll(r,"")}catch(ae){Ze(e,e.return,ae)}}l&4&&e.stateNode!=null&&(r=e.memoizedProps,Qc(e,r,a!==null?a.memoizedProps:r)),l&1024&&(Jc=!0);break;case 6:if(Bt(t,e),qt(e),l&4){if(e.stateNode===null)throw Error(u(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(ae){Ze(e,e.return,ae)}}break;case 3:if(kr=null,r=Na,Na=Rr(t.containerInfo),Bt(t,e),Na=r,qt(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(ae){Ze(e,e.return,ae)}Jc&&(Jc=!1,Am(e));break;case 4:l=Na,Na=Rr(e.stateNode.containerInfo),Bt(t,e),qt(e),Na=l;break;case 12:Bt(t,e),qt(e);break;case 31:Bt(t,e),qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pr(e,l)));break;case 13:Bt(t,e),qt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(yr=tt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pr(e,l)));break;case 22:r=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,R=ln,z=xt;if(ln=R||r,xt=z||S,Bt(t,e),xt=z,ln=R,qt(e),l&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||S||ln||xt||xl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(o=S.stateNode,r)h=o.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{x=S.stateNode;var Y=S.memoizedProps.style,k=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;x.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(ae){Ze(S,S.return,ae)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=r?"":S.memoizedProps}catch(ae){Ze(S,S.return,ae)}}}else if(t.tag===18){if(a===null){S=t;try{var M=S.stateNode;r?pp(M,!0):pp(S.stateNode,!1)}catch(ae){Ze(S,S.return,ae)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,pr(e,a))));break;case 19:Bt(t,e),qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pr(e,l)));break;case 30:break;case 21:break;default:Bt(t,e),qt(e)}}function qt(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(ym(l)){a=l;break}l=l.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var r=a.stateNode,o=Xc(e);mr(e,o,r);break;case 5:var h=a.stateNode;a.flags&32&&(Ll(h,""),a.flags&=-33);var x=Xc(e);mr(e,x,h);break;case 3:case 4:var S=a.stateNode.containerInfo,R=Xc(e);Kc(e,R,S);break;default:throw Error(u(161))}}catch(z){Ze(e,e.return,z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Am(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Am(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function rn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)bm(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Mn(4,t,t.return),xl(t);break;case 1:za(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&pm(t,t.return,a),xl(t);break;case 27:rs(t.stateNode);case 26:case 5:za(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function un(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,r=e,o=t,h=o.flags;switch(o.tag){case 0:case 11:case 15:un(r,o,a),Fi(4,o);break;case 1:if(un(r,o,a),l=o,r=l.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(R){Ze(l,l.return,R)}if(l=o,r=l.updateQueue,r!==null){var x=l.stateNode;try{var S=r.shared.hiddenCallbacks;if(S!==null)for(r.shared.hiddenCallbacks=null,r=0;r<S.length;r++)nh(S[r],x)}catch(R){Ze(l,l.return,R)}}a&&h&64&&mm(o),Wi(o,o.return);break;case 27:vm(o);case 26:case 5:un(r,o,a),a&&l===null&&h&4&&xm(o),Wi(o,o.return);break;case 12:un(r,o,a);break;case 31:un(r,o,a),a&&h&4&&jm(r,o);break;case 13:un(r,o,a),a&&h&4&&Nm(r,o);break;case 22:o.memoizedState===null&&un(r,o,a),Wi(o,o.return);break;case 30:break;default:un(r,o,a)}t=t.sibling}}function Ic(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Bi(a))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bi(e))}function _a(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Em(e,t,a,l),t=t.sibling}function Em(e,t,a,l){var r=t.flags;switch(t.tag){case 0:case 11:case 15:_a(e,t,a,l),r&2048&&Fi(9,t);break;case 1:_a(e,t,a,l);break;case 3:_a(e,t,a,l),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bi(e)));break;case 12:if(r&2048){_a(e,t,a,l),e=t.stateNode;try{var o=t.memoizedProps,h=o.id,x=o.onPostCommit;typeof x=="function"&&x(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Ze(t,t.return,S)}}else _a(e,t,a,l);break;case 31:_a(e,t,a,l);break;case 13:_a(e,t,a,l);break;case 23:break;case 22:o=t.stateNode,h=t.alternate,t.memoizedState!==null?o._visibility&2?_a(e,t,a,l):Pi(e,t):o._visibility&2?_a(e,t,a,l):(o._visibility|=2,ti(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ic(h,t);break;case 24:_a(e,t,a,l),r&2048&&Fc(t.alternate,t);break;default:_a(e,t,a,l)}}function ti(e,t,a,l,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,h=t,x=a,S=l,R=h.flags;switch(h.tag){case 0:case 11:case 15:ti(o,h,x,S,r),Fi(8,h);break;case 23:break;case 22:var z=h.stateNode;h.memoizedState!==null?z._visibility&2?ti(o,h,x,S,r):Pi(o,h):(z._visibility|=2,ti(o,h,x,S,r)),r&&R&2048&&Ic(h.alternate,h);break;case 24:ti(o,h,x,S,r),r&&R&2048&&Fc(h.alternate,h);break;default:ti(o,h,x,S,r)}t=t.sibling}}function Pi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,r=l.flags;switch(l.tag){case 22:Pi(a,l),r&2048&&Ic(l.alternate,l);break;case 24:Pi(a,l),r&2048&&Fc(l.alternate,l);break;default:Pi(a,l)}t=t.sibling}}var es=8192;function ai(e,t,a){if(e.subtreeFlags&es)for(e=e.child;e!==null;)Cm(e,t,a),e=e.sibling}function Cm(e,t,a){switch(e.tag){case 26:ai(e,t,a),e.flags&es&&e.memoizedState!==null&&Wg(a,Na,e.memoizedState,e.memoizedProps);break;case 5:ai(e,t,a);break;case 3:case 4:var l=Na;Na=Rr(e.stateNode.containerInfo),ai(e,t,a),Na=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=es,es=16777216,ai(e,t,a),es=l):ai(e,t,a));break;default:ai(e,t,a)}}function Rm(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 ts(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];St=l,km(l,e)}Rm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tm(e),e=e.sibling}function Tm(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&Mn(9,e,e.return);break;case 3:ts(e);break;case 12:ts(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,xr(e)):ts(e);break;default:ts(e)}}function xr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];St=l,km(l,e)}Rm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mn(8,t,t.return),xr(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,xr(t));break;default:xr(t)}e=e.sibling}}function km(e,t){for(;St!==null;){var a=St;switch(a.tag){case 0:case 11:case 15:Mn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Bi(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,St=l;else e:for(a=e;St!==null;){l=St;var r=l.sibling,o=l.return;if(wm(l),l===a){St=null;break e}if(r!==null){r.return=o,St=r;break e}St=o}}}var hg={getCacheForType:function(e){var t=At(ht),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return At(ht).controller.signal}},mg=typeof WeakMap=="function"?WeakMap:Map,He=0,Ie=null,_e=null,Ee=0,Ye=0,It=null,Dn=!1,ni=!1,Wc=!1,cn=0,rt=0,Ln=0,yl=0,Pc=0,Ft=0,li=0,as=null,Ht=null,eo=!1,yr=0,Om=0,vr=1/0,gr=null,Un=null,bt=0,zn=null,ii=null,on=0,to=0,ao=null,Mm=null,ns=0,no=null;function Wt(){return(He&2)!==0&&Ee!==0?Ee&-Ee:U.T!==null?co():Kd()}function Dm(){if(Ft===0)if((Ee&536870912)===0||Oe){var e=el;el<<=1,(el&3932160)===0&&(el=262144),Ft=e}else Ft=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Ft}function $t(e,t,a){(e===Ie&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(si(e,0),Bn(e,Ee,Ft,!1)),Ni(e,a),((He&2)===0||e!==Ie)&&(e===Ie&&((He&2)===0&&(yl|=a),rt===4&&Bn(e,Ee,Ft,!1)),Ba(e))}function Lm(e,t,a){if((He&6)!==0)throw Error(u(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||O(e,t),r=l?yg(e,t):io(e,t,!0),o=l;do{if(r===0){ni&&!l&&Bn(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!pg(a)){r=io(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var x=e;r=as;var S=x.current.memoizedState.isDehydrated;if(S&&(si(x,h).flags|=256),h=io(x,h,!1),h!==2){if(Wc&&!S){x.errorRecoveryDisabledLanes|=o,yl|=o,r=4;break e}o=Ht,Ht=r,o!==null&&(Ht===null?Ht=o:Ht.push.apply(Ht,o))}r=h}if(o=!1,r!==2)continue}}if(r===1){si(e,0),Bn(e,t,0,!0);break}e:{switch(l=e,o=r,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Bn(l,t,Ft,!Dn);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(r=yr+300-tt(),10<r)){if(Bn(l,t,Ft,!Dn),Cl(l,0,!0)!==0)break e;on=t,l.timeoutHandle=fp(Um.bind(null,l,a,Ht,gr,eo,t,Ft,yl,li,Dn,o,"Throttled",-0,0),r);break e}Um(l,a,Ht,gr,eo,t,Ft,yl,li,Dn,o,null,-0,0)}}break}while(!0);Ba(e)}function Um(e,t,a,l,r,o,h,x,S,R,z,Y,k,M){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ka},Cm(t,o,Y);var ae=(o&62914560)===o?yr-tt():(o&4194048)===o?Om-tt():0;if(ae=Pg(Y,ae),ae!==null){on=o,e.cancelPendingCommit=ae(Zm.bind(null,e,t,o,a,l,r,h,x,S,z,Y,null,k,M)),Bn(e,o,h,!R);return}}Zm(e,t,o,a,l,r,h,x,S)}function pg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var r=a[l],o=r.getSnapshot;r=r.value;try{if(!Qt(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Bn(e,t,a,l){t&=~Pc,t&=~yl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var r=t;0<r;){var o=31-qe(r),h=1<<o;l[o]=-1,r&=~h}a!==0&&Gd(e,a,t)}function br(){return(He&6)===0?(ls(0),!1):!0}function lo(){if(_e!==null){if(Ye===0)var e=_e.return;else e=_e,Wa=ul=null,bc(e),Il=null,Hi=0,e=_e;for(;e!==null;)hm(e.alternate,e),e=e.return;_e=null}}function si(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Lg(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),on=0,lo(),Ie=e,_e=a=Ia(e.current,null),Ee=t,Ye=0,It=null,Dn=!1,ni=O(e,t),Wc=!1,li=Ft=Pc=yl=Ln=rt=0,Ht=as=null,eo=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var r=31-qe(l),o=1<<r;t|=e[r],l&=~o}return cn=t,$s(),a}function zm(e,t){ve=null,U.H=Ki,t===Jl||t===Js?(t=Pf(),Ye=3):t===uc?(t=Pf(),Ye=4):Ye=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,_e===null&&(rt=1,cr(e,sa(t,e.current)))}function Bm(){var e=Kt.current;return e===null?!0:(Ee&4194048)===Ee?oa===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===oa:!1}function qm(){var e=U.H;return U.H=Ki,e===null?Ki:e}function Hm(){var e=U.A;return U.A=hg,e}function wr(){rt=4,Dn||(Ee&4194048)!==Ee&&Kt.current!==null||(ni=!0),(Ln&134217727)===0&&(yl&134217727)===0||Ie===null||Bn(Ie,Ee,Ft,!1)}function io(e,t,a){var l=He;He|=2;var r=qm(),o=Hm();(Ie!==e||Ee!==t)&&(gr=null,si(e,t)),t=!1;var h=rt;e:do try{if(Ye!==0&&_e!==null){var x=_e,S=It;switch(Ye){case 8:lo(),h=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var R=Ye;if(Ye=0,It=null,ri(e,x,S,R),a&&ni){h=0;break e}break;default:R=Ye,Ye=0,It=null,ri(e,x,S,R)}}xg(),h=rt;break}catch(z){zm(e,z)}while(!0);return t&&e.shellSuspendCounter++,Wa=ul=null,He=l,U.H=r,U.A=o,_e===null&&(Ie=null,Ee=0,$s()),h}function xg(){for(;_e!==null;)$m(_e)}function yg(e,t){var a=He;He|=2;var l=qm(),r=Hm();Ie!==e||Ee!==t?(gr=null,vr=tt()+500,si(e,t)):ni=O(e,t);e:do try{if(Ye!==0&&_e!==null){t=_e;var o=It;t:switch(Ye){case 1:Ye=0,It=null,ri(e,t,o,1);break;case 2:case 9:if(Ff(o)){Ye=0,It=null,Vm(t);break}t=function(){Ye!==2&&Ye!==9||Ie!==e||(Ye=7),Ba(e)},o.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:Ff(o)?(Ye=0,It=null,Vm(t)):(Ye=0,It=null,ri(e,t,o,7));break;case 5:var h=null;switch(_e.tag){case 26:h=_e.memoizedState;case 5:case 27:var x=_e;if(h?Ep(h):x.stateNode.complete){Ye=0,It=null;var S=x.sibling;if(S!==null)_e=S;else{var R=x.return;R!==null?(_e=R,Sr(R)):_e=null}break t}}Ye=0,It=null,ri(e,t,o,5);break;case 6:Ye=0,It=null,ri(e,t,o,6);break;case 8:lo(),rt=6;break e;default:throw Error(u(462))}}vg();break}catch(z){zm(e,z)}while(!0);return Wa=ul=null,U.H=l,U.A=r,He=a,_e!==null?0:(Ie=null,Ee=0,$s(),rt)}function vg(){for(;_e!==null&&!gn();)$m(_e)}function $m(e){var t=dm(e.alternate,e,cn);e.memoizedProps=e.pendingProps,t===null?Sr(e):_e=t}function Vm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=im(a,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=im(a,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:bc(t);default:hm(a,t),t=_e=Hf(t,cn),t=dm(a,t,cn)}e.memoizedProps=e.pendingProps,t===null?Sr(e):_e=t}function ri(e,t,a,l){Wa=ul=null,bc(t),Il=null,Hi=0;var r=t.return;try{if(sg(e,r,t,a,Ee)){rt=1,cr(e,sa(a,e.current)),_e=null;return}}catch(o){if(r!==null)throw _e=r,o;rt=1,cr(e,sa(a,e.current)),_e=null;return}t.flags&32768?(Oe||l===1?e=!0:ni||(Ee&536870912)!==0?e=!1:(Dn=e=!0,(l===2||l===9||l===3||l===6)&&(l=Kt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Ym(t,e)):Sr(t)}function Sr(e){var t=e;do{if((t.flags&32768)!==0){Ym(t,Dn);return}e=t.return;var a=cg(t.alternate,t,cn);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);rt===0&&(rt=5)}function Ym(e,t){do{var a=og(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);rt=6,_e=null}function Zm(e,t,a,l,r,o,h,x,S){e.cancelPendingCommit=null;do jr();while(bt!==0);if((He&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(o=t.lanes|t.childLanes,o|=Xu,Fy(e,a,o,h,x,S),e===Ie&&(_e=Ie=null,Ee=0),ii=t,zn=e,on=a,to=o,ao=r,Mm=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Sg(Qa,function(){return Jm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=U.T,U.T=null,r=F.p,F.p=2,h=He,He|=4;try{dg(e,t,a)}finally{He=h,F.p=r,U.T=l}}bt=1,Gm(),Qm(),Xm()}}function Gm(){if(bt===1){bt=0;var e=zn,t=ii,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var l=F.p;F.p=2;var r=He;He|=4;try{_m(t,e);var o=vo,h=kf(e.containerInfo),x=o.focusedElem,S=o.selectionRange;if(h!==x&&x&&x.ownerDocument&&Tf(x.ownerDocument.documentElement,x)){if(S!==null&&Vu(x)){var R=S.start,z=S.end;if(z===void 0&&(z=R),"selectionStart"in x)x.selectionStart=R,x.selectionEnd=Math.min(z,x.value.length);else{var Y=x.ownerDocument||document,k=Y&&Y.defaultView||window;if(k.getSelection){var M=k.getSelection(),ae=x.textContent.length,me=Math.min(S.start,ae),Ke=S.end===void 0?me:Math.min(S.end,ae);!M.extend&&me>Ke&&(h=Ke,Ke=me,me=h);var A=Rf(x,me),j=Rf(x,Ke);if(A&&j&&(M.rangeCount!==1||M.anchorNode!==A.node||M.anchorOffset!==A.offset||M.focusNode!==j.node||M.focusOffset!==j.offset)){var C=Y.createRange();C.setStart(A.node,A.offset),M.removeAllRanges(),me>Ke?(M.addRange(C),M.extend(j.node,j.offset)):(C.setEnd(j.node,j.offset),M.addRange(C))}}}}for(Y=[],M=x;M=M.parentNode;)M.nodeType===1&&Y.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<Y.length;x++){var H=Y[x];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}Lr=!!yo,vo=yo=null}finally{He=r,F.p=l,U.T=a}}e.current=t,bt=2}}function Qm(){if(bt===2){bt=0;var e=zn,t=ii,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var l=F.p;F.p=2;var r=He;He|=4;try{bm(e,t.alternate,t)}finally{He=r,F.p=l,U.T=a}}bt=3}}function Xm(){if(bt===4||bt===3){bt=0,bn();var e=zn,t=ii,a=on,l=Mm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?bt=5:(bt=0,ii=zn=null,Km(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Un=null),ju(a),t=t.stateNode,G&&typeof G.onCommitFiberRoot=="function")try{G.onCommitFiberRoot(Ma,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=U.T,r=F.p,F.p=2,U.T=null;try{for(var o=e.onRecoverableError,h=0;h<l.length;h++){var x=l[h];o(x.value,{componentStack:x.stack})}}finally{U.T=t,F.p=r}}(on&3)!==0&&jr(),Ba(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===no?ns++:(ns=0,no=e):ns=0,ls(0)}}function Km(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Bi(t)))}function jr(){return Gm(),Qm(),Xm(),Jm()}function Jm(){if(bt!==5)return!1;var e=zn,t=to;to=0;var a=ju(on),l=U.T,r=F.p;try{F.p=32>a?32:a,U.T=null,a=ao,ao=null;var o=zn,h=on;if(bt=0,ii=zn=null,on=0,(He&6)!==0)throw Error(u(331));var x=He;if(He|=4,Tm(o.current),Em(o,o.current,h,a),He=x,ls(0,!1),G&&typeof G.onPostCommitFiberRoot=="function")try{G.onPostCommitFiberRoot(Ma,o)}catch{}return!0}finally{F.p=r,U.T=l,Km(e,t)}}function Im(e,t,a){t=sa(a,t),t=Lc(e.stateNode,t,2),e=Tn(e,t,2),e!==null&&(Ni(e,2),Ba(e))}function Ze(e,t,a){if(e.tag===3)Im(e,e,a);else for(;t!==null;){if(t.tag===3){Im(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Un===null||!Un.has(l))){e=sa(a,e),a=Fh(2),l=Tn(t,a,2),l!==null&&(Wh(a,l,t,e),Ni(l,2),Ba(l));break}}t=t.return}}function so(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new mg;var r=new Set;l.set(t,r)}else r=l.get(t),r===void 0&&(r=new Set,l.set(t,r));r.has(a)||(Wc=!0,r.add(a),e=gg.bind(null,e,t,a),t.then(e,e))}function gg(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ie===e&&(Ee&a)===a&&(rt===4||rt===3&&(Ee&62914560)===Ee&&300>tt()-yr?(He&2)===0&&si(e,0):Pc|=a,li===Ee&&(li=0)),Ba(e)}function Fm(e,t){t===0&&(t=Je()),e=il(e,t),e!==null&&(Ni(e,t),Ba(e))}function bg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Fm(e,a)}function wg(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),Fm(e,a)}function Sg(e,t){return Ga(e,t)}var Nr=null,ui=null,ro=!1,_r=!1,uo=!1,qn=0;function Ba(e){e!==ui&&e.next===null&&(ui===null?Nr=ui=e:ui=ui.next=e),_r=!0,ro||(ro=!0,Ng())}function ls(e,t){if(!uo&&_r){uo=!0;do for(var a=!1,l=Nr;l!==null;){if(e!==0){var r=l.pendingLanes;if(r===0)var o=0;else{var h=l.suspendedLanes,x=l.pingedLanes;o=(1<<31-qe(42|e)+1)-1,o&=r&~(h&~x),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,tp(l,o))}else o=Ee,o=Cl(l,l===Ie?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||O(l,o)||(a=!0,tp(l,o));l=l.next}while(a);uo=!1}}function jg(){Wm()}function Wm(){_r=ro=!1;var e=0;qn!==0&&Dg()&&(e=qn);for(var t=tt(),a=null,l=Nr;l!==null;){var r=l.next,o=Pm(l,t);o===0?(l.next=null,a===null?Nr=r:a.next=r,r===null&&(ui=a)):(a=l,(e!==0||(o&3)!==0)&&(_r=!0)),l=r}bt!==0&&bt!==5||ls(e),qn!==0&&(qn=0)}function Pm(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var h=31-qe(o),x=1<<h,S=r[h];S===-1?((x&a)===0||(x&l)!==0)&&(r[h]=oe(x,t)):S<=t&&(e.expiredLanes|=x),o&=~x}if(t=Ie,a=Ee,a=Cl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Mt(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||O(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Mt(l),ju(a)){case 2:case 8:a=Wn;break;case 32:a=Qa;break;case 268435456:a=gt;break;default:a=Qa}return l=ep.bind(null,e),a=Ga(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Mt(l),e.callbackPriority=2,e.callbackNode=null,2}function ep(e,t){if(bt!==0&&bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(jr()&&e.callbackNode!==a)return null;var l=Ee;return l=Cl(e,e===Ie?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Lm(e,l,t),Pm(e,tt()),e.callbackNode!=null&&e.callbackNode===a?ep.bind(null,e):null)}function tp(e,t){if(jr())return null;Lm(e,t,!0)}function Ng(){Ug(function(){(He&6)!==0?Ga(Fn,jg):Wm()})}function co(){if(qn===0){var e=Xl;e===0&&(e=aa,aa<<=1,(aa&261888)===0&&(aa=256)),qn=e}return qn}function ap(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ms(""+e)}function np(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function _g(e,t,a,l,r){if(t==="submit"&&a&&a.stateNode===r){var o=ap((r[Lt]||null).action),h=l.submitter;h&&(t=(t=h[Lt]||null)?ap(t.formAction):h.getAttribute("formAction"),t!==null&&(o=t,h=null));var x=new zs("action","action",null,l,r);e.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(qn!==0){var S=h?np(r,h):new FormData(r);Rc(a,{pending:!0,data:S,method:r.method,action:o},null,S)}}else typeof o=="function"&&(x.preventDefault(),S=h?np(r,h):new FormData(r),Rc(a,{pending:!0,data:S,method:r.method,action:o},o,S))},currentTarget:r}]})}}for(var oo=0;oo<Qu.length;oo++){var fo=Qu[oo],Ag=fo.toLowerCase(),Eg=fo[0].toUpperCase()+fo.slice(1);ja(Ag,"on"+Eg)}ja(Df,"onAnimationEnd"),ja(Lf,"onAnimationIteration"),ja(Uf,"onAnimationStart"),ja("dblclick","onDoubleClick"),ja("focusin","onFocus"),ja("focusout","onBlur"),ja(Yv,"onTransitionRun"),ja(Zv,"onTransitionStart"),ja(Gv,"onTransitionCancel"),ja(zf,"onTransitionEnd"),Ml("onMouseEnter",["mouseout","mouseover"]),Ml("onMouseLeave",["mouseout","mouseover"]),Ml("onPointerEnter",["pointerout","pointerover"]),Ml("onPointerLeave",["pointerout","pointerover"]),tl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tl("onBeforeInput",["compositionend","keypress","textInput","paste"]),tl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var is="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(" "),Cg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(is));function lp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],r=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var h=l.length-1;0<=h;h--){var x=l[h],S=x.instance,R=x.currentTarget;if(x=x.listener,S!==o&&r.isPropagationStopped())break e;o=x,r.currentTarget=R;try{o(r)}catch(z){Hs(z)}r.currentTarget=null,o=S}else for(h=0;h<l.length;h++){if(x=l[h],S=x.instance,R=x.currentTarget,x=x.listener,S!==o&&r.isPropagationStopped())break e;o=x,r.currentTarget=R;try{o(r)}catch(z){Hs(z)}r.currentTarget=null,o=S}}}}function Ae(e,t){var a=t[Nu];a===void 0&&(a=t[Nu]=new Set);var l=e+"__bubble";a.has(l)||(ip(t,e,2,!1),a.add(l))}function ho(e,t,a){var l=0;t&&(l|=4),ip(a,e,l,t)}var Ar="_reactListening"+Math.random().toString(36).slice(2);function mo(e){if(!e[Ar]){e[Ar]=!0,Fd.forEach(function(a){a!=="selectionchange"&&(Cg.has(a)||ho(a,!1,e),ho(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ar]||(t[Ar]=!0,ho("selectionchange",!1,t))}}function ip(e,t,a,l){switch(Dp(t)){case 2:var r=a0;break;case 8:r=n0;break;default:r=Ro}a=r.bind(null,t,a,e),r=void 0,!Mu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),l?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function po(e,t,a,l,r){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var x=l.stateNode.containerInfo;if(x===r)break;if(h===4)for(h=l.return;h!==null;){var S=h.tag;if((S===3||S===4)&&h.stateNode.containerInfo===r)return;h=h.return}for(;x!==null;){if(h=Tl(x),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){l=o=h;continue e}x=x.parentNode}}l=l.return}of(function(){var R=o,z=ku(a),Y=[];e:{var k=Bf.get(e);if(k!==void 0){var M=zs,ae=e;switch(e){case"keypress":if(Ls(a)===0)break e;case"keydown":case"keyup":M=wv;break;case"focusin":ae="focus",M=zu;break;case"focusout":ae="blur",M=zu;break;case"beforeblur":case"afterblur":M=zu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":M=hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=cv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=Nv;break;case Df:case Lf:case Uf:M=fv;break;case zf:M=Av;break;case"scroll":case"scrollend":M=rv;break;case"wheel":M=Cv;break;case"copy":case"cut":case"paste":M=mv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=pf;break;case"toggle":case"beforetoggle":M=Tv}var me=(t&4)!==0,Ke=!me&&(e==="scroll"||e==="scrollend"),A=me?k!==null?k+"Capture":null:k;me=[];for(var j=R,C;j!==null;){var H=j;if(C=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||C===null||A===null||(H=Ei(j,A),H!=null&&me.push(ss(j,H,C))),Ke)break;j=j.return}0<me.length&&(k=new M(k,ae,null,a,z),Y.push({event:k,listeners:me}))}}if((t&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",k&&a!==Tu&&(ae=a.relatedTarget||a.fromElement)&&(Tl(ae)||ae[Rl]))break e;if((M||k)&&(k=z.window===z?z:(k=z.ownerDocument)?k.defaultView||k.parentWindow:window,M?(ae=a.relatedTarget||a.toElement,M=R,ae=ae?Tl(ae):null,ae!==null&&(Ke=f(ae),me=ae.tag,ae!==Ke||me!==5&&me!==27&&me!==6)&&(ae=null)):(M=null,ae=R),M!==ae)){if(me=hf,H="onMouseLeave",A="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(me=pf,H="onPointerLeave",A="onPointerEnter",j="pointer"),Ke=M==null?k:Ai(M),C=ae==null?k:Ai(ae),k=new me(H,j+"leave",M,a,z),k.target=Ke,k.relatedTarget=C,H=null,Tl(z)===R&&(me=new me(A,j+"enter",ae,a,z),me.target=C,me.relatedTarget=Ke,H=me),Ke=H,M&&ae)t:{for(me=Rg,A=M,j=ae,C=0,H=A;H;H=me(H))C++;H=0;for(var de=j;de;de=me(de))H++;for(;0<C-H;)A=me(A),C--;for(;0<H-C;)j=me(j),H--;for(;C--;){if(A===j||j!==null&&A===j.alternate){me=A;break t}A=me(A),j=me(j)}me=null}else me=null;M!==null&&sp(Y,k,M,me,!1),ae!==null&&Ke!==null&&sp(Y,Ke,ae,me,!0)}}e:{if(k=R?Ai(R):window,M=k.nodeName&&k.nodeName.toLowerCase(),M==="select"||M==="input"&&k.type==="file")var ze=jf;else if(wf(k))if(Nf)ze=Hv;else{ze=Bv;var le=zv}else M=k.nodeName,!M||M.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?R&&Ru(R.elementType)&&(ze=jf):ze=qv;if(ze&&(ze=ze(e,R))){Sf(Y,ze,a,z);break e}le&&le(e,k,R),e==="focusout"&&R&&k.type==="number"&&R.memoizedProps.value!=null&&Cu(k,"number",k.value)}switch(le=R?Ai(R):window,e){case"focusin":(wf(le)||le.contentEditable==="true")&&(ql=le,Yu=R,Li=null);break;case"focusout":Li=Yu=ql=null;break;case"mousedown":Zu=!0;break;case"contextmenu":case"mouseup":case"dragend":Zu=!1,Of(Y,a,z);break;case"selectionchange":if(Vv)break;case"keydown":case"keyup":Of(Y,a,z)}var we;if(qu)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Bl?gf(e,a)&&(Ce="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(xf&&a.locale!=="ko"&&(Bl||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Bl&&(we=df()):(jn=z,Du="value"in jn?jn.value:jn.textContent,Bl=!0)),le=Er(R,Ce),0<le.length&&(Ce=new mf(Ce,e,null,a,z),Y.push({event:Ce,listeners:le}),we?Ce.data=we:(we=bf(a),we!==null&&(Ce.data=we)))),(we=Ov?Mv(e,a):Dv(e,a))&&(Ce=Er(R,"onBeforeInput"),0<Ce.length&&(le=new mf("onBeforeInput","beforeinput",null,a,z),Y.push({event:le,listeners:Ce}),le.data=we)),_g(Y,e,R,a,z)}lp(Y,t)})}function ss(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Er(e,t){for(var a=t+"Capture",l=[];e!==null;){var r=e,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Ei(e,a),r!=null&&l.unshift(ss(e,r,o)),r=Ei(e,t),r!=null&&l.push(ss(e,r,o))),e.tag===3)return l;e=e.return}return[]}function Rg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sp(e,t,a,l,r){for(var o=t._reactName,h=[];a!==null&&a!==l;){var x=a,S=x.alternate,R=x.stateNode;if(x=x.tag,S!==null&&S===l)break;x!==5&&x!==26&&x!==27||R===null||(S=R,r?(R=Ei(a,o),R!=null&&h.unshift(ss(a,R,S))):r||(R=Ei(a,o),R!=null&&h.push(ss(a,R,S)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var Tg=/\r\n?/g,kg=/\u0000|\uFFFD/g;function rp(e){return(typeof e=="string"?e:""+e).replace(Tg,`
49
- `).replace(kg,"")}function up(e,t){return t=rp(t),rp(e)===t}function Xe(e,t,a,l,r,o){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Ll(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Ll(e,""+l);break;case"className":ks(e,"class",l);break;case"tabIndex":ks(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ks(e,a,l);break;case"style":uf(e,l,o);break;case"data":if(t!=="object"){ks(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ms(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Xe(e,t,"name",r.name,r,null),Xe(e,t,"formEncType",r.formEncType,r,null),Xe(e,t,"formMethod",r.formMethod,r,null),Xe(e,t,"formTarget",r.formTarget,r,null)):(Xe(e,t,"encType",r.encType,r,null),Xe(e,t,"method",r.method,r,null),Xe(e,t,"target",r.target,r,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ms(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Ka);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Ms(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),Ts(e,"popover",l);break;case"xlinkActuate":Xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Xa(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Xa(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Xa(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Xa(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ts(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=iv.get(a)||a,Ts(e,a,l))}}function xo(e,t,a,l,r,o){switch(a){case"style":uf(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Ll(e,l):(typeof l=="number"||typeof l=="bigint")&&Ll(e,""+l);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Ka);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[Lt]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof l=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,r);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):Ts(e,a,l)}}}function Ct(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var l=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var h=a[o];if(h!=null)switch(o){case"src":l=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Xe(e,t,o,h,a,null)}}r&&Xe(e,t,"srcSet",a.srcSet,a,null),l&&Xe(e,t,"src",a.src,a,null);return;case"input":Ae("invalid",e);var x=o=h=r=null,S=null,R=null;for(l in a)if(a.hasOwnProperty(l)){var z=a[l];if(z!=null)switch(l){case"name":r=z;break;case"type":h=z;break;case"checked":S=z;break;case"defaultChecked":R=z;break;case"value":o=z;break;case"defaultValue":x=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(u(137,t));break;default:Xe(e,t,l,z,a,null)}}nf(e,o,x,S,R,h,r,!1);return;case"select":Ae("invalid",e),l=h=o=null;for(r in a)if(a.hasOwnProperty(r)&&(x=a[r],x!=null))switch(r){case"value":o=x;break;case"defaultValue":h=x;break;case"multiple":l=x;default:Xe(e,t,r,x,a,null)}t=o,a=h,e.multiple=!!l,t!=null?Dl(e,!!l,t,!1):a!=null&&Dl(e,!!l,a,!0);return;case"textarea":Ae("invalid",e),o=r=l=null;for(h in a)if(a.hasOwnProperty(h)&&(x=a[h],x!=null))switch(h){case"value":l=x;break;case"defaultValue":r=x;break;case"children":o=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(u(91));break;default:Xe(e,t,h,x,a,null)}sf(e,l,r,o);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(l=a[S],l!=null))switch(S){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Xe(e,t,S,l,a,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(l=0;l<is.length;l++)Ae(is[l],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(R in a)if(a.hasOwnProperty(R)&&(l=a[R],l!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Xe(e,t,R,l,a,null)}return;default:if(Ru(t)){for(z in a)a.hasOwnProperty(z)&&(l=a[z],l!==void 0&&xo(e,t,z,l,a,void 0));return}}for(x in a)a.hasOwnProperty(x)&&(l=a[x],l!=null&&Xe(e,t,x,l,a,null))}function Og(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,h=null,x=null,S=null,R=null,z=null;for(M in a){var Y=a[M];if(a.hasOwnProperty(M)&&Y!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":S=Y;default:l.hasOwnProperty(M)||Xe(e,t,M,null,l,Y)}}for(var k in l){var M=l[k];if(Y=a[k],l.hasOwnProperty(k)&&(M!=null||Y!=null))switch(k){case"type":o=M;break;case"name":r=M;break;case"checked":R=M;break;case"defaultChecked":z=M;break;case"value":h=M;break;case"defaultValue":x=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:M!==Y&&Xe(e,t,k,M,l,Y)}}Eu(e,h,x,S,R,z,o,r);return;case"select":M=h=x=k=null;for(o in a)if(S=a[o],a.hasOwnProperty(o)&&S!=null)switch(o){case"value":break;case"multiple":M=S;default:l.hasOwnProperty(o)||Xe(e,t,o,null,l,S)}for(r in l)if(o=l[r],S=a[r],l.hasOwnProperty(r)&&(o!=null||S!=null))switch(r){case"value":k=o;break;case"defaultValue":x=o;break;case"multiple":h=o;default:o!==S&&Xe(e,t,r,o,l,S)}t=x,a=h,l=M,k!=null?Dl(e,!!a,k,!1):!!l!=!!a&&(t!=null?Dl(e,!!a,t,!0):Dl(e,!!a,a?[]:"",!1));return;case"textarea":M=k=null;for(x in a)if(r=a[x],a.hasOwnProperty(x)&&r!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Xe(e,t,x,null,l,r)}for(h in l)if(r=l[h],o=a[h],l.hasOwnProperty(h)&&(r!=null||o!=null))switch(h){case"value":k=r;break;case"defaultValue":M=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==o&&Xe(e,t,h,r,l,o)}lf(e,k,M);return;case"option":for(var ae in a)if(k=a[ae],a.hasOwnProperty(ae)&&k!=null&&!l.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:Xe(e,t,ae,null,l,k)}for(S in l)if(k=l[S],M=a[S],l.hasOwnProperty(S)&&k!==M&&(k!=null||M!=null))switch(S){case"selected":e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:Xe(e,t,S,k,l,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 a)k=a[me],a.hasOwnProperty(me)&&k!=null&&!l.hasOwnProperty(me)&&Xe(e,t,me,null,l,k);for(R in l)if(k=l[R],M=a[R],l.hasOwnProperty(R)&&k!==M&&(k!=null||M!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(u(137,t));break;default:Xe(e,t,R,k,l,M)}return;default:if(Ru(t)){for(var Ke in a)k=a[Ke],a.hasOwnProperty(Ke)&&k!==void 0&&!l.hasOwnProperty(Ke)&&xo(e,t,Ke,void 0,l,k);for(z in l)k=l[z],M=a[z],!l.hasOwnProperty(z)||k===M||k===void 0&&M===void 0||xo(e,t,z,k,l,M);return}}for(var A in a)k=a[A],a.hasOwnProperty(A)&&k!=null&&!l.hasOwnProperty(A)&&Xe(e,t,A,null,l,k);for(Y in l)k=l[Y],M=a[Y],!l.hasOwnProperty(Y)||k===M||k==null&&M==null||Xe(e,t,Y,k,l,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 Mg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var r=a[l],o=r.transferSize,h=r.initiatorType,x=r.duration;if(o&&x&&cp(h)){for(h=0,x=r.responseEnd,l+=1;l<a.length;l++){var S=a[l],R=S.startTime;if(R>x)break;var z=S.transferSize,Y=S.initiatorType;z&&cp(Y)&&(S=S.responseEnd,h+=z*(S<x?1:(x-R)/(S-R)))}if(--l,t+=8*(o+h)/(r.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 yo=null,vo=null;function Cr(e){return e.nodeType===9?e:e.ownerDocument}function op(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 dp(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 go(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 bo=null;function Dg(){var e=window.event;return e&&e.type==="popstate"?e===bo?!1:(bo=e,!0):(bo=null,!1)}var fp=typeof setTimeout=="function"?setTimeout:void 0,Lg=typeof clearTimeout=="function"?clearTimeout:void 0,hp=typeof Promise=="function"?Promise:void 0,Ug=typeof queueMicrotask=="function"?queueMicrotask:typeof hp<"u"?function(e){return hp.resolve(null).then(e).catch(zg)}:fp;function zg(e){setTimeout(function(){throw e})}function Hn(e){return e==="head"}function mp(e,t){var a=t,l=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(r),fi(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")rs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,rs(a);for(var o=a.firstChild;o;){var h=o.nextSibling,x=o.nodeName;o[_i]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=h}}else a==="body"&&rs(e.ownerDocument.body);a=r}while(a);fi(t)}function pp(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function wo(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":wo(a),_u(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Bg(e,t,a,l){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[_i])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=da(e.nextSibling),e===null)break}return null}function qg(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=da(e.nextSibling),e===null))return null;return e}function xp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=da(e.nextSibling),e===null))return null;return e}function So(e){return e.data==="$?"||e.data==="$~"}function jo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Hg(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function da(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 No=null;function yp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return da(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function vp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function gp(e,t,a){switch(t=Cr(a),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 rs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_u(e)}var fa=new Map,bp=new Set;function Rr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dn=F.d;F.d={f:$g,r:Vg,D:Yg,C:Zg,L:Gg,m:Qg,X:Kg,S:Xg,M:Jg};function $g(){var e=dn.f(),t=br();return e||t}function Vg(e){var t=kl(e);t!==null&&t.tag===5&&t.type==="form"?zh(t):dn.r(e)}var ci=typeof document>"u"?null:document;function wp(e,t,a){var l=ci;if(l&&typeof t=="string"&&t){var r=la(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),bp.has(r)||(bp.add(r),e={rel:e,crossOrigin:a,href:t},l.querySelector(r)===null&&(t=l.createElement("link"),Ct(t,"link",e),wt(t),l.head.appendChild(t)))}}function Yg(e){dn.D(e),wp("dns-prefetch",e,null)}function Zg(e,t){dn.C(e,t),wp("preconnect",e,t)}function Gg(e,t,a){dn.L(e,t,a);var l=ci;if(l&&e&&t){var r='link[rel="preload"][as="'+la(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+la(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+la(a.imageSizes)+'"]')):r+='[href="'+la(e)+'"]';var o=r;switch(t){case"style":o=oi(e);break;case"script":o=di(e)}fa.has(o)||(e=_({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),fa.set(o,e),l.querySelector(r)!==null||t==="style"&&l.querySelector(us(o))||t==="script"&&l.querySelector(cs(o))||(t=l.createElement("link"),Ct(t,"link",e),wt(t),l.head.appendChild(t)))}}function Qg(e,t){dn.m(e,t);var a=ci;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+la(l)+'"][href="'+la(e)+'"]',o=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=di(e)}if(!fa.has(o)&&(e=_({rel:"modulepreload",href:e},t),fa.set(o,e),a.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(cs(o)))return}l=a.createElement("link"),Ct(l,"link",e),wt(l),a.head.appendChild(l)}}}function Xg(e,t,a){dn.S(e,t,a);var l=ci;if(l&&e){var r=Ol(l).hoistableStyles,o=oi(e);t=t||"default";var h=r.get(o);if(!h){var x={loading:0,preload:null};if(h=l.querySelector(us(o)))x.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},a),(a=fa.get(o))&&_o(e,a);var S=h=l.createElement("link");wt(S),Ct(S,"link",e),S._p=new Promise(function(R,z){S.onload=R,S.onerror=z}),S.addEventListener("load",function(){x.loading|=1}),S.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Tr(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:x},r.set(o,h)}}}function Kg(e,t){dn.X(e,t);var a=ci;if(a&&e){var l=Ol(a).hoistableScripts,r=di(e),o=l.get(r);o||(o=a.querySelector(cs(r)),o||(e=_({src:e,async:!0},t),(t=fa.get(r))&&Ao(e,t),o=a.createElement("script"),wt(o),Ct(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function Jg(e,t){dn.M(e,t);var a=ci;if(a&&e){var l=Ol(a).hoistableScripts,r=di(e),o=l.get(r);o||(o=a.querySelector(cs(r)),o||(e=_({src:e,async:!0,type:"module"},t),(t=fa.get(r))&&Ao(e,t),o=a.createElement("script"),wt(o),Ct(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function Sp(e,t,a,l){var r=(r=ue.current)?Rr(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=oi(a.href),a=Ol(r).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=oi(a.href);var o=Ol(r).hoistableStyles,h=o.get(e);if(h||(r=r.ownerDocument||r,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=r.querySelector(us(e)))&&!o._p&&(h.instance=o,h.state.loading=5),fa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},fa.set(e,a),o||Ig(r,e,a,h.state))),t&&l===null)throw Error(u(528,""));return h}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=di(a),a=Ol(r).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function oi(e){return'href="'+la(e)+'"'}function us(e){return'link[rel="stylesheet"]['+e+"]"}function jp(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function Ig(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ct(t,"link",a),wt(t),e.head.appendChild(t))}function di(e){return'[src="'+la(e)+'"]'}function cs(e){return"script[async]"+e}function Np(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+la(a.href)+'"]');if(l)return t.instance=l,wt(l),l;var r=_({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),Ct(l,"style",r),Tr(l,a.precedence,e),t.instance=l;case"stylesheet":r=oi(a.href);var o=e.querySelector(us(r));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;l=jp(a),(r=fa.get(r))&&_o(l,r),o=(e.ownerDocument||e).createElement("link"),wt(o);var h=o;return h._p=new Promise(function(x,S){h.onload=x,h.onerror=S}),Ct(o,"link",l),t.state.loading|=4,Tr(o,a.precedence,e),t.instance=o;case"script":return o=di(a.src),(r=e.querySelector(cs(o)))?(t.instance=r,wt(r),r):(l=a,(r=fa.get(o))&&(l=_({},a),Ao(l,r)),e=e.ownerDocument||e,r=e.createElement("script"),wt(r),Ct(r,"link",l),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Tr(l,a.precedence,e));return t.instance}function Tr(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,o=r,h=0;h<l.length;h++){var x=l[h];if(x.dataset.precedence===t)o=x;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function _o(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ao(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var kr=null;function _p(e,t,a){if(kr===null){var l=new Map,r=kr=new Map;r.set(a,l)}else r=kr,l=r.get(a),l||(l=new Map,r.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[_i]||o[Nt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var h=o.getAttribute(t)||"";h=e+h;var x=l.get(h);x?x.push(o):l.set(h,[o])}}return l}function Ap(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Fg(e,t,a){if(a===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 Ep(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Wg(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=oi(l.href),o=t.querySelector(us(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Or.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,wt(o);return}o=t.ownerDocument||t,l=jp(l),(r=fa.get(r))&&_o(l,r),o=o.createElement("link"),wt(o);var h=o;h._p=new Promise(function(x,S){h.onload=x,h.onerror=S}),Ct(o,"link",l),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Or.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Eo=0;function Pg(e,t){return e.stylesheets&&e.count===0&&Dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Eo===0&&(Eo=62500*Mg());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Eo?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(r)}}:null}function Or(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mr=null;function Dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mr=new Map,t.forEach(e0,e),Mr=null,Or.call(e))}function e0(e,t){if(!(t.state.loading&4)){var a=Mr.get(e);if(a)var l=a.get(null);else{a=new Map,Mr.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var h=r[o];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(a.set(h.dataset.precedence,h),l=h)}l&&a.set(null,l)}r=t.instance,h=r.getAttribute("data-precedence"),o=a.get(h)||l,o===l&&a.set(null,r),a.set(h,r),this.count++,l=Or.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var os={$$typeof:W,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function t0(e,t,a,l,r,o,h,x,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=Sa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sa(0),this.hiddenUpdates=Sa(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Cp(e,t,a,l,r,o,h,x,S,R,z,Y){return e=new t0(e,t,a,h,S,R,z,Y,x),t=1,o===!0&&(t|=24),o=Xt(3,null,null,t),e.current=o,o.stateNode=e,t=ic(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:a,cache:t},cc(o),e}function Rp(e){return e?(e=Vl,e):Vl}function Tp(e,t,a,l,r,o){r=Rp(r),l.context===null?l.context=r:l.pendingContext=r,l=Rn(t),l.payload={element:a},o=o===void 0?null:o,o!==null&&(l.callback=o),a=Tn(e,l,t),a!==null&&($t(a,e,t),Vi(a,e,t))}function kp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Co(e,t){kp(e,t),(e=e.alternate)&&kp(e,t)}function Op(e){if(e.tag===13||e.tag===31){var t=il(e,67108864);t!==null&&$t(t,e,67108864),Co(e,67108864)}}function Mp(e){if(e.tag===13||e.tag===31){var t=Wt();t=Su(t);var a=il(e,t);a!==null&&$t(a,e,t),Co(e,t)}}var Lr=!0;function a0(e,t,a,l){var r=U.T;U.T=null;var o=F.p;try{F.p=2,Ro(e,t,a,l)}finally{F.p=o,U.T=r}}function n0(e,t,a,l){var r=U.T;U.T=null;var o=F.p;try{F.p=8,Ro(e,t,a,l)}finally{F.p=o,U.T=r}}function Ro(e,t,a,l){if(Lr){var r=To(l);if(r===null)po(e,t,l,Ur,a),Lp(e,l);else if(i0(r,e,t,a,l))l.stopPropagation();else if(Lp(e,l),t&4&&-1<l0.indexOf(e)){for(;r!==null;){var o=kl(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var h=Da(o.pendingLanes);if(h!==0){var x=o;for(x.pendingLanes|=2,x.entangledLanes|=2;h;){var S=1<<31-qe(h);x.entanglements[1]|=S,h&=~S}Ba(o),(He&6)===0&&(vr=tt()+500,ls(0))}}break;case 31:case 13:x=il(o,2),x!==null&&$t(x,o,2),br(),Co(o,2)}if(o=To(l),o===null&&po(e,t,l,Ur,a),o===r)break;r=o}r!==null&&l.stopPropagation()}else po(e,t,l,null,a)}}function To(e){return e=ku(e),ko(e)}var Ur=null;function ko(e){if(Ur=null,e=Tl(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=y(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ur=e,null}function Dp(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(it()){case Fn:return 2;case Wn:return 8;case Qa:case Pn:return 32;case gt:return 268435456;default:return 32}default:return 32}}var Oo=!1,$n=null,Vn=null,Yn=null,ds=new Map,fs=new Map,Zn=[],l0="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 Lp(e,t){switch(e){case"focusin":case"focusout":$n=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fs.delete(t.pointerId)}}function hs(e,t,a,l,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:o,targetContainers:[r]},t!==null&&(t=kl(t),t!==null&&Op(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function i0(e,t,a,l,r){switch(t){case"focusin":return $n=hs($n,e,t,a,l,r),!0;case"dragenter":return Vn=hs(Vn,e,t,a,l,r),!0;case"mouseover":return Yn=hs(Yn,e,t,a,l,r),!0;case"pointerover":var o=r.pointerId;return ds.set(o,hs(ds.get(o)||null,e,t,a,l,r)),!0;case"gotpointercapture":return o=r.pointerId,fs.set(o,hs(fs.get(o)||null,e,t,a,l,r)),!0}return!1}function Up(e){var t=Tl(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Jd(e.priority,function(){Mp(a)});return}}else if(t===31){if(t=y(a),t!==null){e.blockedOn=t,Jd(e.priority,function(){Mp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=To(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Tu=l,a.target.dispatchEvent(l),Tu=null}else return t=kl(a),t!==null&&Op(t),e.blockedOn=a,!1;t.shift()}return!0}function zp(e,t,a){zr(e)&&a.delete(t)}function s0(){Oo=!1,$n!==null&&zr($n)&&($n=null),Vn!==null&&zr(Vn)&&(Vn=null),Yn!==null&&zr(Yn)&&(Yn=null),ds.forEach(zp),fs.forEach(zp)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,Oo||(Oo=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,s0)))}var qr=null;function Bp(e){qr!==e&&(qr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){qr===e&&(qr=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],r=e[t+2];if(typeof l!="function"){if(ko(l||a)===null)continue;break}var o=kl(a);o!==null&&(e.splice(t,3),t-=3,Rc(o,{pending:!0,data:r,method:a.method,action:l},l,r))}}))}function fi(e){function t(S){return Br(S,e)}$n!==null&&Br($n,e),Vn!==null&&Br(Vn,e),Yn!==null&&Br(Yn,e),ds.forEach(t),fs.forEach(t);for(var a=0;a<Zn.length;a++){var l=Zn[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Zn.length&&(a=Zn[0],a.blockedOn===null);)Up(a),a.blockedOn===null&&Zn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var r=a[l],o=a[l+1],h=r[Lt]||null;if(typeof o=="function")h||Bp(a);else if(h){var x=null;if(o&&o.hasAttribute("formAction")){if(r=o,h=o[Lt]||null)x=h.formAction;else if(ko(r)!==null)continue}else x=h.action;typeof x=="function"?a[l+1]=x:(a.splice(l,3),l-=3),Bp(a)}}}function qp(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(h){return r=h})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Mo(e){this._internalRoot=e}Hr.prototype.render=Mo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,l=Wt();Tp(a,l,e,t,null,null)},Hr.prototype.unmount=Mo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Tp(e.current,2,null,e,null,null),br(),t[Rl]=null}};function Hr(e){this._internalRoot=e}Hr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kd();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Zn.length&&t!==0&&t<Zn[a].priority;a++);Zn.splice(a,0,e),a===0&&Up(e)}};var Hp=i.version;if(Hp!=="19.2.7")throw Error(u(527,Hp,"19.2.7"));F.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=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var r0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$r.isDisabled&&$r.supportsFiber)try{Ma=$r.inject(r0),G=$r}catch{}}return ps.createRoot=function(e,t){if(!d(e))throw Error(u(299));var a=!1,l="",r=Xh,o=Kh,h=Jh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Cp(e,1,!1,null,null,a,l,null,r,o,h,qp),e[Rl]=t.current,mo(e),new Mo(t)},ps.hydrateRoot=function(e,t,a){if(!d(e))throw Error(u(299));var l=!1,r="",o=Xh,h=Kh,x=Jh,S=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(x=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=Cp(e,1,!0,t,a??null,l,r,S,o,h,x,qp),t.context=Rp(null),a=t.current,l=Wt(),l=Su(l),r=Rn(l),r.callback=null,Tn(a,r,l),a=l,t.current.lanes=a,Ni(t,a),Ba(t),e[Rl]=t.current,mo(e),new Hr(t)},ps.version="19.2.7",ps}var Ip;function y0(){if(Ip)return Uo.exports;Ip=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Uo.exports=x0(),Uo.exports}var v0=y0();/**
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 _d=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Vx=/^[\\/]{2}/;function g0(n,i){return i+n.replace(/\\/g,"/")}var Fp="popstate";function Wp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function b0(n={}){function i(u,d){var g;let f=(g=d.state)==null?void 0:g.masked,{pathname:m,search:y,hash:v}=f||u.location;return rd("",{pathname:m,search:y,hash:v},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:gl(d)}return S0(i,s,null,n)}function nt(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function va(n,i){if(!n){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function w0(){return Math.random().toString(36).substring(2,10)}function Pp(n,i){return{usr:n.state,key:n.key,idx:i,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function rd(n,i,s=null,u,d){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof i=="string"?gi(i):i,state:s,key:i&&i.key||u||w0(),mask:d}}function gl({pathname:n="/",search:i="",hash:s=""}){return i&&i!=="?"&&(n+=i.charAt(0)==="?"?i:"?"+i),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function gi(n){let i={};if(n){let s=n.indexOf("#");s>=0&&(i.hash=n.substring(s),n=n.substring(0,s));let u=n.indexOf("?");u>=0&&(i.search=n.substring(u),n=n.substring(0,u)),n&&(i.pathname=n)}return i}function S0(n,i,s,u={}){let{window:d=document.defaultView,v5Compat:f=!1}=u,m=d.history,y="POP",v=null,g=b();g==null&&(g=0,m.replaceState({...m.state,idx:g},""));function b(){return(m.state||{idx:null}).idx}function _(){y="POP";let L=b(),B=L==null?null:L-g;g=L,v&&v({action:y,location:V.location,delta:B})}function D(L,B){y="PUSH";let Z=Wp(L)?L:rd(V.location,L,B);g=b()+1;let W=Pp(Z,g),fe=V.createHref(Z.mask||Z);try{m.pushState(W,"",fe)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;d.location.assign(fe)}f&&v&&v({action:y,location:V.location,delta:1})}function Q(L,B){y="REPLACE";let Z=Wp(L)?L:rd(V.location,L,B);g=b();let W=Pp(Z,g),fe=V.createHref(Z.mask||Z);m.replaceState(W,"",fe),f&&v&&v({action:y,location:V.location,delta:0})}function T(L){return j0(d,L)}let V={get action(){return y},get location(){return n(d,m)},listen(L){if(v)throw new Error("A history only accepts one active listener");return d.addEventListener(Fp,_),v=L,()=>{d.removeEventListener(Fp,_),v=null}},createHref(L){return i(d,L)},createURL:T,encodeLocation(L){let B=T(L);return{pathname:B.pathname,search:B.search,hash:B.hash}},push:D,replace:Q,go(L){return m.go(L)}};return V}function j0(n,i,s=!1){let u="http://localhost";n&&(u=n.location.origin!=="null"?n.location.origin:n.location.href),nt(u,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:gl(i);return d=d.replace(/ $/,"%20"),!s&&Vx.test(d)&&(d=u+d),new URL(d,u)}function Yx(n,i,s="/"){return N0(n,i,s,!1)}function N0(n,i,s,u,d){let f=typeof i=="string"?gi(i):i,m=pn(f.pathname||"/",s);if(m==null)return null;let y=_0(n),v=null,g=U0(m);for(let b=0;v==null&&b<y.length;++b)v=L0(y[b],g,u);return v}function _0(n){let i=Zx(n);return A0(i),i}function Zx(n,i=[],s=[],u="",d=!1){let f=(m,y,v=d,g)=>{let b={relativePath:g===void 0?m.path||"":g,caseSensitive:m.caseSensitive===!0,childrenIndex:y,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(u)&&v)return;nt(b.relativePath.startsWith(u),`Absolute route path "${b.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(u.length)}let _=Ra([u,b.relativePath]),D=s.concat(b);m.children&&m.children.length>0&&(nt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${_}".`),Zx(m.children,i,D,_,v)),!(m.path==null&&!m.index)&&i.push({path:_,score:M0(_,m.index),routesMeta:D.map((Q,T)=>{let[V,L]=Xx(Q.relativePath,Q.caseSensitive,T===D.length-1);return{...Q,matcher:V,compiledParams:L}})})};return n.forEach((m,y)=>{var v;if(m.path===""||!((v=m.path)!=null&&v.includes("?")))f(m,y);else for(let g of Gx(m.path))f(m,y,!0,g)}),i}function Gx(n){let i=n.split("/");if(i.length===0)return[];let[s,...u]=i,d=s.endsWith("?"),f=s.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=Gx(u.join("/")),y=[];return y.push(...m.map(v=>v===""?f:[f,v].join("/"))),d&&y.push(...m),y.map(v=>n.startsWith("/")&&v===""?"/":v)}function A0(n){n.sort((i,s)=>i.score!==s.score?s.score-i.score:D0(i.routesMeta.map(u=>u.childrenIndex),s.routesMeta.map(u=>u.childrenIndex)))}var E0=/^:[\w-]+$/,C0=3,R0=2,T0=1,k0=10,O0=-2,ex=n=>n==="*";function M0(n,i){let s=n.split("/"),u=s.length;return s.some(ex)&&(u+=O0),i&&(u+=R0),s.filter(d=>!ex(d)).reduce((d,f)=>d+(E0.test(f)?C0:f===""?T0:k0),u)}function D0(n,i){return n.length===i.length&&n.slice(0,-1).every((u,d)=>u===i[d])?n[n.length-1]-i[i.length-1]:0}function L0(n,i,s=!1){let{routesMeta:u}=n,d={},f="/",m=[];for(let y=0;y<u.length;++y){let v=u[y],g=y===u.length-1,b=f==="/"?i:i.slice(f.length)||"/",_={path:v.relativePath,caseSensitive:v.caseSensitive,end:g},D=v.matcher&&v.compiledParams?Qx(_,b,v.matcher,v.compiledParams):Pr(_,b),Q=v.route;if(!D&&g&&s&&!u[u.length-1].route.index&&(D=Pr({path:v.relativePath,caseSensitive:v.caseSensitive,end:!1},b)),!D)return null;Object.assign(d,D.params),m.push({params:d,pathname:Ra([f,D.pathname]),pathnameBase:q0(Ra([f,D.pathnameBase])),route:Q}),D.pathnameBase!=="/"&&(f=Ra([f,D.pathnameBase]))}return m}function Pr(n,i){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,u]=Xx(n.path,n.caseSensitive,n.end);return Qx(n,i,s,u)}function Qx(n,i,s,u){let d=i.match(s);if(!d)return null;let f=d[0],m=xi(f,1),y=d.slice(1);return{params:u.reduce((g,{paramName:b,isOptional:_},D)=>{if(b==="*"){let T=y[D]||"";m=xi(f.slice(0,f.length-T.length),1)}const Q=y[D];return _&&!Q?g[b]=void 0:g[b]=(Q||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:m,pattern:n}}function Xx(n,i=!1,s=!0){va(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let u=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,y,v,g,b)=>{if(u.push({paramName:y,isOptional:v!=null}),v){let _=b.charAt(g+m.length);return _&&_!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(u.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),u]}function U0(n){try{return n.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return va(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),n}}function pn(n,i){if(i==="/")return n;if(!n.toLowerCase().startsWith(i.toLowerCase()))return null;let s=i.endsWith("/")?i.length-1:i.length,u=n.charAt(s);return u&&u!=="/"?null:n.slice(s)||"/"}function z0(n,i="/"){let{pathname:s,search:u="",hash:d=""}=typeof n=="string"?gi(n):n,f;return s?(s=Kx(s),s.startsWith("/")||s.startsWith("\\")?f=tx(s.substring(1),"/"):f=tx(s,i)):f=i,{pathname:f,search:H0(u),hash:$0(d)}}function tx(n,i){let s=xi(i).split("/");return n.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function Ho(n,i,s,u){return`Cannot include a '${n}' character in a manually specified \`to.${i}\` 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 B0(n){return n.filter((i,s)=>s===0||i.route.path&&i.route.path.length>0)}function Ad(n){let i=B0(n);return i.map((s,u)=>u===i.length-1?s.pathname:s.pathnameBase)}function hu(n,i,s,u=!1){let d;typeof n=="string"?d=gi(n):(d={...n},nt(!d.pathname||!d.pathname.includes("?"),Ho("?","pathname","search",d)),nt(!d.pathname||!d.pathname.includes("#"),Ho("#","pathname","hash",d)),nt(!d.search||!d.search.includes("#"),Ho("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,y;if(m==null)y=s;else{let _=i.length-1;if(!u&&m.startsWith("..")){let D=m.split("/");for(;D[0]==="..";)D.shift(),_-=1;d.pathname=D.join("/")}y=_>=0?i[_]:"/"}let v=z0(d,y),g=m&&m!=="/"&&m.endsWith("/"),b=(f||m===".")&&s.endsWith("/");return!v.pathname.endsWith("/")&&(g||b)&&(v.pathname+="/"),v}var Kx=n=>n.replace(/[\\/]{2,}/g,"/"),Ra=n=>Kx(n.join("/"));function xi(n,i=0){let s=n.length;for(;s>i&&n.charCodeAt(s-1)===47;)s--;return s===n.length?n:n.slice(0,s)}var q0=n=>xi(n).replace(/^\/*/,"/"),H0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,$0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,V0=class{constructor(n,i,s,u=!1){this.status=n,this.statusText=i||"",this.internal=u,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Y0(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Z0(n){let i=n.map(s=>s.route.path).filter(Boolean);return Ra(i)||"/"}var Jx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ix(n,i){let s=n;if(typeof s!="string"||!_d.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let u=s,d=!1;if(Jx)try{let f=new URL(window.location.href),m=Vx.test(s)?new URL(g0(s,f.protocol)):new URL(s),y=pn(m.pathname,i);m.origin===f.origin&&y!=null?s=y+m.search+m.hash:d=!0}catch{va(!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 ax=new URL("http://localhost");function Ed(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),ax)}catch{return ax}}function $o(n,i){return n.origin===i.origin&&(n.origin!=="null"||n.protocol===i.protocol&&n.host===i.host)}function G0(n,i){if(n.startsWith("//"))return!0;let s=i.protocol.toLowerCase();return n.toLowerCase().startsWith(s)?i.host===""||n.slice(s.length).startsWith("//"):!1}function Cd(n,i,s,u){let d=null;try{d=n==null?null:new URL(n,s)}catch{}let f=new URL(i,s),m=d!=null&&!$o(d,s),y=!$o(f,s);if(u==="reject"){if(m||y)throw new Error("External navigation is not allowed")}else if(y&&(d==null||!G0(n,d)||!$o(d,f)))throw new Error("External navigation is not allowed")}var Fx=["POST","PUT","PATCH","DELETE"];new Set(Fx);var Q0=["GET",...Fx];new Set(Q0);var X0=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function K0(n){try{return X0.includes(new URL(n).protocol)}catch{return!1}}var bi=w.createContext(null);bi.displayName="DataRouter";var mu=w.createContext(null);mu.displayName="DataRouterState";var Wx=w.createContext(!1);function J0(){return w.useContext(Wx)}var Px=w.createContext({isTransitioning:!1});Px.displayName="ViewTransition";var I0=w.createContext(new Map);I0.displayName="Fetchers";var F0=w.createContext(null);F0.displayName="Await";var ea=w.createContext(null);ea.displayName="Navigation";var Cs=w.createContext(null);Cs.displayName="Location";var ka=w.createContext({outlet:null,matches:[],isDataRoute:!1});ka.displayName="Route";var Rd=w.createContext(null);Rd.displayName="RouteError";var ey="REACT_ROUTER_ERROR",W0="REDIRECT",P0="ROUTE_ERROR_RESPONSE";function eb(n){if(n.startsWith(`${ey}:${W0}:{`))try{let i=JSON.parse(n.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function tb(n){if(n.startsWith(`${ey}:${P0}:{`))try{let i=JSON.parse(n.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new V0(i.status,i.statusText,i.data)}catch{}}function ab(n,{relative:i}={}){nt(wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:u}=w.useContext(ea),{hash:d,pathname:f,search:m}=Rs(n,{relative:i}),y=f;return s!=="/"&&(y=f==="/"?s:Ra([s,f])),u.createHref({pathname:y,search:m,hash:d})}function wi(){return w.useContext(Cs)!=null}function Oa(){return nt(wi(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Cs).location}var ty="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ay(n){w.useContext(ea).static||w.useLayoutEffect(n)}function Td(){let{isDataRoute:n}=w.useContext(ka);return n?xb():nb()}function nb(){nt(wi(),"useNavigate() may be used only in the context of a <Router> component.");let n=w.useContext(bi),{basename:i,navigator:s}=w.useContext(ea),{matches:u}=w.useContext(ka),{pathname:d}=Oa(),f=JSON.stringify(Ad(u)),m=w.useRef(!1);return ay(()=>{m.current=!0}),w.useCallback((v,g={})=>{if(va(m.current,ty),!m.current)return;if(typeof v=="number"){s.go(v);return}let b=hu(v,JSON.parse(f),d,g.relative==="path");n==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:Ra([i,b.pathname])),Cd(typeof v=="string"?v:gl(v),s.createHref(b),Ed(s),"reject"),(g.replace?s.replace:s.push)(b,g.state,g)},[i,s,f,d,n])}w.createContext(null);function lb(){let{matches:n}=w.useContext(ka),i=n[n.length-1];return(i==null?void 0:i.params)??{}}function Rs(n,{relative:i}={}){let{matches:s}=w.useContext(ka),{pathname:u}=Oa(),d=JSON.stringify(Ad(s));return w.useMemo(()=>hu(n,JSON.parse(d),u,i==="path"),[n,d,u,i])}function ib(n,i){return ny(n,i)}function ny(n,i,s){var L;nt(wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=w.useContext(ea),{matches:d}=w.useContext(ka),f=d[d.length-1],m=f?f.params:{},y=f?f.pathname:"/",v=f?f.pathnameBase:"/",g=f&&f.route;{let B=g&&g.path||"";iy(y,!g||B.endsWith("*")||B.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${y}" (under <Route path="${B}">) 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="${B}"> to <Route path="${B==="/"?"*":`${B}/*`}">.`)}let b=Oa(),_;if(i){let B=typeof i=="string"?gi(i):i;nt(v==="/"||((L=B.pathname)==null?void 0:L.startsWith(v)),`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 "${v}" but pathname "${B.pathname}" was given in the \`location\` prop.`),_=B}else _=b;let D=_.pathname||"/",Q=D;if(v!=="/"){let B=v.replace(/^\//,"").split("/");Q="/"+D.replace(/^\//,"").split("/").slice(B.length).join("/")}let T=s&&s.state.matches.length?s.state.matches.map(B=>Object.assign(B,{route:s.manifest[B.route.id]||B.route})):Yx(n,{pathname:Q});va(g||T!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),va(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.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 V=ob(T&&T.map(B=>Object.assign({},B,{params:Object.assign({},m,B.params),pathname:Ra([v,u.encodeLocation?u.encodeLocation(B.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?v:Ra([v,u.encodeLocation?u.encodeLocation(B.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:B.pathnameBase])})),d,s);return i&&V?w.createElement(Cs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,..._},navigationType:"POP"}},V):V}function sb(){let n=pb(),i=Y0(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.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:",n),m=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:f},"ErrorBoundary")," or"," ",w.createElement("code",{style:f},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},i),s?w.createElement("pre",{style:d},s):null,m)}var rb=w.createElement(sb,null),ly=class extends w.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,i){return i.location!==n.location||i.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:i.error,location:i.location,revalidation:n.revalidation||i.revalidation}}componentDidCatch(n,i){this.props.onError?this.props.onError(n,i):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=tb(n.digest);s&&(n=s)}let i=n!==void 0?w.createElement(ka.Provider,{value:this.props.routeContext},w.createElement(Rd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?w.createElement(ub,{error:n},i):i}};ly.contextType=Wx;var Vo=new WeakMap;function ub({children:n,error:i}){let{basename:s,navigator:u}=w.useContext(ea);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let d=eb(i.digest);if(d){let f=Vo.get(i);if(f)throw f;let m=Ix(d.location,s),y=m.absoluteURL||m.to;if(Cd(d.location,y,Ed(u),"allow-explicit"),K0(y))throw new Error("Invalid redirect location");if(Jx&&!Vo.get(i))if(m.isExternal||d.reloadDocument)window.location.href=y;else{const v=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw Vo.set(i,v),v}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${y}`})}}return n}function cb({routeContext:n,match:i,children:s}){let u=w.useContext(bi);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),w.createElement(ka.Provider,{value:n},s)}function ob(n,i=[],s){let u=s==null?void 0:s.state;if(n==null){if(!u)return null;if(u.errors)n=u.matches;else if(i.length===0&&!u.initialized&&u.matches.length>0)n=u.matches;else return null}let d=n,f=u==null?void 0:u.errors;if(f!=null){let b=d.findIndex(_=>_.route.id&&(f==null?void 0:f[_.route.id])!==void 0);nt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let m=!1,y=-1;if(s&&u){m=u.renderFallback;for(let b=0;b<d.length;b++){let _=d[b];if((_.route.HydrateFallback||_.route.hydrateFallbackElement)&&(y=b),_.route.id){let{loaderData:D,errors:Q}=u,T=_.route.loader&&!D.hasOwnProperty(_.route.id)&&(!Q||Q[_.route.id]===void 0);if(_.route.lazy||T){s.isStatic&&(m=!0),y>=0?d=d.slice(0,y+1):d=[d[0]];break}}}}let v=s==null?void 0:s.onError,g=u&&v?(b,_)=>{var D,Q;v(b,{location:u.location,params:((Q=(D=u.matches)==null?void 0:D[0])==null?void 0:Q.params)??{},pattern:Z0(u.matches),errorInfo:_})}:void 0;return d.reduceRight((b,_,D)=>{let Q,T=!1,V=null,L=null;u&&(Q=f&&_.route.id?f[_.route.id]:void 0,V=_.route.errorElement||rb,m&&(y<0&&D===0?(iy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,L=null):y===D&&(T=!0,L=_.route.hydrateFallbackElement||null)));let B=i.concat(d.slice(0,D+1)),Z=()=>{let W;return Q?W=V:T?W=L:_.route.Component?W=w.createElement(_.route.Component,null):_.route.element?W=_.route.element:W=b,w.createElement(cb,{match:_,routeContext:{outlet:b,matches:B,isDataRoute:u!=null},children:W})};return u&&(_.route.ErrorBoundary||_.route.errorElement||D===0)?w.createElement(ly,{location:u.location,revalidation:u.revalidation,component:V,error:Q,children:Z(),routeContext:{outlet:null,matches:B,isDataRoute:!0},onError:g}):Z()},null)}function kd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function db(n){let i=w.useContext(bi);return nt(i,kd(n)),i}function fb(n){let i=w.useContext(mu);return nt(i,kd(n)),i}function hb(n){let i=w.useContext(ka);return nt(i,kd(n)),i}function Od(n){let i=hb(n),s=i.matches[i.matches.length-1];return nt(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function mb(){return Od("useRouteId")}function pb(){var u;let n=w.useContext(Rd),i=fb("useRouteError"),s=Od("useRouteError");return n!==void 0?n:(u=i.errors)==null?void 0:u[s]}function xb(){let{router:n}=db("useNavigate"),i=Od("useNavigate"),s=w.useRef(!1);return ay(()=>{s.current=!0}),w.useCallback(async(d,f={})=>{va(s.current,ty),s.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:i,...f}))},[n,i])}var nx={};function iy(n,i,s){!i&&!nx[n]&&(nx[n]=!0,va(!1,s))}w.memo(yb);function yb({routes:n,manifest:i,future:s,state:u,isStatic:d,onError:f}){return ny(n,void 0,{manifest:i,state:u,isStatic:d,onError:f})}function sy({to:n,replace:i,state:s,relative:u}){nt(wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:f}=w.useContext(ea);va(!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}=w.useContext(ka),{pathname:y}=Oa(),v=Td(),g=hu(n,Ad(m),y,u==="path");Cd(typeof n=="string"?n:gl(n),f.createHref(g),Ed(f),"reject");let b=JSON.stringify(g);return w.useEffect(()=>{v(JSON.parse(b),{replace:i,state:s,relative:u})},[v,b,u,i,s]),null}function vl(n){nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function vb({basename:n="/",children:i=null,location:s,navigationType:u="POP",navigator:d,static:f=!1,useTransitions:m}){nt(!wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let y=n.replace(/^\/*/,"/"),v=w.useMemo(()=>({basename:y,navigator:d,static:f,useTransitions:m,future:{}}),[y,d,f,m]);typeof s=="string"&&(s=gi(s));let{pathname:g="/",search:b="",hash:_="",state:D=null,key:Q="default",mask:T}=s,V=w.useMemo(()=>{let L=pn(g,y);return L==null?null:{location:{pathname:L,search:b,hash:_,state:D,key:Q,mask:T},navigationType:u}},[y,g,b,_,D,Q,u,T]);return va(V!=null,`<Router basename="${y}"> is not able to match the URL "${g}${b}${_}" because it does not start with the basename, so the <Router> won't render anything.`),V==null?null:w.createElement(ea.Provider,{value:v},w.createElement(Cs.Provider,{children:i,value:V}))}function gb({children:n,location:i}){return ib(ud(n),i)}function ud(n,i=[]){let s=[];return w.Children.forEach(n,(u,d)=>{if(!w.isValidElement(u))return;let f=[...i,d];if(u.type===w.Fragment){s.push.apply(s,ud(u.props.children,f));return}nt(u.type===vl,`[${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>`),nt(!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=ud(u.props.children,f)),s.push(m)}),s}var Jr="get",Ir="application/x-www-form-urlencoded";function pu(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function bb(n){return pu(n)&&n.tagName.toLowerCase()==="button"}function wb(n){return pu(n)&&n.tagName.toLowerCase()==="form"}function Sb(n){return pu(n)&&n.tagName.toLowerCase()==="input"}function jb(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Nb(n,i){return n.button===0&&(!i||i==="_self")&&!jb(n)}function cd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((i,s)=>{let u=n[s];return i.concat(Array.isArray(u)?u.map(d=>[s,d]):[[s,u]])},[]))}function _b(n,i){let s=cd(n);return i&&i.forEach((u,d)=>{s.has(d)||i.getAll(d).forEach(f=>{s.append(d,f)})}),s}var Vr=null;function Ab(){if(Vr===null)try{new FormData(document.createElement("form"),0),Vr=!1}catch{Vr=!0}return Vr}var Eb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yo(n){return n!=null&&!Eb.has(n)?(va(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ir}"`),null):n}function Cb(n,i){let s,u,d,f,m;if(wb(n)){let y=n.getAttribute("action");u=y?pn(y,i):null,s=n.getAttribute("method")||Jr,d=Yo(n.getAttribute("enctype"))||Ir,f=new FormData(n)}else if(bb(n)||Sb(n)&&(n.type==="submit"||n.type==="image")){let y=n.form;if(y==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let v=n.getAttribute("formaction")||y.getAttribute("action");if(u=v?pn(v,i):null,s=n.getAttribute("formmethod")||y.getAttribute("method")||Jr,d=Yo(n.getAttribute("formenctype"))||Yo(y.getAttribute("enctype"))||Ir,f=new FormData(y,n),!Ab()){let{name:g,type:b,value:_}=n;if(b==="image"){let D=g?`${g}.`:"";f.append(`${D}x`,"0"),f.append(`${D}y`,"0")}else g&&f.append(g,_)}}else{if(pu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Jr,u=null,d=Ir,m=n}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 Md(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function ry(n,i,s,u){let d=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:i&&pn(d.pathname,i)==="/"?d.pathname=`${xi(i)}/_root.${u}`:d.pathname=`${xi(d.pathname)}.${u}`,d}async function Rb(n,i){if(n.id in i)return i[n.id];try{let s=await import(n.module);return i[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Tb(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function kb(n,i,s){let u=await Promise.all(n.map(async d=>{let f=i.routes[d.route.id];if(f){let m=await Rb(f,s);return m.links?m.links():[]}return[]}));return Lb(u.flat(1).filter(Tb).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function lx(n,i,s,u,d,f){let m=(v,g)=>s[g]?v.route.id!==s[g].route.id:!0,y=(v,g)=>{var b;return s[g].pathname!==v.pathname||((b=s[g].route.path)==null?void 0:b.endsWith("*"))&&s[g].params["*"]!==v.params["*"]};return f==="assets"?i.filter((v,g)=>m(v,g)||y(v,g)):f==="data"?i.filter((v,g)=>{var _;let b=u.routes[v.route.id];if(!b||!b.hasLoader)return!1;if(m(v,g)||y(v,g))return!0;if(v.route.shouldRevalidate){let D=v.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((_=s[0])==null?void 0:_.params)||{},nextUrl:new URL(n,window.origin),nextParams:v.params,defaultShouldRevalidate:!0});if(typeof D=="boolean")return D}return!0}):[]}function Ob(n,i,{includeHydrateFallback:s}={}){return Mb(n.map(u=>{let d=i.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 Mb(n){return[...new Set(n)]}function Db(n){let i={},s=Object.keys(n).sort();for(let u of s)i[u]=n[u];return i}function Lb(n,i){let s=new Set;return new Set(i),n.reduce((u,d)=>{let f=JSON.stringify(Db(d));return s.has(f)||(s.add(f),u.push({key:f,link:d})),u},[])}function Dd(){let n=w.useContext(bi);return Md(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Ub(){let n=w.useContext(mu);return Md(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Ld=w.createContext(void 0);Ld.displayName="FrameworkContext";function xu(){let n=w.useContext(Ld);return Md(n,"You must render this element inside a <HydratedRouter> element"),n}function zb(n,i){let s=w.useContext(Ld),[u,d]=w.useState(!1),[f,m]=w.useState(!1),{onFocus:y,onBlur:v,onMouseEnter:g,onMouseLeave:b,onTouchStart:_}=i,D=w.useRef(null);w.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let V=B=>{B.forEach(Z=>{m(Z.isIntersecting)})},L=new IntersectionObserver(V,{threshold:.5});return D.current&&L.observe(D.current),()=>{L.disconnect()}}},[n]),w.useEffect(()=>{if(u){let V=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(V)}}},[u]);let Q=()=>{d(!0)},T=()=>{d(!1),m(!1)};return s?n!=="intent"?[f,D,{}]:[f,D,{onFocus:xs(y,Q),onBlur:xs(v,T),onMouseEnter:xs(g,Q),onMouseLeave:xs(b,T),onTouchStart:xs(_,Q)}]:[!1,D,{}]}function xs(n,i){return s=>{n&&n(s),s.defaultPrevented||i(s)}}function Bb({page:n,...i}){let s=J0(),{nonce:u}=xu(),{router:d}=Dd(),f=w.useMemo(()=>Yx(d.routes,n,d.basename),[d.routes,n,d.basename]);return f?(i.nonce==null&&u&&(i={...i,nonce:u}),s?w.createElement(Hb,{page:n,matches:f,...i}):w.createElement($b,{page:n,matches:f,...i})):null}function qb(n){let{manifest:i,routeModules:s}=xu(),[u,d]=w.useState([]);return w.useEffect(()=>{let f=!1;return kb(n,i,s).then(m=>{f||d(m)}),()=>{f=!0}},[n,i,s]),u}function Hb({page:n,matches:i,...s}){let u=Oa(),{future:d}=xu(),{basename:f}=Dd(),m=w.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let y=ry(n,f,d.v8_trailingSlashAwareDataRequests,"rsc"),v=!1,g=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?v=!0:g.push(b.route.id);return v&&g.length>0&&y.searchParams.set("_routes",g.join(",")),[y.pathname+y.search]},[f,d.v8_trailingSlashAwareDataRequests,n,u,i]);return w.createElement(w.Fragment,null,m.map(y=>w.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...s})))}function $b({page:n,matches:i,...s}){let u=Oa(),{future:d,manifest:f,routeModules:m}=xu(),{basename:y}=Dd(),{loaderData:v,matches:g}=Ub(),b=w.useMemo(()=>lx(n,i,g,f,u,"data"),[n,i,g,f,u]),_=w.useMemo(()=>lx(n,i,g,f,u,"assets"),[n,i,g,f,u]),D=w.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let V=new Set,L=!1;if(i.forEach(Z=>{var fe;let W=f.routes[Z.route.id];!W||!W.hasLoader||(!b.some(J=>J.route.id===Z.route.id)&&Z.route.id in v&&((fe=m[Z.route.id])!=null&&fe.shouldRevalidate)||W.hasClientLoader?L=!0:V.add(Z.route.id))}),V.size===0)return[];let B=ry(n,y,d.v8_trailingSlashAwareDataRequests,"data");return L&&V.size>0&&B.searchParams.set("_routes",i.filter(Z=>V.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[B.pathname+B.search]},[y,d.v8_trailingSlashAwareDataRequests,v,u,f,b,i,n,m]),Q=w.useMemo(()=>Ob(_,f),[_,f]),T=qb(_);return w.createElement(w.Fragment,null,D.map(V=>w.createElement("link",{key:V,rel:"prefetch",as:"fetch",href:V,...s})),Q.map(V=>w.createElement("link",{key:V,rel:"modulepreload",href:V,...s})),T.map(({key:V,link:L})=>w.createElement("link",{key:V,nonce:s.nonce,...L,crossOrigin:L.crossOrigin??s.crossOrigin})))}function Vb(...n){return i=>{n.forEach(s=>{typeof s=="function"?s(i):s!=null&&(s.current=i)})}}var Yb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yb&&(window.__reactRouterVersion="7.18.4")}catch{}function Zb({basename:n,children:i,useTransitions:s,window:u}){let d=w.useRef();d.current==null&&(d.current=b0({window:u,v5Compat:!0}));let f=d.current,[m,y]=w.useState({action:f.action,location:f.location}),v=w.useCallback(g=>{s===!1?y(g):w.startTransition(()=>y(g))},[s]);return w.useLayoutEffect(()=>f.listen(v),[f,v]),w.createElement(vb,{basename:n,children:i,location:m.location,navigationType:m.action,navigator:f,useTransitions:s})}var ga=w.forwardRef(function({onClick:i,discover:s="render",prefetch:u="none",relative:d,reloadDocument:f,replace:m,mask:y,state:v,target:g,to:b,preventScrollReset:_,viewTransition:D,defaultShouldRevalidate:Q,...T},V){let{basename:L,navigator:B,useTransitions:Z}=w.useContext(ea),W=typeof b=="string"&&_d.test(b),fe=Ix(b,L);b=fe.to;let J=ab(b,{relative:d}),ke=Oa(),I=null;if(y){let re=hu(y,[],ke.mask?ke.mask.pathname:"/",!0);L!=="/"&&(re.pathname=re.pathname==="/"?L:Ra([L,re.pathname])),I=B.createHref(re)}let[ge,Ve,vt]=zb(u,T),ft=Xb(b,{replace:m,mask:y,state:v,target:g,preventScrollReset:_,relative:d,viewTransition:D,defaultShouldRevalidate:Q,useTransitions:Z});function et(re){i&&i(re),re.defaultPrevented||ft(re)}let Tt=!(fe.isExternal||f),Fe=w.createElement("a",{...T,...vt,href:(Tt?I:void 0)||fe.absoluteURL||J,onClick:Tt?et:i,ref:Vb(V,Ve),target:g,"data-discover":!W&&s==="render"?"true":void 0});return ge&&!W?w.createElement(w.Fragment,null,Fe,w.createElement(Bb,{page:J})):Fe});ga.displayName="Link";var Fr=w.forwardRef(function({"aria-current":i="page",caseSensitive:s=!1,className:u="",end:d=!1,style:f,to:m,viewTransition:y,children:v,...g},b){let _=Rs(m,{relative:g.relative}),D=Oa(),Q=w.useContext(mu),{navigator:T,basename:V}=w.useContext(ea),L=Q!=null&&Wb(_)&&y===!0,B=T.encodeLocation?T.encodeLocation(_).pathname:_.pathname,Z=D.pathname,W=Q&&Q.navigation&&Q.navigation.location?Q.navigation.location.pathname:null;s||(Z=Z.toLowerCase(),W=W?W.toLowerCase():null,B=B.toLowerCase()),W&&V&&(W=pn(W,V)||W);const fe=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let J=Z===B||!d&&Z.startsWith(B)&&Z.charAt(fe)==="/",ke=W!=null&&(W===B||!d&&W.startsWith(B)&&W.charAt(B.length)==="/"),I={isActive:J,isPending:ke,isTransitioning:L},ge=J?i:void 0,Ve;typeof u=="function"?Ve=u(I):Ve=[u,J?"active":null,ke?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let vt=typeof f=="function"?f(I):f;return w.createElement(ga,{...g,"aria-current":ge,className:Ve,ref:b,style:vt,to:m,viewTransition:y},typeof v=="function"?v(I):v)});Fr.displayName="NavLink";var Gb=w.forwardRef(({discover:n="render",fetcherKey:i,navigate:s,reloadDocument:u,replace:d,state:f,method:m=Jr,action:y,onSubmit:v,relative:g,preventScrollReset:b,viewTransition:_,defaultShouldRevalidate:D,...Q},T)=>{let{useTransitions:V}=w.useContext(ea),L=Ib(),B=Fb(y,{relative:g}),Z=m.toLowerCase()==="get"?"get":"post",W=typeof y=="string"&&_d.test(y),fe=J=>{if(v&&v(J),J.defaultPrevented)return;J.preventDefault();let ke=J.nativeEvent.submitter,I=(ke==null?void 0:ke.getAttribute("formmethod"))||m,ge=()=>L(ke||J.currentTarget,{fetcherKey:i,method:I,navigate:s,replace:d,state:f,relative:g,preventScrollReset:b,viewTransition:_,defaultShouldRevalidate:D});V&&s!==!1?w.startTransition(()=>ge()):ge()};return w.createElement("form",{ref:T,method:Z,action:B,onSubmit:u?v:fe,...Q,"data-discover":!W&&n==="render"?"true":void 0})});Gb.displayName="Form";function Qb(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uy(n){let i=w.useContext(bi);return nt(i,Qb(n)),i}function Xb(n,{target:i,replace:s,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:y,defaultShouldRevalidate:v,useTransitions:g}={}){let b=Td(),_=Oa(),D=Rs(n,{relative:m});return w.useCallback(Q=>{if(Nb(Q,i)){Q.preventDefault();let T=s!==void 0?s:gl(_)===gl(D),V=()=>b(n,{replace:T,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:y,defaultShouldRevalidate:v});g?w.startTransition(()=>V()):V()}},[_,b,D,s,u,d,i,n,f,m,y,v,g])}function cy(n){va(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 i=w.useRef(cd(n)),s=w.useRef(!1),u=Oa(),d=w.useMemo(()=>_b(u.search,s.current?null:i.current),[u.search]),f=Td(),m=w.useCallback((y,v)=>{const g=cd(typeof y=="function"?y(new URLSearchParams(d)):y);s.current=!0,f("?"+g,v)},[f,d]);return[d,m]}var Kb=0,Jb=()=>`__${String(++Kb)}__`;function Ib(){let{router:n}=uy("useSubmit"),{basename:i}=w.useContext(ea),s=mb(),u=n.fetch,d=n.navigate;return w.useCallback(async(f,m={})=>{let{action:y,method:v,encType:g,formData:b,body:_}=Cb(f,i);if(m.navigate===!1){let D=m.fetcherKey||Jb();await u(D,s,m.action||y,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:_,formMethod:m.method||v,formEncType:m.encType||g,flushSync:m.flushSync})}else await d(m.action||y,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:_,formMethod:m.method||v,formEncType:m.encType||g,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[u,d,i,s])}function Fb(n,{relative:i}={}){let{basename:s}=w.useContext(ea),u=w.useContext(ka);nt(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...Rs(n||".",{relative:i})},m=Oa();if(n==null){f.search=m.search;let y=new URLSearchParams(f.search),v=y.getAll("index");if(v.some(b=>b==="")){y.delete("index"),v.filter(_=>_).forEach(_=>y.append("index",_));let b=y.toString();f.search=b?`?${b}`:""}}return(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:Ra([s,f.pathname])),gl(f)}function Wb(n,{relative:i}={}){let s=w.useContext(Px);nt(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=uy("useViewTransitionState"),d=Rs(n,{relative:i});if(!s.isTransitioning)return!1;let f=pn(s.currentLocation.pathname,u)||s.currentLocation.pathname,m=pn(s.nextLocation.pathname,u)||s.nextLocation.pathname;return Pr(d.pathname,m)!=null||Pr(d.pathname,f)!=null}var Le;(function(n){n.assertEqual=d=>{};function i(d){}n.assertIs=i;function s(d){throw new Error}n.assertNever=s,n.arrayToEnum=d=>{const f={};for(const m of d)f[m]=m;return f},n.getValidEnumValues=d=>{const f=n.objectKeys(d).filter(y=>typeof d[d[y]]!="number"),m={};for(const y of f)m[y]=d[y];return n.objectValues(m)},n.objectValues=d=>n.objectKeys(d).map(function(f){return d[f]}),n.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},n.find=(d,f)=>{for(const m of d)if(f(m))return m},n.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)}n.joinValues=u,n.jsonStringifyReplacer=(d,f)=>typeof f=="bigint"?f.toString():f})(Le||(Le={}));var ix;(function(n){n.mergeShapes=(i,s)=>({...i,...s})})(ix||(ix={}));const te=Le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xn=n=>{switch(typeof n){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.isNaN(n)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(n)?te.array:n===null?te.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?te.promise:typeof Map<"u"&&n instanceof Map?te.map:typeof Set<"u"&&n instanceof Set?te.set:typeof Date<"u"&&n instanceof Date?te.date:te.object;default:return te.unknown}},K=Le.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 xn extends Error{get errors(){return this.issues}constructor(i){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=i}format(i){const s=i||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 y=u,v=0;for(;v<m.path.length;){const g=m.path[v];v===m.path.length-1?(y[g]=y[g]||{_errors:[]},y[g]._errors.push(s(m))):y[g]=y[g]||{_errors:[]},y=y[g],v++}}};return d(this),u}static assert(i){if(!(i instanceof xn))throw new Error(`Not a ZodError: ${i}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(i=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(i(d))}else u.push(i(d));return{formErrors:u,fieldErrors:s}}get formErrors(){return this.flatten()}}xn.create=n=>new xn(n);const od=(n,i)=>{let s;switch(n.code){case K.invalid_type:n.received===te.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case K.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,Le.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:s=`Unrecognized key(s) in object: ${Le.joinValues(n.keys,", ")}`;break;case K.invalid_union:s="Invalid input";break;case K.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Le.joinValues(n.options)}`;break;case K.invalid_enum_value:s=`Invalid enum value. Expected ${Le.joinValues(n.options)}, received '${n.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 n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:Le.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case K.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case K.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.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 ${n.multipleOf}`;break;case K.not_finite:s="Number must be finite";break;default:s=i.defaultError,Le.assertNever(n)}return{message:s}};let Pb=od;function e1(){return Pb}const t1=n=>{const{data:i,path:s,errorMaps:u,issueData:d}=n,f=[...s,...d.path||[]],m={...d,path:f};if(d.message!==void 0)return{...d,path:f,message:d.message};let y="";const v=u.filter(g=>!!g).slice().reverse();for(const g of v)y=g(m,{data:i,defaultError:y}).message;return{...d,path:f,message:y}};function P(n,i){const s=e1(),u=t1({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===od?void 0:od].filter(d=>!!d)});n.common.issues.push(u)}class Ot{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(i,s){const u=[];for(const d of s){if(d.status==="aborted")return pe;d.status==="dirty"&&i.dirty(),u.push(d.value)}return{status:i.value,value:u}}static async mergeObjectAsync(i,s){const u=[];for(const d of s){const f=await d.key,m=await d.value;u.push({key:f,value:m})}return Ot.mergeObjectSync(i,u)}static mergeObjectSync(i,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"&&i.dirty(),m.status==="dirty"&&i.dirty(),f.value!=="__proto__"&&(typeof m.value<"u"||d.alwaysSet)&&(u[f.value]=m.value)}return{status:i.value,value:u}}}const pe=Object.freeze({status:"aborted"}),vs=n=>({status:"dirty",value:n}),ba=n=>({status:"valid",value:n}),sx=n=>n.status==="aborted",rx=n=>n.status==="dirty",yi=n=>n.status==="valid",eu=n=>typeof Promise<"u"&&n instanceof Promise;var se;(function(n){n.errToObj=i=>typeof i=="string"?{message:i}:i||{},n.toString=i=>typeof i=="string"?i:i==null?void 0:i.message})(se||(se={}));class Va{constructor(i,s,u,d){this._cachedPath=[],this.parent=i,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 ux=(n,i)=>{if(yi(i))return{success:!0,data:i.value};if(!n.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 xn(n.common.issues);return this._error=s,this._error}}};function Se(n){if(!n)return{};const{errorMap:i,invalid_type_error:s,required_error:u,description:d}=n;if(i&&(s||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return i?{errorMap:i,description:d}:{errorMap:(m,y)=>{const{message:v}=n;return m.code==="invalid_enum_value"?{message:v??y.defaultError}:typeof y.data>"u"?{message:v??u??y.defaultError}:m.code!=="invalid_type"?{message:y.defaultError}:{message:v??s??y.defaultError}},description:d}}class Re{get description(){return this._def.description}_getType(i){return Xn(i.data)}_getOrReturnCtx(i,s){return s||{common:i.parent.common,data:i.data,parsedType:Xn(i.data),schemaErrorMap:this._def.errorMap,path:i.path,parent:i.parent}}_processInputParams(i){return{status:new Ot,ctx:{common:i.parent.common,data:i.data,parsedType:Xn(i.data),schemaErrorMap:this._def.errorMap,path:i.path,parent:i.parent}}}_parseSync(i){const s=this._parse(i);if(eu(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(i){const s=this._parse(i);return Promise.resolve(s)}parse(i,s){const u=this.safeParse(i,s);if(u.success)return u.data;throw u.error}safeParse(i,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:i,parsedType:Xn(i)},d=this._parseSync({data:i,path:u.path,parent:u});return ux(u,d)}"~validate"(i){var u,d;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:i,parsedType:Xn(i)};if(!this["~standard"].async)try{const f=this._parseSync({data:i,path:[],parent:s});return yi(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:i,path:[],parent:s}).then(f=>yi(f)?{value:f.value}:{issues:s.common.issues})}async parseAsync(i,s){const u=await this.safeParseAsync(i,s);if(u.success)return u.data;throw u.error}async safeParseAsync(i,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:i,parsedType:Xn(i)},d=this._parse({data:i,path:u.path,parent:u}),f=await(eu(d)?d:Promise.resolve(d));return ux(u,f)}refine(i,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=i(d),y=()=>f.addIssue({code:K.custom,...u(d)});return typeof Promise<"u"&&m instanceof Promise?m.then(v=>v?!0:(y(),!1)):m?!0:(y(),!1)})}refinement(i,s){return this._refinement((u,d)=>i(u)?!0:(d.addIssue(typeof s=="function"?s(u,d):s),!1))}_refinement(i){return new Nl({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:i}})}superRefine(i){return this._refinement(i)}constructor(i){this.spa=this.safeParseAsync,this._def=i,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 mn.create(this,this._def)}nullable(){return _l.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $a.create(this)}promise(){return su.create(this,this._def)}or(i){return au.create([this,i],this._def)}and(i){return nu.create(this,i,this._def)}transform(i){return new Nl({...Se(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:i}})}default(i){const s=typeof i=="function"?i:()=>i;return new ru({...Se(this._def),innerType:this,defaultValue:s,typeName:xe.ZodDefault})}brand(){return new hy({typeName:xe.ZodBranded,type:this,...Se(this._def)})}catch(i){const s=typeof i=="function"?i:()=>i;return new uu({...Se(this._def),innerType:this,catchValue:s,typeName:xe.ZodCatch})}describe(i){const s=this.constructor;return new s({...this._def,description:i})}pipe(i){return zd.create(this,i)}readonly(){return cu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const a1=/^c[^\s-]{8,}$/i,n1=/^[0-9a-z]+$/,l1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,i1=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,s1=/^[a-z0-9_-]{21}$/i,r1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,u1=/^[-+]?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)?)??$/,c1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,o1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zo;const d1=/^(?:(?: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])$/,f1=/^(?:(?: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])$/,h1=/^(([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]))$/,m1=/^(([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])$/,p1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oy="((\\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])))",y1=new RegExp(`^${oy}$`);function dy(n){let i="[0-5]\\d";n.precision?i=`${i}\\.\\d{${n.precision}}`:n.precision==null&&(i=`${i}(\\.\\d+)?`);const s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${i})${s}`}function v1(n){return new RegExp(`^${dy(n)}$`)}function g1(n){let i=`${oy}T${dy(n)}`;const s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),i=`${i}(${s.join("|")})`,new RegExp(`^${i}$`)}function b1(n,i){return!!((i==="v4"||!i)&&d1.test(n)||(i==="v6"||!i)&&h1.test(n))}function w1(n,i){if(!r1.test(n))return!1;try{const[s]=n.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||i&&d.alg!==i)}catch{return!1}}function S1(n,i){return!!((i==="v4"||!i)&&f1.test(n)||(i==="v6"||!i)&&m1.test(n))}class qa extends Re{_parse(i){if(this._def.coerce&&(i.data=String(i.data)),this._getType(i)!==te.string){const f=this._getOrReturnCtx(i);return P(f,{code:K.invalid_type,expected:te.string,received:f.parsedType}),pe}const u=new Ot;let d;for(const f of this._def.checks)if(f.kind==="min")i.data.length<f.value&&(d=this._getOrReturnCtx(i,d),P(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")i.data.length>f.value&&(d=this._getOrReturnCtx(i,d),P(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=i.data.length>f.value,y=i.data.length<f.value;(m||y)&&(d=this._getOrReturnCtx(i,d),m?P(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):y&&P(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")c1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"email",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")Zo||(Zo=new RegExp(o1,"u")),Zo.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"emoji",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")i1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"uuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")s1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"nanoid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")a1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"cuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")n1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"cuid2",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")l1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"ulid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(i.data)}catch{d=this._getOrReturnCtx(i,d),P(d,{validation:"url",code:K.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"regex",code:K.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?i.data=i.data.trim():f.kind==="includes"?i.data.includes(f.value,f.position)||(d=this._getOrReturnCtx(i,d),P(d,{code:K.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?i.data=i.data.toLowerCase():f.kind==="toUpperCase"?i.data=i.data.toUpperCase():f.kind==="startsWith"?i.data.startsWith(f.value)||(d=this._getOrReturnCtx(i,d),P(d,{code:K.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?i.data.endsWith(f.value)||(d=this._getOrReturnCtx(i,d),P(d,{code:K.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?g1(f).test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{code:K.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?y1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{code:K.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?v1(f).test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{code:K.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?u1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"duration",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?b1(i.data,f.version)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"ip",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?w1(i.data,f.alg)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"jwt",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?S1(i.data,f.version)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"cidr",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?p1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"base64",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?x1.test(i.data)||(d=this._getOrReturnCtx(i,d),P(d,{validation:"base64url",code:K.invalid_string,message:f.message}),u.dirty()):Le.assertNever(f);return{status:u.value,value:i.data}}_regex(i,s,u){return this.refinement(d=>i.test(d),{validation:s,code:K.invalid_string,...se.errToObj(u)})}_addCheck(i){return new qa({...this._def,checks:[...this._def.checks,i]})}email(i){return this._addCheck({kind:"email",...se.errToObj(i)})}url(i){return this._addCheck({kind:"url",...se.errToObj(i)})}emoji(i){return this._addCheck({kind:"emoji",...se.errToObj(i)})}uuid(i){return this._addCheck({kind:"uuid",...se.errToObj(i)})}nanoid(i){return this._addCheck({kind:"nanoid",...se.errToObj(i)})}cuid(i){return this._addCheck({kind:"cuid",...se.errToObj(i)})}cuid2(i){return this._addCheck({kind:"cuid2",...se.errToObj(i)})}ulid(i){return this._addCheck({kind:"ulid",...se.errToObj(i)})}base64(i){return this._addCheck({kind:"base64",...se.errToObj(i)})}base64url(i){return this._addCheck({kind:"base64url",...se.errToObj(i)})}jwt(i){return this._addCheck({kind:"jwt",...se.errToObj(i)})}ip(i){return this._addCheck({kind:"ip",...se.errToObj(i)})}cidr(i){return this._addCheck({kind:"cidr",...se.errToObj(i)})}datetime(i){return typeof i=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:i}):this._addCheck({kind:"datetime",precision:typeof(i==null?void 0:i.precision)>"u"?null:i==null?void 0:i.precision,offset:(i==null?void 0:i.offset)??!1,local:(i==null?void 0:i.local)??!1,...se.errToObj(i==null?void 0:i.message)})}date(i){return this._addCheck({kind:"date",message:i})}time(i){return typeof i=="string"?this._addCheck({kind:"time",precision:null,message:i}):this._addCheck({kind:"time",precision:typeof(i==null?void 0:i.precision)>"u"?null:i==null?void 0:i.precision,...se.errToObj(i==null?void 0:i.message)})}duration(i){return this._addCheck({kind:"duration",...se.errToObj(i)})}regex(i,s){return this._addCheck({kind:"regex",regex:i,...se.errToObj(s)})}includes(i,s){return this._addCheck({kind:"includes",value:i,position:s==null?void 0:s.position,...se.errToObj(s==null?void 0:s.message)})}startsWith(i,s){return this._addCheck({kind:"startsWith",value:i,...se.errToObj(s)})}endsWith(i,s){return this._addCheck({kind:"endsWith",value:i,...se.errToObj(s)})}min(i,s){return this._addCheck({kind:"min",value:i,...se.errToObj(s)})}max(i,s){return this._addCheck({kind:"max",value:i,...se.errToObj(s)})}length(i,s){return this._addCheck({kind:"length",value:i,...se.errToObj(s)})}nonempty(i){return this.min(1,se.errToObj(i))}trim(){return new qa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(i=>i.kind==="datetime")}get isDate(){return!!this._def.checks.find(i=>i.kind==="date")}get isTime(){return!!this._def.checks.find(i=>i.kind==="time")}get isDuration(){return!!this._def.checks.find(i=>i.kind==="duration")}get isEmail(){return!!this._def.checks.find(i=>i.kind==="email")}get isURL(){return!!this._def.checks.find(i=>i.kind==="url")}get isEmoji(){return!!this._def.checks.find(i=>i.kind==="emoji")}get isUUID(){return!!this._def.checks.find(i=>i.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(i=>i.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(i=>i.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(i=>i.kind==="cuid2")}get isULID(){return!!this._def.checks.find(i=>i.kind==="ulid")}get isIP(){return!!this._def.checks.find(i=>i.kind==="ip")}get isCIDR(){return!!this._def.checks.find(i=>i.kind==="cidr")}get isBase64(){return!!this._def.checks.find(i=>i.kind==="base64")}get isBase64url(){return!!this._def.checks.find(i=>i.kind==="base64url")}get minLength(){let i=null;for(const s of this._def.checks)s.kind==="min"&&(i===null||s.value>i)&&(i=s.value);return i}get maxLength(){let i=null;for(const s of this._def.checks)s.kind==="max"&&(i===null||s.value<i)&&(i=s.value);return i}}qa.create=n=>new qa({checks:[],typeName:xe.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...Se(n)});function j1(n,i){const s=(n.toString().split(".")[1]||"").length,u=(i.toString().split(".")[1]||"").length,d=s>u?s:u,f=Number.parseInt(n.toFixed(d).replace(".","")),m=Number.parseInt(i.toFixed(d).replace(".",""));return f%m/10**d}class bl extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(i){if(this._def.coerce&&(i.data=Number(i.data)),this._getType(i)!==te.number){const f=this._getOrReturnCtx(i);return P(f,{code:K.invalid_type,expected:te.number,received:f.parsedType}),pe}let u;const d=new Ot;for(const f of this._def.checks)f.kind==="int"?Le.isInteger(i.data)||(u=this._getOrReturnCtx(i,u),P(u,{code:K.invalid_type,expected:"integer",received:"float",message:f.message}),d.dirty()):f.kind==="min"?(f.inclusive?i.data<f.value:i.data<=f.value)&&(u=this._getOrReturnCtx(i,u),P(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?i.data>f.value:i.data>=f.value)&&(u=this._getOrReturnCtx(i,u),P(u,{code:K.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="multipleOf"?j1(i.data,f.value)!==0&&(u=this._getOrReturnCtx(i,u),P(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):f.kind==="finite"?Number.isFinite(i.data)||(u=this._getOrReturnCtx(i,u),P(u,{code:K.not_finite,message:f.message}),d.dirty()):Le.assertNever(f);return{status:d.value,value:i.data}}gte(i,s){return this.setLimit("min",i,!0,se.toString(s))}gt(i,s){return this.setLimit("min",i,!1,se.toString(s))}lte(i,s){return this.setLimit("max",i,!0,se.toString(s))}lt(i,s){return this.setLimit("max",i,!1,se.toString(s))}setLimit(i,s,u,d){return new bl({...this._def,checks:[...this._def.checks,{kind:i,value:s,inclusive:u,message:se.toString(d)}]})}_addCheck(i){return new bl({...this._def,checks:[...this._def.checks,i]})}int(i){return this._addCheck({kind:"int",message:se.toString(i)})}positive(i){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(i)})}negative(i){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(i)})}nonpositive(i){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(i)})}nonnegative(i){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(i)})}multipleOf(i,s){return this._addCheck({kind:"multipleOf",value:i,message:se.toString(s)})}finite(i){return this._addCheck({kind:"finite",message:se.toString(i)})}safe(i){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(i)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.toString(i)})}get minValue(){let i=null;for(const s of this._def.checks)s.kind==="min"&&(i===null||s.value>i)&&(i=s.value);return i}get maxValue(){let i=null;for(const s of this._def.checks)s.kind==="max"&&(i===null||s.value<i)&&(i=s.value);return i}get isInt(){return!!this._def.checks.find(i=>i.kind==="int"||i.kind==="multipleOf"&&Le.isInteger(i.value))}get isFinite(){let i=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"&&(i===null||u.value<i)&&(i=u.value)}return Number.isFinite(s)&&Number.isFinite(i)}}bl.create=n=>new bl({checks:[],typeName:xe.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Se(n)});class wl extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(i){if(this._def.coerce)try{i.data=BigInt(i.data)}catch{return this._getInvalidInput(i)}if(this._getType(i)!==te.bigint)return this._getInvalidInput(i);let u;const d=new Ot;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?i.data<f.value:i.data<=f.value)&&(u=this._getOrReturnCtx(i,u),P(u,{code:K.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?i.data>f.value:i.data>=f.value)&&(u=this._getOrReturnCtx(i,u),P(u,{code:K.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="multipleOf"?i.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(i,u),P(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):Le.assertNever(f);return{status:d.value,value:i.data}}_getInvalidInput(i){const s=this._getOrReturnCtx(i);return P(s,{code:K.invalid_type,expected:te.bigint,received:s.parsedType}),pe}gte(i,s){return this.setLimit("min",i,!0,se.toString(s))}gt(i,s){return this.setLimit("min",i,!1,se.toString(s))}lte(i,s){return this.setLimit("max",i,!0,se.toString(s))}lt(i,s){return this.setLimit("max",i,!1,se.toString(s))}setLimit(i,s,u,d){return new wl({...this._def,checks:[...this._def.checks,{kind:i,value:s,inclusive:u,message:se.toString(d)}]})}_addCheck(i){return new wl({...this._def,checks:[...this._def.checks,i]})}positive(i){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(i)})}negative(i){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(i)})}nonpositive(i){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(i)})}nonnegative(i){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(i)})}multipleOf(i,s){return this._addCheck({kind:"multipleOf",value:i,message:se.toString(s)})}get minValue(){let i=null;for(const s of this._def.checks)s.kind==="min"&&(i===null||s.value>i)&&(i=s.value);return i}get maxValue(){let i=null;for(const s of this._def.checks)s.kind==="max"&&(i===null||s.value<i)&&(i=s.value);return i}}wl.create=n=>new wl({checks:[],typeName:xe.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...Se(n)});class tu extends Re{_parse(i){if(this._def.coerce&&(i.data=!!i.data),this._getType(i)!==te.boolean){const u=this._getOrReturnCtx(i);return P(u,{code:K.invalid_type,expected:te.boolean,received:u.parsedType}),pe}return ba(i.data)}}tu.create=n=>new tu({typeName:xe.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Se(n)});class vi extends Re{_parse(i){if(this._def.coerce&&(i.data=new Date(i.data)),this._getType(i)!==te.date){const f=this._getOrReturnCtx(i);return P(f,{code:K.invalid_type,expected:te.date,received:f.parsedType}),pe}if(Number.isNaN(i.data.getTime())){const f=this._getOrReturnCtx(i);return P(f,{code:K.invalid_date}),pe}const u=new Ot;let d;for(const f of this._def.checks)f.kind==="min"?i.data.getTime()<f.value&&(d=this._getOrReturnCtx(i,d),P(d,{code:K.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?i.data.getTime()>f.value&&(d=this._getOrReturnCtx(i,d),P(d,{code:K.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):Le.assertNever(f);return{status:u.value,value:new Date(i.data.getTime())}}_addCheck(i){return new vi({...this._def,checks:[...this._def.checks,i]})}min(i,s){return this._addCheck({kind:"min",value:i.getTime(),message:se.toString(s)})}max(i,s){return this._addCheck({kind:"max",value:i.getTime(),message:se.toString(s)})}get minDate(){let i=null;for(const s of this._def.checks)s.kind==="min"&&(i===null||s.value>i)&&(i=s.value);return i!=null?new Date(i):null}get maxDate(){let i=null;for(const s of this._def.checks)s.kind==="max"&&(i===null||s.value<i)&&(i=s.value);return i!=null?new Date(i):null}}vi.create=n=>new vi({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:xe.ZodDate,...Se(n)});class cx extends Re{_parse(i){if(this._getType(i)!==te.symbol){const u=this._getOrReturnCtx(i);return P(u,{code:K.invalid_type,expected:te.symbol,received:u.parsedType}),pe}return ba(i.data)}}cx.create=n=>new cx({typeName:xe.ZodSymbol,...Se(n)});class dd extends Re{_parse(i){if(this._getType(i)!==te.undefined){const u=this._getOrReturnCtx(i);return P(u,{code:K.invalid_type,expected:te.undefined,received:u.parsedType}),pe}return ba(i.data)}}dd.create=n=>new dd({typeName:xe.ZodUndefined,...Se(n)});class fd extends Re{_parse(i){if(this._getType(i)!==te.null){const u=this._getOrReturnCtx(i);return P(u,{code:K.invalid_type,expected:te.null,received:u.parsedType}),pe}return ba(i.data)}}fd.create=n=>new fd({typeName:xe.ZodNull,...Se(n)});class ox extends Re{constructor(){super(...arguments),this._any=!0}_parse(i){return ba(i.data)}}ox.create=n=>new ox({typeName:xe.ZodAny,...Se(n)});class hd extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(i){return ba(i.data)}}hd.create=n=>new hd({typeName:xe.ZodUnknown,...Se(n)});class In extends Re{_parse(i){const s=this._getOrReturnCtx(i);return P(s,{code:K.invalid_type,expected:te.never,received:s.parsedType}),pe}}In.create=n=>new In({typeName:xe.ZodNever,...Se(n)});class dx extends Re{_parse(i){if(this._getType(i)!==te.undefined){const u=this._getOrReturnCtx(i);return P(u,{code:K.invalid_type,expected:te.void,received:u.parsedType}),pe}return ba(i.data)}}dx.create=n=>new dx({typeName:xe.ZodVoid,...Se(n)});class $a extends Re{_parse(i){const{ctx:s,status:u}=this._processInputParams(i),d=this._def;if(s.parsedType!==te.array)return P(s,{code:K.invalid_type,expected:te.array,received:s.parsedType}),pe;if(d.exactLength!==null){const m=s.data.length>d.exactLength.value,y=s.data.length<d.exactLength.value;(m||y)&&(P(s,{code:m?K.too_big:K.too_small,minimum:y?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&&(P(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&&(P(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,y)=>d.type._parseAsync(new Va(s,m,s.path,y)))).then(m=>Ot.mergeArray(u,m));const f=[...s.data].map((m,y)=>d.type._parseSync(new Va(s,m,s.path,y)));return Ot.mergeArray(u,f)}get element(){return this._def.type}min(i,s){return new $a({...this._def,minLength:{value:i,message:se.toString(s)}})}max(i,s){return new $a({...this._def,maxLength:{value:i,message:se.toString(s)}})}length(i,s){return new $a({...this._def,exactLength:{value:i,message:se.toString(s)}})}nonempty(i){return this.min(1,i)}}$a.create=(n,i)=>new $a({type:n,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Se(i)});function mi(n){if(n instanceof yt){const i={};for(const s in n.shape){const u=n.shape[s];i[s]=mn.create(mi(u))}return new yt({...n._def,shape:()=>i})}else return n instanceof $a?new $a({...n._def,type:mi(n.element)}):n instanceof mn?mn.create(mi(n.unwrap())):n instanceof _l?_l.create(mi(n.unwrap())):n instanceof Sl?Sl.create(n.items.map(i=>mi(i))):n}class yt extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const i=this._def.shape(),s=Le.objectKeys(i);return this._cached={shape:i,keys:s},this._cached}_parse(i){if(this._getType(i)!==te.object){const g=this._getOrReturnCtx(i);return P(g,{code:K.invalid_type,expected:te.object,received:g.parsedType}),pe}const{status:u,ctx:d}=this._processInputParams(i),{shape:f,keys:m}=this._getCached(),y=[];if(!(this._def.catchall instanceof In&&this._def.unknownKeys==="strip"))for(const g in d.data)m.includes(g)||y.push(g);const v=[];for(const g of m){const b=f[g],_=d.data[g];v.push({key:{status:"valid",value:g},value:b._parse(new Va(d,_,d.path,g)),alwaysSet:g in d.data})}if(this._def.catchall instanceof In){const g=this._def.unknownKeys;if(g==="passthrough")for(const b of y)v.push({key:{status:"valid",value:b},value:{status:"valid",value:d.data[b]}});else if(g==="strict")y.length>0&&(P(d,{code:K.unrecognized_keys,keys:y}),u.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const b of y){const _=d.data[b];v.push({key:{status:"valid",value:b},value:g._parse(new Va(d,_,d.path,b)),alwaysSet:b in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const g=[];for(const b of v){const _=await b.key,D=await b.value;g.push({key:_,value:D,alwaysSet:b.alwaysSet})}return g}).then(g=>Ot.mergeObjectSync(u,g)):Ot.mergeObjectSync(u,v)}get shape(){return this._def.shape()}strict(i){return se.errToObj,new yt({...this._def,unknownKeys:"strict",...i!==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:se.errToObj(i).message??d}:{message:d}}}:{}})}strip(){return new yt({...this._def,unknownKeys:"strip"})}passthrough(){return new yt({...this._def,unknownKeys:"passthrough"})}extend(i){return new yt({...this._def,shape:()=>({...this._def.shape(),...i})})}merge(i){return new yt({unknownKeys:i._def.unknownKeys,catchall:i._def.catchall,shape:()=>({...this._def.shape(),...i._def.shape()}),typeName:xe.ZodObject})}setKey(i,s){return this.augment({[i]:s})}catchall(i){return new yt({...this._def,catchall:i})}pick(i){const s={};for(const u of Le.objectKeys(i))i[u]&&this.shape[u]&&(s[u]=this.shape[u]);return new yt({...this._def,shape:()=>s})}omit(i){const s={};for(const u of Le.objectKeys(this.shape))i[u]||(s[u]=this.shape[u]);return new yt({...this._def,shape:()=>s})}deepPartial(){return mi(this)}partial(i){const s={};for(const u of Le.objectKeys(this.shape)){const d=this.shape[u];i&&!i[u]?s[u]=d:s[u]=d.optional()}return new yt({...this._def,shape:()=>s})}required(i){const s={};for(const u of Le.objectKeys(this.shape))if(i&&!i[u])s[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof mn;)f=f._def.innerType;s[u]=f}return new yt({...this._def,shape:()=>s})}keyof(){return fy(Le.objectKeys(this.shape))}}yt.create=(n,i)=>new yt({shape:()=>n,unknownKeys:"strip",catchall:In.create(),typeName:xe.ZodObject,...Se(i)});yt.strictCreate=(n,i)=>new yt({shape:()=>n,unknownKeys:"strict",catchall:In.create(),typeName:xe.ZodObject,...Se(i)});yt.lazycreate=(n,i)=>new yt({shape:n,unknownKeys:"strip",catchall:In.create(),typeName:xe.ZodObject,...Se(i)});class au extends Re{_parse(i){const{ctx:s}=this._processInputParams(i),u=this._def.options;function d(f){for(const y of f)if(y.result.status==="valid")return y.result;for(const y of f)if(y.result.status==="dirty")return s.common.issues.push(...y.ctx.common.issues),y.result;const m=f.map(y=>new xn(y.ctx.common.issues));return P(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 v of u){const g={...s,common:{...s.common,issues:[]},parent:null},b=v._parseSync({data:s.data,path:s.path,parent:g});if(b.status==="valid")return b;b.status==="dirty"&&!f&&(f={result:b,ctx:g}),g.common.issues.length&&m.push(g.common.issues)}if(f)return s.common.issues.push(...f.ctx.common.issues),f.result;const y=m.map(v=>new xn(v));return P(s,{code:K.invalid_union,unionErrors:y}),pe}}get options(){return this._def.options}}au.create=(n,i)=>new au({options:n,typeName:xe.ZodUnion,...Se(i)});const hn=n=>n instanceof pd?hn(n.schema):n instanceof Nl?hn(n.innerType()):n instanceof iu?[n.value]:n instanceof jl?n.options:n instanceof xd?Le.objectValues(n.enum):n instanceof ru?hn(n._def.innerType):n instanceof dd?[void 0]:n instanceof fd?[null]:n instanceof mn?[void 0,...hn(n.unwrap())]:n instanceof _l?[null,...hn(n.unwrap())]:n instanceof hy||n instanceof cu?hn(n.unwrap()):n instanceof uu?hn(n._def.innerType):[];class Ud extends Re{_parse(i){const{ctx:s}=this._processInputParams(i);if(s.parsedType!==te.object)return P(s,{code:K.invalid_type,expected:te.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}):(P(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(i,s,u){const d=new Map;for(const f of s){const m=hn(f.shape[i]);if(!m.length)throw new Error(`A discriminator value for key \`${i}\` could not be extracted from all schema options`);for(const y of m){if(d.has(y))throw new Error(`Discriminator property ${String(i)} has duplicate value ${String(y)}`);d.set(y,f)}}return new Ud({typeName:xe.ZodDiscriminatedUnion,discriminator:i,options:s,optionsMap:d,...Se(u)})}}function md(n,i){const s=Xn(n),u=Xn(i);if(n===i)return{valid:!0,data:n};if(s===te.object&&u===te.object){const d=Le.objectKeys(i),f=Le.objectKeys(n).filter(y=>d.indexOf(y)!==-1),m={...n,...i};for(const y of f){const v=md(n[y],i[y]);if(!v.valid)return{valid:!1};m[y]=v.data}return{valid:!0,data:m}}else if(s===te.array&&u===te.array){if(n.length!==i.length)return{valid:!1};const d=[];for(let f=0;f<n.length;f++){const m=n[f],y=i[f],v=md(m,y);if(!v.valid)return{valid:!1};d.push(v.data)}return{valid:!0,data:d}}else return s===te.date&&u===te.date&&+n==+i?{valid:!0,data:n}:{valid:!1}}class nu extends Re{_parse(i){const{status:s,ctx:u}=this._processInputParams(i),d=(f,m)=>{if(sx(f)||sx(m))return pe;const y=md(f.value,m.value);return y.valid?((rx(f)||rx(m))&&s.dirty(),{status:s.value,value:y.data}):(P(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}))}}nu.create=(n,i,s)=>new nu({left:n,right:i,typeName:xe.ZodIntersection,...Se(s)});class Sl extends Re{_parse(i){const{status:s,ctx:u}=this._processInputParams(i);if(u.parsedType!==te.array)return P(u,{code:K.invalid_type,expected:te.array,received:u.parsedType}),pe;if(u.data.length<this._def.items.length)return P(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&&(P(u,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const f=[...u.data].map((m,y)=>{const v=this._def.items[y]||this._def.rest;return v?v._parse(new Va(u,m,u.path,y)):null}).filter(m=>!!m);return u.common.async?Promise.all(f).then(m=>Ot.mergeArray(s,m)):Ot.mergeArray(s,f)}get items(){return this._def.items}rest(i){return new Sl({...this._def,rest:i})}}Sl.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sl({items:n,typeName:xe.ZodTuple,rest:null,...Se(i)})};class lu extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(i){const{status:s,ctx:u}=this._processInputParams(i);if(u.parsedType!==te.object)return P(u,{code:K.invalid_type,expected:te.object,received:u.parsedType}),pe;const d=[],f=this._def.keyType,m=this._def.valueType;for(const y in u.data)d.push({key:f._parse(new Va(u,y,u.path,y)),value:m._parse(new Va(u,u.data[y],u.path,y)),alwaysSet:y in u.data});return u.common.async?Ot.mergeObjectAsync(s,d):Ot.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(i,s,u){return s instanceof Re?new lu({keyType:i,valueType:s,typeName:xe.ZodRecord,...Se(u)}):new lu({keyType:qa.create(),valueType:i,typeName:xe.ZodRecord,...Se(s)})}}class fx extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(i){const{status:s,ctx:u}=this._processInputParams(i);if(u.parsedType!==te.map)return P(u,{code:K.invalid_type,expected:te.map,received:u.parsedType}),pe;const d=this._def.keyType,f=this._def.valueType,m=[...u.data.entries()].map(([y,v],g)=>({key:d._parse(new Va(u,y,u.path,[g,"key"])),value:f._parse(new Va(u,v,u.path,[g,"value"]))}));if(u.common.async){const y=new Map;return Promise.resolve().then(async()=>{for(const v of m){const g=await v.key,b=await v.value;if(g.status==="aborted"||b.status==="aborted")return pe;(g.status==="dirty"||b.status==="dirty")&&s.dirty(),y.set(g.value,b.value)}return{status:s.value,value:y}})}else{const y=new Map;for(const v of m){const g=v.key,b=v.value;if(g.status==="aborted"||b.status==="aborted")return pe;(g.status==="dirty"||b.status==="dirty")&&s.dirty(),y.set(g.value,b.value)}return{status:s.value,value:y}}}}fx.create=(n,i,s)=>new fx({valueType:i,keyType:n,typeName:xe.ZodMap,...Se(s)});class Ns extends Re{_parse(i){const{status:s,ctx:u}=this._processInputParams(i);if(u.parsedType!==te.set)return P(u,{code:K.invalid_type,expected:te.set,received:u.parsedType}),pe;const d=this._def;d.minSize!==null&&u.data.size<d.minSize.value&&(P(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&&(P(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(v){const g=new Set;for(const b of v){if(b.status==="aborted")return pe;b.status==="dirty"&&s.dirty(),g.add(b.value)}return{status:s.value,value:g}}const y=[...u.data.values()].map((v,g)=>f._parse(new Va(u,v,u.path,g)));return u.common.async?Promise.all(y).then(v=>m(v)):m(y)}min(i,s){return new Ns({...this._def,minSize:{value:i,message:se.toString(s)}})}max(i,s){return new Ns({...this._def,maxSize:{value:i,message:se.toString(s)}})}size(i,s){return this.min(i,s).max(i,s)}nonempty(i){return this.min(1,i)}}Ns.create=(n,i)=>new Ns({valueType:n,minSize:null,maxSize:null,typeName:xe.ZodSet,...Se(i)});class pd extends Re{get schema(){return this._def.getter()}_parse(i){const{ctx:s}=this._processInputParams(i);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}pd.create=(n,i)=>new pd({getter:n,typeName:xe.ZodLazy,...Se(i)});class iu extends Re{_parse(i){if(i.data!==this._def.value){const s=this._getOrReturnCtx(i);return P(s,{received:s.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:i.data}}get value(){return this._def.value}}iu.create=(n,i)=>new iu({value:n,typeName:xe.ZodLiteral,...Se(i)});function fy(n,i){return new jl({values:n,typeName:xe.ZodEnum,...Se(i)})}class jl extends Re{_parse(i){if(typeof i.data!="string"){const s=this._getOrReturnCtx(i),u=this._def.values;return P(s,{expected:Le.joinValues(u),received:s.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(i.data)){const s=this._getOrReturnCtx(i),u=this._def.values;return P(s,{received:s.data,code:K.invalid_enum_value,options:u}),pe}return ba(i.data)}get options(){return this._def.values}get enum(){const i={};for(const s of this._def.values)i[s]=s;return i}get Values(){const i={};for(const s of this._def.values)i[s]=s;return i}get Enum(){const i={};for(const s of this._def.values)i[s]=s;return i}extract(i,s=this._def){return jl.create(i,{...this._def,...s})}exclude(i,s=this._def){return jl.create(this.options.filter(u=>!i.includes(u)),{...this._def,...s})}}jl.create=fy;class xd extends Re{_parse(i){const s=Le.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(i);if(u.parsedType!==te.string&&u.parsedType!==te.number){const d=Le.objectValues(s);return P(u,{expected:Le.joinValues(d),received:u.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(Le.getValidEnumValues(this._def.values))),!this._cache.has(i.data)){const d=Le.objectValues(s);return P(u,{received:u.data,code:K.invalid_enum_value,options:d}),pe}return ba(i.data)}get enum(){return this._def.values}}xd.create=(n,i)=>new xd({values:n,typeName:xe.ZodNativeEnum,...Se(i)});class su extends Re{unwrap(){return this._def.type}_parse(i){const{ctx:s}=this._processInputParams(i);if(s.parsedType!==te.promise&&s.common.async===!1)return P(s,{code:K.invalid_type,expected:te.promise,received:s.parsedType}),pe;const u=s.parsedType===te.promise?s.data:Promise.resolve(s.data);return ba(u.then(d=>this._def.type.parseAsync(d,{path:s.path,errorMap:s.common.contextualErrorMap})))}}su.create=(n,i)=>new su({type:n,typeName:xe.ZodPromise,...Se(i)});class Nl extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(i){const{status:s,ctx:u}=this._processInputParams(i),d=this._def.effect||null,f={addIssue:m=>{P(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 y=>{if(s.value==="aborted")return pe;const v=await this._def.schema._parseAsync({data:y,path:u.path,parent:u});return v.status==="aborted"?pe:v.status==="dirty"||s.value==="dirty"?vs(v.value):v});{if(s.value==="aborted")return pe;const y=this._def.schema._parseSync({data:m,path:u.path,parent:u});return y.status==="aborted"?pe:y.status==="dirty"||s.value==="dirty"?vs(y.value):y}}if(d.type==="refinement"){const m=y=>{const v=d.refinement(y,f);if(u.common.async)return Promise.resolve(v);if(v instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return y};if(u.common.async===!1){const y=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return y.status==="aborted"?pe:(y.status==="dirty"&&s.dirty(),m(y.value),{status:s.value,value:y.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(y=>y.status==="aborted"?pe:(y.status==="dirty"&&s.dirty(),m(y.value).then(()=>({status:s.value,value:y.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(!yi(m))return pe;const y=d.transform(m.value,f);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:y}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(m=>yi(m)?Promise.resolve(d.transform(m.value,f)).then(y=>({status:s.value,value:y})):pe);Le.assertNever(d)}}Nl.create=(n,i,s)=>new Nl({schema:n,typeName:xe.ZodEffects,effect:i,...Se(s)});Nl.createWithPreprocess=(n,i,s)=>new Nl({schema:i,effect:{type:"preprocess",transform:n},typeName:xe.ZodEffects,...Se(s)});class mn extends Re{_parse(i){return this._getType(i)===te.undefined?ba(void 0):this._def.innerType._parse(i)}unwrap(){return this._def.innerType}}mn.create=(n,i)=>new mn({innerType:n,typeName:xe.ZodOptional,...Se(i)});class _l extends Re{_parse(i){return this._getType(i)===te.null?ba(null):this._def.innerType._parse(i)}unwrap(){return this._def.innerType}}_l.create=(n,i)=>new _l({innerType:n,typeName:xe.ZodNullable,...Se(i)});class ru extends Re{_parse(i){const{ctx:s}=this._processInputParams(i);let u=s.data;return s.parsedType===te.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}ru.create=(n,i)=>new ru({innerType:n,typeName:xe.ZodDefault,defaultValue:typeof i.default=="function"?i.default:()=>i.default,...Se(i)});class uu extends Re{_parse(i){const{ctx:s}=this._processInputParams(i),u={...s,common:{...s.common,issues:[]}},d=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return eu(d)?d.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new xn(u.common.issues)},input:u.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new xn(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}uu.create=(n,i)=>new uu({innerType:n,typeName:xe.ZodCatch,catchValue:typeof i.catch=="function"?i.catch:()=>i.catch,...Se(i)});class hx extends Re{_parse(i){if(this._getType(i)!==te.nan){const u=this._getOrReturnCtx(i);return P(u,{code:K.invalid_type,expected:te.nan,received:u.parsedType}),pe}return{status:"valid",value:i.data}}}hx.create=n=>new hx({typeName:xe.ZodNaN,...Se(n)});class hy extends Re{_parse(i){const{ctx:s}=this._processInputParams(i),u=s.data;return this._def.type._parse({data:u,path:s.path,parent:s})}unwrap(){return this._def.type}}class zd extends Re{_parse(i){const{status:s,ctx:u}=this._processInputParams(i);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(),vs(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(i,s){return new zd({in:i,out:s,typeName:xe.ZodPipeline})}}class cu extends Re{_parse(i){const s=this._def.innerType._parse(i),u=d=>(yi(d)&&(d.value=Object.freeze(d.value)),d);return eu(s)?s.then(d=>u(d)):u(s)}unwrap(){return this._def.innerType}}cu.create=(n,i)=>new cu({innerType:n,typeName:xe.ZodReadonly,...Se(i)});var xe;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(xe||(xe={}));const p=qa.create,E=bl.create;wl.create;const $e=tu.create;vi.create;const my=hd.create;In.create;const ne=$a.create,$=yt.create,N1=au.create,py=Ud.create;nu.create;Sl.create;const _s=lu.create,Ca=iu.create,he=jl.create;su.create;mn.create;_l.create;const mx={string:(n=>qa.create({...n,coerce:!0})),number:(n=>bl.create({...n,coerce:!0})),boolean:(n=>tu.create({...n,coerce:!0})),bigint:(n=>wl.create({...n,coerce:!0})),date:(n=>vi.create({...n,coerce:!0}))},_1=pe,A1=p().regex(/^github\.com\/[^/]+\/[^/]+$/,"Expected github.com/<owner>/<repo>"),E1=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;function C1(n){const i=n.trim();return i?!!(i.startsWith("/")||i.startsWith("~")||i.startsWith(".")||/^[A-Za-z]:[\\/]/.test(i)||i.startsWith("\\\\")):!1}function Bd(n){const i=n.trim();if(!i)throw new Error("Repository is required");if(C1(i))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=E1.exec(i);if(d&&!i.includes("://")&&!i.toLowerCase().includes("github.com"))s=d[1],u=d[2];else{let m=i;/^[a-z][a-z0-9+.-]*:\/\//i.test(m)||(m.startsWith("git@")?m=m.replace(/^git@([^:]+):/,"https://$1/"):m=`https://${m}`);let y;try{y=new URL(m)}catch{throw new Error(`Unrecognized GitHub repository reference: ${n}`)}if(!/^([^.]+\.)?github\.com$/i.test(y.hostname))throw new Error(`Only github.com repositories are supported (got host ${y.hostname})`);const v=y.pathname.replace(/^\/+|\/+$/g,"").split("/");if(v.length<2||!v[0]||!v[1])throw new Error(`Unrecognized GitHub repository reference: ${n}`);s=v[0],u=v[1].replace(/\.git$/i,"")}if(!s||!u||s.includes("..")||u.includes(".."))throw new Error(`Unrecognized GitHub repository reference: ${n}`);const f=A1.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((n,i)=>{try{return Bd(n).identity}catch(s){return i.addIssue({code:K.custom,message:s.message}),_1}}),yy="repo:",R1=he(["resolved","unresolved","conflict","invalid"]),T1=$({status:R1,repository:p().optional(),sourceLabel:p().optional(),labels:ne(p()).optional(),error:p().optional()});function k1(n){return n?n.filter(i=>i.toLowerCase().startsWith(yy)):[]}const O1=100,M1=$({label:p(),repository:p()});$({mappings:ne(M1).max(O1+1)});function vy(n){const i=k1(n);if(i.length===0)return{status:"unresolved",labels:[]};if(i.length>1)return{status:"conflict",labels:[...i]};const s=i[0],u=s.slice(yy.length).trim();if(!u)return{status:"invalid",labels:[s],error:"Repository label has no value"};try{return{status:"resolved",repository:Bd(u).identity,sourceLabel:s,labels:[s]}}catch(d){return{status:"invalid",labels:[s],error:d.message}}}const Zt=he(["claude_code","cursor_local","codex_local","muse_code"]),Ta=$({maxTurns:E().positive().nullable().optional(),maxBudgetUsd:E().positive().nullable().optional()}),gy=$({plan:Ta.optional(),execute:Ta.optional(),reflect:Ta.optional()});function Wr(n){if(!(n!=null&&n.trim()))return null;try{const i=Ta.parse(JSON.parse(n));return i.maxTurns==null&&i.maxBudgetUsd==null?null:i}catch{return null}}function D1(n){return!n||n.maxTurns==null&&n.maxBudgetUsd==null?null:JSON.stringify(n)}const qd=he(["developer","reviewer","legacy"]),L1=he(["queued","running","done","failed","timed_out","cancelled"]);$({id:p().uuid(),issueId:p().uuid(),role:qd,round:E().int().min(1),agentId:p().uuid().nullable(),runtime:Zt.nullable(),model:p().nullable(),budgetJson:p().nullable(),worktreePath:p().nullable(),inputSha:p().nullable(),status:L1,sessionRef:p().nullable(),logPath:p().nullable(),exitCode:E().int().nullable(),errorJson:p().nullable(),metadataJson:p().nullable(),profileSnapshotJson:p().nullable(),processPid:E().int().nullable(),processOwner:p().nullable(),processStartedAt:p().nullable(),createdAt:p(),startedAt:p().nullable(),heartbeatAt:p().nullable(),completedAt:p().nullable(),updatedAt:p()});$({issueId:p().uuid(),role:qd,round:E().int().min(1),agentId:p().uuid().nullable(),runtime:Zt.nullable(),model:p().nullable().optional(),budgetJson:p().nullable().optional(),inputSha:p().nullable().optional(),metadataJson:p().nullable().optional(),profileSnapshotJson:p().nullable().optional()});const U1=$({worktreeWrite:$e(),publishReview:$e(),outboundMutation:$e(),resolveHumanAction:$e()}),by=$({worktreeWrite:$e().optional(),outboundMutation:$e().optional()}).strict(),yu=he(["low","medium","high"]);$({version:Ca(1),agentId:p().nullable(),role:qd,runtime:Zt.nullable(),model:p().nullable(),effort:yu.nullable().default(null),budgetJson:p().nullable(),permissionPolicy:U1,deckId:p().nullable(),purpose:p().nullable(),capturedAt:p()});const wy="auto",z1="muse-spark-1.3-contributor",B1=$({code:he(["cli_missing","runtime_auth","runtime_unknown","cursor_keychain","usage_capped","deck_offline","deck_unauthorized","workspace_missing","deck_missing","mcp_not_registered","github_cli_missing","github_auth","github_unreachable"]),message:p()}),q1=$({id:p().uuid(),name:p(),runtime:Zt,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:yu.nullable(),defaultBudgetJson:p().nullable(),purpose:p().nullable(),playbookIdsJson:p().nullable(),externalMemoryRefsJson:p().nullable(),permissionPolicyJson:p().nullable(),isBuiltin:$e(),createdAt:p(),updatedAt:p()}),Sy=q1.extend({healthy:$e(),issues:ne(B1)});$({name:p().min(1),runtime:Zt,deckId:p().uuid(),defaultModel:p().nullable().optional(),defaultEffort:yu.nullable().optional(),defaultBudget:Ta.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:by.nullable().optional()});$({name:p().min(1).optional(),runtime:Zt.optional(),deckId:p().uuid().nullable().optional(),defaultModel:p().nullable().optional(),defaultEffort:yu.nullable().optional(),defaultBudget:Ta.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:by.nullable().optional()});$({agents:ne(Sy),issueCount:E()});function px(n){return n.defaultModel??n.defaultExecuteModel??n.defaultPlanModel??null}function H1(n){const i=Wr(n.defaultBudgetJson)??Wr(n.defaultExecuteBudgetJson)??Wr(n.defaultPlanBudgetJson);return D1(i)}const $1=he(["slack_message","email","service_tool_call"]),V1=$({target:p().min(1).max(120),body:p().min(1).max(4e3)}),Y1=$({serviceName:p().min(1).max(120),toolName:p().min(1).max(120),arguments:_s(my())}),Z1=$({actionType:$1,summary:V1,toolCall:Y1}),G1=he(["pending","sent","rejected"]);$({draft:Z1,status:G1,sentAt:p().optional(),rejectedAt:p().optional(),bodyMismatch:$e().optional(),deliveryAttempts:E().int().min(0).default(0)});$({draftArtifactId:p().uuid(),sentAt:p(),toolResult:_s(my()),permalink:p().url().optional()});const Q1=$({failure_summary:p().min(1),user_feedback_excerpt:p().min(1),corrected_output_hint:p().optional()}),X1=py("op",[$({op:Ca("add_item"),section:p().min(1),text:p().min(1)}),$({op:Ca("amend_item"),section:p().min(1),anchor:p().min(1),text:p().min(1)}),$({op:Ca("remove_item"),section:p().min(1),anchor:p().min(1)}),$({op:Ca("set_triggers"),triggers:ne(p())}),$({op:Ca("rewrite_body"),text:p()})]);$({rationale:p().min(1),ops:ne(X1).min(1),evidence:Q1.optional()});const K1=he(["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"]),J1=he(["human","developer","reviewer","system"]),jy=he(["manual","linear","agent"]),I1=$({id:p().uuid(),source:jy,externalId:p().nullable(),externalLabel:p().nullable(),externalUrl:p().nullable(),title:p(),description:p().nullable(),acceptanceCriteria:p().nullable(),repo:p(),baseBranch:p(),status:K1,currentOwner:J1,currentIntent:p().nullable(),developerAgentId:p().uuid().nullable(),reviewerAgentId:p().uuid().nullable(),maxReviewRounds:E().int().min(1),currentRound:E().int().min(1),maxInfraAttempts:E().int().min(0),infraAttempts:E().int().min(0),branch:p().nullable(),baseSha:p().nullable(),headSha:p().nullable(),prNumber:E().int().nullable(),prUrl:p().nullable(),autoMerge:$e(),createdAt:p(),updatedAt:p()});$({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:E().int().min(1).default(3),maxInfraAttempts:E().int().min(0).default(3),autoMerge:$e().default(!1),source:jy.default("manual"),externalId:p().optional(),externalLabel:p().optional(),externalUrl:p().optional(),enqueue:$e().default(!0)});$({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:E().int().min(1).optional(),maxInfraAttempts:E().int().min(0).optional(),autoMerge:$e().optional()});const xx={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(xx).filter(n=>xx[n].length===0);const F1=he(["enqueued","already_queued","not_queued"]);I1.extend({created:$e(),queue:F1,priorPasses:E().int().min(0)});$({id:p(),issueId:p().nullable(),workerSessionId:p().nullable(),kind:p(),contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});const W1=he(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),P1=he(["task","infrastructure","unknown"]),ew=he(["high","medium","low"]),tw=he(["outcome_kind","session_error","spawn_log","workflow_event","recovery"]),aw=he(["exact","inferred"]),yd=$({code:W1,domain:P1,primary:$e(),confidence:ew,evidenceSource:tw,occurredAt:p().nullable(),eventCursor:E().int().nullable(),rawReason:p(),sessionId:p().nullable(),logPath:p().nullable(),eventId:p().nullable(),eventType:p().nullable(),quality:aw}),nw=he(["commit","verification_receipt","branch_pushed"]),lw=he(["sampler","salvage","session_end"]),Hd=he(["worktree","commit","verification_receipt","publish_only"]);$({kind:nw,observedSha:p().nullable(),observedAt:p(),origin:lw.nullable(),inputSha:p().nullable(),samplingPrecisionMs:E().int().nullable(),branch:p().nullable()});$({kinds:ne(Hd),retryReason:p().nullable()});const iw=he(["done","closed","migrated"]);$({id:p().uuid(),issueId:p().uuid(),workflowVersion:p(),startedAt:p(),completedAt:p().nullable(),outcome:iw.nullable()});const sw=he(["issue.created","issue.reassigned","workflow.started","worker.started","worker.completed","worker.failed","worker.deferred","worktree.ready","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","legacy.imported"]);$({id:p().uuid(),issueId:p().uuid(),workflowInstanceId:p().uuid().nullable(),workerSessionId:p().uuid().nullable(),type:sw,actorType:he(["human","developer","reviewer","system"]),actorRef:p().nullable(),stage:p(),round:E().int().nullable(),payloadJson:p().nullable(),artifactRef:p().nullable(),idempotencyKey:p().nullable(),causationEventId:p().uuid().nullable(),ts:p()});const rw=he(["product_scope_decision","policy_escalation","attempts_exhausted","final_review","deck_interaction_required","reflection_interaction_required","outbound_delivery_interaction_required"]),uw=he(["open","resolved"]);$({id:p().uuid(),issueId:p().uuid().nullable(),runId:p().uuid().nullable(),workflowInstanceId:p().uuid().nullable(),actionType:rw,reason:p(),question:p(),evidenceJson:p().nullable(),responseOptionsJson:p().nullable(),continuationPreviewJson:p().nullable(),requestId:p().nullable(),status:uw,resolutionJson:p().nullable(),resolvedBy:p().nullable(),requestedAt:p(),resolvedAt:p().nullable()});const cw=he(["blocking","non_blocking"]),ow=he(["open","resolved","recurring","superseded"]);$({id:p().uuid(),issueId:p().uuid(),fingerprint:p(),severity:cw,title:p(),rationale:p(),evidenceRef:p().nullable(),file:p().nullable(),line:E().int().nullable(),status:ow,firstRound:E().int().min(1),lastRound:E().int().min(1)});$({id:p().uuid(),issueId:p().uuid(),workerSessionId:p().uuid(),role:he(["developer","reviewer","legacy"]),runtime:p().nullable(),tokensIn:E().int().nullable(),tokensOut:E().int().nullable(),costUsd:E().nullable(),durationMs:E().int().nullable(),ts:p(),model:p().nullable().optional()});const dw=$({available:Ca(!0)}),fw=$({available:Ca(!1),until:p(),reason:p()});py("available",[dw,fw]);const $d=he(["supported_protocol","observed_event","experimental_api","unavailable"]),vu=he(["unsupported","missing","expired","unparsable","stale"]),hw=he(["five_hour","weekly"]),mw=$({windowKey:p().min(1),providerBucket:p().min(1),durationMinutes:E().int().positive().nullable(),displayLabel:p().min(1),usedValue:E().nullable(),usedUnit:p().nullable(),remainingPercent:E().min(0).max(100).nullable(),resetAt:p().nullable(),observedAt:p(),freshUntil:p().nullable(),expiresAt:p().nullable(),source:$d,unavailableReason:vu.nullable(),criticalRole:hw.nullable()}),pw=$({runtime:Zt,windows:ne(mw),unavailableReason:vu.nullable()});$({runtimes:ne(pw),generatedAt:p()});$({configured:$e(),cycleStart:p().nullable(),cycleEnd:p().nullable(),spendValue:E().nullable(),spendUnit:p().nullable(),hardLimitValue:E().nullable(),hardLimitUnit:p().nullable(),memberCount:E().nullable(),memberLimitOverrideCount:E().nullable(),usagePeriodStart:p().nullable(),usagePeriodEnd:p().nullable(),usageSpendValue:E().nullable(),usageSpendUnit:p().nullable(),source:$d,unavailableReason:vu.nullable(),observedAt:p().nullable(),generatedAt:p()});$({enabled:$e(),configured:$e(),cycleLabel:p().nullable(),cycleStart:p().nullable(),cycleEnd:p().nullable(),usageValue:E().nullable(),usageUnit:p().nullable(),remainingPercent:E().min(0).max(100).nullable(),source:$d,unavailableReason:vu.nullable(),observedAt:p().nullable(),generatedAt:p()});function Ny(n,i=Date.now()){if(n.remainingPercent===null||n.source==="unavailable"||n.unavailableReason!==null)return!1;if(n.resetAt!==null){const s=Date.parse(n.resetAt);if(!Number.isFinite(s)||s<=i)return!1}if(n.freshUntil!==null){const s=Date.parse(n.freshUntil);if(!Number.isFinite(s)||s<=i)return!1}if(n.expiresAt!==null){const s=Date.parse(n.expiresAt);if(!Number.isFinite(s)||s<=i)return!1}if(n.observedAt){const s=Date.parse(n.observedAt);if(!Number.isFinite(s)||s>i+6e4)return!1}return!0}const xw=he(["queued","admitted","removed"]),yw=$({id:p().uuid(),issueId:p().uuid(),position:E().int(),enqueuedAt:p(),state:xw,waitReason:p().nullable(),waitReasonAt:p().nullable()});yw.extend({title:p().optional(),issueStatus:p().optional()});$({issueId:p().uuid()});const vw=N1([Ca("top"),Ca("bottom"),$({before:p().uuid()}).strict(),$({after:p().uuid()}).strict()]);$({to:vw});const gw=2;$({maxActiveIssues:E().int().min(1).max(gw)});$({active:E().int().min(0),waiting:E().int().min(0),limit:E().int().min(0),maxActiveIssues:E().int().min(1),ceiling:E().int().min(0),options:ne(E().int().min(1)),overCap:$e()});const Pt=he(["exact","inferred","unavailable"]),gu=$({quality:Pt,reasons:ne(p())}),_y=he(["queue_wait","coordinator_setup","agent_process","coordinator_validation_publish","coordinator_work"]),js=$({phase:_y,startMs:E().int().nullable(),endMs:E().int().nullable(),durationMs:E().int().nullable(),quality:Pt,reasons:ne(p()),sessionId:p().nullable(),startCursor:E().int().nullable(),endCursor:E().int().nullable()}),bw=gu.extend({phase:_y,durationMs:E().int().nullable(),rawCount:E().int(),known:E().int(),total:E().int()}),Ay=$({kind:he(["admission_dependency_wait","runtime_health_preflight","unexplained_silence","human_wait"]),startMs:E().int().nullable(),endMs:E().int().nullable(),durationMs:E().int().nullable(),quality:Pt,reasons:ne(p()),category:p().nullable(),sessionId:p().nullable()}),Yt=gu.extend({value:E().nullable(),known:E().int(),total:E().int()}),Ha=gu.extend({p50:E().nullable(),p95:E().nullable(),n:E().int()}),ww=$({sessionId:p(),role:p(),runtime:p().nullable(),model:p().nullable(),status:p(),round:E().int(),publishOnly:$e(),setup:js,agentProcess:js,validationPublish:js,spawnEnvelopeMs:E().int().nullable(),spawnEnvelopeQuality:Pt,spawnEnvelopeReasons:ne(p()),failureCauses:ne(yd),reuseKinds:ne(Hd).optional(),silence:ne(Ay),silenceQuality:Pt,silenceReasons:ne(p()),tokensIn:E().int().nullable(),tokensOut:E().int().nullable(),costUsd:E().nullable(),usageDurationMs:E().int().nullable(),usageQuality:Pt,usageReasons:ne(p())}),Sw=$({kind:p().nullable(),observedSha:p().nullable(),msSinceWorkflowStart:E().int().nullable(),quality:Pt,reasons:ne(p())}),jw=$({attempts:E().int(),retries:E().int(),cold:E().int(),reused:E().int(),unknown:E().int(),publishOnly:E().int(),reuseRate:E().nullable(),preservedKinds:ne(Hd).optional(),quality:Pt,reasons:ne(p())}),Nw=$({rounds:E().int(),verdicts:E().int(),changeRequests:E().int(),changeRequestRate:E().nullable(),quality:Pt,reasons:ne(p())});$({issueId:p(),elapsed:js,rawIntervals:ne(js),unionedDurations:ne(bw),exclusiveTotalMs:E().int().nullable(),exclusiveTotalQuality:Pt,exclusiveTotalReasons:ne(p()),nested:ne(Ay),attempts:ne(ww),primaryFailure:yd.nullable(),primaryFailureQuality:Pt,primaryFailureReasons:ne(p()),consequenceCauses:ne(yd),waste:$({failedAttempts:E().int(),publishOnlyAttempts:E().int(),runtimeMs:Yt,tokensIn:Yt,tokensOut:Yt,costUsd:Yt}),firstCheckpoint:Sw,retry:jw,reviewer:Nw,humanWaitMs:E().int().nullable(),humanWaitQuality:Pt,humanWaitReasons:ne(p()),interventionCount:E().int(),coverage:$({duration:Yt,tokens:Yt,cost:Yt})});$({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:E().int().min(1).max(200).default(50),offset:E().int().min(0).default(0)});const Go=gu.extend({numerator:E().int(),denominator:E().int(),rate:E().nullable()}),Qo=$({key:p(),attempts:E().int(),successes:E().int(),successRate:E().nullable(),retries:E().int(),retryRate:E().nullable(),wallTimeMs:Ha});$({window:$({from:p(),to:p(),defaultApplied:$e()}),pagination:$({limit:E().int(),offset:E().int(),totalIssues:E().int()}),issueIds:ne(p()),phaseWallTime:_s(p(),Ha),attemptSuccess:Go,issueSuccess:Go,primaryFailures:ne($({code:p(),count:E().int(),rate:E().nullable()})),primaryFailureDenominator:E().int(),waste:$({failedAttempts:E().int(),runtimeMs:Yt,tokensIn:Yt,tokensOut:Yt,costUsd:Yt}),checkpointLatencyMs:Ha,retryReuse:Go,reviewer:$({rounds:E().int(),verdicts:E().int(),changeRequests:E().int(),changeRequestRate:E().nullable(),quality:Pt,reasons:ne(p())}),humanInterventions:$({totalActions:E().int(),issuesWithIntervention:E().int(),humanWaitMs:Ha}),byRole:ne(Qo),byRuntime:ne(Qo),byModel:ne(Qo),coverage:$({duration:Yt,tokens:Yt,cost:Yt})});const _w=100,Ey=25,Cy=5,Aw=he(["developer","reviewer","legacy"]),Ew=he(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),Cw=he(["task","infrastructure","unknown"]);$({from:p().optional(),to:p().optional(),repo:p().optional(),role:Aw.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(_w).default(Ey)});const Ry=he(["exact","inferred","unavailable"]),ha=$({sum:E().nullable(),known:E().int().min(0),total:E().int().min(0),quality:Ry,reasons:ne(p())}),Xo=$({key:p(),issues:E().int().min(0),attempts:E().int().min(0),issueSuccess:E().nullable(),issueSuccessDenominator:E().int().min(0),attemptSuccess:E().nullable(),attemptSuccessDenominator:E().int().min(0),sessionWallMs:Ha,spawnEnvelopeMs:Ha,retryRate:E().nullable(),tokensIn:ha,tokensOut:ha,costUsd:ha,durationMs:ha,failedDurationMs:ha,failedTokensIn:ha,failedTokensOut:ha,failedCostUsd:ha}),Rw=$({code:Ew,domain:Cw,count:E().int().min(0),share:E().nullable(),issueIds:ne(p()),issueTotal:E().int().min(0)}),Tw=$({id:p(),title:p(),status:p(),repo:p(),attempts:E().int().min(0),updatedAt:p()}),kw=$({window:$({from:p(),to:p()}),filters:$({repo:p().nullable(),role:p().nullable(),runtime:p().nullable(),model:p().nullable(),status:ne(p())}),summary:$({issues:E().int().min(0),closedIssues:E().int().min(0),issueSuccess:E().nullable(),attempts:E().int().min(0),terminalAttempts:E().int().min(0),attemptSuccess:E().nullable(),retryRate:E().nullable(),retryExtraAttempts:E().int().min(0),reuseRate:E().nullable(),reuseDenominator:E().int().min(0),humanWaitMs:E().int().min(0),humanWaitQuality:Ry,interventions:E().int().min(0),avgReviewerRounds:E().nullable(),reviewedIssues:E().int().min(0),changeRequestRate:E().nullable(),sessionWallMs:Ha,spawnEnvelopeMs:Ha,checkpointMs:Ha,phaseWallMs:ne($({phase:p(),stat:Ha})),failedDurationMs:ha,failedTokensIn:ha,failedTokensOut:ha,failedCostUsd:ha}),byRole:ne(Xo),byRuntime:ne(Xo),byModel:ne(Xo),failures:ne(Rw),issues:ne(Tw),pagination:$({page:E().int().min(1),limit:E().int().min(1),total:E().int().min(0),totalPages:E().int().min(0)}),meta:$({generatedAt:p(),partial:$e(),partialReasons:ne(p())})});function Ty(n){const i=new URLSearchParams;for(const[s,u]of Object.entries(n)){if(u==null)continue;const d=String(u).trim();d&&(s==="page"&&d==="1"||s==="limit"&&d===String(Ey)||i.set(s,d))}return i.sort(),i.toString()}function Qn(n,i){return n.sum===null||n.known===0?"Unavailable":n.known<n.total?`${i(n.sum)} (${n.known}/${n.total} known)`:i(n.sum)}function ky(n){return n<Cy?`n=${n} (sparse)`:`n=${n}`}function vd(n){return n<Cy}function yx(n,i){if(n.n===0||n.p50===null&&n.p95===null)return"Unavailable";const s=u=>u===null?"–":i(u);return`P50 ${s(n.p50)} · P95 ${s(n.p95)} (${ky(n.n)})`}function gs(n){return`$${n.toFixed(2)}`}function Ge(n){return n.toLocaleString("en-US")}function Ow(n){if(!Number.isFinite(n))return Ge(n);const i=Math.abs(n);if(i<1e3)return Ge(n);const s=u=>u>=100?String(Math.round(u)):u.toFixed(1).replace(/\.0$/,"");return i<1e6?`${s(n/1e3)}K`:`${s(n/1e6)}M`}function Vt(n){if(n<1e3)return`${Math.round(n)} ms`;const i=n/1e3;if(i<60)return`${i.toFixed(1)} s`;const s=Math.floor(i/60),u=Math.round(i%60);return s<60?`${s}m ${u}s`:`${Math.floor(s/60)}h ${s%60}m`}function bu(n){return n===null||!Number.isFinite(n)?"Unavailable":`${(n*100).toFixed(1)}%`}const Mw=he(["queued","plan_pending","plan_approved","running","review","done","failed","cancelled"]),Oy=he(["code","communication","email","research","content","other"]),Dw=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","reflect_status","linear_sync","send_receipt","result_qa"]),wu=he(["plan","execute","reflect","qa"]),My=he(["retry","approve"]);$({patchId:p(),playbookId:p().optional(),playbookTitle:p().optional(),rationale:p().optional(),status:Ca("proposed"),trigger:My,dashboardUrl:p().optional()});$({status:he(["pending","completed","failed","skipped"]),trigger:My,error:p().optional()});const Lw=$({type:he(["system","human","context","thinking","assistant","tool","rate_limit","result"]),text:p(),toolName:p().optional()});$({phase:wu,runtime:Zt,entries:ne(Lw)});const Uw=$({phase:wu,runtime:Zt,totalCostUsd:E().optional(),inputTokens:E().optional(),outputTokens:E().optional(),cacheReadTokens:E().optional(),cacheWriteTokens:E().optional(),durationMs:E().optional(),model:p().optional(),numTurns:E().optional(),maxTurns:E().optional(),maxBudgetUsd:E().optional()}),zw=$({label:p(),usage:Uw,maxTurns:E().optional(),maxBudgetUsd:E().optional()});$({lines:ne(zw),total:$({totalCostUsd:E(),inputTokens:E(),outputTokens:E(),durationMs:E(),numTurns:E()})});$({phase:wu,runtime:Zt,sessionId:p()});$({phase:wu,exitCode:E(),resultText:p().optional(),isError:$e().optional(),blocker:$({summary:p().optional()}).optional()});$({path:p(),title:p(),markdown:p()});$({markdown:p(),sessionId:p().optional()});const Bw=he(["manual","linear"]);$({id:p(),title:p(),description:p().optional(),url:p().optional()});const fn=$({id:p().uuid(),source:Bw,externalId:p().nullable(),externalLabel:p().nullable(),taskCategory:Oy,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:Zt.nullable(),planModel:p().nullable(),executeModel:p().nullable(),status:Mw,lineageId:p().uuid().nullable(),acceptanceCriteria:p().nullable(),approvalGatesJson:p().nullable(),budgetJson:p().nullable(),createdAt:p(),updatedAt:p()});$({id:p().uuid(),runId:p().uuid(),kind:Dw,contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});$({id:p().uuid(),runId:p().uuid(),type:p(),payloadJson:p().nullable(),ts:p()});$({title:p().min(1),description:p().optional(),taskCategory:Oy.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:gy.optional()});$({runtime:Zt,deckId:p().uuid().optional(),playbookId:p().optional(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:gy.optional()});$({planMarkdown:p(),approve:$e().default(!1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),planBudget:Ta.nullable().optional(),executeBudget:Ta.nullable().optional()});$({runtime:Zt.optional(),deckId:p().uuid().optional(),playbookId:p().optional(),executeModel:p().nullable().optional(),executeBudget:Ta.nullable().optional()});$({feedback:p().min(1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),executeBudget:Ta.nullable().optional()});$({outboundBody:p().min(1).max(4e3).optional()});$({id:p(),identifier:p(),title:p(),description:p().optional(),url:p(),state:p().optional(),labels:ne(p()).optional(),teamId:p().optional(),repoResolution:T1.optional()});$({stateFilter:ne(p()),teamId:p().nullable(),assigneeMe:$e(),syncEnabled:$e()});$({host:p(),port:E().int().min(1).max(65535),envOverride:$e()});const qw=he(["UNAUTHORIZED","DECK_UNAVAILABLE"]);$({connected:$e(),apiUrl:p(),mcpUrl:p(),deckCount:E().optional(),envOverride:$e(),error:p().optional(),deckAccessError:qw.optional(),deckAccessErrorMessage:p().optional()});$({agentId:p().uuid().optional(),autoAgent:$e().optional(),planModel:p().nullable().optional()}).refine(n=>n.agentId!==void 0||n.autoAgent===!0,{message:"Provide agentId or autoAgent: true"});$({planModel:p().nullable().optional(),planBudget:Ta.nullable().optional(),feedback:p().optional(),editedMarkdown:p().optional()});const Hw=$({id:p(),label:p()});$({runtime:Zt,models:ne(Hw),source:he(["live","fallback"])});$({planReviewCount:E(),resultReviewCount:E(),maxConcurrent:E(),planningActiveRuns:ne(fn),planningQueuedRuns:ne(fn),runningRuns:ne(fn),waitingExecution:ne(fn),resultReviewRuns:ne(fn),recentDone:ne(fn),awaitingPlanReview:ne(fn),awaitingAnswerRuns:ne(fn),openQuestionCounts:_s(p(),E()),pendingSendCounts:_s(p(),E()),sentRunIds:ne(p()).optional(),autoApprovedRunIds:ne(p()),runs:ne(fn),agentDeckOnline:$e(),agents:ne(Sy),agentIssueCount:E()});const Dy=new Map,Ko=new Map;function gd(n){return Dy.get(n)??null}function $w(n,i){i.models.length!==0&&Dy.set(n,i)}function Vw(n,i){const s=gd(n);if(s)return Promise.resolve(s);const u=Ko.get(n);if(u)return u;const d=i().then(f=>($w(n,f),f)).finally(()=>Ko.delete(n));return Ko.set(n,d),d}const Te="";async function lt(n){const i=await n.text();try{const s=JSON.parse(i),u=s.error??s.message;if(typeof u=="string"&&u.trim())return u.replace(/^Error:\s*/i,"")}catch{}return i}async function Yw(){const n=await fetch(`${Te}/api/intake/linear`);if(!n.ok)throw new Error(await n.text());return(await n.json()).candidates??[]}async function Zw(n){const i=await fetch(`${Te}/api/intake/linear/lookup?q=${encodeURIComponent(n)}`),s=await i.json().catch(()=>({}));if(!i.ok)throw new Error(s.error??`Lookup failed (${i.status})`);if(!s.candidate)throw new Error("Linear issue not found");return s.candidate}async function Gw(){const n=await fetch(`${Te}/api/settings/repository-mappings`);if(!n.ok)throw new Error(await lt(n));return(await n.json()).mappings??[]}async function Qw(n){const i=await fetch(`${Te}/api/settings/repository-mappings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mappings:n})});if(!i.ok)throw new Error(await lt(i));return(await i.json()).mappings??[]}async function Xw(){const n=await fetch(`${Te}/api/agents`);if(!n.ok)throw new Error("Failed to fetch agents");return n.json()}async function Kw(n){const i=await fetch(`${Te}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(await i.text());return i.json()}async function Jw(n,i){const s=await fetch(`${Te}/api/agents/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok)throw new Error(await s.text());return s.json()}async function Iw(n){const i=await fetch(`${Te}/api/agents/${n}`,{method:"DELETE"});if(!i.ok)throw new Error(await i.text())}async function Fw(n,i){return Vw(n,async()=>{const u=await fetch(`${Te}/api/runtimes/${n}/models`);if(!u.ok)throw new Error(await u.text());return u.json()})}async function Ly(){const n=await fetch(`${Te}/api/runtime-capacity`);if(!n.ok)throw new Error(await n.text());return n.json()}async function Ww(){const n=await fetch(`${Te}/api/cursor-team-billing`);if(!n.ok)throw new Error(await n.text());return n.json()}async function Pw(){const n=await fetch(`${Te}/api/cursor-individual-billing`);if(!n.ok)throw new Error(await n.text());return n.json()}async function Uy(){const n=await fetch(`${Te}/api/agent-deck/status`);if(!n.ok)throw new Error(await n.text());return n.json()}async function e2(){try{const n=await fetch(`${Te}/api/agent-deck/decks`),i=await n.json().catch(()=>null);return n.ok?{ok:!0,decks:(i==null?void 0:i.data)??[]}:{ok:!1,code:i==null?void 0:i.code,message:(i==null?void 0:i.error)??`Agent Deck error (${n.status})`}}catch(n){return{ok:!1,message:n instanceof Error?n.message:String(n)}}}async function t2(n){var u,d,f;const i=new URLSearchParams;(u=n.q)!=null&&u.trim()&&i.set("q",n.q.trim()),(d=n.status)!=null&&d.trim()&&i.set("status",n.status.trim()),(f=n.repo)!=null&&f.trim()&&i.set("repo",n.repo.trim()),n.needsAttention&&i.set("needsAttention","1"),i.set("page",String(n.page&&n.page>1?Math.floor(n.page):1)),i.sort();const s=await fetch(`${Te}/api/issues?${i.toString()}`);if(!s.ok)throw new Error(await lt(s));return s.json()}async function a2(){const n=await fetch(`${Te}/api/issues/recent-repos`);if(!n.ok)throw new Error(await lt(n));return(await n.json()).repos??[]}async function zy(n){const i=await fetch(`${Te}/api/issues/${n}`);if(!i.ok)throw new Error(await lt(i));return i.json()}async function n2(n){const i=await fetch(`${Te}/api/issues/${n}/execution-analysis`);if(!i.ok)throw new Error(await lt(i));return i.json()}async function l2(n){const i=await fetch(`${Te}/api/issues/${n}/evidence`);if(!i.ok)throw new Error(await lt(i));return i.json()}async function i2(n,i){const s=await fetch(`${Te}/api/issues/${n}/artifacts/${i}/trace`);if(!s.ok)throw new Error(await lt(s));return s.json()}async function s2(n){const i=await fetch(`${Te}/api/issues`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(await lt(i));return i.json()}async function bd(n,i){const s=await fetch(`${Te}/api/issues/${n}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(i)});if(!s.ok)throw new Error(await lt(s));return s.json()}async function By(n){const i=await fetch(`${Te}/api/issues/${n}/start`,{method:"POST"});if(!i.ok)throw new Error(await lt(i));return i.json()}async function qy(n){const i=await fetch(`${Te}/api/issues/${n}/execute`,{method:"POST"});if(!i.ok)throw new Error(await lt(i));return i.json()}async function r2(n,i="web"){const s=await fetch(`${Te}/api/issues/${n}/abort`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:i})});if(!s.ok)throw new Error(await lt(s));return s.json()}async function u2(n,i="web"){const s=await fetch(`${Te}/api/issues/${n}/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({closedBy:i})});if(!s.ok)throw new Error(await lt(s));return s.json()}async function c2(n){const i=await fetch(`${Te}/api/queue`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:n})});if(!i.ok)throw new Error(await lt(i));return i.json()}async function Hy(n){const i=await fetch(`${Te}/api/queue/${n}`,{method:"DELETE"});if(!i.ok)throw new Error(await lt(i));return i.json()}async function Yr(n,i){const s=await fetch(`${Te}/api/queue/${n}/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({to:i})});if(!s.ok)throw new Error(await lt(s));return s.json()}async function Jo(){const n=await fetch(`${Te}/api/queue`);if(!n.ok)throw new Error(await lt(n));return n.json()}async function o2(){const n=await fetch(`${Te}/api/queue/status`);if(!n.ok)throw new Error(await lt(n));return n.json()}async function d2(n){const i=await fetch(`${Te}/api/queue/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxActiveIssues:n})});if(!i.ok)throw new Error(await lt(i));return i.json()}async function f2(n,i){const s=await fetch(`${Te}/api/issues/${n}/guidance`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({markdown:i})});if(!s.ok)throw new Error(await lt(s));return s.json()}async function h2(n){const i=Ty(n),s=await fetch(`${Te}/api/execution-report${i?`?${i}`:""}`);if(!s.ok)throw new Error(await lt(s));const u=await s.json(),d=kw.safeParse(u);if(!d.success)throw new Error(`Unexpected report shape: ${d.error.message}`);return d.data}async function m2(){const n=await fetch(`${Te}/api/human-actions`);if(!n.ok)throw new Error(await lt(n));return n.json()}async function $y(n,i,s){const u=await fetch(`${Te}/api/human-actions/${n}/resolve`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:i,choice:s})});if(!u.ok)throw new Error(await lt(u));return u.json()}function p2(n){return n||wy}function x2({runtime:n,label:i,value:s,onChange:u,defaultModelId:d,disabled:f,compact:m}){const y=gd(n),[v,g]=w.useState((y==null?void 0:y.models)??[]),[b,_]=w.useState((y==null?void 0:y.source)??"fallback"),[D,Q]=w.useState(!y);w.useEffect(()=>{const L=gd(n);if(L){g(L.models),_(L.source),Q(!1);return}Q(!0),Fw(n).then(B=>{g(B.models),_(B.source)}).catch(()=>g([])).finally(()=>Q(!1))},[n]);const T=w.useMemo(()=>{var L,B;if(n==="cursor_local"){const Z=p2(d);return((L=v.find(W=>W.id===Z))==null?void 0:L.label)??"Auto (subscription pool)"}return d?((B=v.find(Z=>Z.id===d))==null?void 0:B.label)??d:"runtime default"},[n,d,v]),V=n==="cursor_local"?D?"Loading models…":`Agent default (${T})`:D?"Loading models…":`Default (${T})`;return c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:i}),c.jsxs("select",{className:"field text-sm",disabled:f||D,value:s,onChange:L=>u(L.target.value),children:[c.jsx("option",{value:"",children:V}),v.map(L=>c.jsx("option",{value:L.id,children:L.label},L.id))]}),n==="cursor_local"&&!D&&!m&&c.jsx("p",{className:"text-xs text-white/40",children:"Auto and Composer use your Cursor subscription pool. Other models draw API credits."}),b==="fallback"&&v.length>0&&!D&&n==="cursor_local"&&!m&&c.jsx("p",{className:"text-xs text-white/40",children:"Run cursor-agent login to load the full model list."})]})}function vx(n){const i={};return n.allowWorktreeWrite||(i.worktreeWrite=!1),Object.keys(i).length?i:null}function y2(n){let i={};try{n!=null&&n.trim()&&(i=JSON.parse(n))}catch{i={}}return{allowWorktreeWrite:i.worktreeWrite!==!1}}function gx({value:n,onChange:i,agentDeckOnline:s,disabled:u}){const[d,f]=w.useState([]),[m,y]=w.useState(null);w.useEffect(()=>{e2().then(b=>{b.ok?(f(b.decks),y(null)):(f([]),y(b.message))})},[]);const v=b=>i({...n,...b}),g=n.runtime==="codex_local"||n.runtime==="claude_code";return c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"font-ui-display text-base uppercase tracking-wide text-[#92E4DD]",children:"Agent"}),c.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Runtime (required)"}),c.jsxs("select",{className:"field",disabled:u,value:n.runtime,onChange:b=>{const _=b.target.value;v({runtime:_,defaultModel:_==="cursor_local"?wy:_==="muse_code"?z1:"",defaultEffort:_==="cursor_local"||_==="muse_code"?"":n.defaultEffort})},children:[c.jsx("option",{value:"claude_code",children:"Claude Code (claude -p)"}),c.jsx("option",{value:"cursor_local",children:"Cursor local (cursor-agent -p)"}),c.jsx("option",{value:"codex_local",children:"Codex local (codex exec)"}),c.jsx("option",{value:"muse_code",children:"Muse Code (muse exec) — developer only, trial"})]}),c.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Agent Deck (required)"}),c.jsxs("select",{className:"field",disabled:u||!s||!!m,value:n.deckId,onChange:b=>v({deckId:b.target.value}),required:!0,children:[c.jsx("option",{value:"",disabled:!!n.deckId,children:s?m?"Agent Deck error — see below":"Select a deck…":"Agent Deck offline"}),d.map(b=>c.jsxs("option",{value:b.id,children:["◆ ",b.name]},b.id))]}),s&&m&&c.jsx("p",{className:"text-xs text-amber-300/90",children:m}),c.jsxs("div",{className:"pt-2 mt-2 border-t border-white/10 space-y-2",children:[c.jsx("div",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:"Issue-centric session defaults"}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Purpose (optional)"}),c.jsx("input",{className:"field text-sm",placeholder:"e.g. backend refactors on the payments service",disabled:u,value:n.purpose,onChange:b=>v({purpose:b.target.value})})]}),c.jsxs("div",{className:`grid gap-2 ${g?"grid-cols-2":"grid-cols-1"}`,children:[c.jsx(x2,{runtime:n.runtime,label:"Default model",value:n.defaultModel,onChange:b=>v({defaultModel:b}),disabled:u,compact:!0}),g&&c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Reasoning effort"}),c.jsxs("select",{className:"field text-sm",disabled:u,value:n.defaultEffort,onChange:b=>v({defaultEffort:b.target.value}),children:[c.jsx("option",{value:"",children:"Runtime default"}),c.jsx("option",{value:"low",children:"Low"}),c.jsx("option",{value:"medium",children:"Medium"}),c.jsx("option",{value:"high",children:"High"})]})]})]}),n.runtime==="muse_code"&&c.jsx("p",{className:"text-xs text-white/40",children:"Developer role only — keep a Claude or Codex agent as the reviewer. Contributor-tier content may be used for product improvement; use it on non-sensitive tickets."}),n.runtime==="cursor_local"&&c.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]`)."}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max turns"}),c.jsx("input",{className:"field text-sm",type:"number",min:1,placeholder:"none",disabled:u,value:n.defaultBudget.maxTurns,onChange:b=>v({defaultBudget:{...n.defaultBudget,maxTurns:b.target.value}})})]}),c.jsxs("label",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max $ / session"}),c.jsx("input",{className:"field text-sm",type:"number",min:0,step:"0.1",placeholder:"none",disabled:u,value:n.defaultBudget.maxBudgetUsd,onChange:b=>v({defaultBudget:{...n.defaultBudget,maxBudgetUsd:b.target.value}})})]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Developer capabilities"}),c.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm text-white/70",children:c.jsxs("label",{className:"flex items-center gap-1.5",children:[c.jsx("input",{type:"checkbox",disabled:u,checked:n.allowWorktreeWrite,onChange:b=>v({allowWorktreeWrite:b.target.checked})}),"Write files"]})}),c.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 ya(n){return n==="claude_code"?"Claude":n==="cursor_local"?"Cursor":n==="codex_local"?"Codex":n==="muse_code"?"Muse Code":"No agent"}function v2(){return{maxTurns:"",maxBudgetUsd:""}}function bx(n){const i=n.maxTurns.trim()?Number(n.maxTurns):null,s=n.maxBudgetUsd.trim()?Number(n.maxBudgetUsd):null;return i==null&&s==null||i!=null&&(!Number.isFinite(i)||i<=0)||s!=null&&(!Number.isFinite(s)||s<=0)?null:{maxTurns:i,maxBudgetUsd:s}}function g2(n){const i=Wr(n);return{maxTurns:(i==null?void 0:i.maxTurns)!=null?String(i.maxTurns):"",maxBudgetUsd:(i==null?void 0:i.maxBudgetUsd)!=null?String(i.maxBudgetUsd):""}}function ys({children:n,className:i="",title:s}){return c.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 ${i}`,children:n})}function Zr(n,i){const s=n.find(d=>d.runtime===i);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==="cursor_keychain");return u?{ok:!1,detail:u.message}:{ok:!0,detail:"CLI ready"}}function b2(n){const i=n.flatMap(s=>s.issues).find(s=>s.code==="github_cli_missing"||s.code==="github_auth"||s.code==="github_unreachable");return i?{ok:!1,detail:i.message}:n.length===0?{ok:!1,detail:"no agent"}:{ok:!0,detail:"gh ready"}}function hi({ok:n}){return c.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":!0})}function w2({agents:n,agentDeckOnline:i}){const[s,u]=w.useState(null);w.useEffect(()=>{Uy().then(b=>u(b.mcpUrl)).catch(()=>u(null))},[i]);const d=Zr(n,"claude_code"),f=Zr(n,"cursor_local"),m=Zr(n,"codex_local"),y=n.some(b=>b.runtime==="muse_code")?Zr(n,"muse_code"):null,v=b2(n),g=n.flatMap(b=>b.issues).find(b=>b.code==="mcp_not_registered");return c.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-1.5 text-xs text-white/45",children:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Connections"}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",title:d.detail,children:[c.jsx(hi,{ok:d.ok}),c.jsx("span",{className:d.ok?"text-white/55":"text-amber-200/90",children:"Claude"})]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",title:f.detail,children:[c.jsx(hi,{ok:f.ok}),c.jsx("span",{className:f.ok?"text-white/55":"text-amber-200/90",children:"Cursor"})]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",title:m.detail,children:[c.jsx(hi,{ok:m.ok}),c.jsx("span",{className:m.ok?"text-white/55":"text-amber-200/90",children:"Codex"})]}),y&&c.jsxs("span",{className:"inline-flex items-center gap-1.5",title:y.detail,children:[c.jsx(hi,{ok:y.ok}),c.jsx("span",{className:y.ok?"text-white/55":"text-amber-200/90",children:"Muse Code"})]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",title:v.detail,children:[c.jsx(hi,{ok:v.ok}),c.jsx("span",{className:v.ok?"text-white/55":"text-amber-200/90",children:"GitHub"})]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",title:(g==null?void 0:g.message)??(s?`MCP ${s}`:"Agent Deck optional"),children:[c.jsx(hi,{ok:i&&!g}),c.jsxs("span",{className:i&&!g?"text-[#92E4DD]/80":g?"text-amber-200/90":"text-white/35",children:["Agent Deck MCP",i?g?" (setup needed)":"":" (optional)"]})]})]})}const Vy={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"};function S2(n){return n<10?"critical":n<30?"warning":"normal"}const j2={critical:"font-bold text-red-400",warning:"text-yellow-400",normal:"font-medium"};function N2(n){if(n.unavailableReason!==null)return`${n.displayLabel}: N/A (${Vy[n.unavailableReason]})`;const i=n.resetAt?`, resets ${new Date(n.resetAt).toLocaleString()}`:"";return`${n.displayLabel}: ${Math.round(n.remainingPercent??0)}% remaining${i}`}function _2({window:n}){const i=n.unavailableReason===null&&n.remainingPercent!==null;return c.jsxs("span",{"data-testid":`capacity-window-${n.windowKey}`,"data-reason":n.unavailableReason??void 0,title:N2(n),className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 whitespace-nowrap ${i?"border-white/15 bg-white/5 text-white/70":"border-white/10 bg-transparent text-white/35"}`,children:[c.jsx("span",{className:"text-white/40",children:n.displayLabel}),i?(()=>{const s=n.remainingPercent??0,u=S2(s);return c.jsxs("span",{"data-severity":u,className:j2[u],children:[Math.round(s),"%"]})})():c.jsx("span",{children:"N/A"})]})}function A2({data:n}){return n.runtimes.length===0?null:c.jsxs("div",{"data-testid":"runtime-capacity-strip",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Runtime capacity"}),n.runtimes.map(i=>c.jsxs("span",{"data-testid":`capacity-entry-${i.runtime}`,className:"inline-flex min-w-0 flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"shrink-0 font-medium text-white/55",children:ya(i.runtime)}),i.windows.length===0?c.jsx("span",{"data-testid":`capacity-entry-${i.runtime}-na`,"data-reason":i.unavailableReason??"missing",title:`N/A (${Vy[i.unavailableReason??"missing"]})`,className:"text-white/35",children:"N/A"}):i.windows.map(s=>c.jsx(_2,{window:s},s.windowKey))]},i.runtime))]})}function E2({refreshTick:n}){const[i,s]=w.useState(null);return w.useEffect(()=>{let u=!1;return Ly().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[n]),i?c.jsx(A2,{data:i}):null}const wx={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"};function Io(n,i){return n===null||!Number.isFinite(n)?null:i?`${n} ${i}`:`${n}`}function C2(n){if(!n.cycleStart&&!n.cycleEnd)return null;const i=s=>new Date(s).toLocaleDateString();return n.cycleStart&&n.cycleEnd?`${i(n.cycleStart)} → ${i(n.cycleEnd)}`:i(n.cycleStart??n.cycleEnd)}function R2(n){if(n.memberCount===null||!Number.isFinite(n.memberCount))return null;const i=`${n.memberCount} member${n.memberCount===1?"":"s"}`;return n.memberLimitOverrideCount!==null&&Number.isFinite(n.memberLimitOverrideCount)&&n.memberLimitOverrideCount>0?`${i} · ${n.memberLimitOverrideCount} with a per-member limit override`:i}function T2({data:n}){const i=n.unavailableReason===null&&n.source!=="unavailable",s=Io(n.spendValue,n.spendUnit),u=Io(n.hardLimitValue,n.hardLimitUnit),d=Io(n.usageSpendValue,n.usageSpendUnit),f=R2(n),m=C2(n);return c.jsxs("div",{"data-testid":"cursor-team-billing","data-reason":n.unavailableReason??void 0,"data-configured":n.configured?"true":"false",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Cursor team billing"}),c.jsx("span",{className:"rounded border border-white/10 px-1.5 py-0.5 text-white/35",title:"Official Cursor Admin API — team-level billing, not individual runtime quota",children:"Admin API"}),i?c.jsxs("span",{className:"inline-flex flex-wrap items-center gap-x-3 gap-y-1 text-white/70",children:[s&&c.jsxs("span",{"data-testid":"cursor-team-spend",title:`Team spend ${s}${u?` of ${u} hard limit`:""}`,children:["Spend ",s,u&&c.jsxs("span",{className:"text-white/40",children:[" of ",u," hard limit"]})]}),!s&&u&&c.jsxs("span",{"data-testid":"cursor-team-spend",title:`Hard limit ${u}`,children:["Hard limit ",u]}),m&&c.jsxs("span",{"data-testid":"cursor-team-cycle",className:"text-white/40",children:["cycle ",m]}),f&&c.jsx("span",{"data-testid":"cursor-team-members",className:"text-white/40",title:"Team size and per-member limit overrides as reported — never summed into a team total",children:f}),d&&c.jsxs("span",{"data-testid":"cursor-team-usage",className:"text-white/40",title:"Summed trailing-window usage spend as reported",children:["trailing usage ",d]})]}):c.jsxs("span",{"data-testid":"cursor-team-billing-na",className:"text-white/35",title:`N/A (${wx[n.unavailableReason??"missing"]})`,children:["N/A (",wx[n.unavailableReason??"missing"],")",!n.configured&&c.jsx("span",{className:"ml-1 text-white/25",children:"— set CURSOR_ADMIN_API_KEY to enable"})]})]})}function k2({refreshTick:n}){const[i,s]=w.useState(null);return w.useEffect(()=>{let u=!1;return Ww().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[n]),i?c.jsx(T2,{data:i}):null}const Sx={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},Fo="AGENT_DEALER_CURSOR_INDIVIDUAL_CAPACITY";function O2(n){if(n.cycleLabel)return n.cycleLabel;if(!n.cycleStart&&!n.cycleEnd)return null;const i=s=>new Date(s).toLocaleDateString();return n.cycleStart&&n.cycleEnd?`${i(n.cycleStart)} → ${i(n.cycleEnd)}`:i(n.cycleStart??n.cycleEnd)}function M2(n){return n.cycleEnd?`resets ${new Date(n.cycleEnd).toLocaleString()}`:null}function D2({data:n}){const i=n.unavailableReason===null&&n.source!=="unavailable",s=O2(n),u=M2(n);return c.jsxs("div",{"data-testid":"cursor-individual-billing","data-reason":n.unavailableReason??void 0,"data-enabled":n.enabled?"true":"false","data-configured":n.configured?"true":"false",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Cursor individual billing"}),c.jsx("span",{"data-testid":"cursor-individual-experimental",className:"rounded border border-amber-400/30 px-1.5 py-0.5 text-amber-300/80",title:"Experimental: undocumented Cursor dashboard API via the local login — no supported contract, no support guarantee. Unset AGENT_DEALER_CURSOR_INDIVIDUAL_CAPACITY to disable.",children:"Experimental"}),i?c.jsxs("span",{className:"inline-flex flex-wrap items-center gap-x-3 gap-y-1 text-white/70",children:[n.remainingPercent!==null&&Number.isFinite(n.remainingPercent)&&c.jsxs("span",{"data-testid":"cursor-individual-remaining",title:u??"Billing-cycle remaining usage as reported",children:[Math.round(n.remainingPercent),"% remaining"]}),n.usageValue!==null&&Number.isFinite(n.usageValue)&&c.jsxs("span",{"data-testid":"cursor-individual-usage",className:"text-white/40",children:["used ",n.usageUnit?`${n.usageValue} ${n.usageUnit}`:`${n.usageValue}`]}),s&&c.jsxs("span",{"data-testid":"cursor-individual-cycle",className:"text-white/40",children:["cycle ",s]})]}):c.jsxs("span",{"data-testid":"cursor-individual-billing-na",className:"text-white/35",title:`N/A (${Sx[n.unavailableReason??"missing"]})`,children:["N/A (",Sx[n.unavailableReason??"missing"],")",!n.enabled&&c.jsxs("span",{className:"ml-1 text-white/25",children:["— experimental opt-in off; set ",Fo,"=experimental to enable"]}),n.enabled&&!n.configured&&c.jsx("span",{className:"ml-1 text-white/25",children:"— no usable local Cursor login found"})]}),c.jsxs("span",{className:"text-white/25",title:`Undocumented dashboard source; unset ${Fo} to disable this card.`,children:["disable: unset ",Fo]})]})}function L2({refreshTick:n}){const[i,s]=w.useState(null);return w.useEffect(()=>{let u=!1;return Pw().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[n]),i?c.jsx(D2,{data:i}):null}const U2="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",z2="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";function Yy({src:n,className:i}){return c.jsx("span",{className:`inline-flex items-center justify-center rounded-lg bg-white/[0.04] ${i??"h-8 w-8"}`,children:c.jsx("img",{src:n,alt:"",className:"h-[70%] w-[70%] object-contain",draggable:!1})})}function B2({className:n="h-8 w-8"}){return c.jsx(Yy,{src:U2,className:n})}function q2({className:n="h-8 w-8"}){return c.jsx(Yy,{src:z2,className:n})}function H2({className:n="h-8 w-8"}){return c.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,"aria-hidden":!0,children:[c.jsx("rect",{width:"32",height:"32",rx:"8",fill:"white",fillOpacity:"0.06"}),c.jsx("circle",{cx:"16",cy:"13",r:"4.5",stroke:"#92E4DD",strokeWidth:"1.75"}),c.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 $2({className:n="h-8 w-8"}){return c.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,"aria-hidden":!0,children:[c.jsx("rect",{width:"32",height:"32",rx:"8",fill:"white",fillOpacity:"0.06"}),c.jsx("text",{x:"16",y:"21",textAnchor:"middle",fill:"#92E4DD",fontSize:"11",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontWeight:"600",children:"Cx"})]})}function V2({className:n="h-8 w-8"}){return c.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,"aria-hidden":!0,children:[c.jsx("rect",{width:"32",height:"32",rx:"8",fill:"white",fillOpacity:"0.06"}),c.jsx("text",{x:"16",y:"21",textAnchor:"middle",fill:"#92E4DD",fontSize:"11",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontWeight:"600",children:"Mu"})]})}function Y2({runtime:n,className:i="h-8 w-8 shrink-0"}){return n==="claude_code"?c.jsx(B2,{className:i}):n==="cursor_local"?c.jsx(q2,{className:i}):n==="codex_local"?c.jsx($2,{className:i}):n==="muse_code"?c.jsx(V2,{className:i}):c.jsx(H2,{className:i})}const Gr=()=>({runtime:"claude_code",deckId:"",purpose:"",defaultModel:"",defaultEffort:"",defaultBudget:v2(),allowWorktreeWrite:!0});function Z2({agents:n,agentDeckOnline:i,onRefresh:s}){const[u,d]=w.useState(!1),[f,m]=w.useState(""),[y,v]=w.useState(Gr()),[g,b]=w.useState(!1),[_,D]=w.useState(null),[Q,T]=w.useState(""),[V,L]=w.useState(Gr()),B=async I=>{if(I.preventDefault(),!(!f.trim()||!y.deckId)){b(!0);try{const ge={name:f.trim(),runtime:y.runtime,deckId:y.deckId,defaultModel:y.defaultModel.trim()||null,defaultEffort:y.defaultEffort||null,defaultBudget:bx(y.defaultBudget),purpose:y.purpose.trim()||null,permissionPolicy:vx(y)};await Kw(ge),m(""),v(Gr()),d(!1),s()}catch(ge){alert(String(ge))}finally{b(!1)}}},Z=I=>{D(I.id),T(I.name),L({runtime:I.runtime,deckId:I.deckId??"",purpose:I.purpose??"",defaultModel:px(I)??"",defaultEffort:I.defaultEffort??"",defaultBudget:g2(H1(I)),...y2(I.permissionPolicyJson)})},W=()=>{D(null),L(Gr())},fe=async I=>{if(!(!Q.trim()||!V.deckId)){b(!0);try{const ge={name:Q.trim(),runtime:V.runtime,deckId:V.deckId,defaultModel:V.defaultModel.trim()||null,defaultEffort:V.defaultEffort||null,defaultBudget:bx(V.defaultBudget),purpose:V.purpose.trim()||null,permissionPolicy:vx(V)};await Jw(I.id,ge),W(),s()}catch(ge){alert(String(ge))}finally{b(!1)}}},J=async I=>{if(confirm(`Delete agent "${I.name}"?`)){b(!0);try{await Iw(I.id),s()}catch(ge){alert(String(ge))}finally{b(!1)}}},ke=n.filter(I=>!I.healthy).length;return c.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 max-w-6xl mx-auto w-full",children:[c.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"heading-page",children:"Agents"}),c.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"}),c.jsxs("p",{className:"text-sm text-white/45 mt-2",children:[n.length," agent",n.length===1?"":"s",ke>0&&c.jsxs("span",{className:"text-red-400 ml-2",children:["· ",ke," need",ke===1?"s":""," attention"]})]})]}),c.jsx(w2,{agents:n,agentDeckOnline:i})]}),c.jsxs("div",{className:"mb-4 overflow-x-auto space-y-2",children:[c.jsx(E2,{}),c.jsx(k2,{}),c.jsx(L2,{})]}),c.jsx("div",{className:"space-y-3 mb-6",children:n.map(I=>{const ge=px(I);return c.jsxs("div",{className:"panel flex flex-col sm:flex-row sm:items-start gap-3 justify-between",children:[c.jsxs("div",{className:"flex gap-3 min-w-0 flex-1",children:[c.jsx(Y2,{runtime:I.runtime}),c.jsxs("div",{className:"space-y-2 min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"text-lg font-semibold text-[#E8F6F4]",children:I.name}),!I.healthy&&c.jsx(ys,{className:"bg-red-500/15 text-red-300 border-red-400/30 normal-case",children:"Needs fix"})]}),c.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[c.jsx(ys,{className:"bg-white/5 text-white/55 border-white/15 normal-case",children:ya(I.runtime)}),I.deckName?c.jsxs(ys,{className:"bg-[#92E4DD]/10 text-[#92E4DD] border-[#92E4DD]/25 normal-case",children:["◆ ",I.deckName]}):c.jsx(ys,{className:"bg-white/5 text-white/40 border-white/10 normal-case",children:"No deck"}),ge&&c.jsx(ys,{className:"bg-white/5 text-white/50 border-white/10 normal-case truncate max-w-[10rem]",title:ge,children:ge})]}),_===I.id&&c.jsxs("div",{className:"space-y-3 pt-2 border-t border-white/10",children:[c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),c.jsx("input",{className:"field text-sm",value:Q,onChange:Ve=>T(Ve.target.value)})]}),c.jsx(gx,{value:V,onChange:L,agentDeckOnline:i}),c.jsxs("div",{className:"flex gap-2 pt-1",children:[c.jsx("button",{type:"button",disabled:g||!Q.trim()||!V.deckId,onClick:()=>fe(I),className:"btn-gold text-sm px-3 py-1.5",children:"Save"}),c.jsx("button",{type:"button",onClick:W,className:"btn-ghost text-sm px-3 py-1.5",children:"Cancel"})]})]}),I.issues.length>0&&c.jsx("ul",{className:"text-sm text-red-300/90 space-y-1",children:I.issues.map((Ve,vt)=>c.jsxs("li",{children:["· ",Ve.message]},vt))})]})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[_!==I.id&&c.jsx("button",{type:"button",disabled:g,onClick:()=>Z(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Edit"}),c.jsx("button",{type:"button",disabled:g,onClick:()=>J(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Delete"})]})]},I.id)})}),u?c.jsxs("form",{onSubmit:B,className:"panel space-y-3",children:[c.jsx("h2",{className:"heading-panel",children:"New Agent"}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),c.jsx("input",{className:"field",placeholder:"e.g. Claude · Work",value:f,onChange:I=>m(I.target.value)})]}),c.jsx(gx,{value:y,onChange:v,agentDeckOnline:i}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:g||!f.trim()||!y.deckId,className:"btn-gold px-4 py-2",children:g?"Saving…":"Create agent"}),c.jsx("button",{type:"button",onClick:()=>d(!1),className:"btn-ghost px-4 py-2",children:"Cancel"})]})]}):c.jsx("button",{type:"button",onClick:()=>d(!0),className:"btn-gold px-4 py-2",children:"Add agent"})]})}function G2(n){try{return Bd(n).identity}catch{return null}}function Q2(n,i){return n!=="linear"||!i?null:i.repoResolution??vy(i.labels)}function X2(n,i){if(!i)return n;const s=i.repoResolution??vy(i.labels);return s.status==="resolved"&&s.repository?s.repository:n}function K2(n,i){var u;const s=Q2(n,i);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(n){return n.title.trim().length>0&&G2(n.repo)!=null&&n.developerAgentId.length>0&&n.reviewerAgentId.length>0}const J2=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"],I2={q:"",status:"",repo:"",needsAttention:!1};function Vd(n){return n.startsWith("?")?n.slice(1):n}function Nx(n){var s,u,d;const i=new URLSearchParams(Vd(n));return{q:((s=i.get("q"))==null?void 0:s.trim())??"",status:((u=i.get("status"))==null?void 0:u.trim())??"",repo:((d=i.get("repo"))==null?void 0:d.trim())??"",needsAttention:i.get("needsAttention")==="1"||i.get("needsAttention")==="true"}}function F2(n){const i=new URLSearchParams(Vd(n)),s=v=>{var b;const g=(b=i.get(v))==null?void 0:b.trim();return g||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),(i.get("needsAttention")==="1"||i.get("needsAttention")==="true")&&(u.needsAttention=!0);const y=Number(i.get("page"));return Number.isInteger(y)&&y>=1&&(u.page=y),u}function W2(n){var s,u,d;const i=new URLSearchParams;return(s=n.q)!=null&&s.trim()&&i.set("q",n.q.trim()),(u=n.status)!=null&&u.trim()&&i.set("status",n.status.trim()),(d=n.repo)!=null&&d.trim()&&i.set("repo",n.repo.trim()),n.needsAttention&&i.set("needsAttention","1"),n.page!==void 0&&Number.isInteger(n.page)&&n.page>1&&i.set("page",String(n.page)),i.sort(),i.toString()}function P2(n){const i={};return n.q.trim()&&(i.q=n.q.trim()),n.status.trim()&&(i.status=n.status.trim()),n.repo.trim()&&(i.repo=n.repo.trim()),n.needsAttention&&(i.needsAttention=!0),i}function eS(n,i){const s=new URLSearchParams(Vd(n));return i<=1?s.delete("page"):s.set("page",String(Math.floor(i))),s.sort(),s.toString()}function _x(n){if(n.total===0)return"No issues match these filters";const i=(n.page-1)*n.limit+1,s=Math.min(n.total,n.page*n.limit);return`Showing ${i}–${s} of ${n.total} issues`}function Ax(n){return n.totalPages<=1?"":`Page ${n.page} of ${n.totalPages}`}function Ex(n){return!!(n.q||n.status||n.repo||n.needsAttention)}const tS={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"},aS={ready:"Ready",developing:"Developing",reviewing:"Reviewing",repairing:"Repairing",final_review:"Final review",needs_human:"Needs human",done:"Done",closed:"Closed"};function Zy({status:n}){return c.jsx("span",{className:`text-xs leading-none px-2 py-1 rounded border tabular-nums ${tS[n]}`,children:aS[n]})}function Gy({value:n,onChange:i,recentRepos:s=[],id:u}){return c.jsxs("div",{className:"space-y-1",children:[s.length>0&&c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:s.includes(n)?n:"",onChange:d=>{d.target.value&&i(d.target.value)},"aria-label":"Recent repositories",children:[c.jsx("option",{value:"",children:"Recent repositories…"}),s.map(d=>c.jsx("option",{value:d,children:d},d))]}),c.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:n,onChange:d=>i(d.target.value)})]})}function nS(){return{label:"",repository:""}}function lS(n){const i=new Set;for(const s of n){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(i.has(d))return`Duplicate label "${u}"`;if(i.add(d),!s.repository.trim())return`Repository for "${u}" must not be empty`}return n.length>100?"At most 100 mappings are allowed":null}function iS({recentRepos:n=[],initialMappings:i,loadMappings:s=Gw,saveMappings:u=Qw,onClose:d}){const[f,m]=w.useState(i??[]),[y,v]=w.useState(i!==void 0),[g,b]=w.useState(null),[_,D]=w.useState(null),[Q,T]=w.useState(!1);w.useEffect(()=>{if(i!==void 0)return;let B=!0;return s().then(Z=>{B&&(m(Z),v(!0))}).catch(Z=>{B&&(b(String(Z)),v(!0))}),()=>{B=!1}},[i,s]);const V=(B,Z)=>{m(W=>W.map((fe,J)=>J===B?{...fe,...Z}:fe))},L=async()=>{b(null),D(null);const B=lS(f);if(B){b(B);return}T(!0);try{const Z=await u(f.map(W=>({label:W.label.trim(),repository:W.repository})));m(Z),D(Z.length===0?"Mappings cleared":`Saved ${Z.length} mapping${Z.length===1?"":"s"}`)}catch(Z){b(String(Z))}finally{T(!1)}};return c.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Repository mappings",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{className:"text-xs text-white/60",children:"Repository mappings"}),d&&c.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:d,children:"Close"})]}),y?f.length===0?c.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((B,Z)=>c.jsxs("div",{className:"flex gap-2 items-start","data-testid":"mapping-row",children:[c.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 ${Z+1}`,value:B.label,onChange:W=>V(Z,{label:W.target.value})}),c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx(Gy,{value:B.repository,onChange:W=>V(Z,{repository:W}),recentRepos:n})}),c.jsx("button",{type:"button",className:"shrink-0 text-xs text-white/50 hover:text-white px-1 py-1.5",onClick:()=>m(W=>W.filter((fe,J)=>J!==Z)),children:"Remove"})]},Z)):c.jsx("p",{className:"text-xs text-white/40",children:"Loading…"}),g&&c.jsx("p",{className:"text-xs text-red-300","data-testid":"mappings-error",children:g}),_&&c.jsx("p",{className:"text-xs text-teal-200/80",children:_}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-white/15 text-white/70 hover:text-white",onClick:()=>m(B=>[...B,nS()]),children:"Add mapping"}),c.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:Q||!y,onClick:()=>void L(),children:Q?"Saving…":"Save changes"})]})]})}function Qy(n){return n.issues.some(i=>i.code==="usage_capped")}function Xy(n){return[...n].sort((i,s)=>Number(s.healthy)-Number(i.healthy))}function Jn(n){var u;const i=`${n.name} · ${ya(n.runtime)}`,s=[];if(!n.healthy){const d=((u=n.issues[0])==null?void 0:u.message)??"unhealthy";s.push(`NEEDS FIX: ${d}`)}return Qy(n)&&s.push("USAGE CAPPED"),s.length>0?`${i} — ${s.join(" · ")}`:i}function ou(n){var i;return n?n.healthy?Qy(n)?"Usage capped — admission will refuse until the cap lifts":null:((i=n.issues[0])==null?void 0:i.message)??"Agent is unhealthy":null}function sS({agents:n,initialDeveloperId:i,initialReviewerId:s,busy:u,onSave:d,onCancel:f}){var L,B;const[m,y]=w.useState(i??""),[v,g]=w.useState(s??""),b=Xy(n),_=n.find(Z=>Z.id===m),D=n.find(Z=>Z.id===v),Q=ou(_),T=ou(D),V=m===(i??"")&&v===(s??"");return c.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[c.jsx("p",{className:"text-xs text-white/50",children:"Reassign agents — queue position is kept, the wait reason is rechecked, and the change is recorded on the timeline."}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:m,disabled:u,title:_?`${_.name} · ${ya(_.runtime)}${_.healthy?" · healthy":` · ${((L=_.issues[0])==null?void 0:L.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:Z=>y(Z.target.value),children:[c.jsx("option",{value:"",children:"Developer agent…"}),b.map(Z=>c.jsx("option",{value:Z.id,title:Jn(Z),children:(Z.healthy?"● ":"○ ")+Jn(Z)},Z.id))]}),Q&&c.jsx("span",{className:"text-xs text-amber-200/80 block",children:Q})]}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:v,disabled:u,title:D?`${D.name} · ${ya(D.runtime)}${D.healthy?" · healthy":` · ${((B=D.issues[0])==null?void 0:B.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:Z=>g(Z.target.value),children:[c.jsx("option",{value:"",children:"Reviewer agent…"}),b.map(Z=>Z.runtime==="muse_code"?c.jsx("option",{value:Z.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${Z.name} · ${ya(Z.runtime)} — reviewer not supported`},Z.id):c.jsx("option",{value:Z.id,title:Jn(Z),children:(Z.healthy?"● ":"○ ")+Jn(Z)},Z.id))]}),T&&c.jsx("span",{className:"text-xs text-amber-200/80 block",children:T})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:u||!m||!v||V,title:"Save via the issue PATCH contract — keeps queue position and rechecks the wait reason",onClick:()=>d(m,v),children:"Save agents"}),c.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:u,onClick:f,children:"Cancel"})]})]})}function du({className:n="w-3.5 h-3.5"}){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":!0,children:c.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 rS={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"};function uS(n){return rS[n]??n}function wd(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Ky(n){const i=wd(n.responseOptionsJson);return Array.isArray(i)?i.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function cS(n){var f;const i=[],s=wd(n.evidenceJson),u=wd(n.continuationPreviewJson);if((f=s==null?void 0:s.review)!=null&&f.verdict){const m=Array.isArray(s.review.findings)?s.review.findings.length:0;i.push(`Reviewer verdict: ${s.review.verdict}${m?` · ${m} finding(s)`:""}`)}(s!=null&&s.serviceId||s!=null&&s.toolName)&&i.push(`Delivery: ${[s.serviceId,s.toolName].filter(Boolean).join(" · ")}`);const d=s==null?void 0:s.pushDivergence;if(d&&typeof d.localSha=="string"&&typeof d.remoteSha=="string"){const m=typeof d.branch=="string"?d.branch:"the branch",y=typeof d.ahead=="number"?` (+${d.ahead})`:"",v=typeof d.behind=="number"?` (+${d.behind})`:"";i.push(`Push: local ${d.localSha}${y} · origin/${m} ${d.remoteSha}${v}`),typeof d.observedRemoteSha=="string"&&d.observedRemoteSha!==d.remoteSha&&i.push(`Remote moved: origin/${m} is now at ${d.observedRemoteSha}`),typeof d.lastLeaseError=="string"&&d.lastLeaseError&&i.push(`Last lease attempt: ${d.lastLeaseError}`)}return u!=null&&u.resumeRole&&i.push(`Continuation: resumes as ${u.resumeRole}${u.resumeHeadSha?` at ${u.resumeHeadSha.slice(0,8)}`:""}`),i}function oS(n){return n==="close"||n==="reject"||n==="abort"}function Jy({options:n,disabled:i,onChoose:s}){return n.length===0?null:c.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(u=>c.jsx("button",{type:"button",className:`${oS(u.choice)?"btn-ghost-danger":"btn-gold"} px-3 py-1 text-xs disabled:opacity-50`,disabled:i,onClick:()=>s(u.choice),children:u.label},u.choice))})}function dS({actions:n,busyActionId:i,onResolve:s}){return n.length===0?null:c.jsxs("div",{className:"mb-4 rounded border border-red-400/30 bg-red-500/10",children:[c.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 border-b border-red-400/20",children:[c.jsx(du,{className:"w-4 h-4 shrink-0 text-red-300"}),c.jsxs("span",{className:"font-ui-display text-sm font-medium text-red-200",children:[n.length," ",n.length===1?"item needs":"items need"," your attention"]})]}),c.jsx("div",{className:"divide-y divide-white/5",children:n.map(u=>{const d=uS(u.actionType),f=cS(u);if(u.issueId)return c.jsxs(ga,{to:`/issues/${u.issueId}`,className:"block w-full text-left px-4 py-2 hover:bg-white/5 transition-colors",children:[c.jsx("span",{className:"text-xs uppercase tracking-wide text-red-300/80",children:d}),c.jsx("span",{className:"text-sm text-white/80 ml-2",children:u.question})]},u.id);const m=Ky(u);return c.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[c.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[c.jsx("span",{className:"text-xs uppercase tracking-wide text-red-300/80",children:d}),c.jsx("span",{className:"text-xs text-white/35 shrink-0",children:new Date(u.requestedAt).toLocaleString()})]}),c.jsx("p",{className:"text-sm text-white/85",children:u.question}),u.reason&&u.reason!==u.question&&c.jsx("p",{className:"text-xs text-white/50",children:u.reason}),f.map(y=>c.jsx("p",{className:"text-xs text-white/50",children:y},y)),m.length>0?c.jsx(Jy,{options:m,disabled:i===u.id,onChoose:y=>s(u.id,y)}):c.jsxs("p",{className:"text-xs text-amber-200/80",children:["This item declares no response options — resolve it from the CLI (",c.jsx("code",{children:"agent-dealer action"}),")."]})]},u.id)})})]})}const fS="web";function hS(n){const i=Date.now()-new Date(n).getTime(),s=Math.floor(i/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 mS(n){var u;if(!(n!=null&&n.trim()))return;const i=n.match(/##\s*Acceptance criteria\s*\n([\s\S]*?)(?=\n##\s|$)/i);return((u=i==null?void 0:i[1])==null?void 0:u.trim())||void 0}function pS({agents:n,humanActions:i,onHumanActionsChanged:s}){const[u,d]=w.useState(null),[f,m]=w.useState(null),[y,v]=cy(),g=y.toString(),b=F2(g),_=w.useRef(b);_.current=b;const[D,Q]=w.useState(()=>Nx(g)),[T,V]=w.useState(!1),L=Ex(b),[B,Z]=w.useState(!1),[W,fe]=w.useState(!1),[J,ke]=w.useState("manual"),[I,ge]=w.useState([]),[Ve,vt]=w.useState(""),[ft,et]=w.useState(""),[Tt,Fe]=w.useState(!1),[re,U]=w.useState([]),[F,ce]=w.useState(""),[je,Me]=w.useState(""),[N,q]=w.useState("main"),[X,ee]=w.useState(""),[ie,ue]=w.useState(""),[Ne,ut]=w.useState(""),[Ue,Gt]=w.useState(""),[ta,yn]=w.useState(!0),[wa,De]=w.useState(null),[jt,Ya]=w.useState([]),[ct,Za]=w.useState(null),[vn,Ga]=w.useState(!1),[Mt,gn]=w.useState(null),[bn,tt]=w.useState(null),it=I.find(O=>O.id===Ve)??null,Fn=J==="linear"&&it!=null,Wn=K2(J,it),Qa=jx({title:F,repo:je,developerAgentId:Ne,reviewerAgentId:Ue}),Pn=O=>{t2(O).then(d).catch(oe=>De(String(oe)))},gt=()=>{Pn(_.current),Jo().then(Ya).catch(()=>{}),o2().then(Za).catch(()=>{})},Si=async O=>{Ga(!0),De(null);try{const oe=await d2(O);Za(oe),gt()}catch(oe){De(String(oe))}finally{Ga(!1)}},ji=async O=>{tt(O),De(null);try{const oe=await zy(O);gn({issueId:O,developerAgentId:oe.issue.developerAgentId,reviewerAgentId:oe.issue.reviewerAgentId})}catch(oe){De(String(oe))}finally{tt(null)}},Ma=async(O,oe)=>{if(Mt){tt(Mt.issueId);try{await bd(Mt.issueId,{developerAgentId:O,reviewerAgentId:oe}),gn(null),gt()}catch(Je){gn(null),De(String(Je)),gt()}finally{tt(null)}}},G=async O=>{tt(O),De(null);try{await By(O),gt()}catch(oe){De(String(oe))}finally{tt(null)}},be=async O=>{tt(O),De(null);try{await qy(O),gt()}catch(oe){De(String(oe)),gt()}finally{tt(null)}},qe=O=>{const oe=W2(P2(O));v(oe?Object.fromEntries(new URLSearchParams(oe)):{})},wn=()=>{Q(I2),v({})},Al=O=>{const oe=eS(g,O);v(oe?Object.fromEntries(new URLSearchParams(oe)):{})},Dt=O=>Q(oe=>({...oe,...O})),aa=async(O,oe)=>{m(O),De(null);try{await $y(O,fS,oe),s(),gt()}catch(Je){De(String(Je))}finally{m(null)}};w.useEffect(()=>{Q(Nx(g))},[g]),w.useEffect(()=>{Pn(_.current),Jo().then(Ya).catch(()=>{});const O=setInterval(()=>{Pn(_.current),Jo().then(Ya).catch(()=>{})},5e3);return()=>clearInterval(O)},[g]),w.useEffect(()=>{B&&(a2().then(U).catch(()=>U([])),J==="linear"&&Yw().then(ge).catch(O=>De(`Linear inbox: ${String(O)}`)))},[B,J]),w.useEffect(()=>{it&&(ce(`${it.identifier}: ${it.title}`),ee(it.description??""),ue(mS(it.description)??""),Me(O=>X2(O,it)))},[it]);const el=()=>{ce(""),Me(""),ee(""),ue(""),vt(""),et(""),yn(!0),q("main")},El=O=>{ge(oe=>[O,...oe.filter(Je=>Je.id!==O.id)]),vt(O.id),et(O.identifier)},Da=async()=>{const O=ft.trim();if(!O){De("Paste a Linear id (e.g. NOT-103) or issue URL");return}Fe(!0),De(null);try{const oe=await Zw(O);El(oe)}catch(oe){De(`Linear lookup: ${String(oe)}`)}finally{Fe(!1)}},Cl=async()=>{if(!jx({title:F,repo:je,developerAgentId:Ne,reviewerAgentId:Ue})){De("Title, GitHub repository, developer, and reviewer are required");return}try{await s2({title:F.trim(),repo:je.trim(),baseBranch:N.trim()||"main",description:X.trim()||void 0,acceptanceCriteria:ie.trim()||void 0,developerAgentId:Ne,reviewerAgentId:Ue,maxReviewRounds:3,maxInfraAttempts:3,autoMerge:ta,source:J==="linear"&&it?"linear":"manual",externalId:it==null?void 0:it.id,externalLabel:it==null?void 0:it.identifier,externalUrl:it==null?void 0:it.url}),Z(!1),el(),gt()}catch(O){De(String(O))}};return c.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Issues"}),c.jsx("button",{type:"button",className:"btn-gold px-4",onClick:()=>Z(O=>!O),children:"New issue"})]}),wa&&c.jsx("p",{className:"text-sm text-red-300 mb-3",children:wa}),B&&c.jsxs("div",{className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[c.jsxs("p",{className:"text-xs text-white/50",children:["Workflow:"," ",c.jsxs("span",{className:"text-white/75",children:["developer → reviewer → ",ta?"auto-merge on approve":"final human review"]}),"."]}),c.jsxs("div",{className:"flex gap-2 text-sm",children:[c.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${J==="manual"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>{ke("manual"),vt("")},children:"Manual"}),c.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${J==="linear"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>ke("linear"),children:"From Linear"})]}),J==="linear"&&c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex gap-2",children:[c.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:ft,onChange:O=>et(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),Da())}}),c.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:Tt||!ft.trim(),onClick:()=>void Da(),children:Tt?"…":"Lookup"})]}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:Ve,onChange:O=>{const oe=O.target.value;vt(oe);const Je=I.find(Sa=>Sa.id===oe);Je&&et(Je.identifier)},children:[c.jsx("option",{value:"",children:"Or pick from open inbox…"}),I.map(O=>c.jsxs("option",{value:O.id,children:[O.identifier,": ",O.title]},O.id))]})]}),c.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:F,disabled:Fn,onChange:O=>ce(O.target.value)}),c.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:X,disabled:Fn,onChange:O=>ee(O.target.value)}),c.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:3,placeholder:"Acceptance criteria",value:ie,onChange:O=>ue(O.target.value)}),c.jsxs("div",{className:"flex gap-2 items-stretch",children:[c.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"text-xs text-white/50",children:"Repository"}),c.jsx("button",{type:"button","aria-label":"Configure repository mappings",title:"Configure repository mappings","aria-expanded":W,onClick:()=>fe(O=>!O),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:c.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.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"}),c.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"})]})})]}),c.jsx(Gy,{value:je,onChange:Me,recentRepos:re}),W&&c.jsx(iS,{recentRepos:re,onClose:()=>fe(!1)}),Wn&&c.jsx("p",{className:"text-xs text-amber-200/80","data-testid":"repo-label-warning",children:Wn})]}),c.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:N,onChange:O=>q(O.target.value)})]}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:Ne,onChange:O=>ut(O.target.value),children:[c.jsx("option",{value:"",children:"Developer agent…"}),n.map(O=>c.jsx("option",{value:O.id,children:O.name},O.id))]}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:Ue,onChange:O=>Gt(O.target.value),children:[c.jsx("option",{value:"",children:"Reviewer agent…"}),n.map(O=>c.jsx("option",{value:O.id,children:O.name},O.id))]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:ta,onChange:O=>yn(O.target.checked),className:"accent-[#C4B643]"}),"Auto-merge when reviewer approves (skip final human review)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"btn-gold px-4 disabled:opacity-40",disabled:!Qa,title:Qa?void 0:"Title, GitHub repository, developer, and reviewer are required",onClick:Cl,children:J==="linear"?"Kick from Linear":"Create"}),c.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{Z(!1),el()},children:"Cancel"})]})]}),(jt.length>0||ct)&&c.jsxs("div",{className:"mb-4 rounded border border-cyber-teal/25 bg-cyber-teal/5",children:[c.jsxs("div",{className:"px-4 py-2 border-b border-cyber-teal/20 flex items-center justify-between gap-3",children:[c.jsx("span",{className:"font-ui-display text-sm font-medium text-cyber-teal",children:"Admission queue"}),c.jsx("span",{className:"flex items-center gap-2 text-xs text-white/40",children:ct?c.jsxs(c.Fragment,{children:[c.jsxs("span",{children:[ct.active," active · ",ct.waiting," waiting · limit"," ",ct.limit,ct.overCap?" · over capacity":""]}),ct.options.length>0?c.jsxs("label",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-white/35",children:"limit"}),c.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:ct.options.includes(ct.maxActiveIssues)?ct.maxActiveIssues:ct.limit,disabled:vn,title:ct.ceiling<2?`Capped by the worker/spawn ceiling (${ct.ceiling})`:"How many issues may execute in parallel (max one per repository)",onChange:O=>void Si(Number(O.target.value)),children:ct.options.map(O=>c.jsx("option",{value:O,children:O},O))})]}):c.jsxs("span",{title:`Capped by the worker/spawn ceiling (${ct.ceiling})`,children:["max ",ct.ceiling]})]}):c.jsxs("span",{children:[jt.length," waiting · sequential"]})})]}),c.jsx("div",{className:"divide-y divide-white/5",children:jt.map((O,oe)=>c.jsxs("div",{children:[c.jsxs("div",{className:"px-4 py-2 flex items-start gap-3",children:[c.jsx("span",{className:"text-xs text-white/35 w-5 shrink-0 pt-0.5",children:O.position}),c.jsxs(ga,{to:`/issues/${O.issueId}`,className:"flex-1 min-w-0 text-left hover:text-cyber-teal",children:[c.jsx("span",{className:"text-sm text-white/85 truncate block",children:O.title??O.issueId.slice(0,8)}),O.waitReason?c.jsx("span",{className:"text-xs text-amber-200/80 block mt-0.5",children:O.waitReason}):c.jsxs("span",{className:"text-xs text-white/35 block mt-0.5",children:[O.issueStatus??"queued"," · next up"]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:bn===O.issueId,title:"Change the developer/reviewer agents — keeps queue position and rechecks the wait reason",onClick:()=>void ji(O.issueId),children:"Edit"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:bn===O.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 G(O.issueId),children:"Run next"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:bn===O.issueId,title:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:()=>void be(O.issueId),children:"Execute now"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:oe===0,title:"Move to top",onClick:()=>{Yr(O.issueId,"top").then(gt).catch(Je=>De(String(Je)))},children:"Top"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:oe===0,title:"Move up",onClick:()=>{const Je=jt[oe-1];Je&&Yr(O.issueId,{before:Je.issueId}).then(gt).catch(Sa=>De(String(Sa)))},children:"↑"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:oe===jt.length-1,title:"Move down",onClick:()=>{const Je=jt[oe+1];Je&&Yr(O.issueId,{after:Je.issueId}).then(gt).catch(Sa=>De(String(Sa)))},children:"↓"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:oe===jt.length-1,title:"Move to bottom",onClick:()=>{Yr(O.issueId,"bottom").then(gt).catch(Je=>De(String(Je)))},children:"Bottom"}),c.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-white",onClick:()=>{Hy(O.issueId).then(gt).catch(Je=>De(String(Je)))},children:"Remove"})]})]}),(Mt==null?void 0:Mt.issueId)===O.issueId&&c.jsx("div",{className:"px-4 pb-3 pl-12",children:c.jsx(sS,{agents:n,initialDeveloperId:Mt.developerAgentId,initialReviewerId:Mt.reviewerAgentId,busy:bn===O.issueId,onSave:(Je,Sa)=>void Ma(Je,Sa),onCancel:()=>gn(null)})})]},O.id))})]}),c.jsx(dS,{actions:i,busyActionId:f,onResolve:(O,oe)=>void aa(O,oe)}),c.jsxs("div",{className:"mb-4 rounded border border-white/10 bg-panel-elevated/60",children:[c.jsxs("button",{type:"button","aria-expanded":T,"aria-controls":"issues-filter-form",onClick:()=>V(O=>!O),className:"w-full flex items-center gap-2 px-4 py-2.5 text-sm text-white/70 hover:text-white",children:[c.jsx("span",{"aria-hidden":"true",className:"text-xs text-white/40 w-3 shrink-0",children:T?"▾":"▸"}),c.jsx("span",{className:"font-ui-display",children:T?"Hide filters":"Show filters"}),L&&c.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"})]}),T&&c.jsx("form",{id:"issues-filter-form","aria-label":"Issues filters",className:"px-4 pb-4",onSubmit:O=>{O.preventDefault(),qe(D)},children:c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Search"}),c.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:O=>Dt({q:O.target.value})})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Status"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.status,onChange:O=>Dt({status:O.target.value}),children:[c.jsx("option",{value:"",children:"All statuses"}),J2.map(O=>c.jsx("option",{value:O,children:O},O))]})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Repository"}),c.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:O=>Dt({repo:O.target.value})})]}),c.jsx("div",{className:"flex items-end gap-2",children:c.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer pb-2",children:[c.jsx("input",{type:"checkbox",checked:D.needsAttention,onChange:O=>Dt({needsAttention:O.target.checked}),className:"accent-[#C4B643]"}),"Needs attention"]})}),c.jsxs("div",{className:"flex items-end gap-2 sm:col-span-2 lg:col-span-4",children:[c.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),c.jsx("button",{type:"button",className:"px-4 py-2 text-sm text-white/60 hover:text-white",onClick:wn,children:"Reset"})]})]})})]}),u===null?c.jsx("p",{className:"text-white/50 text-sm",children:"Loading…"}):u.total===0&&!Ex(b)?c.jsx("p",{className:"text-white/45 text-sm",children:"No issues yet — create one to get started."}):u.total===0?c.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/40 px-4 py-3",children:[c.jsx("p",{className:"text-white/45 text-sm",children:_x(u)}),c.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:wn,children:"Reset filters"})]}):c.jsxs("div",{children:[c.jsx("div",{className:"flex justify-end mb-2",children:c.jsxs("p",{className:"text-xs text-white/40 tabular-nums",children:[_x(u),Ax(u)?` · ${Ax(u)}`:""]})}),c.jsx("div",{className:"space-y-2",children:u.issues.map(O=>{const oe=jt.find(Je=>Je.issueId===O.id);return c.jsxs(ga,{to:`/issues/${O.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:[O.hasOpenHumanAction&&c.jsx(du,{className:"w-4 h-4 shrink-0 text-red-400"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-white/90 truncate",children:O.title}),oe!=null&&oe.waitReason?c.jsx("p",{className:"text-xs text-amber-200/80 truncate",title:oe.waitReason,children:oe.waitReason}):O.currentIntent&&c.jsx("p",{className:"text-xs text-white/50 truncate",children:O.currentIntent})]}),c.jsx("span",{className:"text-xs text-white/40 capitalize shrink-0",children:O.currentOwner}),oe&&c.jsxs("span",{className:"text-xs px-2 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal shrink-0",title:oe.waitReason??"Next up for admission",children:["Queued #",oe.position]}),c.jsx(Zy,{status:O.status}),c.jsx("span",{className:"text-xs text-white/35 shrink-0 w-16 text-right",children:hS(O.updatedAt)})]},O.id)})}),u.totalPages>1&&c.jsxs("nav",{"aria-label":"Issues pages",className:"mt-3 flex items-center gap-2",children:[c.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:()=>Al(u.page-1),children:"Previous"}),c.jsxs("span",{className:"text-xs text-white/45 tabular-nums",children:["Page ",u.page," of ",u.totalPages]}),c.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:()=>Al(u.page+1),children:"Next"})]})]})]})}const xS=["developer","reviewer","legacy"],Cx=["claude_code","cursor_local","codex_local"],yS=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"];function pi(n,i){return n.n===0||n.p50===null&&n.p95===null?{available:!1,p50Text:null,p95Text:null,sampleText:"n=0",sampleTitle:"No observations in this cohort",sparse:!0}:{available:!0,p50Text:n.p50===null?null:i(n.p50),p95Text:n.p95===null?null:i(n.p95),sampleText:ky(n.n),sampleTitle:`Sample size ${n.n}${vd(n.n)?" — fewer than 5 observations, compare with care":""}`,sparse:vd(n.n)}}function ma(n,i,s){if(n.sum===null||n.known===0)return{available:!1,valueText:"N/A",exactText:null,noteText:null,noteTitle:null,incomplete:n.known<n.total};const u=i(n.sum),d=s!=null&&s.compact?Ow(n.sum):u,f=n.known<n.total;return{available:!0,valueText:d,exactText:s!=null&&s.compact?u:null,noteText:f?`${Ge(n.known)}/${Ge(n.total)} known`:null,noteTitle:f?"Partial sample — missing provider metadata is excluded, never zero":null,incomplete:f}}function As(n,i,s){return n===null||i===0?{available:!1,valueText:"N/A",evidenceCounts:null,evidenceNoun:null,title:`No ${s} in this cohort`}:{available:!0,valueText:bu(n),evidenceCounts:`${Ge(Math.round(n*i))}/${Ge(i)}`,evidenceNoun:s,title:`Exact share over ${i} ${s}`}}function Rx(n,i,s){const u=As(n,i,s);return u.available?{text:`${u.valueText} (${u.evidenceCounts} ${u.evidenceNoun})`,title:u.title}:{text:u.valueText,title:u.title}}function Wo(n){const i=Rx(n.issueSuccess,n.issueSuccessDenominator,"closed"),s=Rx(n.attemptSuccess,n.attemptSuccessDenominator,"terminal attempts");return{key:n.key,issuesText:Ge(n.issues),attemptsText:Ge(n.attempts),issueSuccessText:i.text,issueSuccessTitle:i.title,attemptSuccessText:s.text,attemptSuccessTitle:s.title,issueSuccessDisplay:As(n.issueSuccess,n.issueSuccessDenominator,"closed"),attemptSuccessDisplay:As(n.attemptSuccess,n.attemptSuccessDenominator,"terminal attempts"),wallText:yx(n.sessionWallMs,Vt),envelopeText:yx(n.spawnEnvelopeMs,Vt),retryText:n.retryRate===null?"N/A":bu(n.retryRate),retryTitle:"Extra attempts after a terminal attempt in the same issue/role/round ÷ attempts",tokensInText:Qn(n.tokensIn,Ge),tokensOutText:Qn(n.tokensOut,Ge),costText:Qn(n.costUsd,gs),costIncomplete:n.costUsd.known<n.costUsd.total,durationText:Qn(n.durationMs,Vt),failedCostText:Qn(n.failedCostUsd,gs),failedTokensText:`${Qn(n.failedTokensIn,Ge)} in · ${Qn(n.failedTokensOut,Ge)} out`,failedDurationText:Qn(n.failedDurationMs,Vt),wall:pi(n.sessionWallMs,Vt),envelope:pi(n.spawnEnvelopeMs,Vt),tokensIn:ma(n.tokensIn,Ge,{compact:!0}),tokensOut:ma(n.tokensOut,Ge,{compact:!0}),cost:ma(n.costUsd,gs),duration:ma(n.durationMs,Vt),failedCost:ma(n.failedCostUsd,gs),failedTokensIn:ma(n.failedTokensIn,Ge,{compact:!0}),failedTokensOut:ma(n.failedTokensOut,Ge,{compact:!0}),failedDuration:ma(n.failedDurationMs,Vt),failedIncomplete:n.failedCostUsd.known<n.failedCostUsd.total||n.failedTokensIn.known<n.failedTokensIn.total||n.failedTokensOut.known<n.failedTokensOut.total||n.failedDurationMs.known<n.failedDurationMs.total,sparse:n.attempts>0&&vd(n.attempts)}}function vS(n,i){const s=n.code==="unknown";return{code:n.code,domain:n.domain,countText:Ge(n.count),shareText:n.share===null?"N/A":bu(n.share),shareTitle:i>0?`${Ge(n.count)} of ${Ge(i)} 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 · ${n.domain} domain`,displayCode:s?"Cause not recorded":n.code,displayNote:s?"Needs more evidence":`Primary cause · ${n.domain} domain`,issueIds:n.issueIds,hiddenIssueCount:Math.max(0,n.issueTotal-n.issueIds.length)}}function gS(n){const i=n.reduce((s,u)=>s+u.count,0);return n.map(s=>vS(s,i))}function bS(n){return`/issues/${n}`}function Tx(n,i){if(n!=null&&n.trim()&&/^\d{4}-\d{2}-\d{2}$/.test(n.trim()))return i?`${n.trim()}T23:59:59.999Z`:`${n.trim()}T00:00:00.000Z`}function kx(n){if(!n)return"";const i=n.match(/^(\d{4}-\d{2}-\d{2})/);return i?i[1]:""}function Ox(n){const i=new URLSearchParams(n.startsWith("?")?n.slice(1):n),s=u=>{var d;return((d=i.get(u))==null?void 0:d.trim())??""};return{fromDate:kx(s("from")),toDate:kx(s("to")),repo:s("repo"),role:s("role"),runtime:s("runtime"),model:s("model"),status:s("status")}}function wS(n){const i=new URLSearchParams(n.startsWith("?")?n.slice(1):n),s=d=>{var m;const f=(m=i.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 SS(n,i,s){const u=new URLSearchParams(n.startsWith("?")?n.slice(1):n);u.set(i,s),u.delete("page"),u.delete("limit"),u.sort();const d=u.toString();return`/reports/execution${d?`?${d}`:""}`}function jS(n){return{from:Tx(n.fromDate,!1),to:Tx(n.toDate,!0),repo:n.repo.trim()||void 0,role:n.role||void 0,runtime:n.runtime.trim()||void 0,model:n.model.trim()||void 0,status:n.status.trim()||void 0}}function Po(n){return n===null?"N/A":bu(n)}function Aa({label:n,value:i,valueTitle:s,note:u}){return c.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[c.jsx("p",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:n}),c.jsx("div",{className:"mt-1 font-mono text-lg font-semibold text-white/90 tabular-nums",title:s,children:i}),u&&c.jsx("div",{className:"mt-0.5 font-ui-display text-xs text-white/40",children:u})]})}function fu({display:n,compact:i}){if(!n.available)return c.jsx("span",{className:"font-mono text-white/45",title:n.title,children:"N/A"});const s=i?"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 c.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",title:n.title,children:[c.jsx("span",{className:s,"aria-label":n.title,children:n.valueText}),c.jsxs("span",{className:"font-ui-display min-w-0 break-words text-xs text-white/40",children:["(",c.jsx("span",{className:"font-mono tabular-nums",children:n.evidenceCounts})," ",n.evidenceNoun,")"]})]})}function bs({display:n,compact:i}){if(!n.available)return c.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=i?"font-ui-display text-[11px] uppercase tracking-wide text-white/40":"font-ui-display text-xs uppercase tracking-wide text-white/40",u=i?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return c.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-3 gap-y-0.5",children:[c.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[c.jsx("span",{className:s,children:"P50"}),c.jsx("span",{className:u,children:n.p50Text??"N/A"})]}),c.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[c.jsx("span",{className:s,children:"P95"}),c.jsx("span",{className:u,children:n.p95Text??"N/A"})]}),c.jsx("span",{className:"font-ui-display text-xs text-white/40",title:n.sampleTitle,children:n.sampleText})]})}function pa({display:n,compact:i}){if(!n.available)return c.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=n.exactText??n.valueText,u=i?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return c.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[c.jsx("span",{className:u,title:s,"aria-label":s,children:n.valueText}),n.noteText&&c.jsx("span",{className:"font-ui-display text-xs text-white/40",title:n.noteTitle??void 0,children:n.noteText})]})}function ed({caption:n,dimension:i,rows:s,cohortLink:u}){return s.length===0?c.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[c.jsx("h4",{className:"font-ui-display text-sm font-medium text-white/80",children:n}),c.jsx("p",{className:"font-ui-display mt-1 text-sm text-white/45",children:"No attempts in this dimension for these filters."})]}):c.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:c.jsxs("table",{className:"w-full min-w-[1440px] text-sm",children:[c.jsxs("caption",{className:"sr-only",children:[n," — sorted by name, never by cost"]}),c.jsx("thead",{children:c.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[c.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:n}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempts"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issue success"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempt success"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Session wall P50/P95"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Retry rate"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens in"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens out"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Cost"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Duration"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed cost"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed tokens"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed runtime"})]})}),c.jsx("tbody",{className:"divide-y divide-white/5",children:s.map(d=>c.jsxs("tr",{className:"tabular-nums",children:[c.jsxs("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:[u?c.jsx(ga,{to:u(i,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 ${i} ${d.key}`,children:d.key}):d.key,d.sparse&&c.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"})]}),c.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.issuesText}),c.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.attemptsText}),c.jsx("td",{className:"px-3 py-2 text-white/75",title:d.issueSuccessTitle,children:c.jsx(fu,{display:d.issueSuccessDisplay,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",title:d.attemptSuccessTitle,children:c.jsx(fu,{display:d.attemptSuccessDisplay,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(bs,{display:d.wall,compact:!0})}),c.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:d.retryTitle,children:d.retryText}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(pa,{display:d.tokensIn,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(pa,{display:d.tokensOut,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(pa,{display:d.cost,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(pa,{display:d.duration,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(pa,{display:d.failedCost,compact:!0})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-1.5",children:[c.jsx(pa,{display:d.failedTokensIn,compact:!0}),c.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"in"}),c.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"·"}),c.jsx(pa,{display:d.failedTokensOut,compact:!0}),c.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"out"})]})}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(pa,{display:d.failedDuration,compact:!0})})]},d.key))})]})})}const NS={fromDate:"",toDate:"",repo:"",role:"",runtime:"",model:"",status:""};function _S({loading:n,error:i,report:s,onRetry:u,cohortLink:d}){const f=(s==null?void 0:s.summary)??null,m=w.useMemo(()=>s?gS(s.failures):[],[s]),y=w.useMemo(()=>s?s.failures.reduce((v,g)=>v+g.count,0):0,[s]);return c.jsxs("div",{"aria-live":"polite",children:[n&&c.jsx("p",{role:"status",className:"text-sm text-white/50",children:"Loading execution report…"}),!n&&i&&c.jsxs("div",{className:"rounded border border-red-400/30 bg-red-500/10 px-4 py-3",role:"alert",children:[c.jsxs("p",{className:"font-ui-display text-sm text-red-200",children:["Couldn’t load the execution report: ",i]}),c.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"})]}),!n&&!i&&s&&f&&c.jsxs("div",{className:"space-y-6",children:[s.meta.partial&&c.jsxs("div",{className:"rounded border border-amber-300/30 bg-amber-400/10 px-4 py-3",children:[c.jsx("p",{className:"font-ui-display text-sm text-amber-100 font-medium",children:"Partial metadata"}),c.jsx("ul",{className:"font-ui-display mt-1 list-disc list-inside text-sm text-amber-100/80",children:s.meta.partialReasons.map(v=>c.jsx("li",{children:v},v))})]}),f.issues===0?c.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."}):c.jsxs(c.Fragment,{children:[c.jsx("section",{"aria-label":"Summary",children:c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-3",children:[c.jsx(Aa,{label:"Issue success",value:c.jsx(fu,{display:As(f.issueSuccess,f.closedIssues,"closed")}),valueTitle:`done / (done + closed), denominator ${f.closedIssues}`,note:`${Ge(f.issues)} issues · ${Ge(f.closedIssues)} closed`}),c.jsx(Aa,{label:"Attempt success",value:c.jsx(fu,{display:As(f.attemptSuccess,f.terminalAttempts,"terminal")}),valueTitle:`done sessions / terminal sessions, denominator ${f.terminalAttempts}`,note:`${Ge(f.attempts)} attempts · ${Ge(f.terminalAttempts)} terminal`}),c.jsx(Aa,{label:"Retry rate",value:Po(f.retryRate),valueTitle:`${f.retryExtraAttempts} extra attempts after a terminal attempt in the same issue/role/round ÷ ${f.attempts} attempts`,note:`Reuse rate ${Po(f.reuseRate)} over ${Ge(f.reuseDenominator)} reviewer sessions with input SHA`}),c.jsx(Aa,{label:"Human wait",value:Vt(f.humanWaitMs),note:`${Ge(f.interventions)} interventions`}),c.jsx(Aa,{label:"Session wall P50/P95",value:c.jsx(bs,{display:pi(f.sessionWallMs,Vt)}),note:"Session bookkeeping proxy — never CLI runtime"}),c.jsx(Aa,{label:"Spawn envelope P50/P95",value:c.jsx(bs,{display:pi(f.spawnEnvelopeMs,Vt)}),note:"Coordinator-measured; includes slot wait + post-exit work"}),c.jsx(Aa,{label:"Checkpoint latency P50/P95",value:c.jsx(bs,{display:pi(f.checkpointMs,Vt)}),note:"Session start → first heartbeat"}),c.jsx(Aa,{label:"Reviewer rounds (avg)",value:f.avgReviewerRounds===null?"N/A":f.avgReviewerRounds.toFixed(1),note:`Change-request rate ${Po(f.changeRequestRate)} over ${Ge(f.reviewedIssues)} reviewed`})]})}),c.jsxs("section",{"aria-label":"Failed-attempt waste",children:[c.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Failed-attempt waste (known values only)"}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[c.jsx(Aa,{label:"Failed cost",value:c.jsx(pa,{display:ma(f.failedCostUsd,gs)})}),c.jsx(Aa,{label:"Failed tokens",value:c.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[c.jsx(pa,{display:ma(f.failedTokensIn,Ge,{compact:!0})}),c.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"in"}),c.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"·"}),c.jsx(pa,{display:ma(f.failedTokensOut,Ge,{compact:!0})}),c.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"out"})]})}),c.jsx(Aa,{label:"Failed runtime",value:c.jsx(pa,{display:ma(f.failedDurationMs,Vt)})})]})]}),c.jsxs("section",{"aria-label":"Phase wall time",children:[c.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Phase wall time"}),c.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."}),c.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:c.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[c.jsx("caption",{className:"sr-only",children:"Exclusive phase wall times. Boundaries without defensible evidence are N/A."}),c.jsx("thead",{children:c.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[c.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Phase"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"P50 / P95"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Why"})]})}),c.jsx("tbody",{className:"divide-y divide-white/5",children:f.phaseWallMs.map(v=>c.jsxs("tr",{className:"tabular-nums",children:[c.jsx("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:v.phase}),c.jsx("td",{className:"px-3 py-2 text-white/75",children:c.jsx(bs,{display:pi(v.stat,Vt),compact:!0})}),c.jsx("td",{className:"font-ui-display px-3 py-2 text-xs text-white/45",children:v.stat.reasons.join(", ")})]},v.phase))})]})})]}),c.jsxs("section",{"aria-label":"Comparisons",className:"space-y-4",children:[c.jsxs("h3",{className:"font-ui-display text-sm font-medium text-white/80",children:["Comparisons ",c.jsx("span",{className:"font-normal text-white/40",children:"— sorted by name, never by cost"})]}),c.jsx(ed,{caption:"By role",dimension:"role",rows:s.byRole.map(Wo),cohortLink:d}),c.jsx(ed,{caption:"By runtime",dimension:"runtime",rows:s.byRuntime.map(Wo),cohortLink:d}),c.jsx(ed,{caption:"By model",dimension:"model",rows:s.byModel.map(Wo),cohortLink:d})]}),c.jsxs("section",{"aria-label":"Why attempts failed",children:[c.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Why attempts failed"}),c.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"," ",Ge(y)," failed ",y===1?"issue":"issues"," in scope."]}),m.length===0?c.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No failed attempts in this window."}):c.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:c.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[c.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."}),c.jsx("thead",{children:c.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[c.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Failure"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Domain"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Share"}),c.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Example issues"})]})}),c.jsx("tbody",{className:"divide-y divide-white/5",children:m.map(v=>c.jsxs("tr",{className:v.isUnknown?"bg-amber-400/5 tabular-nums":"tabular-nums",children:[c.jsxs("th",{scope:"row",className:"px-4 py-2 text-left text-white/85",children:[c.jsx("span",{className:"font-ui-display block font-medium",title:v.code,children:v.displayCode}),c.jsx("span",{className:`font-ui-display block text-xs font-normal ${v.isUnknown?"text-amber-200/90":"text-white/40"}`,children:v.displayNote})]}),c.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:v.domain}),c.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:v.countText}),c.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:v.shareTitle,children:v.shareText}),c.jsx("td",{className:"px-3 py-2",children:c.jsxs("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v.issueIds.map(g=>c.jsx(ga,{to:bS(g),className:"text-cyber-teal hover:underline font-mono text-xs",children:g.slice(0,8)},g)),v.hiddenIssueCount>0&&c.jsxs("span",{className:"font-ui-display text-xs text-white/40",children:["+",v.hiddenIssueCount," more"]})]})})]},v.code))})]})})]})]})]})]})}function AS(){const[n,i]=cy(),s=n.toString(),u=w.useMemo(()=>wS(s),[s]),[d,f]=w.useState(()=>Ox(s)),[m,y]=w.useState(null),[v,g]=w.useState(!0),[b,_]=w.useState(null),[D,Q]=w.useState(0);w.useEffect(()=>{f(Ox(s))},[s]),w.useEffect(()=>{let L=!1;return g(!0),_(null),h2(u).then(B=>{L||(y(B),g(!1))}).catch(B=>{L||(_(B instanceof Error?B.message:String(B)),g(!1))}),()=>{L=!0}},[s,D]);const T=L=>{const B=Ty(jS(L));i(B?Object.fromEntries(new URLSearchParams(B)):{})},V=L=>f(B=>({...B,...L}));return c.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2 mb-1",children:[c.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Execution report"}),m&&c.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()]})]}),c.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."}),c.jsx("form",{"aria-label":"Report filters",className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60",onSubmit:L=>{L.preventDefault(),T(d)},children:c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"From"}),c.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.fromDate,onChange:L=>V({fromDate:L.target.value})})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"To"}),c.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.toDate,onChange:L=>V({toDate:L.target.value})})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Repository"}),c.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=>V({repo:L.target.value})})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Role"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.role,onChange:L=>V({role:L.target.value}),children:[c.jsx("option",{value:"",children:"All roles"}),xS.map(L=>c.jsx("option",{value:L,children:L},L))]})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Runtime"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.runtime,onChange:L=>{V({runtime:L.target.value})},children:[c.jsx("option",{value:"",children:"All runtimes"}),Cx.map(L=>c.jsx("option",{value:L,children:L},L)),c.jsx("option",{value:"unknown",children:"unknown (missing metadata)"}),d.runtime&&!Cx.includes(d.runtime)&&c.jsxs("option",{value:d.runtime,children:[d.runtime," (from URL)"]})]})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Model"}),c.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=>V({model:L.target.value})})]}),c.jsxs("label",{className:"block text-sm",children:[c.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Issue status"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.status,onChange:L=>V({status:L.target.value}),children:[c.jsx("option",{value:"",children:"All statuses"}),yS.map(L=>c.jsx("option",{value:L,children:L},L))]})]}),c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),c.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{f(NS),i({})},children:"Reset"})]})]})}),c.jsx(_S,{loading:v,error:b,report:m,onRetry:()=>Q(L=>L+1),cohortLink:(L,B)=>SS(s,L,B)})]})}function Mx(n,i){var d;if(!n)return"Not assigned";const s=i.find(f=>f.id===n);if(!s)return"Unavailable — profile removed";const u=`${s.name} · ${ya(s.runtime)}`;return s.healthy?u:`${u} (unhealthy: ${((d=s.issues[0])==null?void 0:d.message)??"needs attention"})`}function Dx(n,i){var u;if(!n)return;const s=i.find(d=>d.id===n);return s?`${s.name} · ${ya(s.runtime)}${s.healthy?" · healthy":` · ${((u=s.issues[0])==null?void 0:u.message)??"unhealthy"}`}`:`Configured profile ${n} is not on record (deleted?)`}function ES({agents:n,initialRepo:i,initialDeveloperId:s,initialReviewerId:u,busy:d,onSave:f,onCancel:m}){var W,fe;const[y,v]=w.useState(i),[g,b]=w.useState(s??""),[_,D]=w.useState(u??""),Q=Xy(n),T=n.find(J=>J.id===g),V=n.find(J=>J.id===_),L=ou(T),B=ou(V),Z=y.trim()===i&&g===(s??"")&&_===(u??"");return c.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[c.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."}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Repository"}),c.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:y,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:J=>v(J.target.value)})]}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:g,disabled:d,title:T?`${T.name} · ${ya(T.runtime)}${T.healthy?" · healthy":` · ${((W=T.issues[0])==null?void 0:W.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:J=>b(J.target.value),children:[c.jsx("option",{value:"",children:"Developer agent…"}),Q.map(J=>c.jsx("option",{value:J.id,title:Jn(J),children:(J.healthy?"● ":"○ ")+Jn(J)},J.id))]}),L&&c.jsx("span",{className:"text-xs text-amber-200/80 block",children:L})]}),c.jsxs("label",{className:"block space-y-1",children:[c.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),c.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:_,disabled:d,title:V?`${V.name} · ${ya(V.runtime)}${V.healthy?" · healthy":` · ${((fe=V.issues[0])==null?void 0:fe.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:J=>D(J.target.value),children:[c.jsx("option",{value:"",children:"Reviewer agent…"}),Q.map(J=>J.runtime==="muse_code"?c.jsx("option",{value:J.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${J.name} · ${ya(J.runtime)} — reviewer not supported`},J.id):c.jsx("option",{value:J.id,title:Jn(J),children:(J.healthy?"● ":"○ ")+Jn(J)},J.id))]}),B&&c.jsx("span",{className:"text-xs text-amber-200/80 block",children:B})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:d||!y.trim()||!g||!_||Z,title:"Save via the issue PATCH contract — keeps queue position, rechecks readiness and the wait reason",onClick:()=>f(y.trim(),g,_),children:"Save configuration"}),c.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 CS({issue:n,agents:i,canEdit:s,editing:u,busy:d,onBeginEdit:f,onSave:m,onCancel:y}){return c.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1.5",children:[c.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Configuration"}),c.jsxs("p",{className:"text-sm text-white/85",title:`Exact repository identity: ${n.repo}`,children:[c.jsx("span",{className:"text-white/45",children:"Repository "}),n.repo]}),c.jsxs("p",{className:"text-sm text-white/85",title:Dx(n.developerAgentId,i),children:[c.jsx("span",{className:"text-white/45",children:"Developer "}),Mx(n.developerAgentId,i)]}),c.jsxs("p",{className:"text-sm text-white/85",title:Dx(n.reviewerAgentId,i),children:[c.jsx("span",{className:"text-white/45",children:"Reviewer "}),Mx(n.reviewerAgentId,i)]}),s&&!u&&c.jsx("button",{type:"button",className:"text-xs text-cyber-teal hover:underline disabled:opacity-50",disabled:d,onClick:f,children:"Edit configuration"}),s&&u&&c.jsx(ES,{agents:i,initialRepo:n.repo,initialDeveloperId:n.developerAgentId,initialReviewerId:n.reviewerAgentId,busy:d,onSave:m,onCancel:y})]})}function Qr(n){return n==="developer"?"Developer":n==="reviewer"?"Reviewer":"Worker"}const td={"issue.created":()=>"Issue created","issue.reassigned":()=>"Configuration updated","workflow.started":()=>"Workflow started","worker.started":n=>`${Qr(n.actorType)} started${n.round?` (round ${n.round})`:""}`,"worker.completed":n=>`${Qr(n.actorType)} finished${n.round?` (round ${n.round})`:""}`,"worker.failed":n=>`${Qr(n.actorType)} failed${n.round?` (round ${n.round})`:""}`,"worker.deferred":n=>{var i;return((i=ws(n.payloadJson))==null?void 0:i.outcome)==="deck_unavailable"?`Waiting for Agent Deck${n.round?` (round ${n.round})`:""}`:`${Qr(n.actorType)} deferred${n.round?` (round ${n.round})`:""}`},"worktree.ready":()=>"Worktree ready","deck.connected":()=>"Deck connected","brief.resolved":()=>"Brief resolved","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":n=>`Repair round ${n.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 ws(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}const RS={approved:"text-cyber-teal",changes_requested:"text-amber-300",escalated:"text-red-300"};function TS({e:n}){var i;if(n.type==="pull_request.opened"||n.type==="pull_request.updated"){const s=ws(n.payloadJson);return n.artifactRef?c.jsxs("a",{href:n.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(n.type==="review.submitted"){const s=ws(n.payloadJson);return s?c.jsxs("span",{className:"text-sm",children:[c.jsx("span",{className:RS[s.verdict]??"text-white/70",children:s.verdict.replace("_"," ")}),(i=s.findings)!=null&&i.length?` · ${s.findings.length} finding(s)`:""]}):null}if(n.type==="guidance.added"){const s=ws(n.payloadJson);return s!=null&&s.markdown?c.jsxs("span",{className:"text-sm text-white/55 italic",children:["— ",s.markdown]}):null}if(n.type==="worker.started"||n.type==="worker.completed"||n.type==="worker.failed"||n.type==="worker.deferred"||n.type==="worktree.ready"||n.type==="deck.connected"||n.type==="brief.resolved"||n.type==="branch.pushed"||n.type==="checks.started"||n.type==="checks.completed"){const s=ws(n.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),(n.type==="worker.deferred"||n.type==="worker.failed")&&(s.reason&&u.push(s.reason),n.type==="worker.deferred"&&s.until&&u.push(`until ${new Date(s.until).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`)),u.length===0?null:c.jsxs("span",{className:"text-xs text-white/40",children:["· ",u.join(" · ")]})}return null}function kS(n){var i;return((i=td[n.type])==null?void 0:i.call(td,n))??n.type}const Lx={human:"You",system:"System",developer:"Developer",reviewer:"Reviewer"},OS={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 MS(n){return n.actorRef?`${Lx[n.actorType]} · ${n.actorRef}`:Lx[n.actorType]}function DS({events:n}){return n.length===0?c.jsx("p",{className:"text-white/40 text-sm",children:"No activity yet."}):c.jsx("div",{className:"space-y-1",children:n.map(i=>c.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-white/5 last:border-0",children:[c.jsx("span",{className:"text-xs text-white/35 w-20 shrink-0 tabular-nums",children:new Date(i.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),c.jsx("span",{className:`text-[11px] leading-none px-1.5 py-0.5 rounded shrink-0 ${OS[i.actorType]}`,children:MS(i)}),c.jsx("span",{className:"text-sm text-white/80",children:kS(i)}),c.jsx(TS,{e:i})]},i.id))})}function Ea(n){if(n==null||!Number.isFinite(n))return null;if(n<1e3)return"<1s";const i=Math.round(n/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60);if(s<60){const f=i%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 Ux(n){return n==null||!Number.isFinite(n)?null:`${Math.round(n).toLocaleString("en-US")} tokens`}function LS(n){return n==null||!Number.isFinite(n)?null:`$${n.toFixed(2)}`}const US={queue_wait:"Queue / admission wait",coordinator_setup:"Setup",agent_process:"Agent process",coordinator_validation_publish:"Validation / publish",coordinator_work:"Coordinator work"},zx={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"},Sd={worktree:"worktree",commit:"commit",verification_receipt:"verification receipt",publish_only:"publish-only result"},zS=new Set(["failed","timed_out","error"]);function Yd(n){return n.replace(/_/g," ")}function Es(n,i){const s=`Evidence quality: ${n}`;return i.length>0?`${s} — ${i.join(", ")}`:s}function xa({quality:n,reasons:i}){return c.jsxs("span",{className:`text-[11px] tabular-nums ${n==="exact"?"text-white/60":n==="inferred"?"text-amber-300/90":"text-white/60 italic"}`,title:Es(n,i),children:["· ",n,i.length>0&&c.jsxs("span",{className:"sr-only",children:[" (",i.join(", "),")"]})]})}function Kn({reasons:n}){const i=n.length>0?n.join(", "):"no reason recorded";return c.jsxs("span",{className:"text-white/45 italic",title:`Unavailable — ${i}`,children:["Unavailable",c.jsxs("span",{className:"text-[11px]",children:[" — ",i]})]})}function Xr({covered:n,format:i,unit:s}){if(n.value==null)return c.jsx(Kn,{reasons:n.reasons});const u=n.known<n.total;return c.jsxs("span",{title:`${Es(n.quality,n.reasons)} · known ${n.known} of ${n.total} ${s}`,children:[i(n.value),c.jsx(xa,{quality:n.quality,reasons:n.reasons}),u&&c.jsxs("span",{className:"text-[11px] text-white/60",title:`Known for ${n.known} of ${n.total} ${s}`,children:[" ","(known ",n.known," of ",n.total,")"]})]})}function Bx({cause:n,primary:i}){return c.jsxs("div",{className:i?"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:[c.jsxs("p",{className:i?"text-sm font-medium text-red-200":"text-xs text-white/60",children:[i?"First failure: ":"Consequence: ",Yd(n.code)]}),c.jsx("p",{className:i?"text-sm text-white/85 whitespace-pre-wrap break-words":"text-xs text-white/55 whitespace-pre-wrap break-words",children:n.rawReason}),c.jsxs("p",{className:"text-[11px] text-white/60",title:Es(n.quality==="exact"?"exact":"inferred",[`evidence: ${n.evidenceSource}`,`confidence: ${n.confidence}`]),children:[n.domain," · ",n.confidence," confidence · via ",n.evidenceSource.replace(/_/g," ")," · ",n.quality,n.occurredAt?` · ${new Date(n.occurredAt).toLocaleString()}`:""]})]})}function BS({interval:n}){const i=zx[n.category??"unknown"]??zx.unknown,s=Ea(n.durationMs),u=n.category==="host_suspended";return c.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:[c.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:i}),c.jsx("span",{className:"text-xs tabular-nums",children:s??c.jsx(Kn,{reasons:n.reasons})}),c.jsx(xa,{quality:n.quality,reasons:n.reasons})]})}function qS({attempt:n}){const i=n.reuseKinds;return i===void 0?c.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"}):i.length===0?c.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"}):c.jsx(c.Fragment,{children:i.map(s=>c.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 ${Sd[s]??s} instead of starting cold.`,children:["reused ",Sd[s]??s]},s))})}function HS({attempt:n,isRetry:i}){const s=Ea(n.setup.durationMs),u=Ea(n.agentProcess.durationMs),d=Ea(n.validationPublish.durationMs),f=i&&n.role==="developer";return c.jsxs("li",{className:"py-1.5 border-b border-white/5 last:border-0 space-y-0.5",children:[c.jsxs("p",{className:"text-sm text-white/85",children:[c.jsx("span",{className:"capitalize",children:n.role}),c.jsxs("span",{className:"text-white/45",children:[n.runtime?` · ${n.runtime}`:"",n.model?` · ${n.model}`:"",` · round ${n.round} · ${n.status}`]}),n.publishOnly&&c.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&&!n.publishOnly&&c.jsx(qS,{attempt:n})]}),c.jsxs("p",{className:"text-xs text-white/50 tabular-nums",children:[c.jsxs("span",{title:s?void 0:`Setup unavailable — ${n.setup.reasons.join(", ")||"no reason recorded"}`,children:["Setup ",s??c.jsxs("span",{className:"italic",children:["Unavailable — ",n.setup.reasons.join(", ")||"no reason recorded"]})]}),c.jsx(xa,{quality:n.setup.quality,reasons:n.setup.reasons})," · ",c.jsxs("span",{title:u?void 0:`Agent process unavailable — ${n.agentProcess.reasons.join(", ")||"no reason recorded"}`,children:["Agent ",u??c.jsxs("span",{className:"italic",children:["Unavailable — ",n.agentProcess.reasons.join(", ")||"no reason recorded"]})]}),c.jsx(xa,{quality:n.agentProcess.quality,reasons:n.agentProcess.reasons})," · ",c.jsxs("span",{title:d?void 0:`Validation/publish unavailable — ${n.validationPublish.reasons.join(", ")||"no reason recorded"}`,children:["Validation/publish ",d??c.jsxs("span",{className:"italic",children:["Unavailable — ",n.validationPublish.reasons.join(", ")||"no reason recorded"]})]}),c.jsx(xa,{quality:n.validationPublish.quality,reasons:n.validationPublish.reasons})]}),n.failureCauses.length>0&&c.jsxs("p",{className:"text-[11px] text-white/60",children:["Failures: ",n.failureCauses.map(m=>Yd(m.code)).join(", ")]})]})}function $S({analysis:n}){const i=Ea(n.elapsed.durationMs),s=Ea(n.exclusiveTotalMs),u=Ea(n.firstCheckpoint.msSinceWorkflowStart),d=n.nested.filter(T=>T.kind!=="unexplained_silence"),f=n.attempts.flatMap(T=>T.silence),m=n.attempts.length>0&&n.attempts.every(T=>T.silence.length===0&&T.silenceQuality==="unavailable"),y=n.attempts.filter(T=>T.silence.length===0&&T.silenceQuality==="unavailable"),v=n.waste.failedAttempts>0||n.waste.publishOnlyAttempts>0||n.attempts.some(T=>T.failureCauses.length>0||zS.has(T.status)),g=Ea(n.humanWaitMs),b=n.retry.reuseRate==null?null:`${Math.round(n.retry.reuseRate*100)}% reused`,D=(n.retry.preservedKinds??[]).map(T=>Sd[T]??T),Q=n.waste.failedAttempts>0||n.waste.publishOnlyAttempts>0;return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:["Elapsed ",i??c.jsx(Kn,{reasons:n.elapsed.reasons}),c.jsx(xa,{quality:n.elapsed.quality,reasons:n.elapsed.reasons})]}),c.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??c.jsx(Kn,{reasons:n.exclusiveTotalReasons}),c.jsx(xa,{quality:n.exclusiveTotalQuality,reasons:n.exclusiveTotalReasons}),c.jsx("span",{children:" · overlaps unioned, not summed"})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Phase breakdown"}),c.jsx("ul",{children:n.unionedDurations.map(T=>{const V=Ea(T.durationMs);return c.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 py-0.5 text-sm",children:[c.jsx("span",{className:"text-white/70 w-36 shrink-0",children:US[T.phase]??T.phase}),c.jsx("span",{className:"text-white/85 tabular-nums",children:V??c.jsx(Kn,{reasons:T.reasons})}),c.jsx(xa,{quality:T.quality,reasons:T.reasons}),T.known<T.total&&c.jsxs("span",{className:"text-[11px] text-white/60",children:["(known ",T.known," of ",T.total,")"]})]},T.phase)})}),c.jsxs("p",{className:"text-xs text-white/45 tabular-nums mt-1",children:["Human wait ",g??c.jsx(Kn,{reasons:n.humanWaitReasons}),c.jsx(xa,{quality:n.humanWaitQuality,reasons:n.humanWaitReasons}),c.jsx("span",{title:"Human wait is tracked separately — it never adds to the phase total.",children:" · never additive"})]}),d.length>0&&c.jsx("ul",{className:"mt-1",children:d.map((T,V)=>c.jsxs("li",{className:"text-xs text-white/50 tabular-nums",children:[c.jsxs("span",{title:"Nested drill-down: explains its parent phase, never adds to the total.",children:["↳ ",T.kind==="human_wait"?"Human wait":T.category??T.kind]})," ",Ea(T.durationMs)??c.jsx(Kn,{reasons:T.reasons}),c.jsx(xa,{quality:T.quality,reasons:T.reasons})]},V))})]}),c.jsxs("div",{children:[c.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Attempts (",n.attempts.length,")"]}),n.attempts.length===0?c.jsx("p",{className:"text-xs text-white/45 italic",children:"No attempts recorded yet."}):c.jsx("ul",{children:n.attempts.map((T,V)=>c.jsx(HS,{attempt:T,isRetry:V>0},T.sessionId))})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Failure"}),n.primaryFailure?c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Bx,{cause:n.primaryFailure,primary:!0}),n.consequenceCauses.length>0&&c.jsx("div",{className:"space-y-1 opacity-80",children:n.consequenceCauses.map((T,V)=>c.jsx(Bx,{cause:T,primary:!1},`${T.code}-${V}`))})]}):v?c.jsxs("p",{className:"text-sm text-white/60 italic",title:Es("unavailable",n.primaryFailureReasons),children:["Unknown — ",n.primaryFailureReasons.join(", ")||"no failure evidence recorded"]}):c.jsx("p",{className:"text-sm text-white/45",children:"No failure recorded."})]}),c.jsxs("div",{children:[c.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Retry waste (",n.waste.failedAttempts," failed attempt",n.waste.failedAttempts===1?"":"s",")"]}),Q?c.jsxs("p",{className:"text-sm text-white/85 flex flex-wrap gap-x-3 gap-y-0.5 tabular-nums",children:[c.jsxs("span",{title:"Failed-attempt agent-process time over known values only",children:["Runtime ",c.jsx(Xr,{covered:n.waste.runtimeMs,format:T=>Ea(Math.round(T))??"?",unit:"attempts"})]}),c.jsxs("span",{title:"Failed-attempt input tokens over known values only",children:["In ",c.jsx(Xr,{covered:n.waste.tokensIn,format:T=>Ux(T)??"?",unit:"attempts"})]}),c.jsxs("span",{title:"Failed-attempt output tokens over known values only",children:["Out ",c.jsx(Xr,{covered:n.waste.tokensOut,format:T=>Ux(T)??"?",unit:"attempts"})]}),c.jsxs("span",{title:"Failed-attempt known cost over known values only",children:["Cost ",c.jsx(Xr,{covered:n.waste.costUsd,format:T=>LS(T)??"?",unit:"attempts"})]})]}):c.jsx("p",{className:"text-sm text-white/45",children:"No failed attempts — no retry waste."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"First checkpoint"}),n.firstCheckpoint.msSinceWorkflowStart==null&&n.firstCheckpoint.kind==null?c.jsxs("p",{className:"text-sm text-white/60 italic",title:Es(n.firstCheckpoint.quality,n.firstCheckpoint.reasons),children:["Unavailable — ",n.firstCheckpoint.reasons.join(", ")||"no checkpoint recorded"]}):c.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:[n.firstCheckpoint.kind?Yd(n.firstCheckpoint.kind):"Checkpoint",n.firstCheckpoint.observedSha?` · ${n.firstCheckpoint.observedSha.slice(0,12)}`:"",u?` · ${u} after workflow start`:"",c.jsx(xa,{quality:n.firstCheckpoint.quality,reasons:n.firstCheckpoint.reasons})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Retry reuse"}),c.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Retry reuse summary",children:[c.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 ",n.retry.reused]}),c.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 ",n.retry.cold]}),n.retry.unknown>0&&c.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 ${n.retry.unknown} retr${n.retry.unknown===1?"y":"ies"} — ${n.retry.reasons.join(", ")||"no reuse evidence"}.`,children:["Unknown ",n.retry.unknown]}),n.retry.publishOnly>0&&c.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 ",n.retry.publishOnly]}),c.jsxs("span",{className:"text-[11px] text-white/60 tabular-nums self-center",children:[n.retry.retries===0?"No retries":b??c.jsx(Kn,{reasons:n.retry.reasons}),c.jsx(xa,{quality:n.retry.quality,reasons:n.retry.reasons})]})]}),c.jsx("p",{className:"text-[11px] text-white/60 mt-0.5",children:n.retry.retries===0?"No retries — nothing to preserve.":D.length>0?`Preserved: ${D.join(", ")}.`:n.retry.unknown>0?`Preservation unknown for ${n.retry.unknown} retr${n.retry.unknown===1?"y":"ies"} — no reuse evidence.`:"No prior work preserved — every retry started cold."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Silence"}),c.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?c.jsx("p",{className:"text-sm text-white/60 italic",children:"Unknown — silence cannot be derived without agent-process bounds."}):c.jsx("p",{className:"text-sm text-white/45",children:"No silence observed."}):c.jsxs(c.Fragment,{children:[c.jsx("ul",{"aria-label":"Observed silence intervals",children:f.map((T,V)=>c.jsx(BS,{interval:T},V))}),y.length>0&&c.jsx("ul",{"aria-label":"Attempts with unknown silence",className:"mt-1",children:y.map(T=>c.jsxs("li",{className:"text-[11px] text-white/60 italic py-0.5",children:["Silence unknown for attempt ",T.sessionId.length>12?`${T.sessionId.slice(0,8)}…`:T.sessionId," —"," ",T.silenceReasons.join(", ")||"no silence evidence recorded"]},T.sessionId))})]})]})]})}function VS({issueId:n}){const[i,s]=w.useState(null),[u,d]=w.useState(null),[f,m]=w.useState(!0);return w.useEffect(()=>{s(null),d(null),m(!0);let y=!1;return n2(n).then(v=>{y||(s(v),m(!1))}).catch(v=>{y||(/not found/i.test(String(v))?(s(null),d(null)):d(String(v).replace(/^Error:\s*/i,"")),m(!1))}),()=>{y=!0}},[n]),c.jsxs("section",{"aria-labelledby":"execution-analysis-heading",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03]",children:[c.jsx("h3",{id:"execution-analysis-heading",className:"font-ui-display text-sm font-medium text-white/85 mb-2",children:"Execution analysis"}),f&&c.jsx("p",{className:"text-xs text-white/40",children:"Loading execution analysis…"}),!f&&u&&c.jsx("p",{className:"text-xs text-red-300",children:u}),!f&&!u&&!i&&c.jsx("p",{className:"text-xs text-white/45",children:"No execution analysis yet — start the workflow to see where time goes."}),!f&&!u&&i&&c.jsx($S,{analysis:i})]})}const YS="web";function ZS(n){try{const i=JSON.parse(n);return typeof i.text=="string"?i.text:JSON.stringify(i,null,2)}catch{return n}}function ad(n){const i=Math.floor(n/6e4);return i<60?`${i}m`:`${Math.floor(i/60)}h ${i%60}m`}function GS(n){if(!n)return"no heartbeat yet";const i=Math.max(0,Math.floor((Date.now()-new Date(n).getTime())/1e3));return i<5?"just now":i<60?`${i}s ago`:`${Math.floor(i/60)}m ago`}function Ss(n){if(!n)return null;const i=n.split(/[/\\]/).filter(Boolean);return i.length<=2?n:i.slice(-2).join("/")}function nd(n){var i;return[n.branch,n.tipLabel,(i=n.worktree)!=null&&i.path?Ss(n.worktree.path):null].filter(Boolean).join(" · ")}function ld(n){var i;return[n.restartRisk?"restart risk":null,(i=n.worktree)!=null&&i.preserved?"dirty worktree preserved":null].filter(Boolean).map(s=>` · ${s}`).join("")}function id(n){var i;return!!(n.restartRisk||(i=n.worktree)!=null&&i.preserved)}function QS(n,i){return!n||!i?!1:n===i?!0:n.includes(i)}function XS({busy:n,onConfirm:i,onCancel:s}){return c.jsxs("div",{className:"mt-2 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[c.jsx("p",{className:"text-sm text-white/90 font-medium",children:"Close this issue?"}),c.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."}),c.jsxs("div",{className:"flex gap-2",children:[c.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:n,onClick:i,children:"Close issue"}),c.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 KS(n){const i=n.humanActions.find(s=>s.status==="open");if(i)return i.question;switch(n.issue.currentOwner){case"developer":return"Waiting on the developer";case"reviewer":return"Waiting on the reviewer";case"human":return"Waiting on you";default:return n.issue.status==="done"||n.issue.status==="closed"?"Complete":"Idle"}}function JS({issueId:n,detail:i,agents:s,onHumanActionsChanged:u,refresh:d,onError:f}){var Ma;const[m,y]=w.useState(null),[v,g]=w.useState({}),[b,_]=w.useState(""),[D,Q]=w.useState(!1),[T,V]=w.useState(""),[L,B]=w.useState(""),[Z,W]=w.useState(""),[fe,J]=w.useState(!1),[ke,I]=w.useState(null),[ge,Ve]=w.useState(!1),[vt,ft]=w.useState(!1),[et,Tt]=w.useState(null),Fe=G=>f(String(G)),{issue:re,timeline:U,humanActions:F,usageSummary:ce,readiness:je,humanWaitMs:Me,interventionCount:N,latestWorkflowInstance:q,activeWorkerSession:X,liveProgress:ee,latestSessionFailure:ie,branchTipStatus:ue,queued:Ne,queueEntry:ut}=i,Ue=s.find(G=>G.id===re.developerAgentId),Gt=Ue&&!Ue.healthy,ta=((Ma=Ue==null?void 0:Ue.issues[0])==null?void 0:Ma.message)??"Developer agent is unhealthy",yn=q?new Date(q.completedAt??Date.now()).getTime()-new Date(q.startedAt).getTime():0,wa=F.filter(G=>G.status==="open"),De=je.ok===!1||wa.some(G=>G.actionType==="product_scope_decision"),jt=q!=null&&q.completedAt===null,Ya=re.status==="ready"&&!jt,ct=re.status==="ready"&&!jt,Za=X&&X.status==="running"&&(re.status==="developing"||re.status==="reviewing"||re.status==="repairing"),vn=!!ie&&!Za,Ga=async()=>{b.trim()&&(await f2(n,b),_(""),d())},Mt=()=>{V(re.title),B(re.description??""),W(re.acceptanceCriteria??""),Q(!0)},gn=async()=>{J(!0),f(null);try{await bd(n,{title:T.trim()||void 0,description:L.trim()||null,acceptanceCriteria:Z.trim()||null}),Q(!1),d()}catch(G){Fe(G)}finally{J(!1)}},bn=async()=>{J(!0),f(null);try{const G=await By(n);I(G.state==="admitted"?null:`Queued at position ${G.position}${G.waitReason?` — ${G.waitReason}`:""}`),d()}catch(G){Fe(G)}finally{J(!1)}},tt=async()=>{J(!0),f(null);try{await c2(n),d()}catch(G){Fe(G)}finally{J(!1)}},it=async()=>{J(!0),f(null);try{await qy(n),I(null),Ve(!1),d()}catch(G){Fe(G),d()}finally{J(!1)}},Fn=async(G,be,qe)=>{J(!0),f(null);try{await bd(n,{repo:G,developerAgentId:be,reviewerAgentId:qe}),Ve(!1),d()}catch(wn){Ve(!1),Fe(wn),d()}finally{J(!1)}},Wn=async()=>{J(!0),f(null);try{await Hy(n),d()}catch(G){Fe(G)}finally{J(!1)}},Qa=async()=>{J(!0),f(null);try{await u2(n),ft(!1),Tt("Issue closed — it will not execute. History is retained and can be found as closed work."),d()}catch(G){Fe(G)}finally{J(!1)}},Pn=async()=>{if(confirm("Abort this workflow? The current worker will stop and the issue will close. History and evidence are kept.")){J(!0),f(null);try{await r2(n),d()}catch(G){Fe(G)}finally{J(!1)}}},gt=async(G,be)=>{J(!0),f(null);try{await $y(G,YS,be),u(),d()}catch(qe){Fe(qe)}finally{J(!1)}},Si=()=>{m||l2(n).then(y).catch(G=>Fe(G))},ji=G=>{v[G]||(g(be=>({...be,[G]:{content:"",loading:!0}})),i2(n,G).then(be=>g(qe=>({...qe,[G]:{content:be.content,loading:!1}}))).catch(be=>g(qe=>({...qe,[G]:{content:"",loading:!1,error:String(be)}}))))};return c.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:c.jsxs("div",{className:"max-w-3xl",children:[c.jsx(ga,{to:"/issues",className:"font-ui-display inline-block text-sm text-white/50 hover:text-white mb-3",children:"← Issues"}),c.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-white/90",children:re.title}),c.jsxs("p",{className:"text-xs text-white/45 mt-1",children:["Owner: ",c.jsx("span",{className:"capitalize",children:re.currentOwner}),re.currentIntent?` · ${re.currentIntent}`:""]}),c.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-white/40",children:[re.prUrl&&c.jsxs("a",{href:re.prUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:["PR #",re.prNumber]}),re.externalUrl&&c.jsx("a",{href:re.externalUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:re.externalLabel??"External link"}),c.jsxs("span",{children:["Round ",re.currentRound,"/",re.maxReviewRounds]}),c.jsxs("span",{children:["Infra attempts ",re.infraAttempts,"/",re.maxInfraAttempts]}),c.jsxs("span",{title:"Wall-clock time from workflow start to completion (or now)",children:[ad(yn)," elapsed"]}),c.jsxs("span",{title:`${ce.totalTokensIn} in / ${ce.totalTokensOut} out tokens`,children:["$",ce.totalCostUsd.toFixed(2)]}),Me>0&&c.jsxs("span",{title:"Time spent waiting on a human, excluding autonomous processing",children:[ad(Me)," human wait"]}),N>0&&c.jsxs("span",{children:[N," intervention",N===1?"":"s"]})]})]}),c.jsx(Zy,{status:re.status})]}),et&&c.jsx("div",{className:"mb-4 p-3 rounded border border-white/15 bg-white/[0.04]",children:c.jsx("p",{className:"text-sm text-white/85",children:et})}),c.jsx(CS,{issue:re,agents:s,canEdit:ct,editing:ge,busy:fe,onBeginEdit:()=>Ve(!0),onSave:(G,be,qe)=>void Fn(G,be,qe),onCancel:()=>Ve(!1)}),c.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/40 flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-white/45",children:"Next"}),c.jsx("p",{className:"text-sm text-white/85",children:KS(i)})]}),jt&&c.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:fe,onClick:Pn,children:"Abort workflow"})]}),ut&&c.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5",children:[c.jsxs("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:["Queued · position ",ut.position]}),c.jsx("p",{className:"text-sm text-white/80 mt-0.5",children:ut.waitReason??"Next up — starts as soon as the coordinator ticks"})]}),Za&&X&&c.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/35 bg-cyber-teal/5 space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-cyber-teal animate-pulse","aria-hidden":!0}),c.jsx("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:"Running now"})]}),c.jsxs("p",{className:"text-sm text-white/90",children:[c.jsx("span",{className:"capitalize",children:X.role}),X.runtime?` · ${X.runtime}`:"",X.model?` · ${X.model}`:"",` · round ${X.round}`]}),c.jsxs("p",{className:"text-sm text-[#C4B643] truncate",title:ee??re.currentIntent??"session started",children:["Last progress: ",ee??re.currentIntent??"session started"]}),ue&&c.jsxs("p",{className:`text-xs ${id(ue)?"text-amber-300":"text-white/55"}`,title:nd(ue),children:["Branch tip: ",ue.tipLabel,ld(ue)]}),ee&&re.currentIntent&&!/session running/i.test(re.currentIntent)&&!QS(re.currentIntent,ee)&&c.jsx("p",{className:"text-xs text-white/45 truncate",title:re.currentIntent,children:re.currentIntent}),c.jsxs("p",{className:"text-xs text-white/45",children:["Heartbeat ",GS(X.heartbeatAt),Ss(X.worktreePath)?` · ${Ss(X.worktreePath)}`:""]}),X.logPath&&c.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:X.logPath,children:["Log: ",Ss(X.logPath)??X.logPath]})]}),vn&&ie&&c.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-1.5",children:[c.jsx("p",{className:"text-xs text-red-300 font-medium uppercase tracking-wide",children:"Latest session failure"}),c.jsx("p",{className:"text-sm text-white/90 whitespace-pre-wrap break-words",children:ie.reason}),c.jsxs("p",{className:"text-xs text-white/45",children:[ie.role?c.jsx("span",{className:"capitalize",children:ie.role}):"Worker",ie.outcome?` · ${ie.outcome}`:"",` · ${new Date(ie.when).toLocaleString()}`,` · infra ${ie.infraAttempts}/${ie.maxInfraAttempts}`]}),ue&&c.jsxs("p",{className:`text-xs ${id(ue)?"text-amber-300":"text-white/55"}`,title:nd(ue),children:["Branch tip: ",ue.tipLabel,ld(ue)]}),ie.logPath&&c.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:ie.logPath,children:["Log: ",Ss(ie.logPath)??ie.logPath]})]}),ue&&!Za&&!vn&&c.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1",children:[c.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Branch tip"}),c.jsxs("p",{className:`text-sm ${id(ue)?"text-amber-300":"text-white/80"}`,title:nd(ue),children:[ue.tipLabel,ld(ue)]})]}),!je.ok&&!wa.some(G=>G.actionType==="product_scope_decision")&&c.jsx("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10",children:c.jsxs("p",{className:"text-xs text-amber-300 font-medium",children:["Not startable yet — missing: ",je.missing.join(", ")]})}),wa.length>0&&c.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[c.jsx("p",{className:"text-xs text-red-300 font-medium",children:"Human action needed"}),wa.map(G=>{const be=G.actionType==="product_scope_decision";return c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-sm text-white/80",children:G.question}),be?je.ok&&c.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs",disabled:fe,onClick:()=>gt(G.id,"resume"),children:"Resume"}):c.jsx(Jy,{options:Ky(G),disabled:fe,onChoose:qe=>gt(G.id,qe)})]},G.id)})]}),De&&!D&&c.jsx("button",{type:"button",className:"font-ui-display mb-4 text-xs text-cyber-teal hover:underline",onClick:Mt,children:"Edit title / description / acceptance criteria"}),D&&c.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[c.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:T,onChange:G=>V(G.target.value),placeholder:"Title"}),c.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:L,onChange:G=>B(G.target.value),placeholder:"Description"}),c.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:Z,onChange:G=>W(G.target.value),placeholder:"Acceptance criteria"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm",disabled:fe,onClick:gn,children:"Save"}),c.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>Q(!1),children:"Cancel"})]})]}),(re.status==="ready"||re.status==="needs_human"&&wa.length===0)&&c.jsxs("div",{className:"mb-4 space-y-2",children:[Gt&&c.jsxs("p",{className:"text-sm text-amber-200/90",children:["Fix before Start: ",ta]}),ke&&c.jsx("p",{className:"text-sm text-amber-200/90",children:ke}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",className:"btn-gold px-4 py-2 disabled:opacity-50",disabled:!je.ok||fe||!!Gt,title:Gt?ta:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:bn,children:"Run next"}),c.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:!je.ok||fe||!!Gt,title:Gt?ta:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:it,children:"Execute now"}),Ne?c.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:fe,onClick:Wn,children:"Remove from queue"}):c.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:fe||jt,title:"Add to queue — append to the end of the admission queue; does not start anything now",onClick:tt,children:"Add to queue"})]}),Ne&&ct&&!ge&&c.jsx("p",{className:"text-xs text-white/40",children:"Queued — edit repository / agents from the Configuration section above; position is kept."})]}),c.jsx(VS,{issueId:n}),c.jsx("div",{className:"border-t border-white/10 pt-3",children:c.jsx(DS,{events:U})}),c.jsxs("div",{className:"mt-4 flex gap-2",children:[c.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Guide this issue…",value:b,onChange:G=>_(G.target.value),onKeyDown:G=>G.key==="Enter"&&Ga()}),c.jsx("button",{type:"button",className:"btn-gold px-4",onClick:Ga,children:"Send"})]}),Ya&&c.jsxs("details",{className:"mt-6",children:[c.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"More actions"}),c.jsxs("div",{className:"mt-2 space-y-2",children:[c.jsx("p",{className:"text-xs text-white/45",children:"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."}),vt?c.jsx(XS,{busy:fe,onConfirm:()=>void Qa(),onCancel:()=>ft(!1)}):c.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:fe,title:"Retire this issue without running it — removes any queue entry, keeps history as closed work",onClick:()=>ft(!0),children:"Close issue"})]})]}),c.jsxs("details",{className:"mt-6",onToggle:G=>G.currentTarget.open&&Si(),children:[c.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Evidence & raw trace"}),m?c.jsxs("div",{className:"mt-2 space-y-3 text-xs text-white/60",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-white/45 mb-1",children:"Worker sessions"}),m.workerSessions.map(G=>{const be=m.usageEvents.filter(Dt=>Dt.workerSessionId===G.id),qe=be.reduce((Dt,aa)=>Dt+(aa.costUsd??0),0),wn=be.reduce((Dt,aa)=>Dt+(aa.tokensIn??0),0),Al=be.reduce((Dt,aa)=>Dt+(aa.tokensOut??0),0);return c.jsxs("p",{children:[G.role," round ",G.round," · ",G.status,G.startedAt&&G.completedAt?` · ${ad(new Date(G.completedAt).getTime()-new Date(G.startedAt).getTime())}`:"",be.length>0?` · $${qe.toFixed(3)} · ${wn}→${Al} tok`:""]},G.id)}),m.workerSessions.length===0&&c.jsx("p",{className:"text-white/35",children:"None yet."})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-white/45 mb-1",children:"Artifacts"}),m.artifacts.map(G=>{const be=v[G.id];return c.jsxs("details",{className:"mb-1.5",onToggle:qe=>qe.currentTarget.open&&G.blobPath&&ji(G.id),children:[c.jsxs("summary",{className:"cursor-pointer hover:text-white/80",children:[G.kind," · ",new Date(G.createdAt).toLocaleString()]}),c.jsxs("div",{className:"mt-1 pl-3 border-l border-white/10 space-y-1",children:[G.contentJson&&c.jsx("pre",{className:"whitespace-pre-wrap break-words text-white/55",children:ZS(G.contentJson)}),G.blobPath&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-white/40",children:["Raw trace: ",G.blobPath]}),(be==null?void 0:be.loading)&&c.jsx("p",{className:"text-white/35",children:"Loading trace…"}),(be==null?void 0:be.error)&&c.jsx("p",{className:"text-red-300/80",children:be.error}),be&&!be.loading&&!be.error&&c.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:be.content||"(empty)"})]}),!G.contentJson&&!G.blobPath&&c.jsx("p",{className:"text-white/35",children:"No content recorded."})]})]},G.id)}),m.artifacts.length===0&&c.jsx("p",{className:"text-white/35",children:"None yet."})]})]}):c.jsx("p",{className:"text-xs text-white/40 mt-2",children:"Loading…"})]})]})})}function IS({issueId:n,agents:i,onHumanActionsChanged:s}){const[u,d]=w.useState(null),[f,m]=w.useState(null),[y,v]=w.useState(!1),g=()=>zy(n).then(b=>{d(b),m(null),v(!1)}).catch(b=>{const _=String(b).replace(/^Error:\s*/i,"").trim();/^not found$/i.test(_)?(v(!0),m(null),d(null)):(m(_),v(!1))});return w.useEffect(()=>{d(null),m(null),v(!1),g();const b=setInterval(g,4e3);return()=>clearInterval(b)},[n]),y?c.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:c.jsxs("div",{className:"max-w-md space-y-3",children:[c.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Issue not found"}),c.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."}),c.jsx(ga,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})}):f?c.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-6 space-y-3",children:[c.jsx("p",{className:"text-red-300 text-sm",children:f}),c.jsx(ga,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]}):u?c.jsx(JS,{issueId:n,detail:u,agents:i,onHumanActionsChanged:s,refresh:g,onError:b=>m(b)},n):c.jsx("div",{className:"p-6 text-white/50 text-sm",children:"Loading…"})}function FS(){return c.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:c.jsxs("div",{className:"max-w-md space-y-3",children:[c.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Page not found"}),c.jsx("p",{className:"text-sm text-white/55",children:"That URL is not a destination in Agent Dealer."}),c.jsx(ga,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})})}function WS(){return c.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0 overflow-hidden","aria-hidden":!0,children:[c.jsx("div",{className:"absolute top-16 left-12",children:c.jsx("div",{className:"ambient-orb ambient-orb-a w-[26rem] h-[26rem] rounded-full bg-cyan-500/10 blur-3xl"})}),c.jsx("div",{className:"absolute bottom-20 right-12",children:c.jsx("div",{className:"ambient-orb ambient-orb-b w-[26rem] h-[26rem] rounded-full bg-pink-500/10 blur-3xl"})}),c.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:c.jsx("div",{className:"ambient-orb ambient-orb-c w-[22rem] h-[22rem] rounded-full bg-blue-500/[0.07] blur-3xl"})})]})}function PS({className:n="w-5 h-5"}){return c.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:n,"aria-hidden":!0,children:[c.jsx("circle",{cx:"6.75",cy:"6.25",r:"3.25"}),c.jsx("circle",{cx:"13.5",cy:"6.75",r:"2.85",opacity:"0.85"}),c.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 ej="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 tj({className:n="",size:i=36}){return c.jsx("img",{src:ej,alt:"",width:i,height:i,className:`shrink-0 object-contain ${n}`,"aria-hidden":!0,draggable:!1})}const Zd={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},aj="5H",nj="1W";function lj(n){return{fiveHour:n.find(i=>i.criticalRole==="five_hour")??null,weekly:n.find(i=>i.criticalRole==="weekly")??null}}function Iy(n,i,s){if(n.unavailableReason!==null)return n.unavailableReason;if(n.remainingPercent===null||n.source==="unavailable")return s??"missing";if(n.resetAt!==null){const u=Date.parse(n.resetAt);if(!Number.isFinite(u)||u<=i)return"expired"}if(n.freshUntil!==null){const u=Date.parse(n.freshUntil);if(!Number.isFinite(u)||u<=i)return"stale"}if(n.expiresAt!==null){const u=Date.parse(n.expiresAt);if(!Number.isFinite(u)||u<=i)return"expired"}if(n.observedAt){const u=Date.parse(n.observedAt);if(!Number.isFinite(u)||u>i+6e4)return"stale"}return s??"missing"}function jd(n,i,s){if(Ny(n,i)){const u=Math.round(n.remainingPercent??0),d=n.resetAt?`, resets ${new Date(n.resetAt).toLocaleString()}`:"";return`${n.displayLabel}: ${u}% available (${100-u}% used${d})`}return`${n.displayLabel}: N/A (${Zd[Iy(n,i,s)]})`}function Kr(n,i,s,u){if(Ny(n,s)){const f=n.remainingPercent??0;return{key:n.windowKey,label:n.displayLabel,kind:"known",remaining:Math.round(f),rawRemaining:f,detail:jd(n,s,i.unavailableReason),isCritical:u}}const d=Iy(n,s,i.unavailableReason);return{key:n.windowKey,label:n.displayLabel,kind:"unknown",reason:d,detail:jd(n,s,i.unavailableReason),isCritical:u}}function qx(n,i){const s=i.unavailableReason??"missing";return{key:`missing:${n}`,label:n,kind:"unknown",reason:s,detail:`${n}: N/A (${Zd[s]})`,isCritical:!0}}function ij(n,i=Date.now()){return n.runtimes.map(s=>{const u=ya(s.runtime),{fiveHour:d,weekly:f}=lj(s.windows),m=new Set([d==null?void 0:d.windowKey,f==null?void 0:f.windowKey].filter(Boolean)),y=s.windows.filter(D=>!m.has(D.windowKey));let v,g;if(d!==null||f!==null){const D=d!==null?Kr(d,s,i,!0):qx(aj,s),Q=f!==null?Kr(f,s,i,!0):qx(nj,s);g=[D,Q],v=[...g,...y.map(T=>Kr(T,s,i,!1))]}else s.windows.length>0?(g=[],v=s.windows.map(D=>Kr(D,s,i,!1))):(g=[],v=[]);const b=g.some(D=>D.kind==="known"&&D.rawRemaining===0),_=s.windows.length>0?s.windows.map(D=>jd(D,i,s.unavailableReason)).join("; "):`N/A (${Zd[s.unavailableReason??"missing"]})`;return{runtime:u,windows:v,exhausted:b,detail:_}})}function Hx(n){return n.exhausted?`${n.runtime} exhausted — a capacity window is at 0%: ${n.detail}`:`${n.runtime}: ${n.detail}`}function sj({state:n,nowMs:i}){if(n.status==="loading")return c.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:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),c.jsx("span",{"aria-live":"polite",children:"loading…"})]});if(n.status==="unavailable")return c.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:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),c.jsx("span",{children:"unavailable"})]});const s=ij(n.data,i),u=s.length===0||s.every(d=>!d.windows.some(f=>f.kind==="known"));return c.jsxs("span",{"data-testid":"topbar-capacity","data-status":u?"unknown":"ready",title:s.length===0?"Agent capacity: no runtime accounts reported":s.map(Hx).join(" · "),className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:[c.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),s.length===0?c.jsx("span",{className:"whitespace-nowrap text-white/35",children:"N/A"}):s.map(d=>{const f=d.windows.some(m=>m.kind==="known");return c.jsxs("span",{"data-testid":`topbar-capacity-${d.runtime}`,"data-known":f?"true":"false","data-exhausted":d.exhausted?"true":"false",title:Hx(d),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:[c.jsx("span",{className:d.exhausted?"text-red-200/80":"text-white/40",children:d.runtime}),d.windows.length===0?c.jsx("span",{className:"text-white/35",children:"N/A"}):c.jsx("span",{className:"inline-flex flex-col leading-tight",children:d.windows.map(m=>c.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:[c.jsx("span",{className:"text-white/40",children:m.label}),m.kind==="known"?c.jsxs("span",{className:m.isCritical&&m.rawRemaining===0?"font-medium text-red-300":"font-medium text-white/75",children:[m.remaining,"%"]}):c.jsx("span",{className:"text-white/35",children:"N/A"})]},m.key))})]},d.runtime)})]})}const $x=5e3;function sd({isActive:n}){return`font-ui-display px-3 py-2 text-base rounded ${n?"bg-cyber-teal/20 text-cyber-teal":"text-white/60 hover:text-white"}`}function rj({agents:n,onHumanActionsChanged:i}){const{issueId:s}=lb();return s?c.jsx(IS,{issueId:s,agents:n,onHumanActionsChanged:i},s):c.jsx(sy,{to:"/issues",replace:!0})}function uj({openHumanActionCount:n,agentCount:i,agentIssueCount:s,capacity:u={status:"loading"}}){return c.jsxs("header",{className:"px-6 py-4 border-b border-white/10 flex flex-wrap gap-4 items-center justify-between glass-header shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs(ga,{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:[c.jsx(tj,{size:40}),c.jsxs("div",{children:[c.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"}),c.jsx("p",{className:"text-sm text-cyber-teal",children:"One issue, one durable coordination record"})]})]}),c.jsxs("nav",{className:"flex gap-1",children:[c.jsxs(Fr,{to:"/issues",className:sd,children:["Issues",n>0&&c.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:`${n} open human action${n===1?"":"s"}`,children:[c.jsx(du,{className:"w-3 h-3 shrink-0"}),n]})]}),c.jsx(Fr,{to:"/reports/execution",className:sd,children:"Reports"})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 min-w-0",children:[c.jsx(sj,{state:u}),c.jsxs(Fr,{to:"/agents",className:({isActive:d})=>`${sd({isActive:d})} inline-flex items-center gap-1.5 transition-colors`,"aria-label":"Agents",title:"Agents",children:[c.jsx(PS,{className:"w-6 h-6 shrink-0"}),c.jsx("span",{children:"Agents"}),i>0&&c.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:`${i} configured agent${i===1?"":"s"}`,children:i}),s>0&&c.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:[c.jsx(du,{className:"w-3 h-3 shrink-0"}),s]})]})]})]})}function cj(){const[n,i]=w.useState([]),[s,u]=w.useState(0),[d,f]=w.useState(!1),[m,y]=w.useState([]),[v,g]=w.useState({status:"loading"}),b=w.useCallback(()=>{Xw().then(({agents:T,issueCount:V})=>{i(T),u(V)}).catch(console.error),Uy().then(T=>f(T.connected)).catch(()=>f(!1)),Ly().then(T=>g({status:"ready",data:T})).catch(()=>g({status:"unavailable"}))},[]),_=w.useCallback(()=>m2().then(y).catch(()=>{}),[]);w.useEffect(()=>{b();const T=setInterval(b,$x);return()=>clearInterval(T)},[b]),w.useEffect(()=>{_();const T=setInterval(()=>void _(),$x);return()=>clearInterval(T)},[_]);const D=m.length,Q=n.length;return c.jsxs(c.Fragment,{children:[c.jsx(WS,{}),c.jsxs("div",{className:"relative z-10 min-h-screen flex flex-col",children:[c.jsx(uj,{openHumanActionCount:D,agentCount:Q,agentIssueCount:s,capacity:v}),c.jsx("main",{className:"flex-1 flex overflow-hidden",children:c.jsxs(gb,{children:[c.jsx(vl,{path:"/",element:c.jsx(sy,{to:"/issues",replace:!0})}),c.jsx(vl,{path:"/issues",element:c.jsx(pS,{agents:n,humanActions:m,onHumanActionsChanged:_})}),c.jsx(vl,{path:"/issues/:issueId",element:c.jsx(rj,{agents:n,onHumanActionsChanged:_})}),c.jsx(vl,{path:"/agents",element:c.jsx(Z2,{agents:n,agentDeckOnline:d,onRefresh:b})}),c.jsx(vl,{path:"/reports/execution",element:c.jsx(AS,{})}),c.jsx(vl,{path:"*",element:c.jsx(FS,{})})]})})]})]})}function oj(){return typeof document>"u"?Promise.resolve():document.fonts.load('13px "Monaco"').then(()=>{}).catch(()=>{})}oj();v0.createRoot(document.getElementById("root")).render(c.jsx(w.StrictMode,{children:c.jsx(Zb,{children:c.jsx(cj,{})})}));