agent-dealer 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/server/dist/adapters/git-worktree.js +15 -0
- package/bundle/server/dist/adapters/git-worktree.test.js +30 -0
- package/bundle/server/dist/adapters/linear-inbox.js +97 -0
- package/bundle/server/dist/adapters/linear-inbox.test.js +299 -1
- package/bundle/server/dist/adapters/linear-sync.js +33 -10
- package/bundle/server/dist/coordinator/auto-merge.js +10 -0
- package/bundle/server/dist/coordinator/branch-progress.js +5 -4
- package/bundle/server/dist/coordinator/commands.js +37 -3
- package/bundle/server/dist/coordinator/developer-effect.js +33 -6
- package/bundle/server/dist/coordinator/linear-merge-verify.js +382 -0
- package/bundle/server/dist/coordinator/linear-merge-verify.test.js +376 -0
- package/bundle/server/dist/coordinator/prompts.js +9 -1
- package/bundle/server/dist/coordinator/prompts.test.js +93 -0
- package/bundle/server/dist/coordinator/source-attachments.js +473 -0
- package/bundle/server/dist/coordinator/source-attachments.test.js +284 -0
- package/bundle/server/dist/coordinator/source-reload.js +178 -0
- package/bundle/server/dist/db/schema.sql +28 -0
- package/bundle/server/dist/docs-linear-attachments.test.js +36 -0
- package/bundle/server/dist/paths.js +12 -0
- package/bundle/server/dist/repository/source-attachments.js +56 -0
- package/bundle/server/dist/routes/human-actions.js +17 -0
- package/bundle/server/dist/routes/issues-execution-contract.test.js +296 -0
- package/bundle/server/dist/routes/issues-source-attachments.test.js +411 -0
- package/bundle/server/dist/routes/issues.js +89 -1
- package/bundle/server/package.json +2 -2
- package/bundle/server/static-ui/assets/index-DDbJ9ZU7.js +64 -0
- package/bundle/server/static-ui/index.html +1 -1
- package/bundle/shared/dist/index.d.ts +108 -2
- package/bundle/shared/dist/index.js +12 -1
- package/bundle/shared/dist/issues.d.ts +43 -2
- package/bundle/shared/dist/issues.js +10 -0
- package/bundle/shared/dist/linear-intake.d.ts +85 -0
- package/bundle/shared/dist/linear-intake.js +56 -0
- package/bundle/shared/dist/linear-intake.test.js +55 -1
- package/bundle/shared/dist/workflow.d.ts +4 -4
- package/bundle/shared/dist/workflow.js +7 -0
- package/bundle/shared/package.json +1 -1
- package/package.json +1 -1
- package/bundle/server/static-ui/assets/index-BzLjMBI9.js +0 -64
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function s(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=s(d);fetch(d.href,f)}})();var Qo={exports:{}},Ns={};/**
|
|
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 Ip;function E0(){if(Ip)return Ns;Ip=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(u,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var x in d)x!=="key"&&(f[x]=d[x])}else f=d;return d=f.ref,{$$typeof:n,type:u,key:m,ref:d!==void 0?d:null,props:f}}return Ns.Fragment=l,Ns.jsx=s,Ns.jsxs=s,Ns}var Kp;function R0(){return Kp||(Kp=1,Qo.exports=E0()),Qo.exports}var r=R0(),Xo={exports:{}},ve={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Jp;function C0(){if(Jp)return ve;Jp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),D=Symbol.iterator;function X(_){return _===null||typeof _!="object"?null:(_=D&&_[D]||_["@@iterator"],typeof _=="function"?_:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,M={};function $(_,z,B){this.props=_,this.context=z,this.refs=M,this.updater=B||E}$.prototype.isReactComponent={},$.prototype.setState=function(_,z){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,z,"setState")},$.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function F(){}F.prototype=$.prototype;function W(_,z,B){this.props=_,this.context=z,this.refs=M,this.updater=B||E}var se=W.prototype=new F;se.constructor=W,Y(se,$.prototype),se.isPureReactComponent=!0;var Z=Array.isArray;function _e(){}var I={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function ze(_,z,B){var ae=B.ref;return{$$typeof:n,type:_,key:z,ref:ae!==void 0?ae:null,props:B}}function mt(_,z){return ze(_.type,z,_.props)}function wt(_){return typeof _=="object"&&_!==null&&_.$$typeof===n}function st(_){var z={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(B){return z[B]})}var dt=/\/+/g;function nt(_,z){return typeof _=="object"&&_!==null&&_.key!=null?st(""+_.key):z.toString(36)}function Ve(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(_e,_e):(_.status="pending",_.then(function(z){_.status==="pending"&&(_.status="fulfilled",_.value=z)},function(z){_.status==="pending"&&(_.status="rejected",_.reason=z)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function U(_,z,B,ae,he){var P=typeof _;(P==="undefined"||P==="boolean")&&(_=null);var re=!1;if(_===null)re=!0;else switch(P){case"bigint":case"string":case"number":re=!0;break;case"object":switch(_.$$typeof){case n:case l:re=!0;break;case w:return re=_._init,U(re(_._payload),z,B,ae,he)}}if(re)return he=he(_),re=ae===""?"."+nt(_,0):ae,Z(he)?(B="",re!=null&&(B=re.replace(dt,"$&/")+"/"),U(he,z,B,"",function($t){return $t})):he!=null&&(wt(he)&&(he=mt(he,B+(he.key==null||_&&_.key===he.key?"":(""+he.key).replace(dt,"$&/")+"/")+re)),z.push(he)),1;re=0;var Ze=ae===""?".":ae+":";if(Z(_))for(var Be=0;Be<_.length;Be++)ae=_[Be],P=Ze+nt(ae,Be),re+=U(ae,z,B,P,he);else if(Be=X(_),typeof Be=="function")for(_=Be.call(_),Be=0;!(ae=_.next()).done;)ae=ae.value,P=Ze+nt(ae,Be++),re+=U(ae,z,B,P,he);else if(P==="object"){if(typeof _.then=="function")return U(Ve(_),z,B,ae,he);throw z=String(_),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return re}function J(_,z,B){if(_==null)return _;var ae=[],he=0;return U(_,ae,"","",function(P){return z.call(B,P,he++)}),ae}function oe(_){if(_._status===-1){var z=_._result;z=z(),z.then(function(B){(_._status===0||_._status===-1)&&(_._status=1,_._result=B)},function(B){(_._status===0||_._status===-1)&&(_._status=2,_._result=B)}),_._status===-1&&(_._status=0,_._result=z)}if(_._status===1)return _._result.default;throw _._result}var Me=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},Ue={map:J,forEach:function(_,z,B){J(_,function(){z.apply(this,arguments)},B)},count:function(_){var z=0;return J(_,function(){z++}),z},toArray:function(_){return J(_,function(z){return z})||[]},only:function(_){if(!wt(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return ve.Activity=j,ve.Children=Ue,ve.Component=$,ve.Fragment=s,ve.Profiler=d,ve.PureComponent=W,ve.StrictMode=u,ve.Suspense=y,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ve.__COMPILER_RUNTIME={__proto__:null,c:function(_){return I.H.useMemoCache(_)}},ve.cache=function(_){return function(){return _.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(_,z,B){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var ae=Y({},_.props),he=_.key;if(z!=null)for(P in z.key!==void 0&&(he=""+z.key),z)!ye.call(z,P)||P==="key"||P==="__self"||P==="__source"||P==="ref"&&z.ref===void 0||(ae[P]=z[P]);var P=arguments.length-2;if(P===1)ae.children=B;else if(1<P){for(var re=Array(P),Ze=0;Ze<P;Ze++)re[Ze]=arguments[Ze+2];ae.children=re}return ze(_.type,he,ae)},ve.createContext=function(_){return _={$$typeof:m,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:f,_context:_},_},ve.createElement=function(_,z,B){var ae,he={},P=null;if(z!=null)for(ae in z.key!==void 0&&(P=""+z.key),z)ye.call(z,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(he[ae]=z[ae]);var re=arguments.length-2;if(re===1)he.children=B;else if(1<re){for(var Ze=Array(re),Be=0;Be<re;Be++)Ze[Be]=arguments[Be+2];he.children=Ze}if(_&&_.defaultProps)for(ae in re=_.defaultProps,re)he[ae]===void 0&&(he[ae]=re[ae]);return ze(_,P,he)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(_){return{$$typeof:x,render:_}},ve.isValidElement=wt,ve.lazy=function(_){return{$$typeof:w,_payload:{_status:-1,_result:_},_init:oe}},ve.memo=function(_,z){return{$$typeof:v,type:_,compare:z===void 0?null:z}},ve.startTransition=function(_){var z=I.T,B={};I.T=B;try{var ae=_(),he=I.S;he!==null&&he(B,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(_e,Me)}catch(P){Me(P)}finally{z!==null&&B.types!==null&&(z.types=B.types),I.T=z}},ve.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ve.use=function(_){return I.H.use(_)},ve.useActionState=function(_,z,B){return I.H.useActionState(_,z,B)},ve.useCallback=function(_,z){return I.H.useCallback(_,z)},ve.useContext=function(_){return I.H.useContext(_)},ve.useDebugValue=function(){},ve.useDeferredValue=function(_,z){return I.H.useDeferredValue(_,z)},ve.useEffect=function(_,z){return I.H.useEffect(_,z)},ve.useEffectEvent=function(_){return I.H.useEffectEvent(_)},ve.useId=function(){return I.H.useId()},ve.useImperativeHandle=function(_,z,B){return I.H.useImperativeHandle(_,z,B)},ve.useInsertionEffect=function(_,z){return I.H.useInsertionEffect(_,z)},ve.useLayoutEffect=function(_,z){return I.H.useLayoutEffect(_,z)},ve.useMemo=function(_,z){return I.H.useMemo(_,z)},ve.useOptimistic=function(_,z){return I.H.useOptimistic(_,z)},ve.useReducer=function(_,z,B){return I.H.useReducer(_,z,B)},ve.useRef=function(_){return I.H.useRef(_)},ve.useState=function(_){return I.H.useState(_)},ve.useSyncExternalStore=function(_,z,B){return I.H.useSyncExternalStore(_,z,B)},ve.useTransition=function(){return I.H.useTransition()},ve.version="19.2.7",ve}var Fp;function Dd(){return Fp||(Fp=1,Xo.exports=C0()),Xo.exports}var b=Dd(),Io={exports:{}},_s={},Ko={exports:{}},Jo={};/**
|
|
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 Wp;function T0(){return Wp||(Wp=1,(function(n){function l(U,J){var oe=U.length;U.push(J);e:for(;0<oe;){var Me=oe-1>>>1,Ue=U[Me];if(0<d(Ue,J))U[Me]=J,U[oe]=Ue,oe=Me;else break e}}function s(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var J=U[0],oe=U.pop();if(oe!==J){U[0]=oe;e:for(var Me=0,Ue=U.length,_=Ue>>>1;Me<_;){var z=2*(Me+1)-1,B=U[z],ae=z+1,he=U[ae];if(0>d(B,oe))ae<Ue&&0>d(he,B)?(U[Me]=he,U[ae]=oe,Me=ae):(U[Me]=B,U[z]=oe,Me=z);else if(ae<Ue&&0>d(he,oe))U[Me]=he,U[ae]=oe,Me=ae;else break e}}return J}function d(U,J){var oe=U.sortIndex-J.sortIndex;return oe!==0?oe:U.id-J.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,x=m.now();n.unstable_now=function(){return m.now()-x}}var y=[],v=[],w=1,j=null,D=3,X=!1,E=!1,Y=!1,M=!1,$=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function se(U){for(var J=s(v);J!==null;){if(J.callback===null)u(v);else if(J.startTime<=U)u(v),J.sortIndex=J.expirationTime,l(y,J);else break;J=s(v)}}function Z(U){if(Y=!1,se(U),!E)if(s(y)!==null)E=!0,_e||(_e=!0,st());else{var J=s(v);J!==null&&Ve(Z,J.startTime-U)}}var _e=!1,I=-1,ye=5,ze=-1;function mt(){return M?!0:!(n.unstable_now()-ze<ye)}function wt(){if(M=!1,_e){var U=n.unstable_now();ze=U;var J=!0;try{e:{E=!1,Y&&(Y=!1,F(I),I=-1),X=!0;var oe=D;try{t:{for(se(U),j=s(y);j!==null&&!(j.expirationTime>U&&mt());){var Me=j.callback;if(typeof Me=="function"){j.callback=null,D=j.priorityLevel;var Ue=Me(j.expirationTime<=U);if(U=n.unstable_now(),typeof Ue=="function"){j.callback=Ue,se(U),J=!0;break t}j===s(y)&&u(y),se(U)}else u(y);j=s(y)}if(j!==null)J=!0;else{var _=s(v);_!==null&&Ve(Z,_.startTime-U),J=!1}}break e}finally{j=null,D=oe,X=!1}J=void 0}}finally{J?st():_e=!1}}}var st;if(typeof W=="function")st=function(){W(wt)};else if(typeof MessageChannel<"u"){var dt=new MessageChannel,nt=dt.port2;dt.port1.onmessage=wt,st=function(){nt.postMessage(null)}}else st=function(){$(wt,0)};function Ve(U,J){I=$(function(){U(n.unstable_now())},J)}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"):ye=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 J=3;break;default:J=D}var oe=D;D=J;try{return U()}finally{D=oe}},n.unstable_requestPaint=function(){M=!0},n.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var oe=D;D=U;try{return J()}finally{D=oe}},n.unstable_scheduleCallback=function(U,J,oe){var Me=n.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?Me+oe:Me):oe=Me,U){case 1:var Ue=-1;break;case 2:Ue=250;break;case 5:Ue=1073741823;break;case 4:Ue=1e4;break;default:Ue=5e3}return Ue=oe+Ue,U={id:w++,callback:J,priorityLevel:U,startTime:oe,expirationTime:Ue,sortIndex:-1},oe>Me?(U.sortIndex=oe,l(v,U),s(y)===null&&U===s(v)&&(Y?(F(I),I=-1):Y=!0,Ve(Z,oe-Me))):(U.sortIndex=Ue,l(y,U),E||X||(E=!0,_e||(_e=!0,st()))),U},n.unstable_shouldYield=mt,n.unstable_wrapCallback=function(U){var J=D;return function(){var oe=D;D=J;try{return U.apply(this,arguments)}finally{D=oe}}}})(Jo)),Jo}var Pp;function O0(){return Pp||(Pp=1,Ko.exports=T0()),Ko.exports}var Fo={exports:{}},zt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var ex;function M0(){if(ex)return zt;ex=1;var n=Dd();function l(y){var v="https://react.dev/errors/"+y;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)v+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var u={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(y,v,w){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:y,containerInfo:v,implementation:w}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,v){if(y==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,zt.createPortal=function(y,v){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(l(299));return f(y,v,null,w)},zt.flushSync=function(y){var v=m.T,w=u.p;try{if(m.T=null,u.p=2,y)return y()}finally{m.T=v,u.p=w,u.d.f()}},zt.preconnect=function(y,v){typeof y=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(y,v))},zt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},zt.preinit=function(y,v){if(typeof y=="string"&&v&&typeof v.as=="string"){var w=v.as,j=x(w,v.crossOrigin),D=typeof v.integrity=="string"?v.integrity:void 0,X=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;w==="style"?u.d.S(y,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:j,integrity:D,fetchPriority:X}):w==="script"&&u.d.X(y,{crossOrigin:j,integrity:D,fetchPriority:X,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},zt.preinitModule=function(y,v){if(typeof y=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var w=x(v.as,v.crossOrigin);u.d.M(y,{crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&u.d.M(y)},zt.preload=function(y,v){if(typeof y=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var w=v.as,j=x(w,v.crossOrigin);u.d.L(y,w,{crossOrigin:j,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},zt.preloadModule=function(y,v){if(typeof y=="string")if(v){var w=x(v.as,v.crossOrigin);u.d.m(y,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else u.d.m(y)},zt.requestFormReset=function(y){u.d.r(y)},zt.unstable_batchedUpdates=function(y,v){return y(v)},zt.useFormState=function(y,v,w){return m.H.useFormState(y,v,w)},zt.useFormStatus=function(){return m.H.useHostTransitionStatus()},zt.version="19.2.7",zt}var tx;function L0(){if(tx)return Fo.exports;tx=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(l){console.error(l)}}return n(),Fo.exports=M0(),Fo.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 ax;function D0(){if(ax)return _s;ax=1;var n=O0(),l=Dd(),s=L0();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 x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(f(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,i=t;;){var c=a.return;if(c===null)break;var o=c.alternate;if(o===null){if(i=c.return,i!==null){a=i;continue}break}if(c.child===o.child){for(o=c.child;o;){if(o===a)return y(c),e;if(o===i)return y(c),t;o=o.sibling}throw Error(u(188))}if(a.return!==i.return)a=c,i=o;else{for(var h=!1,g=c.child;g;){if(g===a){h=!0,a=c,i=o;break}if(g===i){h=!0,i=c,a=o;break}g=g.sibling}if(!h){for(g=o.child;g;){if(g===a){h=!0,a=o,i=c;break}if(g===i){h=!0,i=o,a=c;break}g=g.sibling}if(!h)throw Error(u(189))}}if(a.alternate!==i)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,D=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),W=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),_e=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),ze=Symbol.for("react.activity"),mt=Symbol.for("react.memo_cache_sentinel"),wt=Symbol.iterator;function st(e){return e===null||typeof e!="object"?null:(e=wt&&e[wt]||e["@@iterator"],typeof e=="function"?e:null)}var dt=Symbol.for("react.client.reference");function nt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===dt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Y:return"Fragment";case $:return"Profiler";case M:return"StrictMode";case Z:return"Suspense";case _e:return"SuspenseList";case ze:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case W:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:nt(e.type)||"Memo";case ye:t=e._payload,e=e._init;try{return nt(e(t))}catch{}}return null}var Ve=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},Me=[],Ue=-1;function _(e){return{current:e}}function z(e){0>Ue||(e.current=Me[Ue],Me[Ue]=null,Ue--)}function B(e,t){Ue++,Me[Ue]=e.current,e.current=t}var ae=_(null),he=_(null),P=_(null),re=_(null);function Ze(e,t){switch(B(P,t),B(he,e),B(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=yp(t),e=vp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(ae),B(ae,e)}function Be(){z(ae),z(he),z(P)}function $t(e){e.memoizedState!==null&&B(re,e);var t=ae.current,a=vp(t,e.type);t!==a&&(B(he,e),B(ae,a))}function Je(e){he.current===e&&(z(ae),z(he)),re.current===e&&(z(re),bs._currentValue=oe)}var Jt,St;function Fe(e){if(Jt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Jt=t&&t[1]||"",St=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Jt+e+St}var An=!1;function Ra(e,t){if(!e||An)return"";An=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(L){var O=L}Reflect.construct(e,[],G)}else{try{G.call()}catch(L){O=L}e.call(G.prototype)}}else{try{throw Error()}catch(L){O=L}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(L){if(L&&O&&typeof L.stack=="string")return[L.stack,O.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),h=o[0],g=o[1];if(h&&g){var S=h.split(`
|
|
44
|
+
`),C=g.split(`
|
|
45
|
+
`);for(c=i=0;i<S.length&&!S[i].includes("DetermineComponentFrameRoot");)i++;for(;c<C.length&&!C[c].includes("DetermineComponentFrameRoot");)c++;if(i===S.length||c===C.length)for(i=S.length-1,c=C.length-1;1<=i&&0<=c&&S[i]!==C[c];)c--;for(;1<=i&&0<=c;i--,c--)if(S[i]!==C[c]){if(i!==1||c!==1)do if(i--,c--,0>c||S[i]!==C[c]){var H=`
|
|
46
|
+
`+S[i].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=i&&0<=c);break}}}finally{An=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fe(a):""}function Wa(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return e.child!==t&&t!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Ra(e.type,!1);case 11:return Ra(e.type.render,!1);case 1:return Ra(e.type,!0);case 31:return Fe("Activity");default:return""}}function Ca(e){try{var t="",a=null;do t+=Wa(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var qe=Object.prototype.hasOwnProperty,Dt=n.unstable_scheduleCallback,Pa=n.unstable_cancelCallback,ke=n.unstable_shouldYield,zl=n.unstable_requestPaint,_t=n.unstable_now,Ta=n.unstable_getCurrentPriorityLevel,Bl=n.unstable_ImmediatePriority,kn=n.unstable_UserBlockingPriority,En=n.unstable_NormalPriority,ul=n.unstable_LowPriority,Ft=n.unstable_IdlePriority,en=n.log,$a=n.unstable_setDisableYieldValue,Ct=null,Ae=null;function Wt(e){if(typeof en=="function"&&$a(e),Ae&&typeof Ae.setStrictMode=="function")try{Ae.setStrictMode(Ct,e)}catch{}}var At=Math.clz32?Math.clz32:Mi,ql=Math.log,cl=Math.LN2;function Mi(e){return e>>>=0,e===0?32:31-(ql(e)/cl|0)|0}var Rn=256,Cn=262144,pt=4194304;function ca(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Tn(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var c=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var g=i&134217727;return g!==0?(i=g&~o,i!==0?c=ca(i):(h&=g,h!==0?c=ca(h):a||(a=g&~e,a!==0&&(c=ca(a))))):(g=i&~o,g!==0?c=ca(g):h!==0?c=ca(h):a||(a=i&~e,a!==0&&(c=ca(a)))),c===0?0:t!==0&&t!==c&&(t&o)===0&&(o=c&-c,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:c}function tn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Li(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 On(){var e=pt;return pt<<=1,(pt&62914560)===0&&(pt=4194304),e}function ol(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ya(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dl(e,t,a,i,c,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 g=e.entanglements,S=e.expirationTimes,C=e.hiddenUpdates;for(a=h&~a;0<a;){var H=31-At(a),G=1<<H;g[H]=0,S[H]=-1;var O=C[H];if(O!==null)for(C[H]=null,H=0;H<O.length;H++){var L=O[H];L!==null&&(L.lane&=-536870913)}a&=~G}i!==0&&Q(e,i,0),o!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=o&~(h&~t))}function Q(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-At(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function je(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-At(a),c=1<<i;c&t|e[i]&t&&(e[i]|=t),a&=~c}}function tt(e,t){var a=t&-t;return a=(a&42)!==0?1:kt(a),(a&(e.suspendedLanes|t))!==0?0:a}function kt(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 Va(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jt(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:$p(e.type))}function oa(e,t){var a=J.p;try{return J.p=e,t()}finally{J.p=a}}var T=Math.random().toString(36).slice(2),ee="__reactFiber$"+T,Ne="__reactProps$"+T,Ut="__reactContainer$"+T,Uu="__reactEvents$"+T,yv="__reactListeners$"+T,vv="__reactHandles$"+T,nf="__reactResources$"+T,Di="__reactMarker$"+T;function zu(e){delete e[ee],delete e[Ne],delete e[Uu],delete e[yv],delete e[vv]}function Hl(e){var t=e[ee];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Ut]||a[ee]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=_p(e);e!==null;){if(a=e[ee])return a;e=_p(e)}return t}e=a,a=e.parentNode}return null}function $l(e){if(e=e[ee]||e[Ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ui(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Yl(e){var t=e[nf];return t||(t=e[nf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Di]=!0}var lf=new Set,sf={};function fl(e,t){Vl(e,t),Vl(e+"Capture",t)}function Vl(e,t){for(sf[e]=t,e=0;e<t.length;e++)lf.add(t[e])}var gv=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]*$"),rf={},uf={};function bv(e){return qe.call(uf,e)?!0:qe.call(rf,e)?!1:gv.test(e)?uf[e]=!0:(rf[e]=!0,!1)}function Hs(e,t,a){if(bv(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function $s(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 an(e,t,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+i)}}function da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wv(e,t,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,o=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){a=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bu(e){if(!e._valueTracker){var t=cf(e)?"checked":"value";e._valueTracker=wv(e,t,""+e[t])}}function of(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=cf(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function Ys(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 Sv=/[\n"\\]/g;function fa(e){return e.replace(Sv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function qu(e,t,a,i,c,o,h,g){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Hu(e,h,da(t)):a!=null?Hu(e,h,da(a)):i!=null&&e.removeAttribute("value"),c==null&&o!=null&&(e.defaultChecked=!!o),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+da(g):e.removeAttribute("name")}function df(e,t,a,i,c,o,h,g){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)){Bu(e);return}a=a!=null?""+da(a):"",t=t!=null?""+da(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=g?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Bu(e)}function Hu(e,t,a){t==="number"&&Ys(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Zl(e,t,a,i){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&i&&(e[a].defaultSelected=!0)}else{for(a=""+da(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ff(e,t,a){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+da(a):""}function hf(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(u(92));if(Ve(i)){if(1<i.length)throw Error(u(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=da(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),Bu(e)}function Gl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var jv=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 mf(e,t,a){var i=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,a):typeof a!="number"||a===0||jv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function pf(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var c in t)i=t[c],t.hasOwnProperty(c)&&a[c]!==i&&mf(e,c,i)}else for(var o in t)t.hasOwnProperty(o)&&mf(e,o,t[o])}function $u(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 Nv=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"]]),_v=/^[\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 Vs(e){return _v.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nn(){}var Yu=null;function Vu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Xl=null;function xf(e){var t=$l(e);if(t&&(e=t.stateNode)){var a=e[Ne]||null;e:switch(e=t.stateNode,t.type){case"input":if(qu(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="'+fa(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var c=i[Ne]||null;if(!c)throw Error(u(90));qu(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&of(i)}break e;case"textarea":ff(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Zl(e,!!a.multiple,t,!1)}}}var Zu=!1;function yf(e,t,a){if(Zu)return e(t,a);Zu=!0;try{var i=e(t);return i}finally{if(Zu=!1,(Ql!==null||Xl!==null)&&(Cr(),Ql&&(t=Ql,e=Xl,Xl=Ql=null,xf(t),e)))for(t=0;t<e.length;t++)xf(e[t])}}function zi(e,t){var a=e.stateNode;if(a===null)return null;var i=a[Ne]||null;if(i===null)return null;a=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var ln=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(ln)try{var Bi={};Object.defineProperty(Bi,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{Gu=!1}var Mn=null,Qu=null,Zs=null;function vf(){if(Zs)return Zs;var e,t=Qu,a=t.length,i,c="value"in Mn?Mn.value:Mn.textContent,o=c.length;for(e=0;e<a&&t[e]===c[e];e++);var h=a-e;for(i=1;i<=h&&t[a-i]===c[o-i];i++);return Zs=c.slice(e,1<i?1-i:void 0)}function Gs(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 Qs(){return!0}function gf(){return!1}function Yt(e){function t(a,i,c,o,h){this._reactName=a,this._targetInst=c,this.type=i,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(o):o[g]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Qs:gf,this.isPropagationStopped=gf,this}return j(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=Qs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qs)},persist:function(){},isPersistent:Qs}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xs=Yt(hl),qi=j({},hl,{view:0,detail:0}),Av=Yt(qi),Xu,Iu,Hi,Is=j({},qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ju,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!==Hi&&(Hi&&e.type==="mousemove"?(Xu=e.screenX-Hi.screenX,Iu=e.screenY-Hi.screenY):Iu=Xu=0,Hi=e),Xu)},movementY:function(e){return"movementY"in e?e.movementY:Iu}}),bf=Yt(Is),kv=j({},Is,{dataTransfer:0}),Ev=Yt(kv),Rv=j({},qi,{relatedTarget:0}),Ku=Yt(Rv),Cv=j({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),Tv=Yt(Cv),Ov=j({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mv=Yt(Ov),Lv=j({},hl,{data:0}),wf=Yt(Lv),Dv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uv={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"},zv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zv[e])?!!t[e]:!1}function Ju(){return Bv}var qv=j({},qi,{key:function(e){if(e.key){var t=Dv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Uv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ju,charCode:function(e){return e.type==="keypress"?Gs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hv=Yt(qv),$v=j({},Is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sf=Yt($v),Yv=j({},qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ju}),Vv=Yt(Yv),Zv=j({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gv=Yt(Zv),Qv=j({},Is,{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}),Xv=Yt(Qv),Iv=j({},hl,{newState:0,oldState:0}),Kv=Yt(Iv),Jv=[9,13,27,32],Fu=ln&&"CompositionEvent"in window,$i=null;ln&&"documentMode"in document&&($i=document.documentMode);var Fv=ln&&"TextEvent"in window&&!$i,jf=ln&&(!Fu||$i&&8<$i&&11>=$i),Nf=" ",_f=!1;function Af(e,t){switch(e){case"keyup":return Jv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Il=!1;function Wv(e,t){switch(e){case"compositionend":return kf(t);case"keypress":return t.which!==32?null:(_f=!0,Nf);case"textInput":return e=t.data,e===Nf&&_f?null:e;default:return null}}function Pv(e,t){if(Il)return e==="compositionend"||!Fu&&Af(e,t)?(e=vf(),Zs=Qu=Mn=null,Il=!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 jf&&t.locale!=="ko"?null:t.data;default:return null}}var eg={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 Ef(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!eg[e.type]:t==="textarea"}function Rf(e,t,a,i){Ql?Xl?Xl.push(i):Xl=[i]:Ql=i,t=zr(t,"onChange"),0<t.length&&(a=new Xs("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var Yi=null,Vi=null;function tg(e){dp(e,0)}function Ks(e){var t=Ui(e);if(of(t))return e}function Cf(e,t){if(e==="change")return t}var Tf=!1;if(ln){var Wu;if(ln){var Pu="oninput"in document;if(!Pu){var Of=document.createElement("div");Of.setAttribute("oninput","return;"),Pu=typeof Of.oninput=="function"}Wu=Pu}else Wu=!1;Tf=Wu&&(!document.documentMode||9<document.documentMode)}function Mf(){Yi&&(Yi.detachEvent("onpropertychange",Lf),Vi=Yi=null)}function Lf(e){if(e.propertyName==="value"&&Ks(Vi)){var t=[];Rf(t,Vi,e,Vu(e)),yf(tg,t)}}function ag(e,t,a){e==="focusin"?(Mf(),Yi=t,Vi=a,Yi.attachEvent("onpropertychange",Lf)):e==="focusout"&&Mf()}function ng(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ks(Vi)}function lg(e,t){if(e==="click")return Ks(t)}function ig(e,t){if(e==="input"||e==="change")return Ks(t)}function sg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:sg;function Zi(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var c=a[i];if(!qe.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Uf(e,t){var a=Df(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=t&&i>=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Df(a)}}function zf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ys(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=Ys(e.document)}return t}function ec(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var rg=ln&&"documentMode"in document&&11>=document.documentMode,Kl=null,tc=null,Gi=null,ac=!1;function qf(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ac||Kl==null||Kl!==Ys(i)||(i=Kl,"selectionStart"in i&&ec(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Gi&&Zi(Gi,i)||(Gi=i,i=zr(tc,"onSelect"),0<i.length&&(t=new Xs("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=Kl)))}function ml(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Jl={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},nc={},Hf={};ln&&(Hf=document.createElement("div").style,"AnimationEvent"in window||(delete Jl.animationend.animation,delete Jl.animationiteration.animation,delete Jl.animationstart.animation),"TransitionEvent"in window||delete Jl.transitionend.transition);function pl(e){if(nc[e])return nc[e];if(!Jl[e])return e;var t=Jl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Hf)return nc[e]=t[a];return e}var $f=pl("animationend"),Yf=pl("animationiteration"),Vf=pl("animationstart"),ug=pl("transitionrun"),cg=pl("transitionstart"),og=pl("transitioncancel"),Zf=pl("transitionend"),Gf=new Map,lc="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(" ");lc.push("scrollEnd");function Oa(e,t){Gf.set(e,t),fl(t,[e])}var Js=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ha=[],Fl=0,ic=0;function Fs(){for(var e=Fl,t=ic=Fl=0;t<e;){var a=ha[t];ha[t++]=null;var i=ha[t];ha[t++]=null;var c=ha[t];ha[t++]=null;var o=ha[t];if(ha[t++]=null,i!==null&&c!==null){var h=i.pending;h===null?c.next=c:(c.next=h.next,h.next=c),i.pending=c}o!==0&&Qf(a,c,o)}}function Ws(e,t,a,i){ha[Fl++]=e,ha[Fl++]=t,ha[Fl++]=a,ha[Fl++]=i,ic|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function sc(e,t,a,i){return Ws(e,t,a,i),Ps(e)}function xl(e,t){return Ws(e,null,null,t),Ps(e)}function Qf(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var c=!1,o=e.return;o!==null;)o.childLanes|=a,i=o.alternate,i!==null&&(i.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(c=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,c&&t!==null&&(c=31-At(a),e=o.hiddenUpdates,i=e[c],i===null?e[c]=[t]:i.push(t),t.lane=a|536870912),o):null}function Ps(e){if(50<hs)throw hs=0,xo=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wl={};function dg(e,t,a,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(e,t,a,i){return new dg(e,t,a,i)}function rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sn(e,t){var a=e.alternate;return a===null?(a=ea(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 Xf(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 er(e,t,a,i,c,o){var h=0;if(i=e,typeof e=="function")rc(e)&&(h=1);else if(typeof e=="string")h=x0(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ze:return e=ea(31,a,t,c),e.elementType=ze,e.lanes=o,e;case Y:return yl(a.children,c,o,t);case M:h=8,c|=24;break;case $:return e=ea(12,a,t,c|2),e.elementType=$,e.lanes=o,e;case Z:return e=ea(13,a,t,c),e.elementType=Z,e.lanes=o,e;case _e:return e=ea(19,a,t,c),e.elementType=_e,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:h=10;break e;case F:h=9;break e;case se:h=11;break e;case I:h=14;break e;case ye:h=16,i=null;break e}h=29,a=Error(u(130,e===null?"null":typeof e,"")),i=null}return t=ea(h,a,t,c),t.elementType=e,t.type=i,t.lanes=o,t}function yl(e,t,a,i){return e=ea(7,e,i,t),e.lanes=a,e}function uc(e,t,a){return e=ea(6,e,null,t),e.lanes=a,e}function If(e){var t=ea(18,null,null,0);return t.stateNode=e,t}function cc(e,t,a){return t=ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Kf=new WeakMap;function ma(e,t){if(typeof e=="object"&&e!==null){var a=Kf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ca(t)},Kf.set(e,t),t)}return{value:e,source:t,stack:Ca(t)}}var Pl=[],ei=0,tr=null,Qi=0,pa=[],xa=0,Ln=null,Za=1,Ga="";function rn(e,t){Pl[ei++]=Qi,Pl[ei++]=tr,tr=e,Qi=t}function Jf(e,t,a){pa[xa++]=Za,pa[xa++]=Ga,pa[xa++]=Ln,Ln=e;var i=Za;e=Ga;var c=32-At(i)-1;i&=~(1<<c),a+=1;var o=32-At(t)+c;if(30<o){var h=c-c%5;o=(i&(1<<h)-1).toString(32),i>>=h,c-=h,Za=1<<32-At(t)+c|a<<c|i,Ga=o+e}else Za=1<<o|a<<c|i,Ga=e}function oc(e){e.return!==null&&(rn(e,1),Jf(e,1,0))}function dc(e){for(;e===tr;)tr=Pl[--ei],Pl[ei]=null,Qi=Pl[--ei],Pl[ei]=null;for(;e===Ln;)Ln=pa[--xa],pa[xa]=null,Ga=pa[--xa],pa[xa]=null,Za=pa[--xa],pa[xa]=null}function Ff(e,t){pa[xa++]=Za,pa[xa++]=Ga,pa[xa++]=Ln,Za=t.id,Ga=t.overflow,Ln=e}var Tt=null,lt=null,Le=!1,Dn=null,ya=!1,fc=Error(u(519));function Un(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xi(ma(t,e)),fc}function Wf(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[ee]=e,t[Ne]=i,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<ps.length;a++)Re(ps[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),df(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),hf(t,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||i.suppressHydrationWarning===!0||pp(t.textContent,a)?(i.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),i.onScroll!=null&&Re("scroll",t),i.onScrollEnd!=null&&Re("scrollend",t),i.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Un(e,!0)}function Pf(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:ya=!1;return;case 27:case 3:ya=!0;return;default:Tt=Tt.return}}function ti(e){if(e!==Tt)return!1;if(!Le)return Pf(e),Le=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||To(e.type,e.memoizedProps)),a=!a),a&<&&Un(e),Pf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));lt=Np(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));lt=Np(e)}else t===27?(t=lt,Jn(e.type)?(e=Uo,Uo=null,lt=e):lt=t):lt=Tt?ga(e.stateNode.nextSibling):null;return!0}function vl(){lt=Tt=null,Le=!1}function hc(){var e=Dn;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),Dn=null),e}function Xi(e){Dn===null?Dn=[e]:Dn.push(e)}var mc=_(null),gl=null,un=null;function zn(e,t,a){B(mc,t._currentValue),t._currentValue=a}function cn(e){e._currentValue=mc.current,z(mc)}function pc(e,t,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===a)break;e=e.return}}function xc(e,t,a,i){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var o=c.dependencies;if(o!==null){var h=c.child;o=o.firstContext;e:for(;o!==null;){var g=o;o=c;for(var S=0;S<t.length;S++)if(g.context===t[S]){o.lanes|=a,g=o.alternate,g!==null&&(g.lanes|=a),pc(o.return,a,e),i||(h=null);break e}o=g.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(u(341));h.lanes|=a,o=h.alternate,o!==null&&(o.lanes|=a),pc(h,a,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function ai(e,t,a,i){e=null;for(var c=t,o=!1;c!==null;){if(!o){if((c.flags&524288)!==0)o=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var g=c.type;Pt(c.pendingProps.value,h.value)||(e!==null?e.push(g):e=[g])}}else if(c===re.current){if(h=c.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(bs):e=[bs])}c=c.return}e!==null&&xc(t,e,a,i),t.flags|=262144}function ar(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bl(e){gl=e,un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ot(e){return eh(gl,e)}function nr(e,t){return gl===null&&bl(e),eh(e,t)}function eh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},un===null){if(e===null)throw Error(u(308));un=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else un=un.next=t;return a}var fg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},hg=n.unstable_scheduleCallback,mg=n.unstable_NormalPriority,xt={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yc(){return{controller:new fg,data:new Map,refCount:0}}function Ii(e){e.refCount--,e.refCount===0&&hg(mg,function(){e.controller.abort()})}var Ki=null,vc=0,ni=0,li=null;function pg(e,t){if(Ki===null){var a=Ki=[];vc=0,ni=So(),li={status:"pending",value:void 0,then:function(i){a.push(i)}}}return vc++,t.then(th,th),t}function th(){if(--vc===0&&Ki!==null){li!==null&&(li.status="fulfilled");var e=Ki;Ki=null,ni=0,li=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xg(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(i.status="rejected",i.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),i}var ah=U.S;U.S=function(e,t){qm=_t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&pg(e,t),ah!==null&&ah(e,t)};var wl=_(null);function gc(){var e=wl.current;return e!==null?e:at.pooledCache}function lr(e,t){t===null?B(wl,wl.current):B(wl,t.pool)}function nh(){var e=gc();return e===null?null:{parent:xt._currentValue,pool:e}}var ii=Error(u(460)),bc=Error(u(474)),ir=Error(u(542)),sr={then:function(){}};function lh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ih(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(nn,nn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rh(e),e;default:if(typeof t.status=="string")t.then(nn,nn);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=i}},function(i){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rh(e),e}throw jl=t,ii}}function Sl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(jl=a,ii):a}}var jl=null;function sh(){if(jl===null)throw Error(u(459));var e=jl;return jl=null,e}function rh(e){if(e===ii||e===ir)throw Error(u(483))}var si=null,Ji=0;function rr(e){var t=Ji;return Ji+=1,si===null&&(si=[]),ih(si,e,t)}function Fi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ur(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 uh(e){function t(A,N){if(e){var R=A.deletions;R===null?(A.deletions=[N],A.flags|=16):R.push(N)}}function a(A,N){if(!e)return null;for(;N!==null;)t(A,N),N=N.sibling;return null}function i(A){for(var N=new Map;A!==null;)A.key!==null?N.set(A.key,A):N.set(A.index,A),A=A.sibling;return N}function c(A,N){return A=sn(A,N),A.index=0,A.sibling=null,A}function o(A,N,R){return A.index=R,e?(R=A.alternate,R!==null?(R=R.index,R<N?(A.flags|=67108866,N):R):(A.flags|=67108866,N)):(A.flags|=1048576,N)}function h(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function g(A,N,R,V){return N===null||N.tag!==6?(N=uc(R,A.mode,V),N.return=A,N):(N=c(N,R),N.return=A,N)}function S(A,N,R,V){var de=R.type;return de===Y?H(A,N,R.props.children,V,R.key):N!==null&&(N.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ye&&Sl(de)===N.type)?(N=c(N,R.props),Fi(N,R),N.return=A,N):(N=er(R.type,R.key,R.props,null,A.mode,V),Fi(N,R),N.return=A,N)}function C(A,N,R,V){return N===null||N.tag!==4||N.stateNode.containerInfo!==R.containerInfo||N.stateNode.implementation!==R.implementation?(N=cc(R,A.mode,V),N.return=A,N):(N=c(N,R.children||[]),N.return=A,N)}function H(A,N,R,V,de){return N===null||N.tag!==7?(N=yl(R,A.mode,V,de),N.return=A,N):(N=c(N,R),N.return=A,N)}function G(A,N,R){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=uc(""+N,A.mode,R),N.return=A,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case X:return R=er(N.type,N.key,N.props,null,A.mode,R),Fi(R,N),R.return=A,R;case E:return N=cc(N,A.mode,R),N.return=A,N;case ye:return N=Sl(N),G(A,N,R)}if(Ve(N)||st(N))return N=yl(N,A.mode,R,null),N.return=A,N;if(typeof N.then=="function")return G(A,rr(N),R);if(N.$$typeof===W)return G(A,nr(A,N),R);ur(A,N)}return null}function O(A,N,R,V){var de=N!==null?N.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return de!==null?null:g(A,N,""+R,V);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case X:return R.key===de?S(A,N,R,V):null;case E:return R.key===de?C(A,N,R,V):null;case ye:return R=Sl(R),O(A,N,R,V)}if(Ve(R)||st(R))return de!==null?null:H(A,N,R,V,null);if(typeof R.then=="function")return O(A,N,rr(R),V);if(R.$$typeof===W)return O(A,N,nr(A,R),V);ur(A,R)}return null}function L(A,N,R,V,de){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return A=A.get(R)||null,g(N,A,""+V,de);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case X:return A=A.get(V.key===null?R:V.key)||null,S(N,A,V,de);case E:return A=A.get(V.key===null?R:V.key)||null,C(N,A,V,de);case ye:return V=Sl(V),L(A,N,R,V,de)}if(Ve(V)||st(V))return A=A.get(R)||null,H(N,A,V,de,null);if(typeof V.then=="function")return L(A,N,R,rr(V),de);if(V.$$typeof===W)return L(A,N,R,nr(N,V),de);ur(N,V)}return null}function ie(A,N,R,V){for(var de=null,$e=null,ue=N,be=N=0,Te=null;ue!==null&&be<R.length;be++){ue.index>be?(Te=ue,ue=null):Te=ue.sibling;var Ye=O(A,ue,R[be],V);if(Ye===null){ue===null&&(ue=Te);break}e&&ue&&Ye.alternate===null&&t(A,ue),N=o(Ye,N,be),$e===null?de=Ye:$e.sibling=Ye,$e=Ye,ue=Te}if(be===R.length)return a(A,ue),Le&&rn(A,be),de;if(ue===null){for(;be<R.length;be++)ue=G(A,R[be],V),ue!==null&&(N=o(ue,N,be),$e===null?de=ue:$e.sibling=ue,$e=ue);return Le&&rn(A,be),de}for(ue=i(ue);be<R.length;be++)Te=L(ue,A,be,R[be],V),Te!==null&&(e&&Te.alternate!==null&&ue.delete(Te.key===null?be:Te.key),N=o(Te,N,be),$e===null?de=Te:$e.sibling=Te,$e=Te);return e&&ue.forEach(function(tl){return t(A,tl)}),Le&&rn(A,be),de}function me(A,N,R,V){if(R==null)throw Error(u(151));for(var de=null,$e=null,ue=N,be=N=0,Te=null,Ye=R.next();ue!==null&&!Ye.done;be++,Ye=R.next()){ue.index>be?(Te=ue,ue=null):Te=ue.sibling;var tl=O(A,ue,Ye.value,V);if(tl===null){ue===null&&(ue=Te);break}e&&ue&&tl.alternate===null&&t(A,ue),N=o(tl,N,be),$e===null?de=tl:$e.sibling=tl,$e=tl,ue=Te}if(Ye.done)return a(A,ue),Le&&rn(A,be),de;if(ue===null){for(;!Ye.done;be++,Ye=R.next())Ye=G(A,Ye.value,V),Ye!==null&&(N=o(Ye,N,be),$e===null?de=Ye:$e.sibling=Ye,$e=Ye);return Le&&rn(A,be),de}for(ue=i(ue);!Ye.done;be++,Ye=R.next())Ye=L(ue,A,be,Ye.value,V),Ye!==null&&(e&&Ye.alternate!==null&&ue.delete(Ye.key===null?be:Ye.key),N=o(Ye,N,be),$e===null?de=Ye:$e.sibling=Ye,$e=Ye);return e&&ue.forEach(function(k0){return t(A,k0)}),Le&&rn(A,be),de}function et(A,N,R,V){if(typeof R=="object"&&R!==null&&R.type===Y&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case X:e:{for(var de=R.key;N!==null;){if(N.key===de){if(de=R.type,de===Y){if(N.tag===7){a(A,N.sibling),V=c(N,R.props.children),V.return=A,A=V;break e}}else if(N.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ye&&Sl(de)===N.type){a(A,N.sibling),V=c(N,R.props),Fi(V,R),V.return=A,A=V;break e}a(A,N);break}else t(A,N);N=N.sibling}R.type===Y?(V=yl(R.props.children,A.mode,V,R.key),V.return=A,A=V):(V=er(R.type,R.key,R.props,null,A.mode,V),Fi(V,R),V.return=A,A=V)}return h(A);case E:e:{for(de=R.key;N!==null;){if(N.key===de)if(N.tag===4&&N.stateNode.containerInfo===R.containerInfo&&N.stateNode.implementation===R.implementation){a(A,N.sibling),V=c(N,R.children||[]),V.return=A,A=V;break e}else{a(A,N);break}else t(A,N);N=N.sibling}V=cc(R,A.mode,V),V.return=A,A=V}return h(A);case ye:return R=Sl(R),et(A,N,R,V)}if(Ve(R))return ie(A,N,R,V);if(st(R)){if(de=st(R),typeof de!="function")throw Error(u(150));return R=de.call(R),me(A,N,R,V)}if(typeof R.then=="function")return et(A,N,rr(R),V);if(R.$$typeof===W)return et(A,N,nr(A,R),V);ur(A,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,N!==null&&N.tag===6?(a(A,N.sibling),V=c(N,R),V.return=A,A=V):(a(A,N),V=uc(R,A.mode,V),V.return=A,A=V),h(A)):a(A,N)}return function(A,N,R,V){try{Ji=0;var de=et(A,N,R,V);return si=null,de}catch(ue){if(ue===ii||ue===ir)throw ue;var $e=ea(29,ue,null,A.mode);return $e.lanes=V,$e.return=A,$e}finally{}}}var Nl=uh(!0),ch=uh(!1),Bn=!1;function wc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sc(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 qn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Hn(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ge&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=Ps(e),Qf(e,null,a),t}return Ws(e,i,t,a),Ps(e)}function Wi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,je(e,a)}}function jc(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var c=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?c=o=h:o=o.next=h,a=a.next}while(a!==null);o===null?c=o=t:o=o.next=t}else c=o=t;a={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Nc=!1;function Pi(){if(Nc){var e=li;if(e!==null)throw e}}function es(e,t,a,i){Nc=!1;var c=e.updateQueue;Bn=!1;var o=c.firstBaseUpdate,h=c.lastBaseUpdate,g=c.shared.pending;if(g!==null){c.shared.pending=null;var S=g,C=S.next;S.next=null,h===null?o=C:h.next=C,h=S;var H=e.alternate;H!==null&&(H=H.updateQueue,g=H.lastBaseUpdate,g!==h&&(g===null?H.firstBaseUpdate=C:g.next=C,H.lastBaseUpdate=S))}if(o!==null){var G=c.baseState;h=0,H=C=S=null,g=o;do{var O=g.lane&-536870913,L=O!==g.lane;if(L?(Ce&O)===O:(i&O)===O){O!==0&&O===ni&&(Nc=!0),H!==null&&(H=H.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ie=e,me=g;O=t;var et=a;switch(me.tag){case 1:if(ie=me.payload,typeof ie=="function"){G=ie.call(et,G,O);break e}G=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=me.payload,O=typeof ie=="function"?ie.call(et,G,O):ie,O==null)break e;G=j({},G,O);break e;case 2:Bn=!0}}O=g.callback,O!==null&&(e.flags|=64,L&&(e.flags|=8192),L=c.callbacks,L===null?c.callbacks=[O]:L.push(O))}else L={lane:O,tag:g.tag,payload:g.payload,callback:g.callback,next:null},H===null?(C=H=L,S=G):H=H.next=L,h|=O;if(g=g.next,g===null){if(g=c.shared.pending,g===null)break;L=g,g=L.next,L.next=null,c.lastBaseUpdate=L,c.shared.pending=null}}while(!0);H===null&&(S=G),c.baseState=S,c.firstBaseUpdate=C,c.lastBaseUpdate=H,o===null&&(c.shared.lanes=0),Gn|=h,e.lanes=h,e.memoizedState=G}}function oh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function dh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)oh(a[e],t)}var ri=_(null),cr=_(0);function fh(e,t){e=vn,B(cr,e),B(ri,t),vn=e|t.baseLanes}function _c(){B(cr,vn),B(ri,ri.current)}function Ac(){vn=cr.current,z(ri),z(cr)}var ta=_(null),va=null;function $n(e){var t=e.alternate;B(ft,ft.current&1),B(ta,e),va===null&&(t===null||ri.current!==null||t.memoizedState!==null)&&(va=e)}function kc(e){B(ft,ft.current),B(ta,e),va===null&&(va=e)}function hh(e){e.tag===22?(B(ft,ft.current),B(ta,e),va===null&&(va=e)):Yn()}function Yn(){B(ft,ft.current),B(ta,ta.current)}function aa(e){z(ta),va===e&&(va=null),z(ft)}var ft=_(0);function or(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lo(a)||Do(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 on=0,ge=null,We=null,yt=null,dr=!1,ui=!1,_l=!1,fr=0,ts=0,ci=null,yg=0;function ct(){throw Error(u(321))}function Ec(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Pt(e[a],t[a]))return!1;return!0}function Rc(e,t,a,i,c,o){return on=o,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Jh:Zc,_l=!1,o=a(i,c),_l=!1,ui&&(o=ph(t,a,i,c)),mh(e),o}function mh(e){U.H=ls;var t=We!==null&&We.next!==null;if(on=0,yt=We=ge=null,dr=!1,ts=0,ci=null,t)throw Error(u(300));e===null||vt||(e=e.dependencies,e!==null&&ar(e)&&(vt=!0))}function ph(e,t,a,i){ge=e;var c=0;do{if(ui&&(ci=null),ts=0,ui=!1,25<=c)throw Error(u(301));if(c+=1,yt=We=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=Fh,o=t(a,i)}while(ui);return o}function vg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?as(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(ge.flags|=1024),t}function Cc(){var e=fr!==0;return fr=0,e}function Tc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Oc(e){if(dr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}dr=!1}on=0,yt=We=ge=null,ui=!1,ts=fr=0,ci=null}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?ge.memoizedState=yt=e:yt=yt.next=e,yt}function ht(){if(We===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=yt===null?ge.memoizedState:yt.next;if(t!==null)yt=t,We=e;else{if(e===null)throw ge.alternate===null?Error(u(467)):Error(u(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},yt===null?ge.memoizedState=yt=e:yt=yt.next=e}return yt}function hr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=ts;return ts+=1,ci===null&&(ci=[]),e=ih(ci,e,t),t=ge,(yt===null?t.memoizedState:yt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Jh:Zc),e}function mr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return as(e);if(e.$$typeof===W)return Ot(e)}throw Error(u(438,String(e)))}function Mc(e){var t=null,a=ge.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=ge.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=hr(),ge.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),i=0;i<e;i++)a[i]=mt;return t.index++,a}function dn(e,t){return typeof t=="function"?t(e):t}function pr(e){var t=ht();return Lc(t,We,e)}function Lc(e,t,a){var i=e.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=a;var c=e.baseQueue,o=i.pending;if(o!==null){if(c!==null){var h=c.next;c.next=o.next,o.next=h}t.baseQueue=c=o,i.pending=null}if(o=e.baseState,c===null)e.memoizedState=o;else{t=c.next;var g=h=null,S=null,C=t,H=!1;do{var G=C.lane&-536870913;if(G!==C.lane?(Ce&G)===G:(on&G)===G){var O=C.revertLane;if(O===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),G===ni&&(H=!0);else if((on&O)===O){C=C.next,O===ni&&(H=!0);continue}else G={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},S===null?(g=S=G,h=o):S=S.next=G,ge.lanes|=O,Gn|=O;G=C.action,_l&&a(o,G),o=C.hasEagerState?C.eagerState:a(o,G)}else O={lane:G,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},S===null?(g=S=O,h=o):S=S.next=O,ge.lanes|=G,Gn|=G;C=C.next}while(C!==null&&C!==t);if(S===null?h=o:S.next=g,!Pt(o,e.memoizedState)&&(vt=!0,H&&(a=li,a!==null)))throw a;e.memoizedState=o,e.baseState=h,e.baseQueue=S,i.lastRenderedState=o}return c===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Dc(e){var t=ht(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var i=a.dispatch,c=a.pending,o=t.memoizedState;if(c!==null){a.pending=null;var h=c=c.next;do o=e(o,h.action),h=h.next;while(h!==c);Pt(o,t.memoizedState)||(vt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,i]}function xh(e,t,a){var i=ge,c=ht(),o=Le;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var h=!Pt((We||c).memoizedState,a);if(h&&(c.memoizedState=a,vt=!0),c=c.queue,Bc(gh.bind(null,i,c,e),[e]),c.getSnapshot!==t||h||yt!==null&&yt.memoizedState.tag&1){if(i.flags|=2048,oi(9,{destroy:void 0},vh.bind(null,i,c,a,t),null),at===null)throw Error(u(349));o||(on&127)!==0||yh(i,t,a)}return a}function yh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ge.updateQueue,t===null?(t=hr(),ge.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function vh(e,t,a,i){t.value=a,t.getSnapshot=i,bh(t)&&wh(e)}function gh(e,t,a){return a(function(){bh(t)&&wh(e)})}function bh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pt(e,a)}catch{return!0}}function wh(e){var t=xl(e,2);t!==null&&Xt(t,e,2)}function Uc(e){var t=Bt();if(typeof e=="function"){var a=e;if(e=a(),_l){Wt(!0);try{a()}finally{Wt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:e},t}function Sh(e,t,a,i){return e.baseState=a,Lc(e,We,typeof i=="function"?i:dn)}function gg(e,t,a,i,c){if(vr(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:c,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,i(o),a=t.pending,a===null?(o.next=t.pending=o,jh(t,o)):(o.next=a.next,t.pending=a.next=o)}}function jh(e,t){var a=t.action,i=t.payload,c=e.state;if(t.isTransition){var o=U.T,h={};U.T=h;try{var g=a(c,i),S=U.S;S!==null&&S(h,g),Nh(e,t,g)}catch(C){zc(e,t,C)}finally{o!==null&&h.types!==null&&(o.types=h.types),U.T=o}}else try{o=a(c,i),Nh(e,t,o)}catch(C){zc(e,t,C)}}function Nh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){_h(e,t,i)},function(i){return zc(e,t,i)}):_h(e,t,a)}function _h(e,t,a){t.status="fulfilled",t.value=a,Ah(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,jh(e,a)))}function zc(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,Ah(t),t=t.next;while(t!==i)}e.action=null}function Ah(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function kh(e,t){return t}function Eh(e,t){if(Le){var a=at.formState;if(a!==null){e:{var i=ge;if(Le){if(lt){t:{for(var c=lt,o=ya;c.nodeType!==8;){if(!o){c=null;break t}if(c=ga(c.nextSibling),c===null){c=null;break t}}o=c.data,c=o==="F!"||o==="F"?c:null}if(c){lt=ga(c.nextSibling),i=c.data==="F!";break e}}Un(i)}i=!1}i&&(t=a[0])}}return a=Bt(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kh,lastRenderedState:t},a.queue=i,a=Xh.bind(null,ge,i),i.dispatch=a,i=Uc(!1),o=Vc.bind(null,ge,!1,i.queue),i=Bt(),c={state:t,dispatch:null,action:e,pending:null},i.queue=c,a=gg.bind(null,ge,c,o,a),c.dispatch=a,i.memoizedState=e,[t,a,!1]}function Rh(e){var t=ht();return Ch(t,We,e)}function Ch(e,t,a){if(t=Lc(e,t,kh)[0],e=pr(dn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=as(t)}catch(h){throw h===ii?ir:h}else i=t;t=ht();var c=t.queue,o=c.dispatch;return a!==t.memoizedState&&(ge.flags|=2048,oi(9,{destroy:void 0},bg.bind(null,c,a),null)),[i,o,e]}function bg(e,t){e.action=t}function Th(e){var t=ht(),a=We;if(a!==null)return Ch(t,a,e);ht(),t=t.memoizedState,a=ht();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function oi(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=ge.updateQueue,t===null&&(t=hr(),ge.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,t.lastEffect=e),e}function Oh(){return ht().memoizedState}function xr(e,t,a,i){var c=Bt();ge.flags|=e,c.memoizedState=oi(1|t,{destroy:void 0},a,i===void 0?null:i)}function yr(e,t,a,i){var c=ht();i=i===void 0?null:i;var o=c.memoizedState.inst;We!==null&&i!==null&&Ec(i,We.memoizedState.deps)?c.memoizedState=oi(t,o,a,i):(ge.flags|=e,c.memoizedState=oi(1|t,o,a,i))}function Mh(e,t){xr(8390656,8,e,t)}function Bc(e,t){yr(2048,8,e,t)}function wg(e){ge.flags|=4;var t=ge.updateQueue;if(t===null)t=hr(),ge.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Lh(e){var t=ht().memoizedState;return wg({ref:t,nextImpl:e}),function(){if((Ge&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Dh(e,t){return yr(4,2,e,t)}function Uh(e,t){return yr(4,4,e,t)}function zh(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 Bh(e,t,a){a=a!=null?a.concat([e]):null,yr(4,4,zh.bind(null,t,e),a)}function qc(){}function qh(e,t){var a=ht();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&Ec(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function Hh(e,t){var a=ht();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&Ec(t,i[1]))return i[0];if(i=e(),_l){Wt(!0);try{e()}finally{Wt(!1)}}return a.memoizedState=[i,t],i}function Hc(e,t,a){return a===void 0||(on&1073741824)!==0&&(Ce&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=$m(),ge.lanes|=e,Gn|=e,a)}function $h(e,t,a,i){return Pt(a,t)?a:ri.current!==null?(e=Hc(e,a,i),Pt(e,t)||(vt=!0),e):(on&42)===0||(on&1073741824)!==0&&(Ce&261930)===0?(vt=!0,e.memoizedState=a):(e=$m(),ge.lanes|=e,Gn|=e,t)}function Yh(e,t,a,i,c){var o=J.p;J.p=o!==0&&8>o?o:8;var h=U.T,g={};U.T=g,Vc(e,!1,t,a);try{var S=c(),C=U.S;if(C!==null&&C(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var H=xg(S,i);ns(e,t,H,ia(e))}else ns(e,t,i,ia(e))}catch(G){ns(e,t,{then:function(){},status:"rejected",reason:G},ia())}finally{J.p=o,h!==null&&g.types!==null&&(h.types=g.types),U.T=h}}function Sg(){}function $c(e,t,a,i){if(e.tag!==5)throw Error(u(476));var c=Vh(e).queue;Yh(e,c,t,oe,a===null?Sg:function(){return Zh(e),a(i)})}function Vh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:oe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zh(e){var t=Vh(e);t.next===null&&(t=e.alternate.memoizedState),ns(e,t.next.queue,{},ia())}function Yc(){return Ot(bs)}function Gh(){return ht().memoizedState}function Qh(){return ht().memoizedState}function jg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ia();e=qn(a);var i=Hn(t,e,a);i!==null&&(Xt(i,t,a),Wi(i,t,a)),t={cache:yc()},e.payload=t;return}t=t.return}}function Ng(e,t,a){var i=ia();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vr(e)?Ih(t,a):(a=sc(e,t,a,i),a!==null&&(Xt(a,e,i),Kh(a,t,i)))}function Xh(e,t,a){var i=ia();ns(e,t,a,i)}function ns(e,t,a,i){var c={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(vr(e))Ih(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,g=o(h,a);if(c.hasEagerState=!0,c.eagerState=g,Pt(g,h))return Ws(e,t,c,0),at===null&&Fs(),!1}catch{}finally{}if(a=sc(e,t,c,i),a!==null)return Xt(a,e,i),Kh(a,t,i),!0}return!1}function Vc(e,t,a,i){if(i={lane:2,revertLane:So(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},vr(e)){if(t)throw Error(u(479))}else t=sc(e,a,i,2),t!==null&&Xt(t,e,2)}function vr(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function Ih(e,t){ui=dr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Kh(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,je(e,a)}}var ls={readContext:Ot,use:mr,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};ls.useEffectEvent=ct;var Jh={readContext:Ot,use:mr,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:Mh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,xr(4194308,4,zh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return xr(4194308,4,e,t)},useInsertionEffect:function(e,t){xr(4,2,e,t)},useMemo:function(e,t){var a=Bt();t=t===void 0?null:t;var i=e();if(_l){Wt(!0);try{e()}finally{Wt(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=Bt();if(a!==void 0){var c=a(t);if(_l){Wt(!0);try{a(t)}finally{Wt(!1)}}}else c=t;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=Ng.bind(null,ge,e),[i.memoizedState,e]},useRef:function(e){var t=Bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Uc(e);var t=e.queue,a=Xh.bind(null,ge,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:qc,useDeferredValue:function(e,t){var a=Bt();return Hc(a,e,t)},useTransition:function(){var e=Uc(!1);return e=Yh.bind(null,ge,e.queue,!0,!1),Bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ge,c=Bt();if(Le){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),at===null)throw Error(u(349));(Ce&127)!==0||yh(i,t,a)}c.memoizedState=a;var o={value:a,getSnapshot:t};return c.queue=o,Mh(gh.bind(null,i,o,e),[e]),i.flags|=2048,oi(9,{destroy:void 0},vh.bind(null,i,o,a,t),null),a},useId:function(){var e=Bt(),t=at.identifierPrefix;if(Le){var a=Ga,i=Za;a=(i&~(1<<32-At(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=fr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=yg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yc,useFormState:Eh,useActionState:Eh,useOptimistic:function(e){var t=Bt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Vc.bind(null,ge,!0,a),a.dispatch=t,[e,t]},useMemoCache:Mc,useCacheRefresh:function(){return Bt().memoizedState=jg.bind(null,ge)},useEffectEvent:function(e){var t=Bt(),a={impl:e};return t.memoizedState=a,function(){if((Ge&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Zc={readContext:Ot,use:mr,useCallback:qh,useContext:Ot,useEffect:Bc,useImperativeHandle:Bh,useInsertionEffect:Dh,useLayoutEffect:Uh,useMemo:Hh,useReducer:pr,useRef:Oh,useState:function(){return pr(dn)},useDebugValue:qc,useDeferredValue:function(e,t){var a=ht();return $h(a,We.memoizedState,e,t)},useTransition:function(){var e=pr(dn)[0],t=ht().memoizedState;return[typeof e=="boolean"?e:as(e),t]},useSyncExternalStore:xh,useId:Gh,useHostTransitionStatus:Yc,useFormState:Rh,useActionState:Rh,useOptimistic:function(e,t){var a=ht();return Sh(a,We,e,t)},useMemoCache:Mc,useCacheRefresh:Qh};Zc.useEffectEvent=Lh;var Fh={readContext:Ot,use:mr,useCallback:qh,useContext:Ot,useEffect:Bc,useImperativeHandle:Bh,useInsertionEffect:Dh,useLayoutEffect:Uh,useMemo:Hh,useReducer:Dc,useRef:Oh,useState:function(){return Dc(dn)},useDebugValue:qc,useDeferredValue:function(e,t){var a=ht();return We===null?Hc(a,e,t):$h(a,We.memoizedState,e,t)},useTransition:function(){var e=Dc(dn)[0],t=ht().memoizedState;return[typeof e=="boolean"?e:as(e),t]},useSyncExternalStore:xh,useId:Gh,useHostTransitionStatus:Yc,useFormState:Th,useActionState:Th,useOptimistic:function(e,t){var a=ht();return We!==null?Sh(a,We,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Mc,useCacheRefresh:Qh};Fh.useEffectEvent=Lh;function Gc(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Qc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=ia(),c=qn(i);c.payload=t,a!=null&&(c.callback=a),t=Hn(e,c,i),t!==null&&(Xt(t,e,i),Wi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=ia(),c=qn(i);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Hn(e,c,i),t!==null&&(Xt(t,e,i),Wi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ia(),i=qn(a);i.tag=2,t!=null&&(i.callback=t),t=Hn(e,i,a),t!==null&&(Xt(t,e,a),Wi(t,e,a))}};function Wh(e,t,a,i,c,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,o,h):t.prototype&&t.prototype.isPureReactComponent?!Zi(a,i)||!Zi(c,o):!0}function Ph(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&Qc.enqueueReplaceState(t,t.state,null)}function Al(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function em(e){Js(e)}function tm(e){console.error(e)}function am(e){Js(e)}function gr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function nm(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Xc(e,t,a){return a=qn(a),a.tag=3,a.payload={element:null},a.callback=function(){gr(e,t)},a}function lm(e){return e=qn(e),e.tag=3,e}function im(e,t,a,i){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var o=i.value;e.payload=function(){return c(o)},e.callback=function(){nm(t,a,i)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){nm(t,a,i),typeof c!="function"&&(Qn===null?Qn=new Set([this]):Qn.add(this));var g=i.stack;this.componentDidCatch(i.value,{componentStack:g!==null?g:""})})}function _g(e,t,a,i,c){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&ai(t,a,c,!0),a=ta.current,a!==null){switch(a.tag){case 31:case 13:return va===null?Tr():a.alternate===null&&ot===0&&(ot=3),a.flags&=-257,a.flags|=65536,a.lanes=c,i===sr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),go(e,i,c)),!1;case 22:return a.flags|=65536,i===sr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),go(e,i,c)),!1}throw Error(u(435,a.tag))}return go(e,i,c),Tr(),!1}if(Le)return t=ta.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,i!==fc&&(e=Error(u(422),{cause:i}),Xi(ma(e,a)))):(i!==fc&&(t=Error(u(423),{cause:i}),Xi(ma(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,i=ma(i,a),c=Xc(e.stateNode,i,c),jc(e,c),ot!==4&&(ot=2)),!1;var o=Error(u(520),{cause:i});if(o=ma(o,a),fs===null?fs=[o]:fs.push(o),ot!==4&&(ot=2),t===null)return!0;i=ma(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Xc(a.stateNode,i,e),jc(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"&&(Qn===null||!Qn.has(o))))return a.flags|=65536,c&=-c,a.lanes|=c,c=lm(c),im(c,e,a,i),jc(a,c),!1}a=a.return}while(a!==null);return!1}var Ic=Error(u(461)),vt=!1;function Mt(e,t,a,i){t.child=e===null?ch(t,null,a,i):Nl(t,e.child,a,i)}function sm(e,t,a,i,c){a=a.render;var o=t.ref;if("ref"in i){var h={};for(var g in i)g!=="ref"&&(h[g]=i[g])}else h=i;return bl(t),i=Rc(e,t,a,h,o,c),g=Cc(),e!==null&&!vt?(Tc(e,t,c),fn(e,t,c)):(Le&&g&&oc(t),t.flags|=1,Mt(e,t,i,c),t.child)}function rm(e,t,a,i,c){if(e===null){var o=a.type;return typeof o=="function"&&!rc(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,um(e,t,o,i,c)):(e=er(a.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!ao(e,c)){var h=o.memoizedProps;if(a=a.compare,a=a!==null?a:Zi,a(h,i)&&e.ref===t.ref)return fn(e,t,c)}return t.flags|=1,e=sn(o,i),e.ref=t.ref,e.return=t,t.child=e}function um(e,t,a,i,c){if(e!==null){var o=e.memoizedProps;if(Zi(o,i)&&e.ref===t.ref)if(vt=!1,t.pendingProps=i=o,ao(e,c))(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,fn(e,t,c)}return Kc(e,t,a,i,c)}function cm(e,t,a,i){var c=i.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(i=t.child=e.child,c=0;i!==null;)c=c|i.lanes|i.childLanes,i=i.sibling;i=c&~o}else i=0,t.child=null;return om(e,t,o,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&lr(t,o!==null?o.cachePool:null),o!==null?fh(t,o):_c(),hh(t);else return i=t.lanes=536870912,om(e,t,o!==null?o.baseLanes|a:a,a,i)}else o!==null?(lr(t,o.cachePool),fh(t,o),Yn(),t.memoizedState=null):(e!==null&&lr(t,null),_c(),Yn());return Mt(e,t,c,a),t.child}function is(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function om(e,t,a,i,c){var o=gc();return o=o===null?null:{parent:xt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&lr(t,null),_c(),hh(t),e!==null&&ai(e,t,i,!0),t.childLanes=c,null}function br(e,t){return t=Sr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dm(e,t,a){return Nl(t,e.child,null,a),e=br(t,t.pendingProps),e.flags|=2,aa(t),t.memoizedState=null,e}function Ag(e,t,a){var i=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(i.mode==="hidden")return e=br(t,i),t.lanes=536870912,is(null,e);if(kc(t),(e=lt)?(e=jp(e,ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ln!==null?{id:Za,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},a=If(e),a.return=t,t.child=a,Tt=t,lt=null)):e=null,e===null)throw Un(t);return t.lanes=536870912,null}return br(t,i)}var o=e.memoizedState;if(o!==null){var h=o.dehydrated;if(kc(t),c)if(t.flags&256)t.flags&=-257,t=dm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(vt||ai(e,t,a,!1),c=(a&e.childLanes)!==0,vt||c){if(i=at,i!==null&&(h=tt(i,a),h!==0&&h!==o.retryLane))throw o.retryLane=h,xl(e,h),Xt(i,e,h),Ic;Tr(),t=dm(e,t,a)}else e=o.treeContext,lt=ga(h.nextSibling),Tt=t,Le=!0,Dn=null,ya=!1,e!==null&&Ff(t,e),t=br(t,i),t.flags|=4096;return t}return e=sn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wr(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 Kc(e,t,a,i,c){return bl(t),a=Rc(e,t,a,i,void 0,c),i=Cc(),e!==null&&!vt?(Tc(e,t,c),fn(e,t,c)):(Le&&i&&oc(t),t.flags|=1,Mt(e,t,a,c),t.child)}function fm(e,t,a,i,c,o){return bl(t),t.updateQueue=null,a=ph(t,i,a,c),mh(e),i=Cc(),e!==null&&!vt?(Tc(e,t,o),fn(e,t,o)):(Le&&i&&oc(t),t.flags|=1,Mt(e,t,a,o),t.child)}function hm(e,t,a,i,c){if(bl(t),t.stateNode===null){var o=Wl,h=a.contextType;typeof h=="object"&&h!==null&&(o=Ot(h)),o=new a(i,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Qc,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=i,o.state=t.memoizedState,o.refs={},wc(t),h=a.contextType,o.context=typeof h=="object"&&h!==null?Ot(h):Wl,o.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(Gc(t,a,h,i),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&&Qc.enqueueReplaceState(o,o.state,null),es(t,i,o,c),Pi(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){o=t.stateNode;var g=t.memoizedProps,S=Al(a,g);o.props=S;var C=o.context,H=a.contextType;h=Wl,typeof H=="object"&&H!==null&&(h=Ot(H));var G=a.getDerivedStateFromProps;H=typeof G=="function"||typeof o.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,H||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(g||C!==h)&&Ph(t,o,i,h),Bn=!1;var O=t.memoizedState;o.state=O,es(t,i,o,c),Pi(),C=t.memoizedState,g||O!==C||Bn?(typeof G=="function"&&(Gc(t,a,G,i),C=t.memoizedState),(S=Bn||Wh(t,a,S,i,O,C,h))?(H||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=i,t.memoizedState=C),o.props=i,o.state=C,o.context=h,i=S):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Sc(e,t),h=t.memoizedProps,H=Al(a,h),o.props=H,G=t.pendingProps,O=o.context,C=a.contextType,S=Wl,typeof C=="object"&&C!==null&&(S=Ot(C)),g=a.getDerivedStateFromProps,(C=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(h!==G||O!==S)&&Ph(t,o,i,S),Bn=!1,O=t.memoizedState,o.state=O,es(t,i,o,c),Pi();var L=t.memoizedState;h!==G||O!==L||Bn||e!==null&&e.dependencies!==null&&ar(e.dependencies)?(typeof g=="function"&&(Gc(t,a,g,i),L=t.memoizedState),(H=Bn||Wh(t,a,H,i,O,L,S)||e!==null&&e.dependencies!==null&&ar(e.dependencies))?(C||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,L,S),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,L,S)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=L),o.props=i,o.state=L,o.context=S,i=H):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),i=!1)}return o=i,wr(e,t),i=(t.flags&128)!==0,o||i?(o=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&i?(t.child=Nl(t,e.child,null,c),t.child=Nl(t,null,a,c)):Mt(e,t,a,c),t.memoizedState=o.state,e=t.child):e=fn(e,t,c),e}function mm(e,t,a,i){return vl(),t.flags|=256,Mt(e,t,a,i),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fc(e){return{baseLanes:e,cachePool:nh()}}function Wc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=la),e}function pm(e,t,a){var i=t.pendingProps,c=!1,o=(t.flags&128)!==0,h;if((h=o)||(h=e!==null&&e.memoizedState===null?!1:(ft.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?$n(t):Yn(),(e=lt)?(e=jp(e,ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ln!==null?{id:Za,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},a=If(e),a.return=t,t.child=a,Tt=t,lt=null)):e=null,e===null)throw Un(t);return Do(e)?t.lanes=32:t.lanes=536870912,null}var g=i.children;return i=i.fallback,c?(Yn(),c=t.mode,g=Sr({mode:"hidden",children:g},c),i=yl(i,c,a,null),g.return=t,i.return=t,g.sibling=i,t.child=g,i=t.child,i.memoizedState=Fc(a),i.childLanes=Wc(e,h,a),t.memoizedState=Jc,is(null,i)):($n(t),Pc(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(o)t.flags&256?($n(t),t.flags&=-257,t=eo(e,t,a)):t.memoizedState!==null?(Yn(),t.child=e.child,t.flags|=128,t=null):(Yn(),g=i.fallback,c=t.mode,i=Sr({mode:"visible",children:i.children},c),g=yl(g,c,a,null),g.flags|=2,i.return=t,g.return=t,i.sibling=g,t.child=i,Nl(t,e.child,null,a),i=t.child,i.memoizedState=Fc(a),i.childLanes=Wc(e,h,a),t.memoizedState=Jc,t=is(null,i));else if($n(t),Do(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var C=h.dgst;h=C,i=Error(u(419)),i.stack="",i.digest=h,Xi({value:i,source:null,stack:null}),t=eo(e,t,a)}else if(vt||ai(e,t,a,!1),h=(a&e.childLanes)!==0,vt||h){if(h=at,h!==null&&(i=tt(h,a),i!==0&&i!==S.retryLane))throw S.retryLane=i,xl(e,i),Xt(h,e,i),Ic;Lo(g)||Tr(),t=eo(e,t,a)}else Lo(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,lt=ga(g.nextSibling),Tt=t,Le=!0,Dn=null,ya=!1,e!==null&&Ff(t,e),t=Pc(t,i.children),t.flags|=4096);return t}return c?(Yn(),g=i.fallback,c=t.mode,S=e.child,C=S.sibling,i=sn(S,{mode:"hidden",children:i.children}),i.subtreeFlags=S.subtreeFlags&65011712,C!==null?g=sn(C,g):(g=yl(g,c,a,null),g.flags|=2),g.return=t,i.return=t,i.sibling=g,t.child=i,is(null,i),i=t.child,g=e.child.memoizedState,g===null?g=Fc(a):(c=g.cachePool,c!==null?(S=xt._currentValue,c=c.parent!==S?{parent:S,pool:S}:c):c=nh(),g={baseLanes:g.baseLanes|a,cachePool:c}),i.memoizedState=g,i.childLanes=Wc(e,h,a),t.memoizedState=Jc,is(e.child,i)):($n(t),a=e.child,e=a.sibling,a=sn(a,{mode:"visible",children:i.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 Pc(e,t){return t=Sr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Sr(e,t){return e=ea(22,e,null,t),e.lanes=0,e}function eo(e,t,a){return Nl(t,e.child,null,a),e=Pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xm(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),pc(e.return,t,a)}function to(e,t,a,i,c,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:c,treeForkCount:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=a,h.tailMode=c,h.treeForkCount=o)}function ym(e,t,a){var i=t.pendingProps,c=i.revealOrder,o=i.tail;i=i.children;var h=ft.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,B(ft,h),Mt(e,t,i,a),i=Le?Qi:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xm(e,a,t);else if(e.tag===19)xm(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(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&or(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),to(t,!1,c,a,o,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&or(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}to(t,!0,a,null,o,i);break;case"together":to(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function fn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Gn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ai(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=sn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=sn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ao(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ar(e)))}function kg(e,t,a){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),zn(t,xt,e.memoizedState.cache),vl();break;case 27:case 5:$t(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:zn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,kc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?($n(t),t.flags|=128,null):(a&t.child.childLanes)!==0?pm(e,t,a):($n(t),e=fn(e,t,a),e!==null?e.sibling:null);$n(t);break;case 19:var c=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(ai(e,t,a,!1),i=(a&t.childLanes)!==0),c){if(i)return ym(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),B(ft,ft.current),i)break;return null;case 22:return t.lanes=0,cm(e,t,a,t.pendingProps);case 24:zn(t,xt,e.memoizedState.cache)}return fn(e,t,a)}function vm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)vt=!0;else{if(!ao(e,a)&&(t.flags&128)===0)return vt=!1,kg(e,t,a);vt=(e.flags&131072)!==0}else vt=!1,Le&&(t.flags&1048576)!==0&&Jf(t,Qi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Sl(t.elementType),t.type=e,typeof e=="function")rc(e)?(i=Al(e,i),t.tag=1,t=hm(null,t,e,i,a)):(t.tag=0,t=Kc(null,t,e,i,a));else{if(e!=null){var c=e.$$typeof;if(c===se){t.tag=11,t=sm(null,t,e,i,a);break e}else if(c===I){t.tag=14,t=rm(null,t,e,i,a);break e}}throw t=nt(e)||e,Error(u(306,t,""))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,c=Al(i,t.pendingProps),hm(e,t,i,c,a);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(u(387));i=t.pendingProps;var o=t.memoizedState;c=o.element,Sc(e,t),es(t,i,null,a);var h=t.memoizedState;if(i=h.cache,zn(t,xt,i),i!==o.cache&&xc(t,[xt],a,!0),Pi(),i=h.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mm(e,t,i,a);break e}else if(i!==c){c=ma(Error(u(424)),t),Xi(c),t=mm(e,t,i,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(lt=ga(e.firstChild),Tt=t,Le=!0,Dn=null,ya=!0,a=ch(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(vl(),i===c){t=fn(e,t,a);break e}Mt(e,t,i,a)}t=t.child}return t;case 26:return wr(e,t),e===null?(a=Rp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Le||(a=t.type,e=t.pendingProps,i=Br(P.current).createElement(a),i[ee]=t,i[Ne]=e,Lt(i,a,e),Et(i),t.stateNode=i):t.memoizedState=Rp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $t(t),e===null&&Le&&(i=t.stateNode=Ap(t.type,t.pendingProps,P.current),Tt=t,ya=!0,c=lt,Jn(t.type)?(Uo=c,lt=ga(i.firstChild)):lt=c),Mt(e,t,t.pendingProps.children,a),wr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=i=lt)&&(i=n0(i,t.type,t.pendingProps,ya),i!==null?(t.stateNode=i,Tt=t,lt=ga(i.firstChild),ya=!1,c=!0):c=!1),c||Un(t)),$t(t),c=t.type,o=t.pendingProps,h=e!==null?e.memoizedProps:null,i=o.children,To(c,o)?i=null:h!==null&&To(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=Rc(e,t,vg,null,null,a),bs._currentValue=c),wr(e,t),Mt(e,t,i,a),t.child;case 6:return e===null&&Le&&((e=a=lt)&&(a=l0(a,t.pendingProps,ya),a!==null?(t.stateNode=a,Tt=t,lt=null,e=!0):e=!1),e||Un(t)),null;case 13:return pm(e,t,a);case 4:return Ze(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Nl(t,null,i,a):Mt(e,t,i,a),t.child;case 11:return sm(e,t,t.type,t.pendingProps,a);case 7:return Mt(e,t,t.pendingProps,a),t.child;case 8:return Mt(e,t,t.pendingProps.children,a),t.child;case 12:return Mt(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,zn(t,t.type,i.value),Mt(e,t,i.children,a),t.child;case 9:return c=t.type._context,i=t.pendingProps.children,bl(t),c=Ot(c),i=i(c),t.flags|=1,Mt(e,t,i,a),t.child;case 14:return rm(e,t,t.type,t.pendingProps,a);case 15:return um(e,t,t.type,t.pendingProps,a);case 19:return ym(e,t,a);case 31:return Ag(e,t,a);case 22:return cm(e,t,a,t.pendingProps);case 24:return bl(t),i=Ot(xt),e===null?(c=gc(),c===null&&(c=at,o=yc(),c.pooledCache=o,o.refCount++,o!==null&&(c.pooledCacheLanes|=a),c=o),t.memoizedState={parent:i,cache:c},wc(t),zn(t,xt,c)):((e.lanes&a)!==0&&(Sc(e,t),es(t,null,null,a),Pi()),c=e.memoizedState,o=t.memoizedState,c.parent!==i?(c={parent:i,cache:i},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),zn(t,xt,i)):(i=o.cache,zn(t,xt,i),i!==c.cache&&xc(t,[xt],a,!0))),Mt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function hn(e){e.flags|=4}function no(e,t,a,i,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Gm())e.flags|=8192;else throw jl=sr,bc}else e.flags&=-16777217}function gm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lp(t))if(Gm())e.flags|=8192;else throw jl=sr,bc}function jr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?On():536870912,e.lanes|=t,mi|=t)}function ss(e,t){if(!Le)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 i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,i|=c.subtreeFlags&65011712,i|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function Eg(e,t,a){var i=t.pendingProps;switch(dc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),cn(xt),Be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ti(t)?hn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,hc())),it(t),null;case 26:var c=t.type,o=t.memoizedState;return e===null?(hn(t),o!==null?(it(t),gm(t,o)):(it(t),no(t,c,null,i,a))):o?o!==e.memoizedState?(hn(t),it(t),gm(t,o)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&hn(t),it(t),no(t,c,e,i,a)),null;case 27:if(Je(t),a=P.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&hn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return it(t),null}e=ae.current,ti(t)?Wf(t):(e=Ap(c,i,a),t.stateNode=e,hn(t))}return it(t),null;case 5:if(Je(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&hn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return it(t),null}if(o=ae.current,ti(t))Wf(t);else{var h=Br(P.current);switch(o){case 1:o=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:o=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":o=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":o=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?h.createElement(c,{is:i.is}):h.createElement(c)}}o[ee]=t,o[Ne]=i;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(Lt(o,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&hn(t)}}return it(t),no(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&hn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=P.current,ti(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,c=Tt,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[ee]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||pp(e.nodeValue,a)),e||Un(t,!0)}else e=Br(e).createTextNode(i),e[ee]=t,t.stateNode=e}return it(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=ti(t),a!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ee]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else a=hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(aa(t),t):(aa(t),null);if((t.flags&128)!==0)throw Error(u(558))}return it(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ti(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(u(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(u(317));c[ee]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),c=!1}else c=hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(aa(t),t):(aa(t),null)}return aa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==c&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),jr(t,t.updateQueue),it(t),null);case 4:return Be(),e===null&&Ao(t.stateNode.containerInfo),it(t),null;case 10:return cn(t.type),it(t),null;case 19:if(z(ft),i=t.memoizedState,i===null)return it(t),null;if(c=(t.flags&128)!==0,o=i.rendering,o===null)if(c)ss(i,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=or(e),o!==null){for(t.flags|=128,ss(i,!1),e=o.updateQueue,t.updateQueue=e,jr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Xf(a,e),a=a.sibling;return B(ft,ft.current&1|2),Le&&rn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&_t()>Er&&(t.flags|=128,c=!0,ss(i,!1),t.lanes=4194304)}else{if(!c)if(e=or(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,jr(t,e),ss(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Le)return it(t),null}else 2*_t()-i.renderingStartTime>Er&&a!==536870912&&(t.flags|=128,c=!0,ss(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_t(),e.sibling=null,a=ft.current,B(ft,c?a&1|2:a&1),Le&&rn(t,i.treeForkCount),e):(it(t),null);case 22:case 23:return aa(t),Ac(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),a=t.updateQueue,a!==null&&jr(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&z(wl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cn(xt),it(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Rg(e,t){switch(dc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cn(xt),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Je(t),null;case 31:if(t.memoizedState!==null){if(aa(t),t.alternate===null)throw Error(u(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(ft),null;case 4:return Be(),null;case 10:return cn(t.type),null;case 22:case 23:return aa(t),Ac(),e!==null&&z(wl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cn(xt),null;case 25:return null;default:return null}}function bm(e,t){switch(dc(t),t.tag){case 3:cn(xt),Be();break;case 26:case 27:case 5:Je(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&aa(t);break;case 13:aa(t);break;case 19:z(ft);break;case 10:cn(t.type);break;case 22:case 23:aa(t),Ac(),e!==null&&z(wl);break;case 24:cn(xt)}}function rs(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var c=i.next;a=c;do{if((a.tag&e)===e){i=void 0;var o=a.create,h=a.inst;i=o(),h.destroy=i}a=a.next}while(a!==c)}}catch(g){Ie(t,t.return,g)}}function Vn(e,t,a){try{var i=t.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var o=c.next;i=o;do{if((i.tag&e)===e){var h=i.inst,g=h.destroy;if(g!==void 0){h.destroy=void 0,c=t;var S=a,C=g;try{C()}catch(H){Ie(c,S,H)}}}i=i.next}while(i!==o)}}catch(H){Ie(t,t.return,H)}}function wm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{dh(t,a)}catch(i){Ie(e,e.return,i)}}}function Sm(e,t,a){a.props=Al(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Ie(e,t,i)}}function us(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(c){Ie(e,t,c)}}function Qa(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(c){Ie(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Ie(e,t,c)}else a.current=null}function jm(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(c){Ie(e,e.return,c)}}function lo(e,t,a){try{var i=e.stateNode;Fg(i,e.type,a,t),i[Ne]=t}catch(c){Ie(e,e.return,c)}}function Nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Jn(e.type)||e.tag===4}function io(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nm(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&&Jn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function so(e,t,a){var i=e.tag;if(i===5||i===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=nn));else if(i!==4&&(i===27&&Jn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(so(e,t,a),e=e.sibling;e!==null;)so(e,t,a),e=e.sibling}function Nr(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&Jn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Nr(e,t,a),e=e.sibling;e!==null;)Nr(e,t,a),e=e.sibling}function _m(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Lt(t,i,a),t[ee]=e,t[Ne]=a}catch(o){Ie(e,e.return,o)}}var mn=!1,gt=!1,ro=!1,Am=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Cg(e,t){if(e=e.containerInfo,Ro=Gr,e=Bf(e),ec(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var c=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var h=0,g=-1,S=-1,C=0,H=0,G=e,O=null;t:for(;;){for(var L;G!==a||c!==0&&G.nodeType!==3||(g=h+c),G!==o||i!==0&&G.nodeType!==3||(S=h+i),G.nodeType===3&&(h+=G.nodeValue.length),(L=G.firstChild)!==null;)O=G,G=L;for(;;){if(G===e)break t;if(O===a&&++C===c&&(g=h),O===o&&++H===i&&(S=h),(L=G.nextSibling)!==null)break;G=O,O=G.parentNode}G=L}a=g===-1||S===-1?null:{start:g,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(Co={focusedElem:e,selectionRange:a},Gr=!1,Rt=t;Rt!==null;)if(t=Rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Rt=e;else for(;Rt!==null;){switch(t=Rt,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++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,c=o.memoizedProps,o=o.memoizedState,i=a.stateNode;try{var ie=Al(a.type,c);e=i.getSnapshotBeforeUpdate(ie,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(me){Ie(a,a.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Mo(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Mo(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Rt=e;break}Rt=t.return}}function km(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:xn(e,a),i&4&&rs(5,a);break;case 1:if(xn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Ie(a,a.return,h)}else{var c=Al(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Ie(a,a.return,h)}}i&64&&wm(a),i&512&&us(a,a.return);break;case 3:if(xn(e,a),i&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{dh(e,t)}catch(h){Ie(a,a.return,h)}}break;case 27:t===null&&i&4&&_m(a);case 26:case 5:xn(e,a),t===null&&i&4&&jm(a),i&512&&us(a,a.return);break;case 12:xn(e,a);break;case 31:xn(e,a),i&4&&Cm(e,a);break;case 13:xn(e,a),i&4&&Tm(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=qg.bind(null,a),i0(e,a))));break;case 22:if(i=a.memoizedState!==null||mn,!i){t=t!==null&&t.memoizedState!==null||gt,c=mn;var o=gt;mn=i,(gt=t)&&!o?yn(e,a,(a.subtreeFlags&8772)!==0):xn(e,a),mn=c,gt=o}break;case 30:break;default:xn(e,a)}}function Em(e){var t=e.alternate;t!==null&&(e.alternate=null,Em(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Vt=!1;function pn(e,t,a){for(a=a.child;a!==null;)Rm(e,t,a),a=a.sibling}function Rm(e,t,a){if(Ae&&typeof Ae.onCommitFiberUnmount=="function")try{Ae.onCommitFiberUnmount(Ct,a)}catch{}switch(a.tag){case 26:gt||Qa(a,t),pn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gt||Qa(a,t);var i=rt,c=Vt;Jn(a.type)&&(rt=a.stateNode,Vt=!1),pn(e,t,a),ys(a.stateNode),rt=i,Vt=c;break;case 5:gt||Qa(a,t);case 6:if(i=rt,c=Vt,rt=null,pn(e,t,a),rt=i,Vt=c,rt!==null)if(Vt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode)}catch(o){Ie(a,t,o)}else try{rt.removeChild(a.stateNode)}catch(o){Ie(a,t,o)}break;case 18:rt!==null&&(Vt?(e=rt,wp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Si(e)):wp(rt,a.stateNode));break;case 4:i=rt,c=Vt,rt=a.stateNode.containerInfo,Vt=!0,pn(e,t,a),rt=i,Vt=c;break;case 0:case 11:case 14:case 15:Vn(2,a,t),gt||Vn(4,a,t),pn(e,t,a);break;case 1:gt||(Qa(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&Sm(a,t,i)),pn(e,t,a);break;case 21:pn(e,t,a);break;case 22:gt=(i=gt)||a.memoizedState!==null,pn(e,t,a),gt=i;break;default:pn(e,t,a)}}function Cm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Si(e)}catch(a){Ie(t,t.return,a)}}}function Tm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Si(e)}catch(a){Ie(t,t.return,a)}}function Tg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Am),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Am),t;default:throw Error(u(435,e.tag))}}function _r(e,t){var a=Tg(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var c=Hg.bind(null,e,i);i.then(c,c)}})}function Zt(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var c=a[i],o=e,h=t,g=h;e:for(;g!==null;){switch(g.tag){case 27:if(Jn(g.type)){rt=g.stateNode,Vt=!1;break e}break;case 5:rt=g.stateNode,Vt=!1;break e;case 3:case 4:rt=g.stateNode.containerInfo,Vt=!0;break e}g=g.return}if(rt===null)throw Error(u(160));Rm(o,h,c),rt=null,Vt=!1,o=c.alternate,o!==null&&(o.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Om(t,e),t=t.sibling}var Ma=null;function Om(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zt(t,e),Gt(e),i&4&&(Vn(3,e,e.return),rs(3,e),Vn(5,e,e.return));break;case 1:Zt(t,e),Gt(e),i&512&&(gt||a===null||Qa(a,a.return)),i&64&&mn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var c=Ma;if(Zt(t,e),Gt(e),i&512&&(gt||a===null||Qa(a,a.return)),i&4){var o=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(i){case"title":o=c.getElementsByTagName("title")[0],(!o||o[Di]||o[ee]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=c.createElement(i),c.head.insertBefore(o,c.querySelector("head > title"))),Lt(o,i,a),o[ee]=e,Et(o),i=o;break e;case"link":var h=Op("link","href",c).get(i+(a.href||""));if(h){for(var g=0;g<h.length;g++)if(o=h[g],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(g,1);break t}}o=c.createElement(i),Lt(o,i,a),c.head.appendChild(o);break;case"meta":if(h=Op("meta","content",c).get(i+(a.content||""))){for(g=0;g<h.length;g++)if(o=h[g],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(g,1);break t}}o=c.createElement(i),Lt(o,i,a),c.head.appendChild(o);break;default:throw Error(u(468,i))}o[ee]=e,Et(o),i=o}e.stateNode=i}else Mp(c,e.type,e.stateNode);else e.stateNode=Tp(c,i,e.memoizedProps);else o!==i?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,i===null?Mp(c,e.type,e.stateNode):Tp(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&lo(e,e.memoizedProps,a.memoizedProps)}break;case 27:Zt(t,e),Gt(e),i&512&&(gt||a===null||Qa(a,a.return)),a!==null&&i&4&&lo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Zt(t,e),Gt(e),i&512&&(gt||a===null||Qa(a,a.return)),e.flags&32){c=e.stateNode;try{Gl(c,"")}catch(ie){Ie(e,e.return,ie)}}i&4&&e.stateNode!=null&&(c=e.memoizedProps,lo(e,c,a!==null?a.memoizedProps:c)),i&1024&&(ro=!0);break;case 6:if(Zt(t,e),Gt(e),i&4){if(e.stateNode===null)throw Error(u(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(ie){Ie(e,e.return,ie)}}break;case 3:if($r=null,c=Ma,Ma=qr(t.containerInfo),Zt(t,e),Ma=c,Gt(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(ie){Ie(e,e.return,ie)}ro&&(ro=!1,Mm(e));break;case 4:i=Ma,Ma=qr(e.stateNode.containerInfo),Zt(t,e),Gt(e),Ma=i;break;case 12:Zt(t,e),Gt(e);break;case 31:Zt(t,e),Gt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_r(e,i)));break;case 13:Zt(t,e),Gt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(kr=_t()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_r(e,i)));break;case 22:c=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,C=mn,H=gt;if(mn=C||c,gt=H||S,Zt(t,e),gt=H,mn=C,Gt(e),i&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||S||mn||gt||kl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(o=S.stateNode,c)h=o.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{g=S.stateNode;var G=S.memoizedProps.style,O=G!=null&&G.hasOwnProperty("display")?G.display:null;g.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(ie){Ie(S,S.return,ie)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=c?"":S.memoizedProps}catch(ie){Ie(S,S.return,ie)}}}else if(t.tag===18){if(a===null){S=t;try{var L=S.stateNode;c?Sp(L,!0):Sp(S.stateNode,!1)}catch(ie){Ie(S,S.return,ie)}}}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}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,_r(e,a))));break;case 19:Zt(t,e),Gt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_r(e,i)));break;case 30:break;case 21:break;default:Zt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{for(var a,i=e.return;i!==null;){if(Nm(i)){a=i;break}i=i.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var c=a.stateNode,o=io(e);Nr(e,o,c);break;case 5:var h=a.stateNode;a.flags&32&&(Gl(h,""),a.flags&=-33);var g=io(e);Nr(e,g,h);break;case 3:case 4:var S=a.stateNode.containerInfo,C=io(e);so(e,C,S);break;default:throw Error(u(161))}}catch(H){Ie(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)km(e,t.alternate,t),t=t.sibling}function kl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vn(4,t,t.return),kl(t);break;case 1:Qa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Sm(t,t.return,a),kl(t);break;case 27:ys(t.stateNode);case 26:case 5:Qa(t,t.return),kl(t);break;case 22:t.memoizedState===null&&kl(t);break;case 30:kl(t);break;default:kl(t)}e=e.sibling}}function yn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,c=e,o=t,h=o.flags;switch(o.tag){case 0:case 11:case 15:yn(c,o,a),rs(4,o);break;case 1:if(yn(c,o,a),i=o,c=i.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(C){Ie(i,i.return,C)}if(i=o,c=i.updateQueue,c!==null){var g=i.stateNode;try{var S=c.shared.hiddenCallbacks;if(S!==null)for(c.shared.hiddenCallbacks=null,c=0;c<S.length;c++)oh(S[c],g)}catch(C){Ie(i,i.return,C)}}a&&h&64&&wm(o),us(o,o.return);break;case 27:_m(o);case 26:case 5:yn(c,o,a),a&&i===null&&h&4&&jm(o),us(o,o.return);break;case 12:yn(c,o,a);break;case 31:yn(c,o,a),a&&h&4&&Cm(c,o);break;case 13:yn(c,o,a),a&&h&4&&Tm(c,o);break;case 22:o.memoizedState===null&&yn(c,o,a),us(o,o.return);break;case 30:break;default:yn(c,o,a)}t=t.sibling}}function uo(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&&Ii(a))}function co(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ii(e))}function La(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lm(e,t,a,i),t=t.sibling}function Lm(e,t,a,i){var c=t.flags;switch(t.tag){case 0:case 11:case 15:La(e,t,a,i),c&2048&&rs(9,t);break;case 1:La(e,t,a,i);break;case 3:La(e,t,a,i),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ii(e)));break;case 12:if(c&2048){La(e,t,a,i),e=t.stateNode;try{var o=t.memoizedProps,h=o.id,g=o.onPostCommit;typeof g=="function"&&g(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Ie(t,t.return,S)}}else La(e,t,a,i);break;case 31:La(e,t,a,i);break;case 13:La(e,t,a,i);break;case 23:break;case 22:o=t.stateNode,h=t.alternate,t.memoizedState!==null?o._visibility&2?La(e,t,a,i):cs(e,t):o._visibility&2?La(e,t,a,i):(o._visibility|=2,di(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),c&2048&&uo(h,t);break;case 24:La(e,t,a,i),c&2048&&co(t.alternate,t);break;default:La(e,t,a,i)}}function di(e,t,a,i,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,h=t,g=a,S=i,C=h.flags;switch(h.tag){case 0:case 11:case 15:di(o,h,g,S,c),rs(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?di(o,h,g,S,c):cs(o,h):(H._visibility|=2,di(o,h,g,S,c)),c&&C&2048&&uo(h.alternate,h);break;case 24:di(o,h,g,S,c),c&&C&2048&&co(h.alternate,h);break;default:di(o,h,g,S,c)}t=t.sibling}}function cs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,c=i.flags;switch(i.tag){case 22:cs(a,i),c&2048&&uo(i.alternate,i);break;case 24:cs(a,i),c&2048&&co(i.alternate,i);break;default:cs(a,i)}t=t.sibling}}var os=8192;function fi(e,t,a){if(e.subtreeFlags&os)for(e=e.child;e!==null;)Dm(e,t,a),e=e.sibling}function Dm(e,t,a){switch(e.tag){case 26:fi(e,t,a),e.flags&os&&e.memoizedState!==null&&y0(a,Ma,e.memoizedState,e.memoizedProps);break;case 5:fi(e,t,a);break;case 3:case 4:var i=Ma;Ma=qr(e.stateNode.containerInfo),fi(e,t,a),Ma=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=os,os=16777216,fi(e,t,a),os=i):fi(e,t,a));break;default:fi(e,t,a)}}function Um(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 ds(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];Rt=i,Bm(i,e)}Um(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zm(e),e=e.sibling}function zm(e){switch(e.tag){case 0:case 11:case 15:ds(e),e.flags&2048&&Vn(9,e,e.return);break;case 3:ds(e);break;case 12:ds(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ar(e)):ds(e);break;default:ds(e)}}function Ar(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];Rt=i,Bm(i,e)}Um(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vn(8,t,t.return),Ar(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ar(t));break;default:Ar(t)}e=e.sibling}}function Bm(e,t){for(;Rt!==null;){var a=Rt;switch(a.tag){case 0:case 11:case 15:Vn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ii(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,Rt=i;else e:for(a=e;Rt!==null;){i=Rt;var c=i.sibling,o=i.return;if(Em(i),i===a){Rt=null;break e}if(c!==null){c.return=o,Rt=c;break e}Rt=o}}}var Og={getCacheForType:function(e){var t=Ot(xt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ot(xt).controller.signal}},Mg=typeof WeakMap=="function"?WeakMap:Map,Ge=0,at=null,Ee=null,Ce=0,Xe=0,na=null,Zn=!1,hi=!1,oo=!1,vn=0,ot=0,Gn=0,El=0,fo=0,la=0,mi=0,fs=null,Qt=null,ho=!1,kr=0,qm=0,Er=1/0,Rr=null,Qn=null,Nt=0,Xn=null,pi=null,gn=0,mo=0,po=null,Hm=null,hs=0,xo=null;function ia(){return(Ge&2)!==0&&Ce!==0?Ce&-Ce:U.T!==null?So():jt()}function $m(){if(la===0)if((Ce&536870912)===0||Le){var e=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),la=e}else la=536870912;return e=ta.current,e!==null&&(e.flags|=32),la}function Xt(e,t,a){(e===at&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(xi(e,0),In(e,Ce,la,!1)),Ya(e,a),((Ge&2)===0||e!==at)&&(e===at&&((Ge&2)===0&&(El|=a),ot===4&&In(e,Ce,la,!1)),Xa(e))}function Ym(e,t,a){if((Ge&6)!==0)throw Error(u(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||tn(e,t),c=i?Ug(e,t):vo(e,t,!0),o=i;do{if(c===0){hi&&!i&&In(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!Lg(a)){c=vo(e,t,!1),o=!1;continue}if(c===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 g=e;c=fs;var S=g.current.memoizedState.isDehydrated;if(S&&(xi(g,h).flags|=256),h=vo(g,h,!1),h!==2){if(oo&&!S){g.errorRecoveryDisabledLanes|=o,El|=o,c=4;break e}o=Qt,Qt=c,o!==null&&(Qt===null?Qt=o:Qt.push.apply(Qt,o))}c=h}if(o=!1,c!==2)continue}}if(c===1){xi(e,0),In(e,t,0,!0);break}e:{switch(i=e,o=c,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:In(i,t,la,!Zn);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(c=kr+300-_t(),10<c)){if(In(i,t,la,!Zn),Tn(i,0,!0)!==0)break e;gn=t,i.timeoutHandle=gp(Vm.bind(null,i,a,Qt,Rr,ho,t,la,El,mi,Zn,o,"Throttled",-0,0),c);break e}Vm(i,a,Qt,Rr,ho,t,la,El,mi,Zn,o,null,-0,0)}}break}while(!0);Xa(e)}function Vm(e,t,a,i,c,o,h,g,S,C,H,G,O,L){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Dm(t,o,G);var ie=(o&62914560)===o?kr-_t():(o&4194048)===o?qm-_t():0;if(ie=v0(G,ie),ie!==null){gn=o,e.cancelPendingCommit=ie(Fm.bind(null,e,t,o,a,i,c,h,g,S,H,G,null,O,L)),In(e,o,h,!C);return}}Fm(e,t,o,a,i,c,h,g,S)}function Lg(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 i=0;i<a.length;i++){var c=a[i],o=c.getSnapshot;c=c.value;try{if(!Pt(o(),c))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 In(e,t,a,i){t&=~fo,t&=~El,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var c=t;0<c;){var o=31-At(c),h=1<<o;i[o]=-1,c&=~h}a!==0&&Q(e,a,t)}function Cr(){return(Ge&6)===0?(ms(0),!1):!0}function yo(){if(Ee!==null){if(Xe===0)var e=Ee.return;else e=Ee,un=gl=null,Oc(e),si=null,Ji=0,e=Ee;for(;e!==null;)bm(e.alternate,e),e=e.return;Ee=null}}function xi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,e0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),gn=0,yo(),at=e,Ee=a=sn(e.current,null),Ce=t,Xe=0,na=null,Zn=!1,hi=tn(e,t),oo=!1,mi=la=fo=El=Gn=ot=0,Qt=fs=null,ho=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var c=31-At(i),o=1<<c;t|=e[c],i&=~o}return vn=t,Fs(),a}function Zm(e,t){ge=null,U.H=ls,t===ii||t===ir?(t=sh(),Xe=3):t===bc?(t=sh(),Xe=4):Xe=t===Ic?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,na=t,Ee===null&&(ot=1,gr(e,ma(t,e.current)))}function Gm(){var e=ta.current;return e===null?!0:(Ce&4194048)===Ce?va===null:(Ce&62914560)===Ce||(Ce&536870912)!==0?e===va:!1}function Qm(){var e=U.H;return U.H=ls,e===null?ls:e}function Xm(){var e=U.A;return U.A=Og,e}function Tr(){ot=4,Zn||(Ce&4194048)!==Ce&&ta.current!==null||(hi=!0),(Gn&134217727)===0&&(El&134217727)===0||at===null||In(at,Ce,la,!1)}function vo(e,t,a){var i=Ge;Ge|=2;var c=Qm(),o=Xm();(at!==e||Ce!==t)&&(Rr=null,xi(e,t)),t=!1;var h=ot;e:do try{if(Xe!==0&&Ee!==null){var g=Ee,S=na;switch(Xe){case 8:yo(),h=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(t=!0);var C=Xe;if(Xe=0,na=null,yi(e,g,S,C),a&&hi){h=0;break e}break;default:C=Xe,Xe=0,na=null,yi(e,g,S,C)}}Dg(),h=ot;break}catch(H){Zm(e,H)}while(!0);return t&&e.shellSuspendCounter++,un=gl=null,Ge=i,U.H=c,U.A=o,Ee===null&&(at=null,Ce=0,Fs()),h}function Dg(){for(;Ee!==null;)Im(Ee)}function Ug(e,t){var a=Ge;Ge|=2;var i=Qm(),c=Xm();at!==e||Ce!==t?(Rr=null,Er=_t()+500,xi(e,t)):hi=tn(e,t);e:do try{if(Xe!==0&&Ee!==null){t=Ee;var o=na;t:switch(Xe){case 1:Xe=0,na=null,yi(e,t,o,1);break;case 2:case 9:if(lh(o)){Xe=0,na=null,Km(t);break}t=function(){Xe!==2&&Xe!==9||at!==e||(Xe=7),Xa(e)},o.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:lh(o)?(Xe=0,na=null,Km(t)):(Xe=0,na=null,yi(e,t,o,7));break;case 5:var h=null;switch(Ee.tag){case 26:h=Ee.memoizedState;case 5:case 27:var g=Ee;if(h?Lp(h):g.stateNode.complete){Xe=0,na=null;var S=g.sibling;if(S!==null)Ee=S;else{var C=g.return;C!==null?(Ee=C,Or(C)):Ee=null}break t}}Xe=0,na=null,yi(e,t,o,5);break;case 6:Xe=0,na=null,yi(e,t,o,6);break;case 8:yo(),ot=6;break e;default:throw Error(u(462))}}zg();break}catch(H){Zm(e,H)}while(!0);return un=gl=null,U.H=i,U.A=c,Ge=a,Ee!==null?0:(at=null,Ce=0,Fs(),ot)}function zg(){for(;Ee!==null&&!ke();)Im(Ee)}function Im(e){var t=vm(e.alternate,e,vn);e.memoizedProps=e.pendingProps,t===null?Or(e):Ee=t}function Km(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=fm(a,t,t.pendingProps,t.type,void 0,Ce);break;case 11:t=fm(a,t,t.pendingProps,t.type.render,t.ref,Ce);break;case 5:Oc(t);default:bm(a,t),t=Ee=Xf(t,vn),t=vm(a,t,vn)}e.memoizedProps=e.pendingProps,t===null?Or(e):Ee=t}function yi(e,t,a,i){un=gl=null,Oc(t),si=null,Ji=0;var c=t.return;try{if(_g(e,c,t,a,Ce)){ot=1,gr(e,ma(a,e.current)),Ee=null;return}}catch(o){if(c!==null)throw Ee=c,o;ot=1,gr(e,ma(a,e.current)),Ee=null;return}t.flags&32768?(Le||i===1?e=!0:hi||(Ce&536870912)!==0?e=!1:(Zn=e=!0,(i===2||i===9||i===3||i===6)&&(i=ta.current,i!==null&&i.tag===13&&(i.flags|=16384))),Jm(t,e)):Or(t)}function Or(e){var t=e;do{if((t.flags&32768)!==0){Jm(t,Zn);return}e=t.return;var a=Eg(t.alternate,t,vn);if(a!==null){Ee=a;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);ot===0&&(ot=5)}function Jm(e,t){do{var a=Rg(e.alternate,e);if(a!==null){a.flags&=32767,Ee=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=a}while(e!==null);ot=6,Ee=null}function Fm(e,t,a,i,c,o,h,g,S){e.cancelPendingCommit=null;do Mr();while(Nt!==0);if((Ge&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(o=t.lanes|t.childLanes,o|=ic,dl(e,a,o,h,g,S),e===at&&(Ee=at=null,Ce=0),pi=t,Xn=e,gn=a,mo=o,po=c,Hm=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$g(En,function(){return ap(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null,c=J.p,J.p=2,h=Ge,Ge|=4;try{Cg(e,t,a)}finally{Ge=h,J.p=c,U.T=i}}Nt=1,Wm(),Pm(),ep()}}function Wm(){if(Nt===1){Nt=0;var e=Xn,t=pi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var i=J.p;J.p=2;var c=Ge;Ge|=4;try{Om(t,e);var o=Co,h=Bf(e.containerInfo),g=o.focusedElem,S=o.selectionRange;if(h!==g&&g&&g.ownerDocument&&zf(g.ownerDocument.documentElement,g)){if(S!==null&&ec(g)){var C=S.start,H=S.end;if(H===void 0&&(H=C),"selectionStart"in g)g.selectionStart=C,g.selectionEnd=Math.min(H,g.value.length);else{var G=g.ownerDocument||document,O=G&&G.defaultView||window;if(O.getSelection){var L=O.getSelection(),ie=g.textContent.length,me=Math.min(S.start,ie),et=S.end===void 0?me:Math.min(S.end,ie);!L.extend&&me>et&&(h=et,et=me,me=h);var A=Uf(g,me),N=Uf(g,et);if(A&&N&&(L.rangeCount!==1||L.anchorNode!==A.node||L.anchorOffset!==A.offset||L.focusNode!==N.node||L.focusOffset!==N.offset)){var R=G.createRange();R.setStart(A.node,A.offset),L.removeAllRanges(),me>et?(L.addRange(R),L.extend(N.node,N.offset)):(R.setEnd(N.node,N.offset),L.addRange(R))}}}}for(G=[],L=g;L=L.parentNode;)L.nodeType===1&&G.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<G.length;g++){var V=G[g];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Gr=!!Ro,Co=Ro=null}finally{Ge=c,J.p=i,U.T=a}}e.current=t,Nt=2}}function Pm(){if(Nt===2){Nt=0;var e=Xn,t=pi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var i=J.p;J.p=2;var c=Ge;Ge|=4;try{km(e,t.alternate,t)}finally{Ge=c,J.p=i,U.T=a}}Nt=3}}function ep(){if(Nt===4||Nt===3){Nt=0,zl();var e=Xn,t=pi,a=gn,i=Hm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,pi=Xn=null,tp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Qn=null),Va(a),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot=="function")try{Ae.onCommitFiberRoot(Ct,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=U.T,c=J.p,J.p=2,U.T=null;try{for(var o=e.onRecoverableError,h=0;h<i.length;h++){var g=i[h];o(g.value,{componentStack:g.stack})}}finally{U.T=t,J.p=c}}(gn&3)!==0&&Mr(),Xa(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===xo?hs++:(hs=0,xo=e):hs=0,ms(0)}}function tp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ii(t)))}function Mr(){return Wm(),Pm(),ep(),ap()}function ap(){if(Nt!==5)return!1;var e=Xn,t=mo;mo=0;var a=Va(gn),i=U.T,c=J.p;try{J.p=32>a?32:a,U.T=null,a=po,po=null;var o=Xn,h=gn;if(Nt=0,pi=Xn=null,gn=0,(Ge&6)!==0)throw Error(u(331));var g=Ge;if(Ge|=4,zm(o.current),Lm(o,o.current,h,a),Ge=g,ms(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot=="function")try{Ae.onPostCommitFiberRoot(Ct,o)}catch{}return!0}finally{J.p=c,U.T=i,tp(e,t)}}function np(e,t,a){t=ma(a,t),t=Xc(e.stateNode,t,2),e=Hn(e,t,2),e!==null&&(Ya(e,2),Xa(e))}function Ie(e,t,a){if(e.tag===3)np(e,e,a);else for(;t!==null;){if(t.tag===3){np(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Qn===null||!Qn.has(i))){e=ma(a,e),a=lm(2),i=Hn(t,a,2),i!==null&&(im(a,i,t,e),Ya(i,2),Xa(i));break}}t=t.return}}function go(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new Mg;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(a)||(oo=!0,c.add(a),e=Bg.bind(null,e,t,a),t.then(e,e))}function Bg(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,at===e&&(Ce&a)===a&&(ot===4||ot===3&&(Ce&62914560)===Ce&&300>_t()-kr?(Ge&2)===0&&xi(e,0):fo|=a,mi===Ce&&(mi=0)),Xa(e)}function lp(e,t){t===0&&(t=On()),e=xl(e,t),e!==null&&(Ya(e,t),Xa(e))}function qg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),lp(e,a)}function Hg(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),lp(e,a)}function $g(e,t){return Dt(e,t)}var Lr=null,vi=null,bo=!1,Dr=!1,wo=!1,Kn=0;function Xa(e){e!==vi&&e.next===null&&(vi===null?Lr=vi=e:vi=vi.next=e),Dr=!0,bo||(bo=!0,Vg())}function ms(e,t){if(!wo&&Dr){wo=!0;do for(var a=!1,i=Lr;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var o=0;else{var h=i.suspendedLanes,g=i.pingedLanes;o=(1<<31-At(42|e)+1)-1,o&=c&~(h&~g),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,up(i,o))}else o=Ce,o=Tn(i,i===at?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||tn(i,o)||(a=!0,up(i,o));i=i.next}while(a);wo=!1}}function Yg(){ip()}function ip(){Dr=bo=!1;var e=0;Kn!==0&&Pg()&&(e=Kn);for(var t=_t(),a=null,i=Lr;i!==null;){var c=i.next,o=sp(i,t);o===0?(i.next=null,a===null?Lr=c:a.next=c,c===null&&(vi=a)):(a=i,(e!==0||(o&3)!==0)&&(Dr=!0)),i=c}Nt!==0&&Nt!==5||ms(e),Kn!==0&&(Kn=0)}function sp(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var h=31-At(o),g=1<<h,S=c[h];S===-1?((g&a)===0||(g&i)!==0)&&(c[h]=Li(g,t)):S<=t&&(e.expiredLanes|=g),o&=~g}if(t=at,a=Ce,a=Tn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Pa(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||tn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(i!==null&&Pa(i),Va(a)){case 2:case 8:a=kn;break;case 32:a=En;break;case 268435456:a=Ft;break;default:a=En}return i=rp.bind(null,e),a=Dt(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&Pa(i),e.callbackPriority=2,e.callbackNode=null,2}function rp(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Mr()&&e.callbackNode!==a)return null;var i=Ce;return i=Tn(e,e===at?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Ym(e,i,t),sp(e,_t()),e.callbackNode!=null&&e.callbackNode===a?rp.bind(null,e):null)}function up(e,t){if(Mr())return null;Ym(e,t,!0)}function Vg(){t0(function(){(Ge&6)!==0?Dt(Bl,Yg):ip()})}function So(){if(Kn===0){var e=ni;e===0&&(e=Rn,Rn<<=1,(Rn&261888)===0&&(Rn=256)),Kn=e}return Kn}function cp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Vs(""+e)}function op(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 Zg(e,t,a,i,c){if(t==="submit"&&a&&a.stateNode===c){var o=cp((c[Ne]||null).action),h=i.submitter;h&&(t=(t=h[Ne]||null)?cp(t.formAction):h.getAttribute("formAction"),t!==null&&(o=t,h=null));var g=new Xs("action","action",null,i,c);e.push({event:g,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Kn!==0){var S=h?op(c,h):new FormData(c);$c(a,{pending:!0,data:S,method:c.method,action:o},null,S)}}else typeof o=="function"&&(g.preventDefault(),S=h?op(c,h):new FormData(c),$c(a,{pending:!0,data:S,method:c.method,action:o},o,S))},currentTarget:c}]})}}for(var jo=0;jo<lc.length;jo++){var No=lc[jo],Gg=No.toLowerCase(),Qg=No[0].toUpperCase()+No.slice(1);Oa(Gg,"on"+Qg)}Oa($f,"onAnimationEnd"),Oa(Yf,"onAnimationIteration"),Oa(Vf,"onAnimationStart"),Oa("dblclick","onDoubleClick"),Oa("focusin","onFocus"),Oa("focusout","onBlur"),Oa(ug,"onTransitionRun"),Oa(cg,"onTransitionStart"),Oa(og,"onTransitionCancel"),Oa(Zf,"onTransitionEnd"),Vl("onMouseEnter",["mouseout","mouseover"]),Vl("onMouseLeave",["mouseout","mouseover"]),Vl("onPointerEnter",["pointerout","pointerover"]),Vl("onPointerLeave",["pointerout","pointerover"]),fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ps="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(" "),Xg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ps));function dp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],c=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var h=i.length-1;0<=h;h--){var g=i[h],S=g.instance,C=g.currentTarget;if(g=g.listener,S!==o&&c.isPropagationStopped())break e;o=g,c.currentTarget=C;try{o(c)}catch(H){Js(H)}c.currentTarget=null,o=S}else for(h=0;h<i.length;h++){if(g=i[h],S=g.instance,C=g.currentTarget,g=g.listener,S!==o&&c.isPropagationStopped())break e;o=g,c.currentTarget=C;try{o(c)}catch(H){Js(H)}c.currentTarget=null,o=S}}}}function Re(e,t){var a=t[Uu];a===void 0&&(a=t[Uu]=new Set);var i=e+"__bubble";a.has(i)||(fp(t,e,2,!1),a.add(i))}function _o(e,t,a){var i=0;t&&(i|=4),fp(a,e,i,t)}var Ur="_reactListening"+Math.random().toString(36).slice(2);function Ao(e){if(!e[Ur]){e[Ur]=!0,lf.forEach(function(a){a!=="selectionchange"&&(Xg.has(a)||_o(a,!1,e),_o(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ur]||(t[Ur]=!0,_o("selectionchange",!1,t))}}function fp(e,t,a,i){switch($p(t)){case 2:var c=w0;break;case 8:c=S0;break;default:c=$o}a=c.bind(null,t,a,e),c=void 0,!Gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function ko(e,t,a,i,c){var o=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var g=i.stateNode.containerInfo;if(g===c)break;if(h===4)for(h=i.return;h!==null;){var S=h.tag;if((S===3||S===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;g!==null;){if(h=Hl(g),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){i=o=h;continue e}g=g.parentNode}}i=i.return}yf(function(){var C=o,H=Vu(a),G=[];e:{var O=Gf.get(e);if(O!==void 0){var L=Xs,ie=e;switch(e){case"keypress":if(Gs(a)===0)break e;case"keydown":case"keyup":L=Hv;break;case"focusin":ie="focus",L=Ku;break;case"focusout":ie="blur",L=Ku;break;case"beforeblur":case"afterblur":L=Ku;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":L=bf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Ev;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Vv;break;case $f:case Yf:case Vf:L=Tv;break;case Zf:L=Gv;break;case"scroll":case"scrollend":L=Av;break;case"wheel":L=Xv;break;case"copy":case"cut":case"paste":L=Mv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Sf;break;case"toggle":case"beforetoggle":L=Kv}var me=(t&4)!==0,et=!me&&(e==="scroll"||e==="scrollend"),A=me?O!==null?O+"Capture":null:O;me=[];for(var N=C,R;N!==null;){var V=N;if(R=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||R===null||A===null||(V=zi(N,A),V!=null&&me.push(xs(N,V,R))),et)break;N=N.return}0<me.length&&(O=new L(O,ie,null,a,H),G.push({event:O,listeners:me}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",O&&a!==Yu&&(ie=a.relatedTarget||a.fromElement)&&(Hl(ie)||ie[Ut]))break e;if((L||O)&&(O=H.window===H?H:(O=H.ownerDocument)?O.defaultView||O.parentWindow:window,L?(ie=a.relatedTarget||a.toElement,L=C,ie=ie?Hl(ie):null,ie!==null&&(et=f(ie),me=ie.tag,ie!==et||me!==5&&me!==27&&me!==6)&&(ie=null)):(L=null,ie=C),L!==ie)){if(me=bf,V="onMouseLeave",A="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(me=Sf,V="onPointerLeave",A="onPointerEnter",N="pointer"),et=L==null?O:Ui(L),R=ie==null?O:Ui(ie),O=new me(V,N+"leave",L,a,H),O.target=et,O.relatedTarget=R,V=null,Hl(H)===C&&(me=new me(A,N+"enter",ie,a,H),me.target=R,me.relatedTarget=et,V=me),et=V,L&&ie)t:{for(me=Ig,A=L,N=ie,R=0,V=A;V;V=me(V))R++;V=0;for(var de=N;de;de=me(de))V++;for(;0<R-V;)A=me(A),R--;for(;0<V-R;)N=me(N),V--;for(;R--;){if(A===N||N!==null&&A===N.alternate){me=A;break t}A=me(A),N=me(N)}me=null}else me=null;L!==null&&hp(G,O,L,me,!1),ie!==null&&et!==null&&hp(G,et,ie,me,!0)}}e:{if(O=C?Ui(C):window,L=O.nodeName&&O.nodeName.toLowerCase(),L==="select"||L==="input"&&O.type==="file")var $e=Cf;else if(Ef(O))if(Tf)$e=ig;else{$e=ng;var ue=ag}else L=O.nodeName,!L||L.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?C&&$u(C.elementType)&&($e=Cf):$e=lg;if($e&&($e=$e(e,C))){Rf(G,$e,a,H);break e}ue&&ue(e,O,C),e==="focusout"&&C&&O.type==="number"&&C.memoizedProps.value!=null&&Hu(O,"number",O.value)}switch(ue=C?Ui(C):window,e){case"focusin":(Ef(ue)||ue.contentEditable==="true")&&(Kl=ue,tc=C,Gi=null);break;case"focusout":Gi=tc=Kl=null;break;case"mousedown":ac=!0;break;case"contextmenu":case"mouseup":case"dragend":ac=!1,qf(G,a,H);break;case"selectionchange":if(rg)break;case"keydown":case"keyup":qf(G,a,H)}var be;if(Fu)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else Il?Af(e,a)&&(Te="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Te="onCompositionStart");Te&&(jf&&a.locale!=="ko"&&(Il||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Il&&(be=vf()):(Mn=H,Qu="value"in Mn?Mn.value:Mn.textContent,Il=!0)),ue=zr(C,Te),0<ue.length&&(Te=new wf(Te,e,null,a,H),G.push({event:Te,listeners:ue}),be?Te.data=be:(be=kf(a),be!==null&&(Te.data=be)))),(be=Fv?Wv(e,a):Pv(e,a))&&(Te=zr(C,"onBeforeInput"),0<Te.length&&(ue=new wf("onBeforeInput","beforeinput",null,a,H),G.push({event:ue,listeners:Te}),ue.data=be)),Zg(G,e,C,a,H)}dp(G,t)})}function xs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function zr(e,t){for(var a=t+"Capture",i=[];e!==null;){var c=e,o=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||o===null||(c=zi(e,a),c!=null&&i.unshift(xs(e,c,o)),c=zi(e,t),c!=null&&i.push(xs(e,c,o))),e.tag===3)return i;e=e.return}return[]}function Ig(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hp(e,t,a,i,c){for(var o=t._reactName,h=[];a!==null&&a!==i;){var g=a,S=g.alternate,C=g.stateNode;if(g=g.tag,S!==null&&S===i)break;g!==5&&g!==26&&g!==27||C===null||(S=C,c?(C=zi(a,o),C!=null&&h.unshift(xs(a,C,S))):c||(C=zi(a,o),C!=null&&h.push(xs(a,C,S)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var Kg=/\r\n?/g,Jg=/\u0000|\uFFFD/g;function mp(e){return(typeof e=="string"?e:""+e).replace(Kg,`
|
|
49
|
+
`).replace(Jg,"")}function pp(e,t){return t=mp(t),mp(e)===t}function Pe(e,t,a,i,c,o){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Gl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Gl(e,""+i);break;case"className":$s(e,"class",i);break;case"tabIndex":$s(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":$s(e,a,i);break;case"style":pf(e,i,o);break;case"data":if(t!=="object"){$s(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Vs(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="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"&&Pe(e,t,"name",c.name,c,null),Pe(e,t,"formEncType",c.formEncType,c,null),Pe(e,t,"formMethod",c.formMethod,c,null),Pe(e,t,"formTarget",c.formTarget,c,null)):(Pe(e,t,"encType",c.encType,c,null),Pe(e,t,"method",c.method,c,null),Pe(e,t,"target",c.target,c,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Vs(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=nn);break;case"onScroll":i!=null&&Re("scroll",e);break;case"onScrollEnd":i!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(c.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}a=Vs(""+i),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":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""+i):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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":Re("beforetoggle",e),Re("toggle",e),Hs(e,"popover",i);break;case"xlinkActuate":an(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":an(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":an(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":an(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":an(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":an(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":an(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":an(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":an(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Hs(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Nv.get(a)||a,Hs(e,a,i))}}function Eo(e,t,a,i,c,o){switch(a){case"style":pf(e,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(c.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof i=="string"?Gl(e,i):(typeof i=="number"||typeof i=="bigint")&&Gl(e,""+i);break;case"onScroll":i!=null&&Re("scroll",e);break;case"onScrollEnd":i!=null&&Re("scrollend",e);break;case"onClick":i!=null&&(e.onclick=nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sf.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),o=e[Ne]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,c),typeof i=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,c);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):Hs(e,a,i)}}}function Lt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var i=!1,c=!1,o;for(o in a)if(a.hasOwnProperty(o)){var h=a[o];if(h!=null)switch(o){case"src":i=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Pe(e,t,o,h,a,null)}}c&&Pe(e,t,"srcSet",a.srcSet,a,null),i&&Pe(e,t,"src",a.src,a,null);return;case"input":Re("invalid",e);var g=o=h=c=null,S=null,C=null;for(i in a)if(a.hasOwnProperty(i)){var H=a[i];if(H!=null)switch(i){case"name":c=H;break;case"type":h=H;break;case"checked":S=H;break;case"defaultChecked":C=H;break;case"value":o=H;break;case"defaultValue":g=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:Pe(e,t,i,H,a,null)}}df(e,o,g,S,C,h,c,!1);return;case"select":Re("invalid",e),i=h=o=null;for(c in a)if(a.hasOwnProperty(c)&&(g=a[c],g!=null))switch(c){case"value":o=g;break;case"defaultValue":h=g;break;case"multiple":i=g;default:Pe(e,t,c,g,a,null)}t=o,a=h,e.multiple=!!i,t!=null?Zl(e,!!i,t,!1):a!=null&&Zl(e,!!i,a,!0);return;case"textarea":Re("invalid",e),o=c=i=null;for(h in a)if(a.hasOwnProperty(h)&&(g=a[h],g!=null))switch(h){case"value":i=g;break;case"defaultValue":c=g;break;case"children":o=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(u(91));break;default:Pe(e,t,h,g,a,null)}hf(e,i,c,o);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(i=a[S],i!=null))switch(S){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Pe(e,t,S,i,a,null)}return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(i=0;i<ps.length;i++)Re(ps[i],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("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(C in a)if(a.hasOwnProperty(C)&&(i=a[C],i!=null))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Pe(e,t,C,i,a,null)}return;default:if($u(t)){for(H in a)a.hasOwnProperty(H)&&(i=a[H],i!==void 0&&Eo(e,t,H,i,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(i=a[g],i!=null&&Pe(e,t,g,i,a,null))}function Fg(e,t,a,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,o=null,h=null,g=null,S=null,C=null,H=null;for(L in a){var G=a[L];if(a.hasOwnProperty(L)&&G!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":S=G;default:i.hasOwnProperty(L)||Pe(e,t,L,null,i,G)}}for(var O in i){var L=i[O];if(G=a[O],i.hasOwnProperty(O)&&(L!=null||G!=null))switch(O){case"type":o=L;break;case"name":c=L;break;case"checked":C=L;break;case"defaultChecked":H=L;break;case"value":h=L;break;case"defaultValue":g=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:L!==G&&Pe(e,t,O,L,i,G)}}qu(e,h,g,S,C,H,o,c);return;case"select":L=h=g=O=null;for(o in a)if(S=a[o],a.hasOwnProperty(o)&&S!=null)switch(o){case"value":break;case"multiple":L=S;default:i.hasOwnProperty(o)||Pe(e,t,o,null,i,S)}for(c in i)if(o=i[c],S=a[c],i.hasOwnProperty(c)&&(o!=null||S!=null))switch(c){case"value":O=o;break;case"defaultValue":g=o;break;case"multiple":h=o;default:o!==S&&Pe(e,t,c,o,i,S)}t=g,a=h,i=L,O!=null?Zl(e,!!a,O,!1):!!i!=!!a&&(t!=null?Zl(e,!!a,t,!0):Zl(e,!!a,a?[]:"",!1));return;case"textarea":L=O=null;for(g in a)if(c=a[g],a.hasOwnProperty(g)&&c!=null&&!i.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Pe(e,t,g,null,i,c)}for(h in i)if(c=i[h],o=a[h],i.hasOwnProperty(h)&&(c!=null||o!=null))switch(h){case"value":O=c;break;case"defaultValue":L=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(u(91));break;default:c!==o&&Pe(e,t,h,c,i,o)}ff(e,O,L);return;case"option":for(var ie in a)if(O=a[ie],a.hasOwnProperty(ie)&&O!=null&&!i.hasOwnProperty(ie))switch(ie){case"selected":e.selected=!1;break;default:Pe(e,t,ie,null,i,O)}for(S in i)if(O=i[S],L=a[S],i.hasOwnProperty(S)&&O!==L&&(O!=null||L!=null))switch(S){case"selected":e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Pe(e,t,S,O,i,L)}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)O=a[me],a.hasOwnProperty(me)&&O!=null&&!i.hasOwnProperty(me)&&Pe(e,t,me,null,i,O);for(C in i)if(O=i[C],L=a[C],i.hasOwnProperty(C)&&O!==L&&(O!=null||L!=null))switch(C){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Pe(e,t,C,O,i,L)}return;default:if($u(t)){for(var et in a)O=a[et],a.hasOwnProperty(et)&&O!==void 0&&!i.hasOwnProperty(et)&&Eo(e,t,et,void 0,i,O);for(H in i)O=i[H],L=a[H],!i.hasOwnProperty(H)||O===L||O===void 0&&L===void 0||Eo(e,t,H,O,i,L);return}}for(var A in a)O=a[A],a.hasOwnProperty(A)&&O!=null&&!i.hasOwnProperty(A)&&Pe(e,t,A,null,i,O);for(G in i)O=i[G],L=a[G],!i.hasOwnProperty(G)||O===L||O==null&&L==null||Pe(e,t,G,O,i,L)}function xp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Wg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var c=a[i],o=c.transferSize,h=c.initiatorType,g=c.duration;if(o&&g&&xp(h)){for(h=0,g=c.responseEnd,i+=1;i<a.length;i++){var S=a[i],C=S.startTime;if(C>g)break;var H=S.transferSize,G=S.initiatorType;H&&xp(G)&&(S=S.responseEnd,h+=H*(S<g?1:(g-C)/(S-C)))}if(--i,t+=8*(o+h)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ro=null,Co=null;function Br(e){return e.nodeType===9?e:e.ownerDocument}function yp(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 vp(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 To(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 Oo=null;function Pg(){var e=window.event;return e&&e.type==="popstate"?e===Oo?!1:(Oo=e,!0):(Oo=null,!1)}var gp=typeof setTimeout=="function"?setTimeout:void 0,e0=typeof clearTimeout=="function"?clearTimeout:void 0,bp=typeof Promise=="function"?Promise:void 0,t0=typeof queueMicrotask=="function"?queueMicrotask:typeof bp<"u"?function(e){return bp.resolve(null).then(e).catch(a0)}:gp;function a0(e){setTimeout(function(){throw e})}function Jn(e){return e==="head"}function wp(e,t){var a=t,i=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(c),Si(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")ys(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ys(a);for(var o=a.firstChild;o;){var h=o.nextSibling,g=o.nodeName;o[Di]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=h}}else a==="body"&&ys(e.ownerDocument.body);a=c}while(a);Si(t)}function Sp(e,t){var a=e;e=0;do{var i=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||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function Mo(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":Mo(a),zu(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function n0(e,t,a,i){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Di])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!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=ga(e.nextSibling),e===null)break}return null}function l0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ga(e.nextSibling),e===null))return null;return e}function jp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ga(e.nextSibling),e===null))return null;return e}function Lo(e){return e.data==="$?"||e.data==="$~"}function Do(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i0(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var i=function(){t(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ga(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Uo=null;function Np(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ga(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function _p(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 Ap(e,t,a){switch(t=Br(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 ys(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zu(e)}var ba=new Map,kp=new Set;function qr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bn=J.d;J.d={f:s0,r:r0,D:u0,C:c0,L:o0,m:d0,X:h0,S:f0,M:m0};function s0(){var e=bn.f(),t=Cr();return e||t}function r0(e){var t=$l(e);t!==null&&t.tag===5&&t.type==="form"?Zh(t):bn.r(e)}var gi=typeof document>"u"?null:document;function Ep(e,t,a){var i=gi;if(i&&typeof t=="string"&&t){var c=fa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),kp.has(c)||(kp.add(c),e={rel:e,crossOrigin:a,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),Lt(t,"link",e),Et(t),i.head.appendChild(t)))}}function u0(e){bn.D(e),Ep("dns-prefetch",e,null)}function c0(e,t){bn.C(e,t),Ep("preconnect",e,t)}function o0(e,t,a){bn.L(e,t,a);var i=gi;if(i&&e&&t){var c='link[rel="preload"][as="'+fa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+fa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+fa(a.imageSizes)+'"]')):c+='[href="'+fa(e)+'"]';var o=c;switch(t){case"style":o=bi(e);break;case"script":o=wi(e)}ba.has(o)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ba.set(o,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(vs(o))||t==="script"&&i.querySelector(gs(o))||(t=i.createElement("link"),Lt(t,"link",e),Et(t),i.head.appendChild(t)))}}function d0(e,t){bn.m(e,t);var a=gi;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+fa(i)+'"][href="'+fa(e)+'"]',o=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=wi(e)}if(!ba.has(o)&&(e=j({rel:"modulepreload",href:e},t),ba.set(o,e),a.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gs(o)))return}i=a.createElement("link"),Lt(i,"link",e),Et(i),a.head.appendChild(i)}}}function f0(e,t,a){bn.S(e,t,a);var i=gi;if(i&&e){var c=Yl(i).hoistableStyles,o=bi(e);t=t||"default";var h=c.get(o);if(!h){var g={loading:0,preload:null};if(h=i.querySelector(vs(o)))g.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ba.get(o))&&zo(e,a);var S=h=i.createElement("link");Et(S),Lt(S,"link",e),S._p=new Promise(function(C,H){S.onload=C,S.onerror=H}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Hr(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:g},c.set(o,h)}}}function h0(e,t){bn.X(e,t);var a=gi;if(a&&e){var i=Yl(a).hoistableScripts,c=wi(e),o=i.get(c);o||(o=a.querySelector(gs(c)),o||(e=j({src:e,async:!0},t),(t=ba.get(c))&&Bo(e,t),o=a.createElement("script"),Et(o),Lt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(c,o))}}function m0(e,t){bn.M(e,t);var a=gi;if(a&&e){var i=Yl(a).hoistableScripts,c=wi(e),o=i.get(c);o||(o=a.querySelector(gs(c)),o||(e=j({src:e,async:!0,type:"module"},t),(t=ba.get(c))&&Bo(e,t),o=a.createElement("script"),Et(o),Lt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(c,o))}}function Rp(e,t,a,i){var c=(c=P.current)?qr(c):null;if(!c)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=bi(a.href),a=Yl(c).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=bi(a.href);var o=Yl(c).hoistableStyles,h=o.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=c.querySelector(vs(e)))&&!o._p&&(h.instance=o,h.state.loading=5),ba.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},ba.set(e,a),o||p0(c,e,a,h.state))),t&&i===null)throw Error(u(528,""));return h}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=wi(a),a=Yl(c).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function bi(e){return'href="'+fa(e)+'"'}function vs(e){return'link[rel="stylesheet"]['+e+"]"}function Cp(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function p0(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Lt(t,"link",a),Et(t),e.head.appendChild(t))}function wi(e){return'[src="'+fa(e)+'"]'}function gs(e){return"script[async]"+e}function Tp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+fa(a.href)+'"]');if(i)return t.instance=i,Et(i),i;var c=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Et(i),Lt(i,"style",c),Hr(i,a.precedence,e),t.instance=i;case"stylesheet":c=bi(a.href);var o=e.querySelector(vs(c));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;i=Cp(a),(c=ba.get(c))&&zo(i,c),o=(e.ownerDocument||e).createElement("link"),Et(o);var h=o;return h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Lt(o,"link",i),t.state.loading|=4,Hr(o,a.precedence,e),t.instance=o;case"script":return o=wi(a.src),(c=e.querySelector(gs(o)))?(t.instance=c,Et(c),c):(i=a,(c=ba.get(o))&&(i=j({},a),Bo(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),Et(c),Lt(c,"link",i),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Hr(i,a.precedence,e));return t.instance}function Hr(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,o=c,h=0;h<i.length;h++){var g=i[h];if(g.dataset.precedence===t)o=g;else if(o!==c)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function zo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Bo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $r=null;function Op(e,t,a){if($r===null){var i=new Map,c=$r=new Map;c.set(a,i)}else c=$r,i=c.get(a),i||(i=new Map,c.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var o=a[c];if(!(o[Di]||o[ee]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var h=o.getAttribute(t)||"";h=e+h;var g=i.get(h);g?g.push(o):i.set(h,[o])}}return i}function Mp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function x0(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 Lp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function y0(e,t,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=bi(i.href),o=t.querySelector(vs(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Yr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,Et(o);return}o=t.ownerDocument||t,i=Cp(i),(c=ba.get(c))&&zo(i,c),o=o.createElement("link"),Et(o);var h=o;h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Lt(o,"link",i),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=Yr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var qo=0;function v0(e,t){return e.stylesheets&&e.count===0&&Zr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Zr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&qo===0&&(qo=62500*Wg());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>qo?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function Yr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vr=null;function Zr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vr=new Map,t.forEach(g0,e),Vr=null,Yr.call(e))}function g0(e,t){if(!(t.state.loading&4)){var a=Vr.get(e);if(a)var i=a.get(null);else{a=new Map,Vr.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<c.length;o++){var h=c[o];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(a.set(h.dataset.precedence,h),i=h)}i&&a.set(null,i)}c=t.instance,h=c.getAttribute("data-precedence"),o=a.get(h)||i,o===i&&a.set(null,c),a.set(h,c),this.count++,i=Yr.bind(this),c.addEventListener("load",i),c.addEventListener("error",i),o?o.parentNode.insertBefore(c,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var bs={$$typeof:W,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function b0(e,t,a,i,c,o,h,g,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ol(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ol(0),this.hiddenUpdates=ol(null),this.identifierPrefix=i,this.onUncaughtError=c,this.onCaughtError=o,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Dp(e,t,a,i,c,o,h,g,S,C,H,G){return e=new b0(e,t,a,h,S,C,H,G,g),t=1,o===!0&&(t|=24),o=ea(3,null,null,t),e.current=o,o.stateNode=e,t=yc(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:i,isDehydrated:a,cache:t},wc(o),e}function Up(e){return e?(e=Wl,e):Wl}function zp(e,t,a,i,c,o){c=Up(c),i.context===null?i.context=c:i.pendingContext=c,i=qn(t),i.payload={element:a},o=o===void 0?null:o,o!==null&&(i.callback=o),a=Hn(e,i,t),a!==null&&(Xt(a,e,t),Wi(a,e,t))}function Bp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ho(e,t){Bp(e,t),(e=e.alternate)&&Bp(e,t)}function qp(e){if(e.tag===13||e.tag===31){var t=xl(e,67108864);t!==null&&Xt(t,e,67108864),Ho(e,67108864)}}function Hp(e){if(e.tag===13||e.tag===31){var t=ia();t=kt(t);var a=xl(e,t);a!==null&&Xt(a,e,t),Ho(e,t)}}var Gr=!0;function w0(e,t,a,i){var c=U.T;U.T=null;var o=J.p;try{J.p=2,$o(e,t,a,i)}finally{J.p=o,U.T=c}}function S0(e,t,a,i){var c=U.T;U.T=null;var o=J.p;try{J.p=8,$o(e,t,a,i)}finally{J.p=o,U.T=c}}function $o(e,t,a,i){if(Gr){var c=Yo(i);if(c===null)ko(e,t,i,Qr,a),Yp(e,i);else if(N0(c,e,t,a,i))i.stopPropagation();else if(Yp(e,i),t&4&&-1<j0.indexOf(e)){for(;c!==null;){var o=$l(c);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var h=ca(o.pendingLanes);if(h!==0){var g=o;for(g.pendingLanes|=2,g.entangledLanes|=2;h;){var S=1<<31-At(h);g.entanglements[1]|=S,h&=~S}Xa(o),(Ge&6)===0&&(Er=_t()+500,ms(0))}}break;case 31:case 13:g=xl(o,2),g!==null&&Xt(g,o,2),Cr(),Ho(o,2)}if(o=Yo(i),o===null&&ko(e,t,i,Qr,a),o===c)break;c=o}c!==null&&i.stopPropagation()}else ko(e,t,i,null,a)}}function Yo(e){return e=Vu(e),Vo(e)}var Qr=null;function Vo(e){if(Qr=null,e=Hl(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=x(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 Qr=e,null}function $p(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(Ta()){case Bl:return 2;case kn:return 8;case En:case ul:return 32;case Ft:return 268435456;default:return 32}default:return 32}}var Zo=!1,Fn=null,Wn=null,Pn=null,ws=new Map,Ss=new Map,el=[],j0="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 Yp(e,t){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Wn=null;break;case"mouseover":case"mouseout":Pn=null;break;case"pointerover":case"pointerout":ws.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(t.pointerId)}}function js(e,t,a,i,c,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:o,targetContainers:[c]},t!==null&&(t=$l(t),t!==null&&qp(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function N0(e,t,a,i,c){switch(t){case"focusin":return Fn=js(Fn,e,t,a,i,c),!0;case"dragenter":return Wn=js(Wn,e,t,a,i,c),!0;case"mouseover":return Pn=js(Pn,e,t,a,i,c),!0;case"pointerover":var o=c.pointerId;return ws.set(o,js(ws.get(o)||null,e,t,a,i,c)),!0;case"gotpointercapture":return o=c.pointerId,Ss.set(o,js(Ss.get(o)||null,e,t,a,i,c)),!0}return!1}function Vp(e){var t=Hl(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,oa(e.priority,function(){Hp(a)});return}}else if(t===31){if(t=x(a),t!==null){e.blockedOn=t,oa(e.priority,function(){Hp(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 Xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Yo(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);Yu=i,a.target.dispatchEvent(i),Yu=null}else return t=$l(a),t!==null&&qp(t),e.blockedOn=a,!1;t.shift()}return!0}function Zp(e,t,a){Xr(e)&&a.delete(t)}function _0(){Zo=!1,Fn!==null&&Xr(Fn)&&(Fn=null),Wn!==null&&Xr(Wn)&&(Wn=null),Pn!==null&&Xr(Pn)&&(Pn=null),ws.forEach(Zp),Ss.forEach(Zp)}function Ir(e,t){e.blockedOn===t&&(e.blockedOn=null,Zo||(Zo=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,_0)))}var Kr=null;function Gp(e){Kr!==e&&(Kr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Kr===e&&(Kr=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],c=e[t+2];if(typeof i!="function"){if(Vo(i||a)===null)continue;break}var o=$l(a);o!==null&&(e.splice(t,3),t-=3,$c(o,{pending:!0,data:c,method:a.method,action:i},i,c))}}))}function Si(e){function t(S){return Ir(S,e)}Fn!==null&&Ir(Fn,e),Wn!==null&&Ir(Wn,e),Pn!==null&&Ir(Pn,e),ws.forEach(t),Ss.forEach(t);for(var a=0;a<el.length;a++){var i=el[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<el.length&&(a=el[0],a.blockedOn===null);)Vp(a),a.blockedOn===null&&el.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var c=a[i],o=a[i+1],h=c[Ne]||null;if(typeof o=="function")h||Gp(a);else if(h){var g=null;if(o&&o.hasAttribute("formAction")){if(c=o,h=o[Ne]||null)g=h.formAction;else if(Vo(c)!==null)continue}else g=h.action;typeof g=="function"?a[i+1]=g:(a.splice(i,3),i-=3),Gp(a)}}}function Qp(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),i||setTimeout(a,20)}function a(){if(!i&&!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 i=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Go(e){this._internalRoot=e}Jr.prototype.render=Go.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,i=ia();zp(a,i,e,t,null,null)},Jr.prototype.unmount=Go.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zp(e.current,2,null,e,null,null),Cr(),t[Ut]=null}};function Jr(e){this._internalRoot=e}Jr.prototype.unstable_scheduleHydration=function(e){if(e){var t=jt();e={blockedOn:null,target:e,priority:t};for(var a=0;a<el.length&&t!==0&&t<el[a].priority;a++);el.splice(a,0,e),a===0&&Vp(e)}};var Xp=l.version;if(Xp!=="19.2.7")throw Error(u(527,Xp,"19.2.7"));J.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var A0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fr.isDisabled&&Fr.supportsFiber)try{Ct=Fr.inject(A0),Ae=Fr}catch{}}return _s.createRoot=function(e,t){if(!d(e))throw Error(u(299));var a=!1,i="",c=em,o=tm,h=am;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Dp(e,1,!1,null,null,a,i,null,c,o,h,Qp),e[Ut]=t.current,Ao(e),new Go(t)},_s.hydrateRoot=function(e,t,a){if(!d(e))throw Error(u(299));var i=!1,c="",o=em,h=tm,g=am,S=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=Dp(e,1,!0,t,a??null,i,c,S,o,h,g,Qp),t.context=Up(null),a=t.current,i=ia(),i=kt(i),c=qn(i),c.callback=null,Hn(a,c,i),a=i,t.current.lanes=a,Ya(t,a),Xa(t),e[Ut]=t.current,Ao(e),new Jr(t)},_s.version="19.2.7",_s}var nx;function U0(){if(nx)return Io.exports;nx=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(l){console.error(l)}}return n(),Io.exports=D0(),Io.exports}var z0=U0();/**
|
|
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 Ud=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ey=/^[\\/]{2}/;function B0(n,l){return l+n.replace(/\\/g,"/")}var lx="popstate";function ix(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function q0(n={}){function l(u,d){var v;let f=(v=d.state)==null?void 0:v.masked,{pathname:m,search:x,hash:y}=f||u.location;return gd("",{pathname:m,search:x,hash:y},d.state&&d.state.usr||null,d.state&&d.state.key||"default",f?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function s(u,d){return typeof d=="string"?d:Cl(d)}return $0(l,s,null,n)}function ut(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function ka(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function H0(){return Math.random().toString(36).substring(2,10)}function sx(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function gd(n,l,s=null,u,d){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Ci(l):l,state:s,key:l&&l.key||u||H0(),mask:d}}function Cl({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Ci(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let u=n.indexOf("?");u>=0&&(l.search=n.substring(u),n=n.substring(0,u)),n&&(l.pathname=n)}return l}function $0(n,l,s,u={}){let{window:d=document.defaultView,v5Compat:f=!1}=u,m=d.history,x="POP",y=null,v=w();v==null&&(v=0,m.replaceState({...m.state,idx:v},""));function w(){return(m.state||{idx:null}).idx}function j(){x="POP";let M=w(),$=M==null?null:M-v;v=M,y&&y({action:x,location:Y.location,delta:$})}function D(M,$){x="PUSH";let F=ix(M)?M:gd(Y.location,M,$);v=w()+1;let W=sx(F,v),se=Y.createHref(F.mask||F);try{m.pushState(W,"",se)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;d.location.assign(se)}f&&y&&y({action:x,location:Y.location,delta:1})}function X(M,$){x="REPLACE";let F=ix(M)?M:gd(Y.location,M,$);v=w();let W=sx(F,v),se=Y.createHref(F.mask||F);m.replaceState(W,"",se),f&&y&&y({action:x,location:Y.location,delta:0})}function E(M){return Y0(d,M)}let Y={get action(){return x},get location(){return n(d,m)},listen(M){if(y)throw new Error("A history only accepts one active listener");return d.addEventListener(lx,j),y=M,()=>{d.removeEventListener(lx,j),y=null}},createHref(M){return l(d,M)},createURL:E,encodeLocation(M){let $=E(M);return{pathname:$.pathname,search:$.search,hash:$.hash}},push:D,replace:X,go(M){return m.go(M)}};return Y}function Y0(n,l,s=!1){let u="http://localhost";n&&(u=n.location.origin!=="null"?n.location.origin:n.location.href),ut(u,"No window.location.(origin|href) available to create URL");let d=typeof l=="string"?l:Cl(l);return d=d.replace(/ $/,"%20"),!s&&ey.test(d)&&(d=u+d),new URL(d,u)}function ty(n,l,s="/"){return V0(n,l,s,!1)}function V0(n,l,s,u,d){let f=typeof l=="string"?Ci(l):l,m=Nn(f.pathname||"/",s);if(m==null)return null;let x=Z0(n),y=null,v=tb(m);for(let w=0;y==null&&w<x.length;++w)y=eb(x[w],v,u);return y}function Z0(n){let l=ay(n);return G0(l),l}function ay(n,l=[],s=[],u="",d=!1){let f=(m,x,y=d,v)=>{let w={relativePath:v===void 0?m.path||"":v,caseSensitive:m.caseSensitive===!0,childrenIndex:x,route:m};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(u)&&y)return;ut(w.relativePath.startsWith(u),`Absolute route path "${w.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(u.length)}let j=za([u,w.relativePath]),D=s.concat(w);m.children&&m.children.length>0&&(ut(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),ay(m.children,l,D,j,y)),!(m.path==null&&!m.index)&&l.push({path:j,score:W0(j,m.index),routesMeta:D.map((X,E)=>{let[Y,M]=iy(X.relativePath,X.caseSensitive,E===D.length-1);return{...X,matcher:Y,compiledParams:M}})})};return n.forEach((m,x)=>{var y;if(m.path===""||!((y=m.path)!=null&&y.includes("?")))f(m,x);else for(let v of ny(m.path))f(m,x,!0,v)}),l}function ny(n){let l=n.split("/");if(l.length===0)return[];let[s,...u]=l,d=s.endsWith("?"),f=s.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=ny(u.join("/")),x=[];return x.push(...m.map(y=>y===""?f:[f,y].join("/"))),d&&x.push(...m),x.map(y=>n.startsWith("/")&&y===""?"/":y)}function G0(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:P0(l.routesMeta.map(u=>u.childrenIndex),s.routesMeta.map(u=>u.childrenIndex)))}var Q0=/^:[\w-]+$/,X0=3,I0=2,K0=1,J0=10,F0=-2,rx=n=>n==="*";function W0(n,l){let s=n.split("/"),u=s.length;return s.some(rx)&&(u+=F0),l&&(u+=I0),s.filter(d=>!rx(d)).reduce((d,f)=>d+(Q0.test(f)?X0:f===""?K0:J0),u)}function P0(n,l){return n.length===l.length&&n.slice(0,-1).every((u,d)=>u===l[d])?n[n.length-1]-l[l.length-1]:0}function eb(n,l,s=!1){let{routesMeta:u}=n,d={},f="/",m=[];for(let x=0;x<u.length;++x){let y=u[x],v=x===u.length-1,w=f==="/"?l:l.slice(f.length)||"/",j={path:y.relativePath,caseSensitive:y.caseSensitive,end:v},D=y.matcher&&y.compiledParams?ly(j,w,y.matcher,y.compiledParams):cu(j,w),X=y.route;if(!D&&v&&s&&!u[u.length-1].route.index&&(D=cu({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!D)return null;Object.assign(d,D.params),m.push({params:d,pathname:za([f,D.pathname]),pathnameBase:lb(za([f,D.pathnameBase])),route:X}),D.pathnameBase!=="/"&&(f=za([f,D.pathnameBase]))}return m}function cu(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,u]=iy(n.path,n.caseSensitive,n.end);return ly(n,l,s,u)}function ly(n,l,s,u){let d=l.match(s);if(!d)return null;let f=d[0],m=ki(f,1),x=d.slice(1);return{params:u.reduce((v,{paramName:w,isOptional:j},D)=>{if(w==="*"){let E=x[D]||"";m=ki(f.slice(0,f.length-E.length),1)}const X=x[D];return j&&!X?v[w]=void 0:v[w]=(X||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:m,pattern:n}}function iy(n,l=!1,s=!0){ka(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,x,y,v,w)=>{if(u.push({paramName:x,isOptional:y!=null}),y){let j=w.charAt(v+m.length);return j&&j!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(u.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,l?void 0:"i"),u]}function tb(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return ka(!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 (${l}).`),n}}function Nn(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,u=n.charAt(s);return u&&u!=="/"?null:n.slice(s)||"/"}function ab(n,l="/"){let{pathname:s,search:u="",hash:d=""}=typeof n=="string"?Ci(n):n,f;return s?(s=sy(s),s.startsWith("/")||s.startsWith("\\")?f=ux(s.substring(1),"/"):f=ux(s,l)):f=l,{pathname:f,search:ib(u),hash:sb(d)}}function ux(n,l){let s=ki(l).split("/");return n.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function Wo(n,l,s,u){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nb(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function zd(n){let l=nb(n);return l.map((s,u)=>u===l.length-1?s.pathname:s.pathnameBase)}function Nu(n,l,s,u=!1){let d;typeof n=="string"?d=Ci(n):(d={...n},ut(!d.pathname||!d.pathname.includes("?"),Wo("?","pathname","search",d)),ut(!d.pathname||!d.pathname.includes("#"),Wo("#","pathname","hash",d)),ut(!d.search||!d.search.includes("#"),Wo("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,x;if(m==null)x=s;else{let j=l.length-1;if(!u&&m.startsWith("..")){let D=m.split("/");for(;D[0]==="..";)D.shift(),j-=1;d.pathname=D.join("/")}x=j>=0?l[j]:"/"}let y=ab(d,x),v=m&&m!=="/"&&m.endsWith("/"),w=(f||m===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(v||w)&&(y.pathname+="/"),y}var sy=n=>n.replace(/[\\/]{2,}/g,"/"),za=n=>sy(n.join("/"));function ki(n,l=0){let s=n.length;for(;s>l&&n.charCodeAt(s-1)===47;)s--;return s===n.length?n:n.slice(0,s)}var lb=n=>ki(n).replace(/^\/*/,"/"),ib=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,sb=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,rb=class{constructor(n,l,s,u=!1){this.status=n,this.statusText=l||"",this.internal=u,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function ub(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function cb(n){let l=n.map(s=>s.route.path).filter(Boolean);return za(l)||"/"}var ry=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function uy(n,l){let s=n;if(typeof s!="string"||!Ud.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let u=s,d=!1;if(ry)try{let f=new URL(window.location.href),m=ey.test(s)?new URL(B0(s,f.protocol)):new URL(s),x=Nn(m.pathname,l);m.origin===f.origin&&x!=null?s=x+m.search+m.hash:d=!0}catch{ka(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cx=new URL("http://localhost");function Bd(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),cx)}catch{return cx}}function Po(n,l){return n.origin===l.origin&&(n.origin!=="null"||n.protocol===l.protocol&&n.host===l.host)}function ob(n,l){if(n.startsWith("//"))return!0;let s=l.protocol.toLowerCase();return n.toLowerCase().startsWith(s)?l.host===""||n.slice(s.length).startsWith("//"):!1}function qd(n,l,s,u){let d=null;try{d=n==null?null:new URL(n,s)}catch{}let f=new URL(l,s),m=d!=null&&!Po(d,s),x=!Po(f,s);if(u==="reject"){if(m||x)throw new Error("External navigation is not allowed")}else if(x&&(d==null||!ob(n,d)||!Po(d,f)))throw new Error("External navigation is not allowed")}var cy=["POST","PUT","PATCH","DELETE"];new Set(cy);var db=["GET",...cy];new Set(db);var fb=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function hb(n){try{return fb.includes(new URL(n).protocol)}catch{return!1}}var Ti=b.createContext(null);Ti.displayName="DataRouter";var _u=b.createContext(null);_u.displayName="DataRouterState";var oy=b.createContext(!1);function mb(){return b.useContext(oy)}var dy=b.createContext({isTransitioning:!1});dy.displayName="ViewTransition";var pb=b.createContext(new Map);pb.displayName="Fetchers";var xb=b.createContext(null);xb.displayName="Await";var ua=b.createContext(null);ua.displayName="Navigation";var Bs=b.createContext(null);Bs.displayName="Location";var qa=b.createContext({outlet:null,matches:[],isDataRoute:!1});qa.displayName="Route";var Hd=b.createContext(null);Hd.displayName="RouteError";var fy="REACT_ROUTER_ERROR",yb="REDIRECT",vb="ROUTE_ERROR_RESPONSE";function gb(n){if(n.startsWith(`${fy}:${yb}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function bb(n){if(n.startsWith(`${fy}:${vb}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new rb(l.status,l.statusText,l.data)}catch{}}function wb(n,{relative:l}={}){ut(Oi(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:u}=b.useContext(ua),{hash:d,pathname:f,search:m}=qs(n,{relative:l}),x=f;return s!=="/"&&(x=f==="/"?s:za([s,f])),u.createHref({pathname:x,search:m,hash:d})}function Oi(){return b.useContext(Bs)!=null}function Ha(){return ut(Oi(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Bs).location}var hy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function my(n){b.useContext(ua).static||b.useLayoutEffect(n)}function $d(){let{isDataRoute:n}=b.useContext(qa);return n?Db():Sb()}function Sb(){ut(Oi(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Ti),{basename:l,navigator:s}=b.useContext(ua),{matches:u}=b.useContext(qa),{pathname:d}=Ha(),f=JSON.stringify(zd(u)),m=b.useRef(!1);return my(()=>{m.current=!0}),b.useCallback((y,v={})=>{if(ka(m.current,hy),!m.current)return;if(typeof y=="number"){s.go(y);return}let w=Nu(y,JSON.parse(f),d,v.relative==="path");n==null&&l!=="/"&&(w.pathname=w.pathname==="/"?l:za([l,w.pathname])),qd(typeof y=="string"?y:Cl(y),s.createHref(w),Bd(s),"reject"),(v.replace?s.replace:s.push)(w,v.state,v)},[l,s,f,d,n])}b.createContext(null);function jb(){let{matches:n}=b.useContext(qa),l=n[n.length-1];return(l==null?void 0:l.params)??{}}function qs(n,{relative:l}={}){let{matches:s}=b.useContext(qa),{pathname:u}=Ha(),d=JSON.stringify(zd(s));return b.useMemo(()=>Nu(n,JSON.parse(d),u,l==="path"),[n,d,u,l])}function Nb(n,l){return py(n,l)}function py(n,l,s){var M;ut(Oi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=b.useContext(ua),{matches:d}=b.useContext(qa),f=d[d.length-1],m=f?f.params:{},x=f?f.pathname:"/",y=f?f.pathnameBase:"/",v=f&&f.route;{let $=v&&v.path||"";yy(x,!v||$.endsWith("*")||$.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${$}">) 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="${$}"> to <Route path="${$==="/"?"*":`${$}/*`}">.`)}let w=Ha(),j;if(l){let $=typeof l=="string"?Ci(l):l;ut(y==="/"||((M=$.pathname)==null?void 0:M.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${$.pathname}" was given in the \`location\` prop.`),j=$}else j=w;let D=j.pathname||"/",X=D;if(y!=="/"){let $=y.replace(/^\//,"").split("/");X="/"+D.replace(/^\//,"").split("/").slice($.length).join("/")}let E=s&&s.state.matches.length?s.state.matches.map($=>Object.assign($,{route:s.manifest[$.route.id]||$.route})):ty(n,{pathname:X});ka(v||E!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),ka(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let Y=Rb(E&&E.map($=>Object.assign({},$,{params:Object.assign({},m,$.params),pathname:za([y,u.encodeLocation?u.encodeLocation($.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:$.pathname]),pathnameBase:$.pathnameBase==="/"?y:za([y,u.encodeLocation?u.encodeLocation($.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:$.pathnameBase])})),d,s);return l&&Y?b.createElement(Bs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...j},navigationType:"POP"}},Y):Y}function _b(){let n=Lb(),l=ub(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=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),s?b.createElement("pre",{style:d},s):null,m)}var Ab=b.createElement(_b,null),xy=class extends b.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,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):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=bb(n.digest);s&&(n=s)}let l=n!==void 0?b.createElement(qa.Provider,{value:this.props.routeContext},b.createElement(Hd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(kb,{error:n},l):l}};xy.contextType=oy;var ed=new WeakMap;function kb({children:n,error:l}){let{basename:s,navigator:u}=b.useContext(ua);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let d=gb(l.digest);if(d){let f=ed.get(l);if(f)throw f;let m=uy(d.location,s),x=m.absoluteURL||m.to;if(qd(d.location,x,Bd(u),"allow-explicit"),hb(x))throw new Error("Invalid redirect location");if(ry&&!ed.get(l))if(m.isExternal||d.reloadDocument)window.location.href=x;else{const y=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw ed.set(l,y),y}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x}`})}}return n}function Eb({routeContext:n,match:l,children:s}){let u=b.useContext(Ti);return u&&u.static&&u.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(qa.Provider,{value:n},s)}function Rb(n,l=[],s){let u=s==null?void 0:s.state;if(n==null){if(!u)return null;if(u.errors)n=u.matches;else if(l.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 w=d.findIndex(j=>j.route.id&&(f==null?void 0:f[j.route.id])!==void 0);ut(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,w+1))}let m=!1,x=-1;if(s&&u){m=u.renderFallback;for(let w=0;w<d.length;w++){let j=d[w];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(x=w),j.route.id){let{loaderData:D,errors:X}=u,E=j.route.loader&&!D.hasOwnProperty(j.route.id)&&(!X||X[j.route.id]===void 0);if(j.route.lazy||E){s.isStatic&&(m=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let y=s==null?void 0:s.onError,v=u&&y?(w,j)=>{var D,X;y(w,{location:u.location,params:((X=(D=u.matches)==null?void 0:D[0])==null?void 0:X.params)??{},pattern:cb(u.matches),errorInfo:j})}:void 0;return d.reduceRight((w,j,D)=>{let X,E=!1,Y=null,M=null;u&&(X=f&&j.route.id?f[j.route.id]:void 0,Y=j.route.errorElement||Ab,m&&(x<0&&D===0?(yy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,M=null):x===D&&(E=!0,M=j.route.hydrateFallbackElement||null)));let $=l.concat(d.slice(0,D+1)),F=()=>{let W;return X?W=Y:E?W=M:j.route.Component?W=b.createElement(j.route.Component,null):j.route.element?W=j.route.element:W=w,b.createElement(Eb,{match:j,routeContext:{outlet:w,matches:$,isDataRoute:u!=null},children:W})};return u&&(j.route.ErrorBoundary||j.route.errorElement||D===0)?b.createElement(xy,{location:u.location,revalidation:u.revalidation,component:Y,error:X,children:F(),routeContext:{outlet:null,matches:$,isDataRoute:!0},onError:v}):F()},null)}function Yd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cb(n){let l=b.useContext(Ti);return ut(l,Yd(n)),l}function Tb(n){let l=b.useContext(_u);return ut(l,Yd(n)),l}function Ob(n){let l=b.useContext(qa);return ut(l,Yd(n)),l}function Vd(n){let l=Ob(n),s=l.matches[l.matches.length-1];return ut(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function Mb(){return Vd("useRouteId")}function Lb(){var u;let n=b.useContext(Hd),l=Tb("useRouteError"),s=Vd("useRouteError");return n!==void 0?n:(u=l.errors)==null?void 0:u[s]}function Db(){let{router:n}=Cb("useNavigate"),l=Vd("useNavigate"),s=b.useRef(!1);return my(()=>{s.current=!0}),b.useCallback(async(d,f={})=>{ka(s.current,hy),s.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:l,...f}))},[n,l])}var ox={};function yy(n,l,s){!l&&!ox[n]&&(ox[n]=!0,ka(!1,s))}b.memo(Ub);function Ub({routes:n,manifest:l,future:s,state:u,isStatic:d,onError:f}){return py(n,void 0,{manifest:l,state:u,isStatic:d,onError:f})}function vy({to:n,replace:l,state:s,relative:u}){ut(Oi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:f}=b.useContext(ua);ka(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=b.useContext(qa),{pathname:x}=Ha(),y=$d(),v=Nu(n,zd(m),x,u==="path");qd(typeof n=="string"?n:Cl(n),f.createHref(v),Bd(f),"reject");let w=JSON.stringify(v);return b.useEffect(()=>{y(JSON.parse(w),{replace:l,state:s,relative:u})},[y,w,u,l,s]),null}function Rl(n){ut(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function zb({basename:n="/",children:l=null,location:s,navigationType:u="POP",navigator:d,static:f=!1,useTransitions:m}){ut(!Oi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=n.replace(/^\/*/,"/"),y=b.useMemo(()=>({basename:x,navigator:d,static:f,useTransitions:m,future:{}}),[x,d,f,m]);typeof s=="string"&&(s=Ci(s));let{pathname:v="/",search:w="",hash:j="",state:D=null,key:X="default",mask:E}=s,Y=b.useMemo(()=>{let M=Nn(v,x);return M==null?null:{location:{pathname:M,search:w,hash:j,state:D,key:X,mask:E},navigationType:u}},[x,v,w,j,D,X,u,E]);return ka(Y!=null,`<Router basename="${x}"> is not able to match the URL "${v}${w}${j}" because it does not start with the basename, so the <Router> won't render anything.`),Y==null?null:b.createElement(ua.Provider,{value:y},b.createElement(Bs.Provider,{children:l,value:Y}))}function Bb({children:n,location:l}){return Nb(bd(n),l)}function bd(n,l=[]){let s=[];return b.Children.forEach(n,(u,d)=>{if(!b.isValidElement(u))return;let f=[...l,d];if(u.type===b.Fragment){s.push.apply(s,bd(u.props.children,f));return}ut(u.type===Rl,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ut(!u.props.index||!u.props.children,"An index route cannot have child routes.");let m={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(m.children=bd(u.props.children,f)),s.push(m)}),s}var lu="get",iu="application/x-www-form-urlencoded";function Au(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function qb(n){return Au(n)&&n.tagName.toLowerCase()==="button"}function Hb(n){return Au(n)&&n.tagName.toLowerCase()==="form"}function $b(n){return Au(n)&&n.tagName.toLowerCase()==="input"}function Yb(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Vb(n,l){return n.button===0&&(!l||l==="_self")&&!Yb(n)}function wd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let u=n[s];return l.concat(Array.isArray(u)?u.map(d=>[s,d]):[[s,u]])},[]))}function Zb(n,l){let s=wd(n);return l&&l.forEach((u,d)=>{s.has(d)||l.getAll(d).forEach(f=>{s.append(d,f)})}),s}var Wr=null;function Gb(){if(Wr===null)try{new FormData(document.createElement("form"),0),Wr=!1}catch{Wr=!0}return Wr}var Qb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function td(n){return n!=null&&!Qb.has(n)?(ka(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${iu}"`),null):n}function Xb(n,l){let s,u,d,f,m;if(Hb(n)){let x=n.getAttribute("action");u=x?Nn(x,l):null,s=n.getAttribute("method")||lu,d=td(n.getAttribute("enctype"))||iu,f=new FormData(n)}else if(qb(n)||$b(n)&&(n.type==="submit"||n.type==="image")){let x=n.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=n.getAttribute("formaction")||x.getAttribute("action");if(u=y?Nn(y,l):null,s=n.getAttribute("formmethod")||x.getAttribute("method")||lu,d=td(n.getAttribute("formenctype"))||td(x.getAttribute("enctype"))||iu,f=new FormData(x,n),!Gb()){let{name:v,type:w,value:j}=n;if(w==="image"){let D=v?`${v}.`:"";f.append(`${D}x`,"0"),f.append(`${D}y`,"0")}else v&&f.append(v,j)}}else{if(Au(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=lu,u=null,d=iu,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 Zd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function gy(n,l,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}`:l&&Nn(d.pathname,l)==="/"?d.pathname=`${ki(l)}/_root.${u}`:d.pathname=`${ki(d.pathname)}.${u}`,d}async function Ib(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[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 Kb(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 Jb(n,l,s){let u=await Promise.all(n.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await Ib(f,s);return m.links?m.links():[]}return[]}));return e1(u.flat(1).filter(Kb).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function dx(n,l,s,u,d,f){let m=(y,v)=>s[v]?y.route.id!==s[v].route.id:!0,x=(y,v)=>{var w;return s[v].pathname!==y.pathname||((w=s[v].route.path)==null?void 0:w.endsWith("*"))&&s[v].params["*"]!==y.params["*"]};return f==="assets"?l.filter((y,v)=>m(y,v)||x(y,v)):f==="data"?l.filter((y,v)=>{var j;let w=u.routes[y.route.id];if(!w||!w.hasLoader)return!1;if(m(y,v)||x(y,v))return!0;if(y.route.shouldRevalidate){let D=y.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((j=s[0])==null?void 0:j.params)||{},nextUrl:new URL(n,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof D=="boolean")return D}return!0}):[]}function Fb(n,l,{includeHydrateFallback:s}={}){return Wb(n.map(u=>{let d=l.routes[u.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),s&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function Wb(n){return[...new Set(n)]}function Pb(n){let l={},s=Object.keys(n).sort();for(let u of s)l[u]=n[u];return l}function e1(n,l){let s=new Set;return new Set(l),n.reduce((u,d)=>{let f=JSON.stringify(Pb(d));return s.has(f)||(s.add(f),u.push({key:f,link:d})),u},[])}function Gd(){let n=b.useContext(Ti);return Zd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function t1(){let n=b.useContext(_u);return Zd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Qd=b.createContext(void 0);Qd.displayName="FrameworkContext";function ku(){let n=b.useContext(Qd);return Zd(n,"You must render this element inside a <HydratedRouter> element"),n}function a1(n,l){let s=b.useContext(Qd),[u,d]=b.useState(!1),[f,m]=b.useState(!1),{onFocus:x,onBlur:y,onMouseEnter:v,onMouseLeave:w,onTouchStart:j}=l,D=b.useRef(null);b.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let Y=$=>{$.forEach(F=>{m(F.isIntersecting)})},M=new IntersectionObserver(Y,{threshold:.5});return D.current&&M.observe(D.current),()=>{M.disconnect()}}},[n]),b.useEffect(()=>{if(u){let Y=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(Y)}}},[u]);let X=()=>{d(!0)},E=()=>{d(!1),m(!1)};return s?n!=="intent"?[f,D,{}]:[f,D,{onFocus:As(x,X),onBlur:As(y,E),onMouseEnter:As(v,X),onMouseLeave:As(w,E),onTouchStart:As(j,X)}]:[!1,D,{}]}function As(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function n1({page:n,...l}){let s=mb(),{nonce:u}=ku(),{router:d}=Gd(),f=b.useMemo(()=>ty(d.routes,n,d.basename),[d.routes,n,d.basename]);return f?(l.nonce==null&&u&&(l={...l,nonce:u}),s?b.createElement(i1,{page:n,matches:f,...l}):b.createElement(s1,{page:n,matches:f,...l})):null}function l1(n){let{manifest:l,routeModules:s}=ku(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return Jb(n,l,s).then(m=>{f||d(m)}),()=>{f=!0}},[n,l,s]),u}function i1({page:n,matches:l,...s}){let u=Ha(),{future:d}=ku(),{basename:f}=Gd(),m=b.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let x=gy(n,f,d.v8_trailingSlashAwareDataRequests,"rsc"),y=!1,v=[];for(let w of l)typeof w.route.shouldRevalidate=="function"?y=!0:v.push(w.route.id);return y&&v.length>0&&x.searchParams.set("_routes",v.join(",")),[x.pathname+x.search]},[f,d.v8_trailingSlashAwareDataRequests,n,u,l]);return b.createElement(b.Fragment,null,m.map(x=>b.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...s})))}function s1({page:n,matches:l,...s}){let u=Ha(),{future:d,manifest:f,routeModules:m}=ku(),{basename:x}=Gd(),{loaderData:y,matches:v}=t1(),w=b.useMemo(()=>dx(n,l,v,f,u,"data"),[n,l,v,f,u]),j=b.useMemo(()=>dx(n,l,v,f,u,"assets"),[n,l,v,f,u]),D=b.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let Y=new Set,M=!1;if(l.forEach(F=>{var se;let W=f.routes[F.route.id];!W||!W.hasLoader||(!w.some(Z=>Z.route.id===F.route.id)&&F.route.id in y&&((se=m[F.route.id])!=null&&se.shouldRevalidate)||W.hasClientLoader?M=!0:Y.add(F.route.id))}),Y.size===0)return[];let $=gy(n,x,d.v8_trailingSlashAwareDataRequests,"data");return M&&Y.size>0&&$.searchParams.set("_routes",l.filter(F=>Y.has(F.route.id)).map(F=>F.route.id).join(",")),[$.pathname+$.search]},[x,d.v8_trailingSlashAwareDataRequests,y,u,f,w,l,n,m]),X=b.useMemo(()=>Fb(j,f),[j,f]),E=l1(j);return b.createElement(b.Fragment,null,D.map(Y=>b.createElement("link",{key:Y,rel:"prefetch",as:"fetch",href:Y,...s})),X.map(Y=>b.createElement("link",{key:Y,rel:"modulepreload",href:Y,...s})),E.map(({key:Y,link:M})=>b.createElement("link",{key:Y,nonce:s.nonce,...M,crossOrigin:M.crossOrigin??s.crossOrigin})))}function r1(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var u1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{u1&&(window.__reactRouterVersion="7.18.4")}catch{}function c1({basename:n,children:l,useTransitions:s,window:u}){let d=b.useRef();d.current==null&&(d.current=q0({window:u,v5Compat:!0}));let f=d.current,[m,x]=b.useState({action:f.action,location:f.location}),y=b.useCallback(v=>{s===!1?x(v):b.startTransition(()=>x(v))},[s]);return b.useLayoutEffect(()=>f.listen(y),[f,y]),b.createElement(zb,{basename:n,children:l,location:m.location,navigationType:m.action,navigator:f,useTransitions:s})}var ra=b.forwardRef(function({onClick:l,discover:s="render",prefetch:u="none",relative:d,reloadDocument:f,replace:m,mask:x,state:y,target:v,to:w,preventScrollReset:j,viewTransition:D,defaultShouldRevalidate:X,...E},Y){let{basename:M,navigator:$,useTransitions:F}=b.useContext(ua),W=typeof w=="string"&&Ud.test(w),se=uy(w,M);w=se.to;let Z=wb(w,{relative:d}),_e=Ha(),I=null;if(x){let Ve=Nu(x,[],_e.mask?_e.mask.pathname:"/",!0);M!=="/"&&(Ve.pathname=Ve.pathname==="/"?M:za([M,Ve.pathname])),I=$.createHref(Ve)}let[ye,ze,mt]=a1(u,E),wt=f1(w,{replace:m,mask:x,state:y,target:v,preventScrollReset:j,relative:d,viewTransition:D,defaultShouldRevalidate:X,useTransitions:F});function st(Ve){l&&l(Ve),Ve.defaultPrevented||wt(Ve)}let dt=!(se.isExternal||f),nt=b.createElement("a",{...E,...mt,href:(dt?I:void 0)||se.absoluteURL||Z,onClick:dt?st:l,ref:r1(Y,ze),target:v,"data-discover":!W&&s==="render"?"true":void 0});return ye&&!W?b.createElement(b.Fragment,null,nt,b.createElement(n1,{page:Z})):nt});ra.displayName="Link";var su=b.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:u="",end:d=!1,style:f,to:m,viewTransition:x,children:y,...v},w){let j=qs(m,{relative:v.relative}),D=Ha(),X=b.useContext(_u),{navigator:E,basename:Y}=b.useContext(ua),M=X!=null&&y1(j)&&x===!0,$=E.encodeLocation?E.encodeLocation(j).pathname:j.pathname,F=D.pathname,W=X&&X.navigation&&X.navigation.location?X.navigation.location.pathname:null;s||(F=F.toLowerCase(),W=W?W.toLowerCase():null,$=$.toLowerCase()),W&&Y&&(W=Nn(W,Y)||W);const se=$!=="/"&&$.endsWith("/")?$.length-1:$.length;let Z=F===$||!d&&F.startsWith($)&&F.charAt(se)==="/",_e=W!=null&&(W===$||!d&&W.startsWith($)&&W.charAt($.length)==="/"),I={isActive:Z,isPending:_e,isTransitioning:M},ye=Z?l:void 0,ze;typeof u=="function"?ze=u(I):ze=[u,Z?"active":null,_e?"pending":null,M?"transitioning":null].filter(Boolean).join(" ");let mt=typeof f=="function"?f(I):f;return b.createElement(ra,{...v,"aria-current":ye,className:ze,ref:w,style:mt,to:m,viewTransition:x},typeof y=="function"?y(I):y)});su.displayName="NavLink";var o1=b.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:u,replace:d,state:f,method:m=lu,action:x,onSubmit:y,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D,...X},E)=>{let{useTransitions:Y}=b.useContext(ua),M=p1(),$=x1(x,{relative:v}),F=m.toLowerCase()==="get"?"get":"post",W=typeof x=="string"&&Ud.test(x),se=Z=>{if(y&&y(Z),Z.defaultPrevented)return;Z.preventDefault();let _e=Z.nativeEvent.submitter,I=(_e==null?void 0:_e.getAttribute("formmethod"))||m,ye=()=>M(_e||Z.currentTarget,{fetcherKey:l,method:I,navigate:s,replace:d,state:f,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D});Y&&s!==!1?b.startTransition(()=>ye()):ye()};return b.createElement("form",{ref:E,method:F,action:$,onSubmit:u?y:se,...X,"data-discover":!W&&n==="render"?"true":void 0})});o1.displayName="Form";function d1(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function by(n){let l=b.useContext(Ti);return ut(l,d1(n)),l}function f1(n,{target:l,replace:s,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y,useTransitions:v}={}){let w=$d(),j=Ha(),D=qs(n,{relative:m});return b.useCallback(X=>{if(Vb(X,l)){X.preventDefault();let E=s!==void 0?s:Cl(j)===Cl(D),Y=()=>w(n,{replace:E,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y});v?b.startTransition(()=>Y()):Y()}},[j,w,D,s,u,d,l,n,f,m,x,y,v])}function wy(n){ka(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=b.useRef(wd(n)),s=b.useRef(!1),u=Ha(),d=b.useMemo(()=>Zb(u.search,s.current?null:l.current),[u.search]),f=$d(),m=b.useCallback((x,y)=>{const v=wd(typeof x=="function"?x(new URLSearchParams(d)):x);s.current=!0,f("?"+v,y)},[f,d]);return[d,m]}var h1=0,m1=()=>`__${String(++h1)}__`;function p1(){let{router:n}=by("useSubmit"),{basename:l}=b.useContext(ua),s=Mb(),u=n.fetch,d=n.navigate;return b.useCallback(async(f,m={})=>{let{action:x,method:y,encType:v,formData:w,body:j}=Xb(f,l);if(m.navigate===!1){let D=m.fetcherKey||m1();await u(D,s,m.action||x,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:w,body:j,formMethod:m.method||y,formEncType:m.encType||v,flushSync:m.flushSync})}else await d(m.action||x,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:w,body:j,formMethod:m.method||y,formEncType:m.encType||v,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[u,d,l,s])}function x1(n,{relative:l}={}){let{basename:s}=b.useContext(ua),u=b.useContext(qa);ut(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...qs(n||".",{relative:l})},m=Ha();if(n==null){f.search=m.search;let x=new URLSearchParams(f.search),y=x.getAll("index");if(y.some(w=>w==="")){x.delete("index"),y.filter(j=>j).forEach(j=>x.append("index",j));let w=x.toString();f.search=w?`?${w}`:""}}return(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:za([s,f.pathname])),Cl(f)}function y1(n,{relative:l}={}){let s=b.useContext(dy);ut(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=by("useViewTransitionState"),d=qs(n,{relative:l});if(!s.isTransitioning)return!1;let f=Nn(s.currentLocation.pathname,u)||s.currentLocation.pathname,m=Nn(s.nextLocation.pathname,u)||s.nextLocation.pathname;return cu(d.pathname,m)!=null||cu(d.pathname,f)!=null}var He;(function(n){n.assertEqual=d=>{};function l(d){}n.assertIs=l;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(x=>typeof d[d[x]]!="number"),m={};for(const x of f)m[x]=d[x];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})(He||(He={}));var fx;(function(n){n.mergeShapes=(l,s)=>({...l,...s})})(fx||(fx={}));const le=He.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ll=n=>{switch(typeof n){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(n)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(n)?le.array:n===null?le.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?le.promise:typeof Map<"u"&&n instanceof Map?le.map:typeof Set<"u"&&n instanceof Set?le.set:typeof Date<"u"&&n instanceof Date?le.date:le.object;default:return le.unknown}},K=He.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 _n extends Error{get errors(){return this.issues}constructor(l){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=l}format(l){const s=l||function(f){return f.message},u={_errors:[]},d=f=>{for(const m of f.issues)if(m.code==="invalid_union")m.unionErrors.map(d);else if(m.code==="invalid_return_type")d(m.returnTypeError);else if(m.code==="invalid_arguments")d(m.argumentsError);else if(m.path.length===0)u._errors.push(s(m));else{let x=u,y=0;for(;y<m.path.length;){const v=m.path[y];y===m.path.length-1?(x[v]=x[v]||{_errors:[]},x[v]._errors.push(s(m))):x[v]=x[v]||{_errors:[]},x=x[v],y++}}};return d(this),u}static assert(l){if(!(l instanceof _n))throw new Error(`Not a ZodError: ${l}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,He.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(l=s=>s.message){const s={},u=[];for(const d of this.issues)if(d.path.length>0){const f=d.path[0];s[f]=s[f]||[],s[f].push(l(d))}else u.push(l(d));return{formErrors:u,fieldErrors:s}}get formErrors(){return this.flatten()}}_n.create=n=>new _n(n);const Sd=(n,l)=>{let s;switch(n.code){case K.invalid_type:n.received===le.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case K.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,He.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:s=`Unrecognized key(s) in object: ${He.joinValues(n.keys,", ")}`;break;case K.invalid_union:s="Invalid input";break;case K.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${He.joinValues(n.options)}`;break;case K.invalid_enum_value:s=`Invalid enum value. Expected ${He.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}"`:He.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=l.defaultError,He.assertNever(n)}return{message:s}};let v1=Sd;function g1(){return v1}const b1=n=>{const{data:l,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 x="";const y=u.filter(v=>!!v).slice().reverse();for(const v of y)x=v(m,{data:l,defaultError:x}).message;return{...d,path:f,message:x}};function te(n,l){const s=g1(),u=b1({issueData:l,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===Sd?void 0:Sd].filter(d=>!!d)});n.common.issues.push(u)}class qt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(l,s){const u=[];for(const d of s){if(d.status==="aborted")return pe;d.status==="dirty"&&l.dirty(),u.push(d.value)}return{status:l.value,value:u}}static async mergeObjectAsync(l,s){const u=[];for(const d of s){const f=await d.key,m=await d.value;u.push({key:f,value:m})}return qt.mergeObjectSync(l,u)}static mergeObjectSync(l,s){const u={};for(const d of s){const{key:f,value:m}=d;if(f.status==="aborted"||m.status==="aborted")return pe;f.status==="dirty"&&l.dirty(),m.status==="dirty"&&l.dirty(),f.value!=="__proto__"&&(typeof m.value<"u"||d.alwaysSet)&&(u[f.value]=m.value)}return{status:l.value,value:u}}}const pe=Object.freeze({status:"aborted"}),Es=n=>({status:"dirty",value:n}),Ea=n=>({status:"valid",value:n}),hx=n=>n.status==="aborted",mx=n=>n.status==="dirty",Ei=n=>n.status==="valid",ou=n=>typeof Promise<"u"&&n instanceof Promise;var ce;(function(n){n.errToObj=l=>typeof l=="string"?{message:l}:l||{},n.toString=l=>typeof l=="string"?l:l==null?void 0:l.message})(ce||(ce={}));class Fa{constructor(l,s,u,d){this._cachedPath=[],this.parent=l,this.data=s,this._path=u,this._key=d}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const px=(n,l)=>{if(Ei(l))return{success:!0,data:l.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 _n(n.common.issues);return this._error=s,this._error}}};function we(n){if(!n)return{};const{errorMap:l,invalid_type_error:s,required_error:u,description:d}=n;if(l&&(s||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return l?{errorMap:l,description:d}:{errorMap:(m,x)=>{const{message:y}=n;return m.code==="invalid_enum_value"?{message:y??x.defaultError}:typeof x.data>"u"?{message:y??u??x.defaultError}:m.code!=="invalid_type"?{message:x.defaultError}:{message:y??s??x.defaultError}},description:d}}class Oe{get description(){return this._def.description}_getType(l){return ll(l.data)}_getOrReturnCtx(l,s){return s||{common:l.parent.common,data:l.data,parsedType:ll(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}_processInputParams(l){return{status:new qt,ctx:{common:l.parent.common,data:l.data,parsedType:ll(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}}_parseSync(l){const s=this._parse(l);if(ou(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(l){const s=this._parse(l);return Promise.resolve(s)}parse(l,s){const u=this.safeParse(l,s);if(u.success)return u.data;throw u.error}safeParse(l,s){const u={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:ll(l)},d=this._parseSync({data:l,path:u.path,parent:u});return px(u,d)}"~validate"(l){var u,d;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:ll(l)};if(!this["~standard"].async)try{const f=this._parseSync({data:l,path:[],parent:s});return Ei(f)?{value:f.value}:{issues:s.common.issues}}catch(f){(d=(u=f==null?void 0:f.message)==null?void 0:u.toLowerCase())!=null&&d.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:l,path:[],parent:s}).then(f=>Ei(f)?{value:f.value}:{issues:s.common.issues})}async parseAsync(l,s){const u=await this.safeParseAsync(l,s);if(u.success)return u.data;throw u.error}async safeParseAsync(l,s){const u={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:ll(l)},d=this._parse({data:l,path:u.path,parent:u}),f=await(ou(d)?d:Promise.resolve(d));return px(u,f)}refine(l,s){const u=d=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(d):s;return this._refinement((d,f)=>{const m=l(d),x=()=>f.addIssue({code:K.custom,...u(d)});return typeof Promise<"u"&&m instanceof Promise?m.then(y=>y?!0:(x(),!1)):m?!0:(x(),!1)})}refinement(l,s){return this._refinement((u,d)=>l(u)?!0:(d.addIssue(typeof s=="function"?s(u,d):s),!1))}_refinement(l){return new Dl({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:l}})}superRefine(l){return this._refinement(l)}constructor(l){this.spa=this.safeParseAsync,this._def=l,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return jn.create(this,this._def)}nullable(){return Ul.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ja.create(this)}promise(){return xu.create(this,this._def)}or(l){return fu.create([this,l],this._def)}and(l){return hu.create(this,l,this._def)}transform(l){return new Dl({...we(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:l}})}default(l){const s=typeof l=="function"?l:()=>l;return new yu({...we(this._def),innerType:this,defaultValue:s,typeName:xe.ZodDefault})}brand(){return new _y({typeName:xe.ZodBranded,type:this,...we(this._def)})}catch(l){const s=typeof l=="function"?l:()=>l;return new vu({...we(this._def),innerType:this,catchValue:s,typeName:xe.ZodCatch})}describe(l){const s=this.constructor;return new s({...this._def,description:l})}pipe(l){return Id.create(this,l)}readonly(){return gu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const w1=/^c[^\s-]{8,}$/i,S1=/^[0-9a-z]+$/,j1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,N1=/^[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,_1=/^[a-z0-9_-]{21}$/i,A1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,k1=/^[-+]?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)?)??$/,E1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ad;const C1=/^(?:(?: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])$/,T1=/^(?:(?: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])$/,O1=/^(([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])$/,L1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sy="((\\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])))",U1=new RegExp(`^${Sy}$`);function jy(n){let l="[0-5]\\d";n.precision?l=`${l}\\.\\d{${n.precision}}`:n.precision==null&&(l=`${l}(\\.\\d+)?`);const s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${s}`}function z1(n){return new RegExp(`^${jy(n)}$`)}function B1(n){let l=`${Sy}T${jy(n)}`;const s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${s.join("|")})`,new RegExp(`^${l}$`)}function q1(n,l){return!!((l==="v4"||!l)&&C1.test(n)||(l==="v6"||!l)&&O1.test(n))}function H1(n,l){if(!A1.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||l&&d.alg!==l)}catch{return!1}}function $1(n,l){return!!((l==="v4"||!l)&&T1.test(n)||(l==="v6"||!l)&&M1.test(n))}class Ia extends Oe{_parse(l){if(this._def.coerce&&(l.data=String(l.data)),this._getType(l)!==le.string){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_type,expected:le.string,received:f.parsedType}),pe}const u=new qt;let d;for(const f of this._def.checks)if(f.kind==="min")l.data.length<f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")l.data.length>f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="length"){const m=l.data.length>f.value,x=l.data.length<f.value;(m||x)&&(d=this._getOrReturnCtx(l,d),m?te(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):x&&te(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")E1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"email",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")ad||(ad=new RegExp(R1,"u")),ad.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"emoji",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")N1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"uuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")_1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"nanoid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")w1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"cuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")S1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"cuid2",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")j1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"ulid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(l.data)}catch{d=this._getOrReturnCtx(l,d),te(d,{validation:"url",code:K.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"regex",code:K.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?l.data=l.data.trim():f.kind==="includes"?l.data.includes(f.value,f.position)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?l.data=l.data.toLowerCase():f.kind==="toUpperCase"?l.data=l.data.toUpperCase():f.kind==="startsWith"?l.data.startsWith(f.value)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?l.data.endsWith(f.value)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?B1(f).test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?U1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?z1(f).test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{code:K.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?k1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"duration",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?q1(l.data,f.version)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"ip",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?H1(l.data,f.alg)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"jwt",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?$1(l.data,f.version)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"cidr",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?L1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"base64",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?D1.test(l.data)||(d=this._getOrReturnCtx(l,d),te(d,{validation:"base64url",code:K.invalid_string,message:f.message}),u.dirty()):He.assertNever(f);return{status:u.value,value:l.data}}_regex(l,s,u){return this.refinement(d=>l.test(d),{validation:s,code:K.invalid_string,...ce.errToObj(u)})}_addCheck(l){return new Ia({...this._def,checks:[...this._def.checks,l]})}email(l){return this._addCheck({kind:"email",...ce.errToObj(l)})}url(l){return this._addCheck({kind:"url",...ce.errToObj(l)})}emoji(l){return this._addCheck({kind:"emoji",...ce.errToObj(l)})}uuid(l){return this._addCheck({kind:"uuid",...ce.errToObj(l)})}nanoid(l){return this._addCheck({kind:"nanoid",...ce.errToObj(l)})}cuid(l){return this._addCheck({kind:"cuid",...ce.errToObj(l)})}cuid2(l){return this._addCheck({kind:"cuid2",...ce.errToObj(l)})}ulid(l){return this._addCheck({kind:"ulid",...ce.errToObj(l)})}base64(l){return this._addCheck({kind:"base64",...ce.errToObj(l)})}base64url(l){return this._addCheck({kind:"base64url",...ce.errToObj(l)})}jwt(l){return this._addCheck({kind:"jwt",...ce.errToObj(l)})}ip(l){return this._addCheck({kind:"ip",...ce.errToObj(l)})}cidr(l){return this._addCheck({kind:"cidr",...ce.errToObj(l)})}datetime(l){return typeof l=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:l}):this._addCheck({kind:"datetime",precision:typeof(l==null?void 0:l.precision)>"u"?null:l==null?void 0:l.precision,offset:(l==null?void 0:l.offset)??!1,local:(l==null?void 0:l.local)??!1,...ce.errToObj(l==null?void 0:l.message)})}date(l){return this._addCheck({kind:"date",message:l})}time(l){return typeof l=="string"?this._addCheck({kind:"time",precision:null,message:l}):this._addCheck({kind:"time",precision:typeof(l==null?void 0:l.precision)>"u"?null:l==null?void 0:l.precision,...ce.errToObj(l==null?void 0:l.message)})}duration(l){return this._addCheck({kind:"duration",...ce.errToObj(l)})}regex(l,s){return this._addCheck({kind:"regex",regex:l,...ce.errToObj(s)})}includes(l,s){return this._addCheck({kind:"includes",value:l,position:s==null?void 0:s.position,...ce.errToObj(s==null?void 0:s.message)})}startsWith(l,s){return this._addCheck({kind:"startsWith",value:l,...ce.errToObj(s)})}endsWith(l,s){return this._addCheck({kind:"endsWith",value:l,...ce.errToObj(s)})}min(l,s){return this._addCheck({kind:"min",value:l,...ce.errToObj(s)})}max(l,s){return this._addCheck({kind:"max",value:l,...ce.errToObj(s)})}length(l,s){return this._addCheck({kind:"length",value:l,...ce.errToObj(s)})}nonempty(l){return this.min(1,ce.errToObj(l))}trim(){return new Ia({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ia({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ia({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(l=>l.kind==="datetime")}get isDate(){return!!this._def.checks.find(l=>l.kind==="date")}get isTime(){return!!this._def.checks.find(l=>l.kind==="time")}get isDuration(){return!!this._def.checks.find(l=>l.kind==="duration")}get isEmail(){return!!this._def.checks.find(l=>l.kind==="email")}get isURL(){return!!this._def.checks.find(l=>l.kind==="url")}get isEmoji(){return!!this._def.checks.find(l=>l.kind==="emoji")}get isUUID(){return!!this._def.checks.find(l=>l.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(l=>l.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(l=>l.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(l=>l.kind==="cuid2")}get isULID(){return!!this._def.checks.find(l=>l.kind==="ulid")}get isIP(){return!!this._def.checks.find(l=>l.kind==="ip")}get isCIDR(){return!!this._def.checks.find(l=>l.kind==="cidr")}get isBase64(){return!!this._def.checks.find(l=>l.kind==="base64")}get isBase64url(){return!!this._def.checks.find(l=>l.kind==="base64url")}get minLength(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxLength(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}}Ia.create=n=>new Ia({checks:[],typeName:xe.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...we(n)});function Y1(n,l){const s=(n.toString().split(".")[1]||"").length,u=(l.toString().split(".")[1]||"").length,d=s>u?s:u,f=Number.parseInt(n.toFixed(d).replace(".","")),m=Number.parseInt(l.toFixed(d).replace(".",""));return f%m/10**d}class Tl extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(l){if(this._def.coerce&&(l.data=Number(l.data)),this._getType(l)!==le.number){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_type,expected:le.number,received:f.parsedType}),pe}let u;const d=new qt;for(const f of this._def.checks)f.kind==="int"?He.isInteger(l.data)||(u=this._getOrReturnCtx(l,u),te(u,{code:K.invalid_type,expected:"integer",received:"float",message:f.message}),d.dirty()):f.kind==="min"?(f.inclusive?l.data<f.value:l.data<=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?l.data>f.value:l.data>=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="multipleOf"?Y1(l.data,f.value)!==0&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):f.kind==="finite"?Number.isFinite(l.data)||(u=this._getOrReturnCtx(l,u),te(u,{code:K.not_finite,message:f.message}),d.dirty()):He.assertNever(f);return{status:d.value,value:l.data}}gte(l,s){return this.setLimit("min",l,!0,ce.toString(s))}gt(l,s){return this.setLimit("min",l,!1,ce.toString(s))}lte(l,s){return this.setLimit("max",l,!0,ce.toString(s))}lt(l,s){return this.setLimit("max",l,!1,ce.toString(s))}setLimit(l,s,u,d){return new Tl({...this._def,checks:[...this._def.checks,{kind:l,value:s,inclusive:u,message:ce.toString(d)}]})}_addCheck(l){return new Tl({...this._def,checks:[...this._def.checks,l]})}int(l){return this._addCheck({kind:"int",message:ce.toString(l)})}positive(l){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(l)})}negative(l){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(l)})}multipleOf(l,s){return this._addCheck({kind:"multipleOf",value:l,message:ce.toString(s)})}finite(l){return this._addCheck({kind:"finite",message:ce.toString(l)})}safe(l){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(l)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(l)})}get minValue(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxValue(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}get isInt(){return!!this._def.checks.find(l=>l.kind==="int"||l.kind==="multipleOf"&&He.isInteger(l.value))}get isFinite(){let l=null,s=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(s===null||u.value>s)&&(s=u.value):u.kind==="max"&&(l===null||u.value<l)&&(l=u.value)}return Number.isFinite(s)&&Number.isFinite(l)}}Tl.create=n=>new Tl({checks:[],typeName:xe.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...we(n)});class Ol extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(l){if(this._def.coerce)try{l.data=BigInt(l.data)}catch{return this._getInvalidInput(l)}if(this._getType(l)!==le.bigint)return this._getInvalidInput(l);let u;const d=new qt;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?l.data<f.value:l.data<=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?l.data>f.value:l.data>=f.value)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="multipleOf"?l.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(l,u),te(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):He.assertNever(f);return{status:d.value,value:l.data}}_getInvalidInput(l){const s=this._getOrReturnCtx(l);return te(s,{code:K.invalid_type,expected:le.bigint,received:s.parsedType}),pe}gte(l,s){return this.setLimit("min",l,!0,ce.toString(s))}gt(l,s){return this.setLimit("min",l,!1,ce.toString(s))}lte(l,s){return this.setLimit("max",l,!0,ce.toString(s))}lt(l,s){return this.setLimit("max",l,!1,ce.toString(s))}setLimit(l,s,u,d){return new Ol({...this._def,checks:[...this._def.checks,{kind:l,value:s,inclusive:u,message:ce.toString(d)}]})}_addCheck(l){return new Ol({...this._def,checks:[...this._def.checks,l]})}positive(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(l)})}negative(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(l)})}multipleOf(l,s){return this._addCheck({kind:"multipleOf",value:l,message:ce.toString(s)})}get minValue(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxValue(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}}Ol.create=n=>new Ol({checks:[],typeName:xe.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...we(n)});class du extends Oe{_parse(l){if(this._def.coerce&&(l.data=!!l.data),this._getType(l)!==le.boolean){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:le.boolean,received:u.parsedType}),pe}return Ea(l.data)}}du.create=n=>new du({typeName:xe.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...we(n)});class Ri extends Oe{_parse(l){if(this._def.coerce&&(l.data=new Date(l.data)),this._getType(l)!==le.date){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_type,expected:le.date,received:f.parsedType}),pe}if(Number.isNaN(l.data.getTime())){const f=this._getOrReturnCtx(l);return te(f,{code:K.invalid_date}),pe}const u=new qt;let d;for(const f of this._def.checks)f.kind==="min"?l.data.getTime()<f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?l.data.getTime()>f.value&&(d=this._getOrReturnCtx(l,d),te(d,{code:K.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):He.assertNever(f);return{status:u.value,value:new Date(l.data.getTime())}}_addCheck(l){return new Ri({...this._def,checks:[...this._def.checks,l]})}min(l,s){return this._addCheck({kind:"min",value:l.getTime(),message:ce.toString(s)})}max(l,s){return this._addCheck({kind:"max",value:l.getTime(),message:ce.toString(s)})}get minDate(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l!=null?new Date(l):null}get maxDate(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l!=null?new Date(l):null}}Ri.create=n=>new Ri({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:xe.ZodDate,...we(n)});class xx extends Oe{_parse(l){if(this._getType(l)!==le.symbol){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:le.symbol,received:u.parsedType}),pe}return Ea(l.data)}}xx.create=n=>new xx({typeName:xe.ZodSymbol,...we(n)});class jd extends Oe{_parse(l){if(this._getType(l)!==le.undefined){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:le.undefined,received:u.parsedType}),pe}return Ea(l.data)}}jd.create=n=>new jd({typeName:xe.ZodUndefined,...we(n)});class Nd extends Oe{_parse(l){if(this._getType(l)!==le.null){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:le.null,received:u.parsedType}),pe}return Ea(l.data)}}Nd.create=n=>new Nd({typeName:xe.ZodNull,...we(n)});class yx extends Oe{constructor(){super(...arguments),this._any=!0}_parse(l){return Ea(l.data)}}yx.create=n=>new yx({typeName:xe.ZodAny,...we(n)});class _d extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(l){return Ea(l.data)}}_d.create=n=>new _d({typeName:xe.ZodUnknown,...we(n)});class rl extends Oe{_parse(l){const s=this._getOrReturnCtx(l);return te(s,{code:K.invalid_type,expected:le.never,received:s.parsedType}),pe}}rl.create=n=>new rl({typeName:xe.ZodNever,...we(n)});class vx extends Oe{_parse(l){if(this._getType(l)!==le.undefined){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:le.void,received:u.parsedType}),pe}return Ea(l.data)}}vx.create=n=>new vx({typeName:xe.ZodVoid,...we(n)});class Ja extends Oe{_parse(l){const{ctx:s,status:u}=this._processInputParams(l),d=this._def;if(s.parsedType!==le.array)return te(s,{code:K.invalid_type,expected:le.array,received:s.parsedType}),pe;if(d.exactLength!==null){const m=s.data.length>d.exactLength.value,x=s.data.length<d.exactLength.value;(m||x)&&(te(s,{code:m?K.too_big:K.too_small,minimum:x?d.exactLength.value:void 0,maximum:m?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),u.dirty())}if(d.minLength!==null&&s.data.length<d.minLength.value&&(te(s,{code:K.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),u.dirty()),d.maxLength!==null&&s.data.length>d.maxLength.value&&(te(s,{code:K.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),u.dirty()),s.common.async)return Promise.all([...s.data].map((m,x)=>d.type._parseAsync(new Fa(s,m,s.path,x)))).then(m=>qt.mergeArray(u,m));const f=[...s.data].map((m,x)=>d.type._parseSync(new Fa(s,m,s.path,x)));return qt.mergeArray(u,f)}get element(){return this._def.type}min(l,s){return new Ja({...this._def,minLength:{value:l,message:ce.toString(s)}})}max(l,s){return new Ja({...this._def,maxLength:{value:l,message:ce.toString(s)}})}length(l,s){return new Ja({...this._def,exactLength:{value:l,message:ce.toString(s)}})}nonempty(l){return this.min(1,l)}}Ja.create=(n,l)=>new Ja({type:n,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...we(l)});function Ni(n){if(n instanceof bt){const l={};for(const s in n.shape){const u=n.shape[s];l[s]=jn.create(Ni(u))}return new bt({...n._def,shape:()=>l})}else return n instanceof Ja?new Ja({...n._def,type:Ni(n.element)}):n instanceof jn?jn.create(Ni(n.unwrap())):n instanceof Ul?Ul.create(Ni(n.unwrap())):n instanceof Ml?Ml.create(n.items.map(l=>Ni(l))):n}class bt extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const l=this._def.shape(),s=He.objectKeys(l);return this._cached={shape:l,keys:s},this._cached}_parse(l){if(this._getType(l)!==le.object){const v=this._getOrReturnCtx(l);return te(v,{code:K.invalid_type,expected:le.object,received:v.parsedType}),pe}const{status:u,ctx:d}=this._processInputParams(l),{shape:f,keys:m}=this._getCached(),x=[];if(!(this._def.catchall instanceof rl&&this._def.unknownKeys==="strip"))for(const v in d.data)m.includes(v)||x.push(v);const y=[];for(const v of m){const w=f[v],j=d.data[v];y.push({key:{status:"valid",value:v},value:w._parse(new Fa(d,j,d.path,v)),alwaysSet:v in d.data})}if(this._def.catchall instanceof rl){const v=this._def.unknownKeys;if(v==="passthrough")for(const w of x)y.push({key:{status:"valid",value:w},value:{status:"valid",value:d.data[w]}});else if(v==="strict")x.length>0&&(te(d,{code:K.unrecognized_keys,keys:x}),u.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const v=this._def.catchall;for(const w of x){const j=d.data[w];y.push({key:{status:"valid",value:w},value:v._parse(new Fa(d,j,d.path,w)),alwaysSet:w in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const v=[];for(const w of y){const j=await w.key,D=await w.value;v.push({key:j,value:D,alwaysSet:w.alwaysSet})}return v}).then(v=>qt.mergeObjectSync(u,v)):qt.mergeObjectSync(u,y)}get shape(){return this._def.shape()}strict(l){return ce.errToObj,new bt({...this._def,unknownKeys:"strict",...l!==void 0?{errorMap:(s,u)=>{var f,m;const d=((m=(f=this._def).errorMap)==null?void 0:m.call(f,s,u).message)??u.defaultError;return s.code==="unrecognized_keys"?{message:ce.errToObj(l).message??d}:{message:d}}}:{}})}strip(){return new bt({...this._def,unknownKeys:"strip"})}passthrough(){return new bt({...this._def,unknownKeys:"passthrough"})}extend(l){return new bt({...this._def,shape:()=>({...this._def.shape(),...l})})}merge(l){return new bt({unknownKeys:l._def.unknownKeys,catchall:l._def.catchall,shape:()=>({...this._def.shape(),...l._def.shape()}),typeName:xe.ZodObject})}setKey(l,s){return this.augment({[l]:s})}catchall(l){return new bt({...this._def,catchall:l})}pick(l){const s={};for(const u of He.objectKeys(l))l[u]&&this.shape[u]&&(s[u]=this.shape[u]);return new bt({...this._def,shape:()=>s})}omit(l){const s={};for(const u of He.objectKeys(this.shape))l[u]||(s[u]=this.shape[u]);return new bt({...this._def,shape:()=>s})}deepPartial(){return Ni(this)}partial(l){const s={};for(const u of He.objectKeys(this.shape)){const d=this.shape[u];l&&!l[u]?s[u]=d:s[u]=d.optional()}return new bt({...this._def,shape:()=>s})}required(l){const s={};for(const u of He.objectKeys(this.shape))if(l&&!l[u])s[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof jn;)f=f._def.innerType;s[u]=f}return new bt({...this._def,shape:()=>s})}keyof(){return Ny(He.objectKeys(this.shape))}}bt.create=(n,l)=>new bt({shape:()=>n,unknownKeys:"strip",catchall:rl.create(),typeName:xe.ZodObject,...we(l)});bt.strictCreate=(n,l)=>new bt({shape:()=>n,unknownKeys:"strict",catchall:rl.create(),typeName:xe.ZodObject,...we(l)});bt.lazycreate=(n,l)=>new bt({shape:n,unknownKeys:"strip",catchall:rl.create(),typeName:xe.ZodObject,...we(l)});class fu extends Oe{_parse(l){const{ctx:s}=this._processInputParams(l),u=this._def.options;function d(f){for(const x of f)if(x.result.status==="valid")return x.result;for(const x of f)if(x.result.status==="dirty")return s.common.issues.push(...x.ctx.common.issues),x.result;const m=f.map(x=>new _n(x.ctx.common.issues));return te(s,{code:K.invalid_union,unionErrors:m}),pe}if(s.common.async)return Promise.all(u.map(async f=>{const m={...s,common:{...s.common,issues:[]},parent:null};return{result:await f._parseAsync({data:s.data,path:s.path,parent:m}),ctx:m}})).then(d);{let f;const m=[];for(const y of u){const v={...s,common:{...s.common,issues:[]},parent:null},w=y._parseSync({data:s.data,path:s.path,parent:v});if(w.status==="valid")return w;w.status==="dirty"&&!f&&(f={result:w,ctx:v}),v.common.issues.length&&m.push(v.common.issues)}if(f)return s.common.issues.push(...f.ctx.common.issues),f.result;const x=m.map(y=>new _n(y));return te(s,{code:K.invalid_union,unionErrors:x}),pe}}get options(){return this._def.options}}fu.create=(n,l)=>new fu({options:n,typeName:xe.ZodUnion,...we(l)});const Sn=n=>n instanceof kd?Sn(n.schema):n instanceof Dl?Sn(n.innerType()):n instanceof pu?[n.value]:n instanceof Ll?n.options:n instanceof Ed?He.objectValues(n.enum):n instanceof yu?Sn(n._def.innerType):n instanceof jd?[void 0]:n instanceof Nd?[null]:n instanceof jn?[void 0,...Sn(n.unwrap())]:n instanceof Ul?[null,...Sn(n.unwrap())]:n instanceof _y||n instanceof gu?Sn(n.unwrap()):n instanceof vu?Sn(n._def.innerType):[];class Xd extends Oe{_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==le.object)return te(s,{code:K.invalid_type,expected:le.object,received:s.parsedType}),pe;const u=this.discriminator,d=s.data[u],f=this.optionsMap.get(d);return f?s.common.async?f._parseAsync({data:s.data,path:s.path,parent:s}):f._parseSync({data:s.data,path:s.path,parent:s}):(te(s,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(l,s,u){const d=new Map;for(const f of s){const m=Sn(f.shape[l]);if(!m.length)throw new Error(`A discriminator value for key \`${l}\` could not be extracted from all schema options`);for(const x of m){if(d.has(x))throw new Error(`Discriminator property ${String(l)} has duplicate value ${String(x)}`);d.set(x,f)}}return new Xd({typeName:xe.ZodDiscriminatedUnion,discriminator:l,options:s,optionsMap:d,...we(u)})}}function Ad(n,l){const s=ll(n),u=ll(l);if(n===l)return{valid:!0,data:n};if(s===le.object&&u===le.object){const d=He.objectKeys(l),f=He.objectKeys(n).filter(x=>d.indexOf(x)!==-1),m={...n,...l};for(const x of f){const y=Ad(n[x],l[x]);if(!y.valid)return{valid:!1};m[x]=y.data}return{valid:!0,data:m}}else if(s===le.array&&u===le.array){if(n.length!==l.length)return{valid:!1};const d=[];for(let f=0;f<n.length;f++){const m=n[f],x=l[f],y=Ad(m,x);if(!y.valid)return{valid:!1};d.push(y.data)}return{valid:!0,data:d}}else return s===le.date&&u===le.date&&+n==+l?{valid:!0,data:n}:{valid:!1}}class hu extends Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l),d=(f,m)=>{if(hx(f)||hx(m))return pe;const x=Ad(f.value,m.value);return x.valid?((mx(f)||mx(m))&&s.dirty(),{status:s.value,value:x.data}):(te(u,{code:K.invalid_intersection_types}),pe)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([f,m])=>d(f,m)):d(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}hu.create=(n,l,s)=>new hu({left:n,right:l,typeName:xe.ZodIntersection,...we(s)});class Ml extends Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.array)return te(u,{code:K.invalid_type,expected:le.array,received:u.parsedType}),pe;if(u.data.length<this._def.items.length)return te(u,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&u.data.length>this._def.items.length&&(te(u,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const f=[...u.data].map((m,x)=>{const y=this._def.items[x]||this._def.rest;return y?y._parse(new Fa(u,m,u.path,x)):null}).filter(m=>!!m);return u.common.async?Promise.all(f).then(m=>qt.mergeArray(s,m)):qt.mergeArray(s,f)}get items(){return this._def.items}rest(l){return new Ml({...this._def,rest:l})}}Ml.create=(n,l)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ml({items:n,typeName:xe.ZodTuple,rest:null,...we(l)})};class mu extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.object)return te(u,{code:K.invalid_type,expected:le.object,received:u.parsedType}),pe;const d=[],f=this._def.keyType,m=this._def.valueType;for(const x in u.data)d.push({key:f._parse(new Fa(u,x,u.path,x)),value:m._parse(new Fa(u,u.data[x],u.path,x)),alwaysSet:x in u.data});return u.common.async?qt.mergeObjectAsync(s,d):qt.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(l,s,u){return s instanceof Oe?new mu({keyType:l,valueType:s,typeName:xe.ZodRecord,...we(u)}):new mu({keyType:Ia.create(),valueType:l,typeName:xe.ZodRecord,...we(s)})}}class gx extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.map)return te(u,{code:K.invalid_type,expected:le.map,received:u.parsedType}),pe;const d=this._def.keyType,f=this._def.valueType,m=[...u.data.entries()].map(([x,y],v)=>({key:d._parse(new Fa(u,x,u.path,[v,"key"])),value:f._parse(new Fa(u,y,u.path,[v,"value"]))}));if(u.common.async){const x=new Map;return Promise.resolve().then(async()=>{for(const y of m){const v=await y.key,w=await y.value;if(v.status==="aborted"||w.status==="aborted")return pe;(v.status==="dirty"||w.status==="dirty")&&s.dirty(),x.set(v.value,w.value)}return{status:s.value,value:x}})}else{const x=new Map;for(const y of m){const v=y.key,w=y.value;if(v.status==="aborted"||w.status==="aborted")return pe;(v.status==="dirty"||w.status==="dirty")&&s.dirty(),x.set(v.value,w.value)}return{status:s.value,value:x}}}}gx.create=(n,l,s)=>new gx({valueType:l,keyType:n,typeName:xe.ZodMap,...we(s)});class Ls extends Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.set)return te(u,{code:K.invalid_type,expected:le.set,received:u.parsedType}),pe;const d=this._def;d.minSize!==null&&u.data.size<d.minSize.value&&(te(u,{code:K.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),s.dirty()),d.maxSize!==null&&u.data.size>d.maxSize.value&&(te(u,{code:K.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),s.dirty());const f=this._def.valueType;function m(y){const v=new Set;for(const w of y){if(w.status==="aborted")return pe;w.status==="dirty"&&s.dirty(),v.add(w.value)}return{status:s.value,value:v}}const x=[...u.data.values()].map((y,v)=>f._parse(new Fa(u,y,u.path,v)));return u.common.async?Promise.all(x).then(y=>m(y)):m(x)}min(l,s){return new Ls({...this._def,minSize:{value:l,message:ce.toString(s)}})}max(l,s){return new Ls({...this._def,maxSize:{value:l,message:ce.toString(s)}})}size(l,s){return this.min(l,s).max(l,s)}nonempty(l){return this.min(1,l)}}Ls.create=(n,l)=>new Ls({valueType:n,minSize:null,maxSize:null,typeName:xe.ZodSet,...we(l)});class kd extends Oe{get schema(){return this._def.getter()}_parse(l){const{ctx:s}=this._processInputParams(l);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}kd.create=(n,l)=>new kd({getter:n,typeName:xe.ZodLazy,...we(l)});class pu extends Oe{_parse(l){if(l.data!==this._def.value){const s=this._getOrReturnCtx(l);return te(s,{received:s.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:l.data}}get value(){return this._def.value}}pu.create=(n,l)=>new pu({value:n,typeName:xe.ZodLiteral,...we(l)});function Ny(n,l){return new Ll({values:n,typeName:xe.ZodEnum,...we(l)})}class Ll extends Oe{_parse(l){if(typeof l.data!="string"){const s=this._getOrReturnCtx(l),u=this._def.values;return te(s,{expected:He.joinValues(u),received:s.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(l.data)){const s=this._getOrReturnCtx(l),u=this._def.values;return te(s,{received:s.data,code:K.invalid_enum_value,options:u}),pe}return Ea(l.data)}get options(){return this._def.values}get enum(){const l={};for(const s of this._def.values)l[s]=s;return l}get Values(){const l={};for(const s of this._def.values)l[s]=s;return l}get Enum(){const l={};for(const s of this._def.values)l[s]=s;return l}extract(l,s=this._def){return Ll.create(l,{...this._def,...s})}exclude(l,s=this._def){return Ll.create(this.options.filter(u=>!l.includes(u)),{...this._def,...s})}}Ll.create=Ny;class Ed extends Oe{_parse(l){const s=He.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(l);if(u.parsedType!==le.string&&u.parsedType!==le.number){const d=He.objectValues(s);return te(u,{expected:He.joinValues(d),received:u.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(He.getValidEnumValues(this._def.values))),!this._cache.has(l.data)){const d=He.objectValues(s);return te(u,{received:u.data,code:K.invalid_enum_value,options:d}),pe}return Ea(l.data)}get enum(){return this._def.values}}Ed.create=(n,l)=>new Ed({values:n,typeName:xe.ZodNativeEnum,...we(l)});class xu extends Oe{unwrap(){return this._def.type}_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==le.promise&&s.common.async===!1)return te(s,{code:K.invalid_type,expected:le.promise,received:s.parsedType}),pe;const u=s.parsedType===le.promise?s.data:Promise.resolve(s.data);return Ea(u.then(d=>this._def.type.parseAsync(d,{path:s.path,errorMap:s.common.contextualErrorMap})))}}xu.create=(n,l)=>new xu({type:n,typeName:xe.ZodPromise,...we(l)});class Dl extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(l){const{status:s,ctx:u}=this._processInputParams(l),d=this._def.effect||null,f={addIssue:m=>{te(u,m),m.fatal?s.abort():s.dirty()},get path(){return u.path}};if(f.addIssue=f.addIssue.bind(f),d.type==="preprocess"){const m=d.transform(u.data,f);if(u.common.async)return Promise.resolve(m).then(async x=>{if(s.value==="aborted")return pe;const y=await this._def.schema._parseAsync({data:x,path:u.path,parent:u});return y.status==="aborted"?pe:y.status==="dirty"||s.value==="dirty"?Es(y.value):y});{if(s.value==="aborted")return pe;const x=this._def.schema._parseSync({data:m,path:u.path,parent:u});return x.status==="aborted"?pe:x.status==="dirty"||s.value==="dirty"?Es(x.value):x}}if(d.type==="refinement"){const m=x=>{const y=d.refinement(x,f);if(u.common.async)return Promise.resolve(y);if(y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return x};if(u.common.async===!1){const x=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return x.status==="aborted"?pe:(x.status==="dirty"&&s.dirty(),m(x.value),{status:s.value,value:x.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(x=>x.status==="aborted"?pe:(x.status==="dirty"&&s.dirty(),m(x.value).then(()=>({status:s.value,value:x.value}))))}if(d.type==="transform")if(u.common.async===!1){const m=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ei(m))return pe;const x=d.transform(m.value,f);if(x instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:x}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(m=>Ei(m)?Promise.resolve(d.transform(m.value,f)).then(x=>({status:s.value,value:x})):pe);He.assertNever(d)}}Dl.create=(n,l,s)=>new Dl({schema:n,typeName:xe.ZodEffects,effect:l,...we(s)});Dl.createWithPreprocess=(n,l,s)=>new Dl({schema:l,effect:{type:"preprocess",transform:n},typeName:xe.ZodEffects,...we(s)});class jn extends Oe{_parse(l){return this._getType(l)===le.undefined?Ea(void 0):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}jn.create=(n,l)=>new jn({innerType:n,typeName:xe.ZodOptional,...we(l)});class Ul extends Oe{_parse(l){return this._getType(l)===le.null?Ea(null):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}Ul.create=(n,l)=>new Ul({innerType:n,typeName:xe.ZodNullable,...we(l)});class yu extends Oe{_parse(l){const{ctx:s}=this._processInputParams(l);let u=s.data;return s.parsedType===le.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}yu.create=(n,l)=>new yu({innerType:n,typeName:xe.ZodDefault,defaultValue:typeof l.default=="function"?l.default:()=>l.default,...we(l)});class vu extends Oe{_parse(l){const{ctx:s}=this._processInputParams(l),u={...s,common:{...s.common,issues:[]}},d=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return ou(d)?d.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new _n(u.common.issues)},input:u.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new _n(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}vu.create=(n,l)=>new vu({innerType:n,typeName:xe.ZodCatch,catchValue:typeof l.catch=="function"?l.catch:()=>l.catch,...we(l)});class bx extends Oe{_parse(l){if(this._getType(l)!==le.nan){const u=this._getOrReturnCtx(l);return te(u,{code:K.invalid_type,expected:le.nan,received:u.parsedType}),pe}return{status:"valid",value:l.data}}}bx.create=n=>new bx({typeName:xe.ZodNaN,...we(n)});class _y extends Oe{_parse(l){const{ctx:s}=this._processInputParams(l),u=s.data;return this._def.type._parse({data:u,path:s.path,parent:s})}unwrap(){return this._def.type}}class Id extends Oe{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return f.status==="aborted"?pe:f.status==="dirty"?(s.dirty(),Es(f.value)):this._def.out._parseAsync({data:f.value,path:u.path,parent:u})})();{const d=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return d.status==="aborted"?pe:d.status==="dirty"?(s.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:u.path,parent:u})}}static create(l,s){return new Id({in:l,out:s,typeName:xe.ZodPipeline})}}class gu extends Oe{_parse(l){const s=this._def.innerType._parse(l),u=d=>(Ei(d)&&(d.value=Object.freeze(d.value)),d);return ou(s)?s.then(d=>u(d)):u(s)}unwrap(){return this._def.innerType}}gu.create=(n,l)=>new gu({innerType:n,typeName:xe.ZodReadonly,...we(l)});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=Ia.create,k=Tl.create;Ol.create;const De=du.create;Ri.create;const Ay=_d.create;rl.create;const ne=Ja.create,q=bt.create,V1=fu.create,ky=Xd.create;hu.create;Ml.create;const Ds=mu.create,_a=pu.create,fe=Ll.create;xu.create;jn.create;Ul.create;const wx={string:(n=>Ia.create({...n,coerce:!0})),number:(n=>Tl.create({...n,coerce:!0})),boolean:(n=>du.create({...n,coerce:!0})),bigint:(n=>Ol.create({...n,coerce:!0})),date:(n=>Ri.create({...n,coerce:!0}))},Z1=pe,G1=p().regex(/^github\.com\/[^/]+\/[^/]+$/,"Expected github.com/<owner>/<repo>"),Q1=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;function X1(n){const l=n.trim();return l?!!(l.startsWith("/")||l.startsWith("~")||l.startsWith(".")||/^[A-Za-z]:[\\/]/.test(l)||l.startsWith("\\\\")):!1}function Kd(n){const l=n.trim();if(!l)throw new Error("Repository is required");if(X1(l))throw new Error("Local filesystem paths are no longer accepted. Pass a GitHub URL or owner/repo (e.g. https://github.com/acme/app or acme/app).");let s,u;const d=Q1.exec(l);if(d&&!l.includes("://")&&!l.toLowerCase().includes("github.com"))s=d[1],u=d[2];else{let m=l;/^[a-z][a-z0-9+.-]*:\/\//i.test(m)||(m.startsWith("git@")?m=m.replace(/^git@([^:]+):/,"https://$1/"):m=`https://${m}`);let x;try{x=new URL(m)}catch{throw new Error(`Unrecognized GitHub repository reference: ${n}`)}if(!/^([^.]+\.)?github\.com$/i.test(x.hostname))throw new Error(`Only github.com repositories are supported (got host ${x.hostname})`);const y=x.pathname.replace(/^\/+|\/+$/g,"").split("/");if(y.length<2||!y[0]||!y[1])throw new Error(`Unrecognized GitHub repository reference: ${n}`);s=y[0],u=y[1].replace(/\.git$/i,"")}if(!s||!u||s.includes("..")||u.includes(".."))throw new Error(`Unrecognized GitHub repository reference: ${n}`);const f=G1.parse(`github.com/${s}/${u}`);return{owner:s,repo:u,identity:f,cloneUrl:`https://github.com/${s}/${u}.git`}}const Ey=p().min(1).transform((n,l)=>{try{return Kd(n).identity}catch(s){return l.addIssue({code:K.custom,message:s.message}),Z1}}),Ry="repo:",I1=fe(["resolved","unresolved","conflict","invalid"]),K1=q({status:I1,repository:p().optional(),sourceLabel:p().optional(),labels:ne(p()).optional(),error:p().optional()});function J1(n){return n?n.filter(l=>l.toLowerCase().startsWith(Ry)):[]}const F1=100,W1=q({label:p(),repository:p()});q({mappings:ne(W1).max(F1+1)});function Cy(n){const l=J1(n);if(l.length===0)return{status:"unresolved",labels:[]};if(l.length>1)return{status:"conflict",labels:[...l]};const s=l[0],u=s.slice(Ry.length).trim();if(!u)return{status:"invalid",labels:[s],error:"Repository label has no value"};try{return{status:"resolved",repository:Kd(u).identity,sourceLabel:s,labels:[s]}}catch(d){return{status:"invalid",labels:[s],error:d.message}}}const Ty=q({id:p(),title:p(),url:p(),subtitle:p().optional(),source:p().optional()});q({linearAttachmentId:p(),kind:fe(["file","link"]),title:p(),safeFileName:p().optional(),blobPath:p().optional(),contentType:p().optional(),sizeBytes:k().int().nonnegative().optional(),sha256:p().optional(),url:p(),subtitle:p().optional(),source:p().optional()});const Ht=fe(["claude_code","cursor_local","codex_local","muse_code"]),Ba=q({maxTurns:k().positive().nullable().optional(),maxBudgetUsd:k().positive().nullable().optional()}),Oy=q({plan:Ba.optional(),execute:Ba.optional(),reflect:Ba.optional()});function ru(n){if(!(n!=null&&n.trim()))return null;try{const l=Ba.parse(JSON.parse(n));return l.maxTurns==null&&l.maxBudgetUsd==null?null:l}catch{return null}}function P1(n){return!n||n.maxTurns==null&&n.maxBudgetUsd==null?null:JSON.stringify(n)}const Jd=fe(["developer","reviewer","legacy"]),ew=fe(["queued","running","done","failed","timed_out","cancelled"]);q({id:p().uuid(),issueId:p().uuid(),role:Jd,round:k().int().min(1),agentId:p().uuid().nullable(),runtime:Ht.nullable(),model:p().nullable(),budgetJson:p().nullable(),worktreePath:p().nullable(),inputSha:p().nullable(),status:ew,sessionRef:p().nullable(),logPath:p().nullable(),exitCode:k().int().nullable(),errorJson:p().nullable(),metadataJson:p().nullable(),profileSnapshotJson:p().nullable(),processPid:k().int().nullable(),processOwner:p().nullable(),processStartedAt:p().nullable(),deckCorrelationId:p().uuid().nullable(),createdAt:p(),startedAt:p().nullable(),heartbeatAt:p().nullable(),completedAt:p().nullable(),updatedAt:p()});q({issueId:p().uuid(),role:Jd,round:k().int().min(1),agentId:p().uuid().nullable(),runtime:Ht.nullable(),model:p().nullable().optional(),budgetJson:p().nullable().optional(),inputSha:p().nullable().optional(),metadataJson:p().nullable().optional(),profileSnapshotJson:p().nullable().optional()});const tw=q({worktreeWrite:De(),publishReview:De(),outboundMutation:De(),resolveHumanAction:De()}),My=q({worktreeWrite:De().optional(),outboundMutation:De().optional()}).strict(),Eu=fe(["low","medium","high"]);q({version:_a(1),agentId:p().nullable(),role:Jd,runtime:Ht.nullable(),model:p().nullable(),effort:Eu.nullable().default(null),budgetJson:p().nullable(),permissionPolicy:tw,deckId:p().nullable(),purpose:p().nullable(),capturedAt:p()});const Ly="auto",aw="muse-spark-1.3-contributor",nw=q({code:fe(["cli_missing","runtime_auth","runtime_unknown","runtime_capability","cursor_keychain","usage_capped","deck_offline","deck_unauthorized","workspace_missing","deck_missing","mcp_not_registered","github_cli_missing","github_auth","github_unreachable"]),message:p()}),lw=q({id:p().uuid(),name:p(),runtime:Ht,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:Eu.nullable(),defaultBudgetJson:p().nullable(),purpose:p().nullable(),playbookIdsJson:p().nullable(),externalMemoryRefsJson:p().nullable(),permissionPolicyJson:p().nullable(),isBuiltin:De(),createdAt:p(),updatedAt:p()}),Dy=lw.extend({healthy:De(),issues:ne(nw)});q({name:p().min(1),runtime:Ht,deckId:p().uuid(),defaultModel:p().nullable().optional(),defaultEffort:Eu.nullable().optional(),defaultBudget:Ba.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:My.nullable().optional()});q({name:p().min(1).optional(),runtime:Ht.optional(),deckId:p().uuid().nullable().optional(),defaultModel:p().nullable().optional(),defaultEffort:Eu.nullable().optional(),defaultBudget:Ba.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:My.nullable().optional()});q({agents:ne(Dy),issueCount:k()});function Sx(n){return n.defaultModel??n.defaultExecuteModel??n.defaultPlanModel??null}function iw(n){const l=ru(n.defaultBudgetJson)??ru(n.defaultExecuteBudgetJson)??ru(n.defaultPlanBudgetJson);return P1(l)}const sw=fe(["slack_message","email","service_tool_call"]),rw=q({target:p().min(1).max(120),body:p().min(1).max(4e3)}),uw=q({serviceName:p().min(1).max(120),toolName:p().min(1).max(120),arguments:Ds(Ay())}),cw=q({actionType:sw,summary:rw,toolCall:uw}),ow=fe(["pending","sent","rejected"]);q({draft:cw,status:ow,sentAt:p().optional(),rejectedAt:p().optional(),bodyMismatch:De().optional(),deliveryAttempts:k().int().min(0).default(0)});q({draftArtifactId:p().uuid(),sentAt:p(),toolResult:Ds(Ay()),permalink:p().url().optional()});const dw=q({failure_summary:p().min(1),user_feedback_excerpt:p().min(1),corrected_output_hint:p().optional()}),fw=ky("op",[q({op:_a("add_item"),section:p().min(1),text:p().min(1)}),q({op:_a("amend_item"),section:p().min(1),anchor:p().min(1),text:p().min(1)}),q({op:_a("remove_item"),section:p().min(1),anchor:p().min(1)}),q({op:_a("set_triggers"),triggers:ne(p())}),q({op:_a("rewrite_body"),text:p()})]);q({rationale:p().min(1),ops:ne(fw).min(1),evidence:dw.optional()});const hw="v1",Uy=fe(["feature","bug fix","refactor","investigation","split child"]);Uy.options;const mw=q({text:p(),evidence:p().nullable()}),pw=q({version:_a(hw),executionMode:Uy,nonGoals:ne(p()),exitPredicate:p(),onePrStoppingPoint:p(),acceptanceCriteria:ne(mw)}),zy={executionMode:"Builder execution mode",nonGoals:"Non-goals",exitPredicate:"Exit predicate",onePrStoppingPoint:"One-PR stopping point",acceptanceCriteria:"Acceptance criteria"},xw=Object.keys(zy);function yw(n){return n.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}Object.fromEntries(xw.map(n=>[yw(zy[n]),n]));const vw=fe(["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"]),gw=fe(["human","developer","reviewer","system"]),By=fe(["manual","linear","agent"]),bw=q({id:p().uuid(),source:By,externalId:p().nullable(),externalLabel:p().nullable(),externalUrl:p().nullable(),title:p(),description:p().nullable(),acceptanceCriteria:p().nullable(),executionContract:pw.nullable().optional(),repo:p(),baseBranch:p(),status:vw,currentOwner:gw,currentIntent:p().nullable(),developerAgentId:p().uuid().nullable(),reviewerAgentId:p().uuid().nullable(),maxReviewRounds:k().int().min(1),currentRound:k().int().min(1),maxInfraAttempts:k().int().min(0),infraAttempts:k().int().min(0),maxCiAttempts:k().int().min(0),ciAttempts:k().int().min(0),branch:p().nullable(),baseSha:p().nullable(),headSha:p().nullable(),prNumber:k().int().nullable(),prUrl:p().nullable(),autoMerge:De(),createdAt:p(),updatedAt:p()});q({title:p().min(1),description:p().optional(),acceptanceCriteria:p().optional(),repo:Ey,baseBranch:p().min(1).default("main"),developerAgentId:p().uuid(),reviewerAgentId:p().uuid(),maxReviewRounds:k().int().min(1).default(3),maxInfraAttempts:k().int().min(0).default(3),autoMerge:De().default(!1),source:By.default("manual"),externalId:p().optional(),externalLabel:p().optional(),externalUrl:p().optional(),enqueue:De().default(!0),linearAttachments:ne(Ty).optional()});q({title:p().min(1).optional(),description:p().nullable().optional(),acceptanceCriteria:p().nullable().optional(),repo:Ey.optional(),baseBranch:p().min(1).optional(),developerAgentId:p().uuid().optional(),reviewerAgentId:p().uuid().optional(),maxReviewRounds:k().int().min(1).optional(),maxInfraAttempts:k().int().min(0).optional(),autoMerge:De().optional()});const jx={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(jx).filter(n=>jx[n].length===0);const ww=fe(["enqueued","already_queued","not_queued"]);bw.extend({created:De(),queue:ww,priorPasses:k().int().min(0)});q({id:p(),issueId:p().nullable(),workerSessionId:p().nullable(),kind:p(),contentJson:p().nullable(),blobPath:p().nullable(),author:fe(["human","agent","system"]),createdAt:p()});const Sw=fe(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","muse_no_progress","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),jw=fe(["task","infrastructure","unknown"]),Nw=fe(["high","medium","low"]),_w=fe(["outcome_kind","session_error","spawn_log","workflow_event","recovery"]),Aw=fe(["exact","inferred"]),Rd=q({code:Sw,domain:jw,primary:De(),confidence:Nw,evidenceSource:_w,occurredAt:p().nullable(),eventCursor:k().int().nullable(),rawReason:p(),sessionId:p().nullable(),logPath:p().nullable(),eventId:p().nullable(),eventType:p().nullable(),quality:Aw}),kw=fe(["commit","verification_receipt","branch_pushed"]),Ew=fe(["sampler","salvage","session_end"]),Fd=fe(["worktree","commit","verification_receipt","publish_only"]);q({kind:kw,observedSha:p().nullable(),observedAt:p(),origin:Ew.nullable(),inputSha:p().nullable(),samplingPrecisionMs:k().int().nullable(),branch:p().nullable()});q({kinds:ne(Fd),retryReason:p().nullable()});const Rw=fe(["done","closed","migrated"]);q({id:p().uuid(),issueId:p().uuid(),workflowVersion:p(),startedAt:p(),completedAt:p().nullable(),outcome:Rw.nullable()});const Cw=fe(["issue.created","issue.reassigned","issue.source_reloaded","workflow.started","worker.started","worker.completed","worker.failed","worker.deferred","worktree.ready","worktree.deps_ready","inputs.materialized","deck.connected","brief.resolved","branch.pushed","checks.started","pull_request.opened","pull_request.updated","checks.completed","review.submitted","repair.started","guidance.added","task_snapshot.refreshed","human_action.requested","human_action.resolved","final_review.requested","issue.completed","issue.closed","queue.enqueued","queue.wait_reason_changed","queue.admitted","queue.removed","agent.started","agent.completed","host.suspended","checkpoint.observed","retry.reused","auto_merge.conflict_sync","auto_merge.conflict_repair_queued","base.probe","base.advanced","operator_verification.waived","legacy.imported"]);q({id:p().uuid(),issueId:p().uuid(),workflowInstanceId:p().uuid().nullable(),workerSessionId:p().uuid().nullable(),type:Cw,actorType:fe(["human","developer","reviewer","system"]),actorRef:p().nullable(),stage:p(),round:k().int().nullable(),payloadJson:p().nullable(),artifactRef:p().nullable(),idempotencyKey:p().nullable(),causationEventId:p().uuid().nullable(),ts:p()});const Tw=fe(["product_scope_decision","policy_escalation","attempts_exhausted","final_review","deck_interaction_required","reflection_interaction_required","outbound_delivery_interaction_required","muse_capability","operator_verification"]),Ow=fe(["open","resolved"]);q({id:p().uuid(),issueId:p().uuid().nullable(),runId:p().uuid().nullable(),workflowInstanceId:p().uuid().nullable(),actionType:Tw,reason:p(),question:p(),evidenceJson:p().nullable(),responseOptionsJson:p().nullable(),continuationPreviewJson:p().nullable(),requestId:p().nullable(),status:Ow,resolutionJson:p().nullable(),resolvedBy:p().nullable(),requestedAt:p(),resolvedAt:p().nullable()});function Ru(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Mw(n){const l=Ru(n.responseOptionsJson);return Array.isArray(l)?l.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function Wd(n){return Ru(n.evidenceJson)??{}}function Cu(n){const s=Wd(n).pushDivergence;return!s||typeof s!="object"?null:s}function Lw(n){const s=Wd(n).worktreeBlocker;return!!s&&typeof s=="object"&&typeof s.fingerprint=="string"}function Dw(n){return Wd(n).mergeFailure===!0}function qy(n){const l=Ru(n.continuationPreviewJson);return typeof(l==null?void 0:l.resumeRole)=="string"?l.resumeRole:null}const Uw=/worktree|unpushed|uncommitted|dirty|preserved|non-fast-forward|diverged|already used by|recovery:|force-with-lease/i,zw=/could not be pushed|non-fast-forward|rejected.*push|push.*rejected/i,Bw=/uncommitted|dirty worktree|has uncommitted changes/i;function Hy(n){const l=/\n?Recovery:\s*\n?/,s=n.match(l);if(!s||s.index===void 0)return{head:n.trim(),commands:[]};const u=n.slice(0,s.index).trim(),f=n.slice(s.index+s[0].length).split(`
|
|
61
|
+
`).map(m=>m.trim()).filter(m=>m.length>0);return{head:u,commands:f}}function qw(n){const s=Hy(n).head.replace(/\s+/g," ").trim(),u=s.match(/^(.+?[.!?])(\s|$)/);return(u?u[1]:s).trim()}const Hw=/(?:~|\/(?:[^/\s\\:"'*?<>|][^/\s\\:"'*?<>|]*))+(?:\/[^/\s\\:"'*?<>|]+)*/g;function $w(n){const l=[],s=new Set,u=f=>{const m=f.trim().replace(/[.,;:!?)"'\]]+$/,"");m.length<2||s.has(m)||(s.add(m),l.push(m))};for(const f of[n.reason,n.question])for(const m of f.matchAll(Hw)){const x=m[0];/^\/\d+(\.\d+)*$/.test(x)||!x.includes("/")&&!x.startsWith("~")||u(x)}const d=Cu(n);return typeof(d==null?void 0:d.worktreePath)=="string"&&d.worktreePath&&u(d.worktreePath),l}function Nx(n){return n.length>12?n.slice(0,12):n}function Yw(n){const l=[],s=Cu(n);if(s&&typeof s.localSha=="string"&&typeof s.remoteSha=="string"){const d=typeof s.branch=="string"?s.branch:"the branch",f=typeof s.ahead=="number"?` (+${s.ahead})`:"",m=typeof s.behind=="number"?` (+${s.behind})`:"";l.push(`Push: local ${s.localSha}${f} · origin/${d} ${s.remoteSha}${m}`),typeof s.observedRemoteSha=="string"&&s.observedRemoteSha!==s.remoteSha&&l.push(`Remote moved: origin/${d} is now at ${s.observedRemoteSha}`),typeof s.lastLeaseError=="string"&&s.lastLeaseError&&l.push(`Last lease attempt: ${s.lastLeaseError}`)}const u=qy(n);return u&&l.push(`Continuation: resumes as ${u}`),l}function Vw(n){return n==="close"||n==="reject"||n==="abort"}function al(n){return n.length===0?null:n.some(l=>l.choice==="push_with_lease")?"push_with_lease":(n.find(l=>!Vw(l.choice))??n[0]).choice}function Zw(n){if(n.actionType!=="policy_escalation")return"other";if(Dw(n))return"merge-failure";const l=Cu(n);if((l==null?void 0:l.relationship)==="diverged")return"diverged-push";if(l&&(l.relationship==="behind"||typeof l.localSha=="string"))return"unpushed";const s=`${n.reason}
|
|
62
|
+
${n.question}`;return zw.test(s)?"unpushed":qy(n)==="reviewer"?"reviewer-retry":Bw.test(s)?"dirty-worktree":Lw(n)||/already used by worktree/i.test(s)||/worktree/i.test(s)&&/Recovery:/.test(s)?"worktree-conflict":"ordinary-escalation"}const Gw="Resume safely";function $y(n){const l=Zw(n),s=Mw(n),{commands:u}=Hy(n.reason),d=$w(n),f=Yw(n),m=(()=>{const y=Ru(n.evidenceJson);return y==null?null:JSON.stringify(y,null,2)})(),x={question:n.question,reason:n.reason,commands:u,paths:d,factLines:f,evidencePretty:m};switch(l){case"diverged-push":{const y=Cu(n),v=y&&typeof y.branch=="string"&&typeof y.localSha=="string"&&typeof y.remoteSha=="string"?` (origin/${y.branch}: local ${Nx(y.localSha)} against remote ${Nx(y.remoteSha)})`:"";return{kind:l,title:"Publish these finished commits with a pinned lease?",context:`Your branch diverged from the remote — confirm the pinned commits${v} under Details, then choose Push with lease.`,safeResume:!1,displayOptions:s,primaryChoice:al(s),details:x}}case"unpushed":return{kind:l,title:"The push was rejected — how should we proceed?",context:"Your commits are saved; resuming continues development without discarding them.",safeResume:!1,displayOptions:s,primaryChoice:al(s),details:x};case"worktree-conflict":return{kind:l,title:"A saved worktree still holds this branch — how should we proceed?",context:"Your work is preserved; check the worktree path and recovery steps under Details before choosing.",safeResume:!1,displayOptions:s,primaryChoice:al(s),details:x};case"dirty-worktree":return{kind:l,title:"Uncommitted changes were preserved — how should we proceed?",context:"Nothing was discarded; review the saved changes under Details before choosing.",safeResume:!1,displayOptions:s,primaryChoice:al(s),details:x};case"merge-failure":return{kind:l,title:"The merge failed after approval — retry it?",context:"The work is already approved; retrying the merge publishes the same commits without a new developer round.",safeResume:!1,displayOptions:s,primaryChoice:al(s),details:x};case"reviewer-retry":return{kind:l,title:"The review attempt failed — retry it?",context:"Nothing is wrong with the code itself; retrying re-queues the reviewer at the same pinned commit.",safeResume:!0,displayOptions:s,primaryChoice:al(s),details:x};case"ordinary-escalation":{const y=qw(n.reason),v=!Uw.test(`${n.reason}
|
|
63
|
+
${n.question}`),w=v?s.map(j=>j.choice==="resume"&&j.label==="Resume development"?{...j,label:Gw}:j):s;return{kind:l,title:"Development is parked — resume or close?",context:y?`${y} Choose ${v?"Resume safely":"Resume"} to continue, or Close to stop.`:null,safeResume:v,displayOptions:w,primaryChoice:al(w),details:x}}case"other":default:return{kind:"other",title:n.question,context:null,safeResume:!1,displayOptions:s,primaryChoice:al(s),details:x}}}const Qw=fe(["blocking","non_blocking"]),Xw=fe(["open","resolved","recurring","superseded"]);q({id:p().uuid(),issueId:p().uuid(),fingerprint:p(),severity:Qw,title:p(),rationale:p(),evidenceRef:p().nullable(),file:p().nullable(),line:k().int().nullable(),status:Xw,firstRound:k().int().min(1),lastRound:k().int().min(1)});q({id:p().uuid(),issueId:p().uuid(),workerSessionId:p().uuid(),role:fe(["developer","reviewer","legacy"]),runtime:p().nullable(),tokensIn:k().int().nullable(),tokensOut:k().int().nullable(),costUsd:k().nullable(),durationMs:k().int().nullable(),ts:p(),model:p().nullable().optional()});const Iw=q({available:_a(!0)}),Kw=q({available:_a(!1),until:p(),reason:p()});ky("available",[Iw,Kw]);const Pd=fe(["supported_protocol","observed_event","experimental_api","unavailable"]),Tu=fe(["unsupported","missing","expired","unparsable","stale"]),Jw=fe(["five_hour","weekly"]),Fw=q({windowKey:p().min(1),providerBucket:p().min(1),durationMinutes:k().int().positive().nullable(),displayLabel:p().min(1),usedValue:k().nullable(),usedUnit:p().nullable(),remainingPercent:k().min(0).max(100).nullable(),resetAt:p().nullable(),observedAt:p(),freshUntil:p().nullable(),expiresAt:p().nullable(),source:Pd,unavailableReason:Tu.nullable(),criticalRole:Jw.nullable()}),Ww=q({runtime:Ht,windows:ne(Fw),unavailableReason:Tu.nullable()});q({runtimes:ne(Ww),generatedAt:p()});q({configured:De(),cycleStart:p().nullable(),cycleEnd:p().nullable(),spendValue:k().nullable(),spendUnit:p().nullable(),hardLimitValue:k().nullable(),hardLimitUnit:p().nullable(),memberCount:k().nullable(),memberLimitOverrideCount:k().nullable(),usagePeriodStart:p().nullable(),usagePeriodEnd:p().nullable(),usageSpendValue:k().nullable(),usageSpendUnit:p().nullable(),source:Pd,unavailableReason:Tu.nullable(),observedAt:p().nullable(),generatedAt:p()});q({enabled:De(),configured:De(),cycleLabel:p().nullable(),cycleStart:p().nullable(),cycleEnd:p().nullable(),usageValue:k().nullable(),usageUnit:p().nullable(),remainingPercent:k().min(0).max(100).nullable(),source:Pd,unavailableReason:Tu.nullable(),observedAt:p().nullable(),generatedAt:p()});function Yy(n,l=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<=l)return!1}if(n.freshUntil!==null){const s=Date.parse(n.freshUntil);if(!Number.isFinite(s)||s<=l)return!1}if(n.expiresAt!==null){const s=Date.parse(n.expiresAt);if(!Number.isFinite(s)||s<=l)return!1}if(n.observedAt){const s=Date.parse(n.observedAt);if(!Number.isFinite(s)||s>l+6e4)return!1}return!0}const Pw=fe(["queued","admitted","removed"]),e2=q({id:p().uuid(),issueId:p().uuid(),position:k().int(),enqueuedAt:p(),state:Pw,waitReason:p().nullable(),waitReasonAt:p().nullable()});e2.extend({title:p().optional(),issueStatus:p().optional()});q({issueId:p().uuid()});const t2=V1([_a("top"),_a("bottom"),q({before:p().uuid()}).strict(),q({after:p().uuid()}).strict()]);q({to:t2});const a2=2;q({maxActiveIssues:k().int().min(1).max(a2)});q({active:k().int().min(0),waiting:k().int().min(0),limit:k().int().min(0),maxActiveIssues:k().int().min(1),ceiling:k().int().min(0),options:ne(k().int().min(1)),overCap:De()});const sa=fe(["exact","inferred","unavailable"]),Ou=q({quality:sa,reasons:ne(p())}),Vy=fe(["queue_wait","coordinator_setup","agent_process","coordinator_validation_publish","coordinator_work"]),Os=q({phase:Vy,startMs:k().int().nullable(),endMs:k().int().nullable(),durationMs:k().int().nullable(),quality:sa,reasons:ne(p()),sessionId:p().nullable(),startCursor:k().int().nullable(),endCursor:k().int().nullable()}),n2=Ou.extend({phase:Vy,durationMs:k().int().nullable(),rawCount:k().int(),known:k().int(),total:k().int()}),Zy=q({kind:fe(["admission_dependency_wait","runtime_health_preflight","unexplained_silence","human_wait"]),startMs:k().int().nullable(),endMs:k().int().nullable(),durationMs:k().int().nullable(),quality:sa,reasons:ne(p()),category:p().nullable(),sessionId:p().nullable()}),Kt=Ou.extend({value:k().nullable(),known:k().int(),total:k().int()}),Ka=Ou.extend({p50:k().nullable(),p95:k().nullable(),n:k().int()}),l2=q({sessionId:p(),role:p(),runtime:p().nullable(),model:p().nullable(),status:p(),round:k().int(),publishOnly:De(),setup:Os,agentProcess:Os,validationPublish:Os,spawnEnvelopeMs:k().int().nullable(),spawnEnvelopeQuality:sa,spawnEnvelopeReasons:ne(p()),failureCauses:ne(Rd),reuseKinds:ne(Fd).optional(),silence:ne(Zy),silenceQuality:sa,silenceReasons:ne(p()),tokensIn:k().int().nullable(),tokensOut:k().int().nullable(),costUsd:k().nullable(),usageDurationMs:k().int().nullable(),usageQuality:sa,usageReasons:ne(p())}),i2=q({kind:p().nullable(),observedSha:p().nullable(),msSinceWorkflowStart:k().int().nullable(),quality:sa,reasons:ne(p())}),s2=q({attempts:k().int(),retries:k().int(),cold:k().int(),reused:k().int(),unknown:k().int(),publishOnly:k().int(),reuseRate:k().nullable(),preservedKinds:ne(Fd).optional(),quality:sa,reasons:ne(p())}),r2=q({rounds:k().int(),verdicts:k().int(),changeRequests:k().int(),changeRequestRate:k().nullable(),quality:sa,reasons:ne(p())});q({issueId:p(),elapsed:Os,rawIntervals:ne(Os),unionedDurations:ne(n2),exclusiveTotalMs:k().int().nullable(),exclusiveTotalQuality:sa,exclusiveTotalReasons:ne(p()),nested:ne(Zy),attempts:ne(l2),primaryFailure:Rd.nullable(),primaryFailureQuality:sa,primaryFailureReasons:ne(p()),consequenceCauses:ne(Rd),waste:q({failedAttempts:k().int(),publishOnlyAttempts:k().int(),runtimeMs:Kt,tokensIn:Kt,tokensOut:Kt,costUsd:Kt}),firstCheckpoint:i2,retry:s2,reviewer:r2,humanWaitMs:k().int().nullable(),humanWaitQuality:sa,humanWaitReasons:ne(p()),interventionCount:k().int(),coverage:q({duration:Kt,tokens:Kt,cost:Kt})});q({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:k().int().min(1).max(200).default(50),offset:k().int().min(0).default(0)});const nd=Ou.extend({numerator:k().int(),denominator:k().int(),rate:k().nullable()}),ld=q({key:p(),attempts:k().int(),successes:k().int(),successRate:k().nullable(),retries:k().int(),retryRate:k().nullable(),wallTimeMs:Ka});q({window:q({from:p(),to:p(),defaultApplied:De()}),pagination:q({limit:k().int(),offset:k().int(),totalIssues:k().int()}),issueIds:ne(p()),phaseWallTime:Ds(p(),Ka),attemptSuccess:nd,issueSuccess:nd,primaryFailures:ne(q({code:p(),count:k().int(),rate:k().nullable()})),primaryFailureDenominator:k().int(),waste:q({failedAttempts:k().int(),runtimeMs:Kt,tokensIn:Kt,tokensOut:Kt,costUsd:Kt}),checkpointLatencyMs:Ka,retryReuse:nd,reviewer:q({rounds:k().int(),verdicts:k().int(),changeRequests:k().int(),changeRequestRate:k().nullable(),quality:sa,reasons:ne(p())}),humanInterventions:q({totalActions:k().int(),issuesWithIntervention:k().int(),humanWaitMs:Ka}),byRole:ne(ld),byRuntime:ne(ld),byModel:ne(ld),coverage:q({duration:Kt,tokens:Kt,cost:Kt})});const u2=100,Gy=25,Qy=5,c2=fe(["developer","reviewer","legacy"]),o2=fe(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","muse_no_progress","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),d2=fe(["task","infrastructure","unknown"]);q({from:p().optional(),to:p().optional(),repo:p().optional(),role:c2.optional(),runtime:p().optional(),model:p().optional(),status:p().optional(),page:wx.number().int().min(1).default(1),limit:wx.number().int().min(1).max(u2).default(Gy)});const Xy=fe(["exact","inferred","unavailable"]),wa=q({sum:k().nullable(),known:k().int().min(0),total:k().int().min(0),quality:Xy,reasons:ne(p())}),id=q({key:p(),issues:k().int().min(0),attempts:k().int().min(0),issueSuccess:k().nullable(),issueSuccessDenominator:k().int().min(0),attemptSuccess:k().nullable(),attemptSuccessDenominator:k().int().min(0),sessionWallMs:Ka,spawnEnvelopeMs:Ka,retryRate:k().nullable(),tokensIn:wa,tokensOut:wa,costUsd:wa,durationMs:wa,failedDurationMs:wa,failedTokensIn:wa,failedTokensOut:wa,failedCostUsd:wa}),f2=q({code:o2,domain:d2,count:k().int().min(0),share:k().nullable(),issueIds:ne(p()),issueTotal:k().int().min(0)}),h2=q({id:p(),title:p(),status:p(),repo:p(),attempts:k().int().min(0),updatedAt:p()}),m2=q({window:q({from:p(),to:p()}),filters:q({repo:p().nullable(),role:p().nullable(),runtime:p().nullable(),model:p().nullable(),status:ne(p())}),summary:q({issues:k().int().min(0),closedIssues:k().int().min(0),issueSuccess:k().nullable(),attempts:k().int().min(0),terminalAttempts:k().int().min(0),attemptSuccess:k().nullable(),retryRate:k().nullable(),retryExtraAttempts:k().int().min(0),reuseRate:k().nullable(),reuseDenominator:k().int().min(0),humanWaitMs:k().int().min(0),humanWaitQuality:Xy,interventions:k().int().min(0),avgReviewerRounds:k().nullable(),reviewedIssues:k().int().min(0),changeRequestRate:k().nullable(),sessionWallMs:Ka,spawnEnvelopeMs:Ka,checkpointMs:Ka,phaseWallMs:ne(q({phase:p(),stat:Ka})),failedDurationMs:wa,failedTokensIn:wa,failedTokensOut:wa,failedCostUsd:wa}),byRole:ne(id),byRuntime:ne(id),byModel:ne(id),failures:ne(f2),issues:ne(h2),pagination:q({page:k().int().min(1),limit:k().int().min(1),total:k().int().min(0),totalPages:k().int().min(0)}),meta:q({generatedAt:p(),partial:De(),partialReasons:ne(p())})});function Iy(n){const l=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(Gy)||l.set(s,d))}return l.sort(),l.toString()}function nl(n,l){return n.sum===null||n.known===0?"Unavailable":n.known<n.total?`${l(n.sum)} (${n.known}/${n.total} known)`:l(n.sum)}function Ky(n){return n<Qy?`n=${n} (sparse)`:`n=${n}`}function Cd(n){return n<Qy}function _x(n,l){if(n.n===0||n.p50===null&&n.p95===null)return"Unavailable";const s=u=>u===null?"–":l(u);return`P50 ${s(n.p50)} · P95 ${s(n.p95)} (${Ky(n.n)})`}function Rs(n){return`$${n.toFixed(2)}`}function Ke(n){return n.toLocaleString("en-US")}function p2(n){if(!Number.isFinite(n))return Ke(n);const l=Math.abs(n);if(l<1e3)return Ke(n);const s=u=>u>=100?String(Math.round(u)):u.toFixed(1).replace(/\.0$/,"");return l<1e6?`${s(n/1e3)}K`:`${s(n/1e6)}M`}function It(n){if(n<1e3)return`${Math.round(n)} ms`;const l=n/1e3;if(l<60)return`${l.toFixed(1)} s`;const s=Math.floor(l/60),u=Math.round(l%60);return s<60?`${s}m ${u}s`:`${Math.floor(s/60)}h ${s%60}m`}function Mu(n){return n===null||!Number.isFinite(n)?"Unavailable":`${(n*100).toFixed(1)}%`}const x2=fe(["queued","plan_pending","plan_approved","running","review","done","failed","cancelled"]),Jy=fe(["code","communication","email","research","content","other"]),y2=fe(["task_snapshot","draft_plan","approved_plan","plan_triage","plan_answers","acceptance_criteria","transcript","stream_trace","usage","agent_session","execution_result","diff","pr","email_draft","slack_draft","service_draft","document","research_brief","deliverable","feedback","playbook_patch","playbook_use_receipt","deck_feedback_signal","reflect_status","linear_sync","send_receipt","result_qa"]),Lu=fe(["plan","execute","reflect","qa"]),Fy=fe(["retry","approve"]);q({patchId:p(),playbookId:p().optional(),playbookTitle:p().optional(),rationale:p().optional(),status:_a("proposed"),trigger:Fy,dashboardUrl:p().optional()});q({status:fe(["pending","completed","failed","skipped"]),trigger:Fy,error:p().optional()});const v2=q({type:fe(["system","human","context","thinking","assistant","tool","rate_limit","result"]),text:p(),toolName:p().optional()});q({phase:Lu,runtime:Ht,entries:ne(v2)});const g2=q({phase:Lu,runtime:Ht,totalCostUsd:k().optional(),inputTokens:k().optional(),outputTokens:k().optional(),cacheReadTokens:k().optional(),cacheWriteTokens:k().optional(),durationMs:k().optional(),model:p().optional(),numTurns:k().optional(),maxTurns:k().optional(),maxBudgetUsd:k().optional()}),b2=q({label:p(),usage:g2,maxTurns:k().optional(),maxBudgetUsd:k().optional()});q({lines:ne(b2),total:q({totalCostUsd:k(),inputTokens:k(),outputTokens:k(),durationMs:k(),numTurns:k()})});q({phase:Lu,runtime:Ht,sessionId:p()});q({phase:Lu,exitCode:k(),resultText:p().optional(),isError:De().optional(),blocker:q({summary:p().optional()}).optional()});q({path:p(),title:p(),markdown:p()});q({markdown:p(),sessionId:p().optional()});const w2=fe(["manual","linear"]);q({id:p(),title:p(),description:p().optional(),url:p().optional()});const wn=q({id:p().uuid(),source:w2,externalId:p().nullable(),externalLabel:p().nullable(),taskCategory:Jy,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:Ht.nullable(),planModel:p().nullable(),executeModel:p().nullable(),status:x2,lineageId:p().uuid().nullable(),acceptanceCriteria:p().nullable(),approvalGatesJson:p().nullable(),budgetJson:p().nullable(),createdAt:p(),updatedAt:p()});q({id:p().uuid(),runId:p().uuid(),kind:y2,contentJson:p().nullable(),blobPath:p().nullable(),author:fe(["human","agent","system"]),createdAt:p()});q({id:p().uuid(),runId:p().uuid(),type:p(),payloadJson:p().nullable(),ts:p()});q({title:p().min(1),description:p().optional(),taskCategory:Jy.default("other"),repo:p().optional(),artifactWorkspace:p().optional(),acceptanceCriteria:p().optional(),status:fe(["queued","plan_pending","plan_approved"]).default("plan_pending"),agentId:p().uuid(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:Oy.optional()});q({runtime:Ht,deckId:p().uuid().optional(),playbookId:p().optional(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:Oy.optional()});q({planMarkdown:p(),approve:De().default(!1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),planBudget:Ba.nullable().optional(),executeBudget:Ba.nullable().optional()});q({runtime:Ht.optional(),deckId:p().uuid().optional(),playbookId:p().optional(),executeModel:p().nullable().optional(),executeBudget:Ba.nullable().optional()});q({feedback:p().min(1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),executeBudget:Ba.nullable().optional()});q({outboundBody:p().min(1).max(4e3).optional()});const S2=q({id:p(),identifier:p(),title:p(),description:p().optional(),url:p(),state:p().optional(),labels:ne(p()).optional(),teamId:p().optional(),branchName:p().optional(),repoResolution:K1.optional(),attachments:ne(Ty).optional()});q({stateFilter:ne(p()),teamId:p().nullable(),assigneeMe:De(),syncEnabled:De()});const Td=q({stateFilter:ne(p().min(1)).min(1),teamId:p().nullable(),assigneeMe:De()});Td.extend({persisted:Td,envOverrides:q({stateFilter:De(),teamId:De()})});Td.partial();const j2=q({id:p(),name:p(),key:p().optional()}),N2=q({name:p(),type:p().optional(),teamId:p().optional()});q({teams:ne(j2),workflowStates:ne(N2),viewer:q({id:p(),name:p(),email:p().optional()}).nullable()});q({candidates:ne(S2),hasMore:De()});q({host:p(),port:k().int().min(1).max(65535),envOverride:De()});const _2=fe(["UNAUTHORIZED","DECK_UNAVAILABLE"]);q({connected:De(),apiUrl:p(),mcpUrl:p(),deckCount:k().optional(),envOverride:De(),error:p().optional(),deckAccessError:_2.optional(),deckAccessErrorMessage:p().optional()});q({agentId:p().uuid().optional(),autoAgent:De().optional(),planModel:p().nullable().optional()}).refine(n=>n.agentId!==void 0||n.autoAgent===!0,{message:"Provide agentId or autoAgent: true"});q({planModel:p().nullable().optional(),planBudget:Ba.nullable().optional(),feedback:p().optional(),editedMarkdown:p().optional()});const A2=q({id:p(),label:p()});q({runtime:Ht,models:ne(A2),source:fe(["live","fallback"])});q({planReviewCount:k(),resultReviewCount:k(),maxConcurrent:k(),planningActiveRuns:ne(wn),planningQueuedRuns:ne(wn),runningRuns:ne(wn),waitingExecution:ne(wn),resultReviewRuns:ne(wn),recentDone:ne(wn),awaitingPlanReview:ne(wn),awaitingAnswerRuns:ne(wn),openQuestionCounts:Ds(p(),k()),pendingSendCounts:Ds(p(),k()),sentRunIds:ne(p()).optional(),autoApprovedRunIds:ne(p()),runs:ne(wn),agentDeckOnline:De(),agents:ne(Dy),agentIssueCount:k()});const Wy=new Map,sd=new Map;function Od(n){return Wy.get(n)??null}function k2(n,l){l.models.length!==0&&Wy.set(n,l)}function E2(n,l){const s=Od(n);if(s)return Promise.resolve(s);const u=sd.get(n);if(u)return u;const d=l().then(f=>(k2(n,f),f)).finally(()=>sd.delete(n));return sd.set(n,d),d}const Se="";async function Qe(n){const l=await n.text();try{const s=JSON.parse(l),u=s.error??s.message;if(typeof u=="string"&&u.trim())return u.replace(/^Error:\s*/i,"")}catch{}return l}async function R2(){const n=await fetch(`${Se}/api/intake/linear`);if(!n.ok)throw new Error(await n.text());const l=await n.json();return{candidates:l.candidates??[],hasMore:!!l.hasMore}}async function C2(n){const l=await fetch(`${Se}/api/intake/linear/lookup?q=${encodeURIComponent(n)}`),s=await l.json().catch(()=>({}));if(!l.ok)throw new Error(s.error??`Lookup failed (${l.status})`);if(!s.candidate)throw new Error("Linear issue not found");return s.candidate}async function T2(){const n=await fetch(`${Se}/api/intake/linear/config`);if(!n.ok)throw new Error(await Qe(n));return n.json()}async function O2(n){const l=await fetch(`${Se}/api/intake/linear/config`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function M2(){const n=await fetch(`${Se}/api/intake/linear/metadata`);if(!n.ok)throw new Error(await Qe(n));return n.json()}async function L2(){const n=await fetch(`${Se}/api/settings/repository-mappings`);if(!n.ok)throw new Error(await Qe(n));return(await n.json()).mappings??[]}async function D2(n){const l=await fetch(`${Se}/api/settings/repository-mappings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mappings:n})});if(!l.ok)throw new Error(await Qe(l));return(await l.json()).mappings??[]}async function U2(){const n=await fetch(`${Se}/api/agents`);if(!n.ok)throw new Error("Failed to fetch agents");return n.json()}async function z2(n){const l=await fetch(`${Se}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new Error(await l.text());return l.json()}async function B2(n,l){const s=await fetch(`${Se}/api/agents/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await s.text());return s.json()}async function q2(n){const l=await fetch(`${Se}/api/agents/${n}`,{method:"DELETE"});if(!l.ok)throw new Error(await l.text())}async function H2(n,l){return E2(n,async()=>{const u=await fetch(`${Se}/api/runtimes/${n}/models`);if(!u.ok)throw new Error(await u.text());return u.json()})}async function Py(){const n=await fetch(`${Se}/api/runtime-capacity`);if(!n.ok)throw new Error(await n.text());return n.json()}async function ev(){const n=await fetch(`${Se}/api/agent-deck/status`);if(!n.ok)throw new Error(await n.text());return n.json()}async function $2(){try{const n=await fetch(`${Se}/api/agent-deck/decks`),l=await n.json().catch(()=>null);return n.ok?{ok:!0,decks:(l==null?void 0:l.data)??[]}:{ok:!1,code:l==null?void 0:l.code,message:(l==null?void 0:l.error)??`Agent Deck error (${n.status})`}}catch(n){return{ok:!1,message:n instanceof Error?n.message:String(n)}}}async function Ax(n){const l=new URLSearchParams,s=n.map(f=>f.trim()).filter(Boolean);s.length>0&&l.set("status",s.join(",")),l.set("page","1"),l.set("limit","1"),l.sort();const u=await fetch(`${Se}/api/issues?${l.toString()}`);if(!u.ok)throw new Error(await Qe(u));const d=await u.json();return typeof d.total=="number"?d.total:0}async function Y2(n){var u,d,f;const l=new URLSearchParams;(u=n.q)!=null&&u.trim()&&l.set("q",n.q.trim()),(d=n.status)!=null&&d.trim()&&l.set("status",n.status.trim()),(f=n.repo)!=null&&f.trim()&&l.set("repo",n.repo.trim()),n.needsAttention&&l.set("needsAttention","1"),l.set("page",String(n.page&&n.page>1?Math.floor(n.page):1)),l.sort();const s=await fetch(`${Se}/api/issues?${l.toString()}`);if(!s.ok)throw new Error(await Qe(s));return s.json()}async function V2(){const n=await fetch(`${Se}/api/issues/recent-repos`);if(!n.ok)throw new Error(await Qe(n));return(await n.json()).repos??[]}async function tv(n){const l=await fetch(`${Se}/api/issues/${n}`);if(!l.ok)throw new Error(await Qe(l));return l.json()}async function Z2(n){const l=await fetch(`${Se}/api/issues/${n}/execution-analysis`);if(!l.ok)throw new Error(await Qe(l));return l.json()}async function G2(n){const l=await fetch(`${Se}/api/issues/${n}/evidence`);if(!l.ok)throw new Error(await Qe(l));return l.json()}async function Q2(n,l){const s=await fetch(`${Se}/api/issues/${n}/artifacts/${l}/trace`);if(!s.ok)throw new Error(await Qe(s));return s.json()}async function X2(n){const l=await fetch(`${Se}/api/issues`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function uu(n,l){const s=await fetch(`${Se}/api/issues/${n}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await Qe(s));return s.json()}async function I2(n){const l=await fetch(`${Se}/api/issues/${n}/reload-source`,{method:"POST"});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function av(n){const l=await fetch(`${Se}/api/issues/${n}/start`,{method:"POST"});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function nv(n){const l=await fetch(`${Se}/api/issues/${n}/execute`,{method:"POST"});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function K2(n,l="web"){const s=await fetch(`${Se}/api/issues/${n}/abort`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:l})});if(!s.ok)throw new Error(await Qe(s));return s.json()}async function J2(n){const l=await fetch(`${Se}/api/issues/${n}/park`,{method:"POST"});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function F2(n,l="web"){const s=await fetch(`${Se}/api/issues/${n}/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({closedBy:l})});if(!s.ok)throw new Error(await Qe(s));return s.json()}async function W2(n){const l=await fetch(`${Se}/api/queue`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:n})});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function lv(n){const l=await fetch(`${Se}/api/queue/${n}`,{method:"DELETE"});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function Pr(n,l){const s=await fetch(`${Se}/api/queue/${n}/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({to:l})});if(!s.ok)throw new Error(await Qe(s));return s.json()}async function rd(){const n=await fetch(`${Se}/api/queue`);if(!n.ok)throw new Error(await Qe(n));return n.json()}async function P2(){const n=await fetch(`${Se}/api/queue/status`);if(!n.ok)throw new Error(await Qe(n));return n.json()}async function eS(n){const l=await fetch(`${Se}/api/queue/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxActiveIssues:n})});if(!l.ok)throw new Error(await Qe(l));return l.json()}async function tS(n,l){const s=await fetch(`${Se}/api/issues/${n}/guidance`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({markdown:l})});if(!s.ok)throw new Error(await Qe(s));return s.json()}async function aS(n){const l=Iy(n),s=await fetch(`${Se}/api/execution-report${l?`?${l}`:""}`);if(!s.ok)throw new Error(await Qe(s));const u=await s.json(),d=m2.safeParse(u);if(!d.success)throw new Error(`Unexpected report shape: ${d.error.message}`);return d.data}async function nS(){const n=await fetch(`${Se}/api/human-actions`);if(!n.ok)throw new Error(await Qe(n));return n.json()}async function iv(n,l,s,u){const d=await fetch(`${Se}/api/human-actions/${n}/resolve`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u!=null&&u.trim()?{resolvedBy:l,choice:s,note:u.trim()}:{resolvedBy:l,choice:s})});if(!d.ok)throw new Error(await Qe(d));return d.json()}function lS(n){return n||Ly}function iS({runtime:n,label:l,value:s,onChange:u,defaultModelId:d,disabled:f,compact:m}){const x=Od(n),[y,v]=b.useState((x==null?void 0:x.models)??[]),[w,j]=b.useState((x==null?void 0:x.source)??"fallback"),[D,X]=b.useState(!x);b.useEffect(()=>{const M=Od(n);if(M){v(M.models),j(M.source),X(!1);return}X(!0),H2(n).then($=>{v($.models),j($.source)}).catch(()=>v([])).finally(()=>X(!1))},[n]);const E=b.useMemo(()=>{var M,$;if(n==="cursor_local"){const F=lS(d);return((M=y.find(W=>W.id===F))==null?void 0:M.label)??"Auto (subscription pool)"}return d?(($=y.find(F=>F.id===d))==null?void 0:$.label)??d:"runtime default"},[n,d,y]),Y=n==="cursor_local"?D?"Loading models…":`Agent default (${E})`:D?"Loading models…":`Default (${E})`;return r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:l}),r.jsxs("select",{className:"field text-sm",disabled:f||D,value:s,onChange:M=>u(M.target.value),children:[r.jsx("option",{value:"",children:Y}),y.map(M=>r.jsx("option",{value:M.id,children:M.label},M.id))]}),n==="cursor_local"&&!D&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Auto and Composer use your Cursor subscription pool. Other models draw API credits."}),w==="fallback"&&y.length>0&&!D&&n==="cursor_local"&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Run cursor-agent login to load the full model list."})]})}function kx(n){const l={};return n.allowWorktreeWrite||(l.worktreeWrite=!1),Object.keys(l).length?l:null}function sS(n){let l={};try{n!=null&&n.trim()&&(l=JSON.parse(n))}catch{l={}}return{allowWorktreeWrite:l.worktreeWrite!==!1}}function Ex({value:n,onChange:l,agentDeckOnline:s,disabled:u}){const[d,f]=b.useState([]),[m,x]=b.useState(null);b.useEffect(()=>{$2().then(w=>{w.ok?(f(w.decks),x(null)):(f([]),x(w.message))})},[]);const y=w=>l({...n,...w}),v=n.runtime==="codex_local"||n.runtime==="claude_code";return r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"font-ui-display text-base uppercase tracking-wide text-[#92E4DD]",children:"Agent"}),r.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Runtime (required)"}),r.jsxs("select",{className:"field",disabled:u,value:n.runtime,onChange:w=>{const j=w.target.value;y({runtime:j,defaultModel:j==="cursor_local"?Ly:j==="muse_code"?aw:"",defaultEffort:j==="cursor_local"||j==="muse_code"?"":n.defaultEffort})},children:[r.jsx("option",{value:"claude_code",children:"Claude Code (claude -p)"}),r.jsx("option",{value:"cursor_local",children:"Cursor local (cursor-agent -p)"}),r.jsx("option",{value:"codex_local",children:"Codex local (codex exec)"}),r.jsx("option",{value:"muse_code",children:"Muse Code (muse exec) — developer only, trial"})]}),r.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Agent Deck (required)"}),r.jsxs("select",{className:"field",disabled:u||!s||!!m,value:n.deckId,onChange:w=>y({deckId:w.target.value}),required:!0,children:[r.jsx("option",{value:"",disabled:!!n.deckId,children:s?m?"Agent Deck error — see below":"Select a deck…":"Agent Deck offline"}),d.map(w=>r.jsxs("option",{value:w.id,children:["◆ ",w.name]},w.id))]}),s&&m&&r.jsx("p",{className:"text-xs text-amber-300/90",children:m}),r.jsxs("div",{className:"pt-2 mt-2 border-t border-white/10 space-y-2",children:[r.jsx("div",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:"Issue-centric session defaults"}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Purpose (optional)"}),r.jsx("input",{className:"field text-sm",placeholder:"e.g. backend refactors on the payments service",disabled:u,value:n.purpose,onChange:w=>y({purpose:w.target.value})})]}),r.jsxs("div",{className:`grid gap-2 ${v?"grid-cols-2":"grid-cols-1"}`,children:[r.jsx(iS,{runtime:n.runtime,label:"Default model",value:n.defaultModel,onChange:w=>y({defaultModel:w}),disabled:u,compact:!0}),v&&r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Reasoning effort"}),r.jsxs("select",{className:"field text-sm",disabled:u,value:n.defaultEffort,onChange:w=>y({defaultEffort:w.target.value}),children:[r.jsx("option",{value:"",children:"Runtime default"}),r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"})]})]})]}),n.runtime==="muse_code"&&r.jsx("p",{className:"text-xs text-white/40",children:"Developer role only — keep a Claude or Codex agent as the reviewer. The developer session receives the selected deck above. Contributor-tier content may be used for product improvement; use it on non-sensitive tickets."}),n.runtime==="cursor_local"&&r.jsx("p",{className:"text-xs text-white/40",children:"Cursor has no separate effort flag — put effort in the model id if needed (e.g. parameterized `[effort=high]`)."}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max turns"}),r.jsx("input",{className:"field text-sm",type:"number",min:1,placeholder:"none",disabled:u,value:n.defaultBudget.maxTurns,onChange:w=>y({defaultBudget:{...n.defaultBudget,maxTurns:w.target.value}})})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max $ / session"}),r.jsx("input",{className:"field text-sm",type:"number",min:0,step:"0.1",placeholder:"none",disabled:u,value:n.defaultBudget.maxBudgetUsd,onChange:w=>y({defaultBudget:{...n.defaultBudget,maxBudgetUsd:w.target.value}})})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Developer capabilities"}),r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm text-white/70",children:r.jsxs("label",{className:"flex items-center gap-1.5",children:[r.jsx("input",{type:"checkbox",disabled:u,checked:n.allowWorktreeWrite,onChange:w=>y({allowWorktreeWrite:w.target.checked})}),"Write files"]})}),r.jsx("p",{className:"text-xs text-white/40",children:"Unchecking runs the developer read-only (no Write/Edit/Bash grant), same as a reviewer. There is no separate push / open-PR toggle — a session with file-write access can already push and open PRs, and no mechanism here can restrict just that without also removing write access."})]})]})]})}function Aa(n){return n==="claude_code"?"Claude":n==="cursor_local"?"Cursor":n==="codex_local"?"Codex":n==="muse_code"?"Muse Code":"No agent"}function rS(){return{maxTurns:"",maxBudgetUsd:""}}function Rx(n){const l=n.maxTurns.trim()?Number(n.maxTurns):null,s=n.maxBudgetUsd.trim()?Number(n.maxBudgetUsd):null;return l==null&&s==null||l!=null&&(!Number.isFinite(l)||l<=0)||s!=null&&(!Number.isFinite(s)||s<=0)?null:{maxTurns:l,maxBudgetUsd:s}}function uS(n){const l=ru(n);return{maxTurns:(l==null?void 0:l.maxTurns)!=null?String(l.maxTurns):"",maxBudgetUsd:(l==null?void 0:l.maxBudgetUsd)!=null?String(l.maxBudgetUsd):""}}function ks({children:n,className:l="",title:s}){return r.jsx("span",{title:s,className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium uppercase tracking-wide border ${l}`,children:n})}function eu(n,l){const s=n.find(d=>d.runtime===l);if(!s)return{ok:!1,detail:"no agent"};const u=s.issues.find(d=>d.code==="cli_missing"||d.code==="runtime_auth"||d.code==="runtime_unknown"||d.code==="runtime_capability"||d.code==="cursor_keychain");return u?{ok:!1,detail:u.message}:{ok:!0,detail:"CLI ready"}}function cS(n){const l=n.flatMap(s=>s.issues).find(s=>s.code==="github_cli_missing"||s.code==="github_auth"||s.code==="github_unreachable");return l?{ok:!1,detail:l.message}:n.length===0?{ok:!1,detail:"no agent"}:{ok:!0,detail:"gh ready"}}function ji({ok:n}){return r.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 oS({agents:n,agentDeckOnline:l}){const[s,u]=b.useState(null);b.useEffect(()=>{ev().then(w=>u(w.mcpUrl)).catch(()=>u(null))},[l]);const d=eu(n,"claude_code"),f=eu(n,"cursor_local"),m=eu(n,"codex_local"),x=n.some(w=>w.runtime==="muse_code")?eu(n,"muse_code"):null,y=cS(n),v=n.flatMap(w=>w.issues).find(w=>w.code==="mcp_not_registered");return r.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-1.5 text-xs text-white/45",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Connections"}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:d.detail,children:[r.jsx(ji,{ok:d.ok}),r.jsx("span",{className:d.ok?"text-white/55":"text-amber-200/90",children:"Claude"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:f.detail,children:[r.jsx(ji,{ok:f.ok}),r.jsx("span",{className:f.ok?"text-white/55":"text-amber-200/90",children:"Cursor"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:m.detail,children:[r.jsx(ji,{ok:m.ok}),r.jsx("span",{className:m.ok?"text-white/55":"text-amber-200/90",children:"Codex"})]}),x&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:x.detail,children:[r.jsx(ji,{ok:x.ok}),r.jsx("span",{className:x.ok?"text-white/55":"text-amber-200/90",children:"Muse Code"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:y.detail,children:[r.jsx(ji,{ok:y.ok}),r.jsx("span",{className:y.ok?"text-white/55":"text-amber-200/90",children:"GitHub"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:(v==null?void 0:v.message)??(s?`MCP ${s}`:"Agent Deck optional"),children:[r.jsx(ji,{ok:l&&!v}),r.jsxs("span",{className:l&&!v?"text-[#92E4DD]/80":v?"text-amber-200/90":"text-white/35",children:["Agent Deck MCP",l?v?" (setup needed)":"":" (optional)"]})]})]})}function sv(n){return n<10?"critical":n<30?"warning":"normal"}const ef={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},dS={critical:"font-bold text-red-400",warning:"text-yellow-400",normal:"font-medium"},fS=new Set(["claude_code","codex_local","muse_code"]),hS="billing_cycle",mS="1M",pS="5H",xS="1W";function Cx(n,l,s,u){if(n!==null)return rv(n,l,null);const d=s??"missing";return{key:u,label:l,kind:"unknown",reason:d,title:`${l}: N/A (${ef[d]})`}}function rv(n,l,s){if(n.unavailableReason===null&&n.remainingPercent!==null){const d=n.remainingPercent,f=n.resetAt?`, resets ${new Date(n.resetAt).toLocaleString()}`:"",m=s?`, ${s}`:"";return{key:n.windowKey,label:l,kind:"known",remaining:Math.round(d),rawRemaining:d,title:`${l}: ${Math.round(d)}% remaining${m}${f}`}}const u=n.unavailableReason??"missing";return{key:n.windowKey,label:l,kind:"unknown",reason:u,title:`${l}: N/A (${ef[u]})`}}function yS(n){if(n.runtime==="cursor_local"){const l=n.windows.find(s=>s.windowKey===hS)??null;return l===null?[]:[rv(l,mS,"current billing cycle")]}if(fS.has(n.runtime)){const l=n.windows.find(u=>u.criticalRole==="five_hour")??null,s=n.windows.find(u=>u.criticalRole==="weekly")??null;return[Cx(l,pS,n.unavailableReason,"missing-5H"),Cx(s,xS,n.unavailableReason,"missing-1W")]}return[]}function vS({row:n}){const l=n.kind==="known";return r.jsxs("span",{"data-testid":`capacity-window-${n.key}`,"data-reason":n.kind==="unknown"?n.reason:void 0,title:n.title,className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 whitespace-nowrap ${l?"border-white/15 bg-white/5 text-white/70":"border-white/10 bg-transparent text-white/35"}`,children:[r.jsx("span",{className:"text-white/40",children:n.label}),n.kind==="known"?(()=>{const s=sv(n.rawRemaining);return r.jsxs("span",{"data-severity":s,className:dS[s],children:[n.remaining,"%"]})})():r.jsx("span",{children:"N/A"})]})}function gS({data:n}){return n.runtimes.length===0?null:r.jsxs("div",{"data-testid":"runtime-capacity-strip",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Runtime capacity"}),n.runtimes.map(l=>{const s=yS(l);return r.jsxs("span",{"data-testid":`capacity-entry-${l.runtime}`,className:"inline-flex min-w-0 flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"shrink-0 whitespace-nowrap font-medium text-white/55",children:Aa(l.runtime)}),s.length===0?r.jsx("span",{"data-testid":`capacity-entry-${l.runtime}-na`,"data-reason":l.unavailableReason??"missing",title:`N/A (${ef[l.unavailableReason??"missing"]})`,className:"whitespace-nowrap text-white/35",children:"N/A"}):s.map(u=>r.jsx(vS,{row:u},u.key))]},l.runtime)})]})}function bS({refreshTick:n}){const[l,s]=b.useState(null);return b.useEffect(()=>{let u=!1;return Py().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[n]),l?r.jsx(gS,{data:l}):null}const wS="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",SS="/assets/codex-YZSpL-SB.png",jS="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",NS="/assets/muse-CtdcC6ve.svg";function Du({src:n,className:l}){return r.jsx("span",{className:`inline-flex items-center justify-center rounded-lg bg-white/[0.04] ${l??"h-8 w-8"}`,children:r.jsx("img",{src:n,alt:"",className:"h-[70%] w-[70%] object-contain",draggable:!1})})}function _S({className:n="h-8 w-8"}){return r.jsx(Du,{src:wS,className:n})}function AS({className:n="h-8 w-8"}){return r.jsx(Du,{src:jS,className:n})}function kS({className:n="h-8 w-8"}){return r.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,"aria-hidden":!0,children:[r.jsx("rect",{width:"32",height:"32",rx:"8",fill:"white",fillOpacity:"0.06"}),r.jsx("circle",{cx:"16",cy:"13",r:"4.5",stroke:"#92E4DD",strokeWidth:"1.75"}),r.jsx("path",{d:"M8.5 24.5c1.2-3.5 3.8-5.5 7.5-5.5s6.3 2 7.5 5.5",stroke:"#92E4DD",strokeWidth:"1.75",strokeLinecap:"round"})]})}function ES({className:n="h-8 w-8"}){return r.jsx(Du,{src:SS,className:n})}function RS({className:n="h-8 w-8"}){return r.jsx(Du,{src:NS,className:n})}function uv({runtime:n,className:l="h-8 w-8 shrink-0"}){return n==="claude_code"?r.jsx(_S,{className:l}):n==="cursor_local"?r.jsx(AS,{className:l}):n==="codex_local"?r.jsx(ES,{className:l}):n==="muse_code"?r.jsx(RS,{className:l}):r.jsx(kS,{className:l})}const tu=()=>({runtime:"claude_code",deckId:"",purpose:"",defaultModel:"",defaultEffort:"",defaultBudget:rS(),allowWorktreeWrite:!0});function CS({agents:n,agentDeckOnline:l,onRefresh:s}){const[u,d]=b.useState(!1),[f,m]=b.useState(""),[x,y]=b.useState(tu()),[v,w]=b.useState(!1),[j,D]=b.useState(null),[X,E]=b.useState(""),[Y,M]=b.useState(tu()),$=async I=>{if(I.preventDefault(),!(!f.trim()||!x.deckId)){w(!0);try{const ye={name:f.trim(),runtime:x.runtime,deckId:x.deckId,defaultModel:x.defaultModel.trim()||null,defaultEffort:x.defaultEffort||null,defaultBudget:Rx(x.defaultBudget),purpose:x.purpose.trim()||null,permissionPolicy:kx(x)};await z2(ye),m(""),y(tu()),d(!1),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},F=I=>{D(I.id),E(I.name),M({runtime:I.runtime,deckId:I.deckId??"",purpose:I.purpose??"",defaultModel:Sx(I)??"",defaultEffort:I.defaultEffort??"",defaultBudget:uS(iw(I)),...sS(I.permissionPolicyJson)})},W=()=>{D(null),M(tu())},se=async I=>{if(!(!X.trim()||!Y.deckId)){w(!0);try{const ye={name:X.trim(),runtime:Y.runtime,deckId:Y.deckId,defaultModel:Y.defaultModel.trim()||null,defaultEffort:Y.defaultEffort||null,defaultBudget:Rx(Y.defaultBudget),purpose:Y.purpose.trim()||null,permissionPolicy:kx(Y)};await B2(I.id,ye),W(),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},Z=async I=>{if(confirm(`Delete agent "${I.name}"?`)){w(!0);try{await q2(I.id),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},_e=n.filter(I=>!I.healthy).length;return r.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 max-w-6xl mx-auto w-full",children:[r.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"heading-page",children:"Agents"}),r.jsx("p",{className:"text-sm text-white/50 mt-1",children:"Saved execution profiles — pick one when creating an issue instead of configuring each task"}),r.jsxs("p",{className:"text-sm text-white/45 mt-2",children:[n.length," agent",n.length===1?"":"s",_e>0&&r.jsxs("span",{className:"text-red-400 ml-2",children:["· ",_e," need",_e===1?"s":""," attention"]})]})]}),r.jsx(oS,{agents:n,agentDeckOnline:l})]}),r.jsx("div",{className:"mb-4 overflow-x-auto space-y-2",children:r.jsx(bS,{})}),r.jsx("div",{className:"space-y-3 mb-6",children:n.map(I=>{const ye=Sx(I);return r.jsxs("div",{className:"panel flex flex-col sm:flex-row sm:items-start gap-3 justify-between",children:[r.jsxs("div",{className:"flex gap-3 min-w-0 flex-1",children:[r.jsx(uv,{runtime:I.runtime}),r.jsxs("div",{className:"space-y-2 min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-lg font-semibold text-[#E8F6F4]",children:I.name}),!I.healthy&&r.jsx(ks,{className:"bg-red-500/15 text-red-300 border-red-400/30 normal-case",children:"Needs fix"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.jsx(ks,{className:"bg-white/5 text-white/55 border-white/15 normal-case",children:Aa(I.runtime)}),I.deckName?r.jsxs(ks,{className:"bg-[#92E4DD]/10 text-[#92E4DD] border-[#92E4DD]/25 normal-case",children:["◆ ",I.deckName]}):r.jsx(ks,{className:"bg-white/5 text-white/40 border-white/10 normal-case",children:"No deck"}),ye&&r.jsx(ks,{className:"bg-white/5 text-white/50 border-white/10 normal-case truncate max-w-[10rem]",title:ye,children:ye})]}),j===I.id&&r.jsxs("div",{className:"space-y-3 pt-2 border-t border-white/10",children:[r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),r.jsx("input",{className:"field text-sm",value:X,onChange:ze=>E(ze.target.value)})]}),r.jsx(Ex,{value:Y,onChange:M,agentDeckOnline:l}),r.jsxs("div",{className:"flex gap-2 pt-1",children:[r.jsx("button",{type:"button",disabled:v||!X.trim()||!Y.deckId,onClick:()=>se(I),className:"btn-gold text-sm px-3 py-1.5",children:"Save"}),r.jsx("button",{type:"button",onClick:W,className:"btn-ghost text-sm px-3 py-1.5",children:"Cancel"})]})]}),I.issues.length>0&&r.jsx("ul",{className:"text-sm text-red-300/90 space-y-1",children:I.issues.map((ze,mt)=>r.jsxs("li",{children:["· ",ze.message]},mt))})]})]}),r.jsxs("div",{className:"flex gap-2 shrink-0",children:[j!==I.id&&r.jsx("button",{type:"button",disabled:v,onClick:()=>F(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Edit"}),r.jsx("button",{type:"button",disabled:v,onClick:()=>Z(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Delete"})]})]},I.id)})}),u?r.jsxs("form",{onSubmit:$,className:"panel space-y-3",children:[r.jsx("h2",{className:"heading-panel",children:"New Agent"}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),r.jsx("input",{className:"field",placeholder:"e.g. Claude · Work",value:f,onChange:I=>m(I.target.value)})]}),r.jsx(Ex,{value:x,onChange:y,agentDeckOnline:l}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"submit",disabled:v||!f.trim()||!x.deckId,className:"btn-gold px-4 py-2",children:v?"Saving…":"Create agent"}),r.jsx("button",{type:"button",onClick:()=>d(!1),className:"btn-ghost px-4 py-2",children:"Cancel"})]})]}):r.jsx("button",{type:"button",onClick:()=>d(!0),className:"btn-gold px-4 py-2",children:"Add agent"})]})}function TS(n){try{return Kd(n).identity}catch{return null}}function OS(n,l){return n!=="linear"||!l?null:l.repoResolution??Cy(l.labels)}function MS(n,l){if(!l)return n;const s=l.repoResolution??Cy(l.labels);return s.status==="resolved"&&s.repository?s.repository:n}function LS(n,l){var u;const s=OS(n,l);if(!s)return null;if(s.status==="conflict")return`Conflicting repo: labels (${(s.labels??[]).join(", ")}) — kept the current repository. Fix the labels in Linear or type a repository below.`;if(s.status==="invalid"){const d=((u=s.labels)==null?void 0:u[0])??"repo:",f=s.error?` — ${s.error}`:"";return`Invalid repository label ${d}${f}. Kept the current repository — fix the label in Linear or type a repository below.`}return null}function Tx(n){return n.title.trim().length>0&&TS(n.repo)!=null&&n.developerAgentId.length>0&&n.reviewerAgentId.length>0}function DS(n,l,s){const u=s?n.find(d=>d.id===s):void 0;return u&&!l.some(d=>d.id===u.id)?[u,...l]:[...l]}function US(n,l){return{candidates:[l,...n.filter(s=>s.id!==l.id)],selectedId:l.id}}const ud=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"],zS={q:"",status:"",repo:"",needsAttention:!1};function tf(n){return n.startsWith("?")?n.slice(1):n}function Ox(n){var s,u,d;const l=new URLSearchParams(tf(n));return{q:((s=l.get("q"))==null?void 0:s.trim())??"",status:((u=l.get("status"))==null?void 0:u.trim())??"",repo:((d=l.get("repo"))==null?void 0:d.trim())??"",needsAttention:l.get("needsAttention")==="1"||l.get("needsAttention")==="true"}}function BS(n){const l=new URLSearchParams(tf(n)),s=y=>{var w;const v=(w=l.get(y))==null?void 0:w.trim();return v||void 0},u={},d=s("q");d!==void 0&&(u.q=d);const f=s("status");f!==void 0&&(u.status=f);const m=s("repo");m!==void 0&&(u.repo=m),(l.get("needsAttention")==="1"||l.get("needsAttention")==="true")&&(u.needsAttention=!0);const x=Number(l.get("page"));return Number.isInteger(x)&&x>=1&&(u.page=x),u}function qS(n){var s,u,d;const l=new URLSearchParams;return(s=n.q)!=null&&s.trim()&&l.set("q",n.q.trim()),(u=n.status)!=null&&u.trim()&&l.set("status",n.status.trim()),(d=n.repo)!=null&&d.trim()&&l.set("repo",n.repo.trim()),n.needsAttention&&l.set("needsAttention","1"),n.page!==void 0&&Number.isInteger(n.page)&&n.page>1&&l.set("page",String(n.page)),l.sort(),l.toString()}function HS(n){const l={};return n.q.trim()&&(l.q=n.q.trim()),n.status.trim()&&(l.status=n.status.trim()),n.repo.trim()&&(l.repo=n.repo.trim()),n.needsAttention&&(l.needsAttention=!0),l}function $S(n,l){const s=new URLSearchParams(tf(n));return l<=1?s.delete("page"):s.set("page",String(Math.floor(l))),s.sort(),s.toString()}function Mx(n){if(n.total===0)return"No issues match these filters";const l=(n.page-1)*n.limit+1,s=Math.min(n.total,n.page*n.limit);return`Showing ${l}–${s} of ${n.total} issues`}function Lx(n){return n.totalPages<=1?"":`Page ${n.page} of ${n.totalPages}`}function Dx(n){return!!(n.q||n.status||n.repo||n.needsAttention)}const YS={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"},VS={ready:"Ready",developing:"Developing",reviewing:"Reviewing",repairing:"Repairing",final_review:"Final review",needs_human:"Needs human",done:"Done",closed:"Closed"};function cv({status:n}){return r.jsx("span",{className:`text-xs leading-none px-2 py-1 rounded border tabular-nums ${YS[n]}`,children:VS[n]})}const ov="agent-dealer:first-issue-dismissed:v1";function ZS(n){return n.healthy}function GS(n){return n.healthy&&n.runtime!=="muse_code"}function QS(n){const l=n.some(ZS),s=n.some(GS);return l&&s?"new-issue":"agents"}function XS(n){return n.historyTotal===0&&!n.filtersActive&&!n.dismissed}function dv(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function IS(n=dv()){try{return(n==null?void 0:n.getItem(ov))==="1"}catch{return!1}}function KS(n=dv()){try{n==null||n.setItem(ov,"1")}catch{}}function JS({agents:n,onStartIssue:l,onDismiss:s}){const u=QS(n);return r.jsx("section",{"aria-label":"Create your first issue","data-testid":"first-issue-strip",className:"mb-4 rounded border border-[#C4B643]/40 bg-[#C4B643]/5 px-4 py-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-ui-display text-sm font-medium text-white/90",children:"Create your first issue"}),r.jsx("p",{className:"mt-1 text-sm text-white/60",children:"Connect a developer and a reviewer agent, pick a GitHub repository, then create the issue. Capacity status in the header is informational — it never blocks creating an issue."}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[u==="agents"?r.jsx(ra,{to:"/agents","data-testid":"first-issue-primary",className:"btn-gold px-4 py-2 text-sm",children:"Configure agents"}):r.jsx("button",{type:"button","data-testid":"first-issue-primary",className:"btn-gold px-4 py-2 text-sm",onClick:l,children:"New issue"}),u==="agents"&&r.jsx("span",{className:"text-xs text-white/40",children:"then pick a repository and create the issue"})]})]}),r.jsx("button",{type:"button","aria-label":"Dismiss first-issue guide",title:"Dismiss",onClick:s,className:"shrink-0 rounded px-2 py-1 text-sm text-white/40 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:"✕"})]})})}function fv({value:n,onChange:l,recentRepos:s=[],id:u}){return r.jsxs("div",{className:"space-y-1",children:[s.length>0&&r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:s.includes(n)?n:"",onChange:d=>{d.target.value&&l(d.target.value)},"aria-label":"Recent repositories",children:[r.jsx("option",{value:"",children:"Recent repositories…"}),s.map(d=>r.jsx("option",{value:d,children:d},d))]}),r.jsx("input",{id:u,className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"GitHub URL or owner/repo",value:n,onChange:d=>l(d.target.value)})]})}function FS(){return{label:"",repository:""}}function WS(n){const l=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(l.has(d))return`Duplicate label "${u}"`;if(l.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 PS({recentRepos:n=[],initialMappings:l,loadMappings:s=L2,saveMappings:u=D2,onClose:d}){const[f,m]=b.useState(l??[]),[x,y]=b.useState(l!==void 0),[v,w]=b.useState(null),[j,D]=b.useState(null),[X,E]=b.useState(!1);b.useEffect(()=>{if(l!==void 0)return;let $=!0;return s().then(F=>{$&&(m(F),y(!0))}).catch(F=>{$&&(w(String(F)),y(!0))}),()=>{$=!1}},[l,s]);const Y=($,F)=>{m(W=>W.map((se,Z)=>Z===$?{...se,...F}:se))},M=async()=>{w(null),D(null);const $=WS(f);if($){w($);return}E(!0);try{const F=await u(f.map(W=>({label:W.label.trim(),repository:W.repository})));m(F),D(F.length===0?"Mappings cleared":`Saved ${F.length} mapping${F.length===1?"":"s"}`)}catch(F){w(String(F))}finally{E(!1)}};return r.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Repository mappings",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-white/60",children:"Repository mappings"}),d&&r.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:d,children:"Close"})]}),x?f.length===0?r.jsx("p",{className:"text-xs text-white/40",children:"No mappings yet — add one to prefill the Repository field from a Linear label."}):f.map(($,F)=>r.jsxs("div",{className:"flex gap-2 items-start","data-testid":"mapping-row",children:[r.jsx("input",{className:"w-40 shrink-0 bg-black/30 border border-white/10 rounded px-2 py-1.5 text-sm",placeholder:"Linear label","aria-label":`Linear label for mapping ${F+1}`,value:$.label,onChange:W=>Y(F,{label:W.target.value})}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(fv,{value:$.repository,onChange:W=>Y(F,{repository:W}),recentRepos:n})}),r.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((se,Z)=>Z!==F)),children:"Remove"})]},F)):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"}),v&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"mappings-error",children:v}),j&&r.jsx("p",{className:"text-xs text-teal-200/80",children:j}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-white/15 text-white/70 hover:text-white",onClick:()=>m($=>[...$,FS()]),children:"Add mapping"}),r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:X||!x,onClick:()=>void M(),children:X?"Saving…":"Save changes"})]})]})}const ej=["Backlog","Todo","In Progress","In Review"];function cd(n,l){const s=l?n.filter(f=>f.teamId===l):n,u=new Set,d=[];for(const f of s){const m=f.name.toLowerCase();u.has(m)||(u.add(m),d.push(f.name))}return d}function Ux(n,l){return l.length===0?[...n]:n.filter(s=>l.some(u=>u.toLowerCase()===s.toLowerCase()))}function tj(n,l){return n!==null&&!l}function aj({initialConfig:n,initialMetadata:l,loadConfig:s=T2,loadMetadata:u=M2,saveConfig:d=O2,onSaved:f,onClose:m}){var he;const[x,y]=b.useState(n===void 0?null:n),[v,w]=b.useState(l===void 0?null:l),[j,D]=b.useState((n==null?void 0:n.persisted.teamId)??""),[X,E]=b.useState((n==null?void 0:n.persisted.assigneeMe)??!1),[Y,M]=b.useState((n==null?void 0:n.persisted.stateFilter)??[...ej]),[$,F]=b.useState(n!==void 0),[W,se]=b.useState(l!==void 0),[Z,_e]=b.useState(n===null?"Could not load saved Linear intake filters":null),[I,ye]=b.useState(l===null?"Could not load Linear teams and statuses":null),[ze,mt]=b.useState(null),[wt,st]=b.useState(!1),[dt,nt]=b.useState(null);b.useEffect(()=>{if(n!==void 0)return;let P=!0;return s().then(re=>{P&&(y(re),D(re.persisted.teamId??""),E(re.persisted.assigneeMe),M(re.persisted.stateFilter),_e(null),F(!0))}).catch(re=>{P&&(y(null),_e(String(re)),F(!0))}),()=>{P=!1}},[n,s]),b.useEffect(()=>{if(l!==void 0)return;let P=!0;return u().then(re=>{P&&(w(re),ye(null),se(!0))}).catch(re=>{P&&(w(null),ye(String(re)),se(!0))}),()=>{P=!1}},[l,u]),b.useEffect(()=>{if(!v)return;const P=cd(v.workflowStates,j||null);M(re=>Ux(re,P))},[v,j]);const Ve=b.useMemo(()=>cd((v==null?void 0:v.workflowStates)??[],j||null),[v,j]),U=Ve.length>0?Ve:Y,J=!!(x!=null&&x.envOverrides.teamId),oe=!!(x!=null&&x.envOverrides.stateFilter),Me=J||oe,Ue=$&&W,_=tj(x,wt),z=P=>{M(re=>re.some(Be=>Be.toLowerCase()===P.toLowerCase())?re.filter(Be=>Be.toLowerCase()!==P.toLowerCase()):[...re,P])},B=async()=>{if(nt(null),mt(null),!x){nt("Saved filters are unavailable — reload before saving");return}if(Y.length===0){nt("Select at least one workflow status");return}st(!0);try{const P=cd((v==null?void 0:v.workflowStates)??[],j.trim()||null),re=Ux(Y,P);if(re.length===0){nt("Select at least one workflow status"),st(!1);return}const Ze=await d({stateFilter:re,teamId:j.trim()||null,assigneeMe:X});y(Ze),D(Ze.persisted.teamId??""),E(Ze.persisted.assigneeMe),M(Ze.persisted.stateFilter),mt(Ze.envOverrides.stateFilter||Ze.envOverrides.teamId?"Saved locally — env still overrides the disabled controls":"Saved"),f==null||f()}catch(P){nt(String(P))}finally{st(!1)}},ae=Z||I||dt;return r.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Linear intake filters",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-white/60",children:"Linear intake filters"}),m&&r.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:m,children:"Close"})]}),Ue?r.jsxs(r.Fragment,{children:[Me&&r.jsxs("p",{className:"text-xs text-amber-200/90 rounded bg-amber-500/10 border border-amber-400/20 px-2 py-1.5","data-testid":"linear-filter-env-notice",children:[J&&oe?r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_TEAM_ID"})," and"," ",r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_STATE_FILTER"})," override saved Team and Status."]}):J?r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_TEAM_ID"})," overrides saved Team."]}):r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_STATE_FILTER"})," overrides saved Status."]})," ","Remove the env var to use the value below."]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Team"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-2 py-1.5 text-sm disabled:opacity-50","aria-label":"Team",value:j,disabled:J||!x,onChange:P=>D(P.target.value),children:[r.jsx("option",{value:"",children:"All teams"}),((v==null?void 0:v.teams)??[]).map(P=>r.jsxs("option",{value:P.id,children:[P.name,P.key?` (${P.key})`:""]},P.id))]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:!x,children:[r.jsx("legend",{className:"text-xs text-white/50",children:"Assignee"}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"linear-assignee",checked:!X,onChange:()=>E(!1),className:"accent-[#C4B643]"}),"Anyone"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"linear-assignee",checked:X,onChange:()=>E(!0),className:"accent-[#C4B643]"}),"Assigned to me",(he=v==null?void 0:v.viewer)!=null&&he.name?r.jsxs("span",{className:"text-xs text-white/40",children:["(",v.viewer.name,")"]}):null]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:oe||!x,children:[r.jsx("legend",{className:"text-xs text-white/50",children:"Status"}),U.length===0?r.jsx("p",{className:"text-xs text-white/40",children:"No workflow statuses available."}):r.jsx("div",{className:"max-h-40 overflow-y-auto space-y-1","data-testid":"linear-status-list",children:U.map(P=>{const re=Y.some(Ze=>Ze.toLowerCase()===P.toLowerCase());return r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:re,disabled:oe||!x,onChange:()=>z(P),className:"accent-[#C4B643]","aria-label":`Status ${P}`}),P]},P)})})]}),ae&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"linear-filters-error",children:ae}),ze&&r.jsx("p",{className:"text-xs text-teal-200/80","data-testid":"linear-filters-notice",children:ze}),r.jsx("div",{className:"flex gap-2",children:r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:!_,"data-testid":"linear-filters-save",onClick:()=>void B(),children:wt?"Saving…":"Save"})})]}):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"})]})}function hv(n){return n.issues.some(l=>l.code==="usage_capped")}function mv(n){return[...n].sort((l,s)=>Number(s.healthy)-Number(l.healthy))}function sl(n){var u;const l=`${n.name} · ${Aa(n.runtime)}`,s=[];if(!n.healthy){const d=((u=n.issues[0])==null?void 0:u.message)??"unhealthy";s.push(`NEEDS FIX: ${d}`)}return hv(n)&&s.push("USAGE CAPPED"),s.length>0?`${l} — ${s.join(" · ")}`:l}function bu(n){var l;return n?n.healthy?hv(n)?"Usage capped — admission will refuse until the cap lifts":null:((l=n.issues[0])==null?void 0:l.message)??"Agent is unhealthy":null}function pv({agents:n,initialDeveloperId:l,initialReviewerId:s,busy:u,onSave:d,onCancel:f,variant:m="queued",notice:x=null}){var W,se;const[y,v]=b.useState(l??""),[w,j]=b.useState(s??""),D=mv(n),X=n.find(Z=>Z.id===y),E=n.find(Z=>Z.id===w),Y=bu(X),M=bu(E),$=y===(l??"")&&w===(s??""),F=m==="parked"?"Save via the issue PATCH contract — keeps the worktree and branch, records the change on the timeline; resume continues with the new agents":"Save via the issue PATCH contract — keeps queue position and rechecks the wait reason";return r.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("p",{className:"text-xs text-white/50",children:m==="parked"?r.jsx(r.Fragment,{children:"Swap the developer and/or reviewer to another profile — the worktree, branch and review rounds are kept, the change is recorded on the timeline, and a resume continues with the new agents."}):r.jsx(r.Fragment,{children:"Reassign agents — queue position is kept, the wait reason is rechecked, and the change is recorded on the timeline."})}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:y,disabled:u,title:X?`${X.name} · ${Aa(X.runtime)}${X.healthy?" · healthy":` · ${((W=X.issues[0])==null?void 0:W.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:Z=>v(Z.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),D.map(Z=>r.jsx("option",{value:Z.id,title:sl(Z),children:(Z.healthy?"● ":"○ ")+sl(Z)},Z.id))]}),Y&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:Y})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:w,disabled:u,title:E?`${E.name} · ${Aa(E.runtime)}${E.healthy?" · healthy":` · ${((se=E.issues[0])==null?void 0:se.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:Z=>j(Z.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),D.map(Z=>Z.runtime==="muse_code"?r.jsx("option",{value:Z.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${Z.name} · ${Aa(Z.runtime)} — reviewer not supported`},Z.id):r.jsx("option",{value:Z.id,title:sl(Z),children:(Z.healthy?"● ":"○ ")+sl(Z)},Z.id))]}),M&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:M})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:u||!y||!w||$,title:F,onClick:()=>d(y,w),children:"Save agents"}),r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:u,title:m==="parked"?"Reset the selectors to the issue's current agents":void 0,onClick:()=>{if(m==="parked"){v(l??""),j(s??""),f==null||f();return}f==null||f()},children:"Cancel"})]}),x&&r.jsx("p",{className:"text-xs text-emerald-200/90",children:x})]})}function wu({className:n="w-3.5 h-3.5"}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":!0,children:r.jsx("path",{fillRule:"evenodd",d:"M8.982 1.566a1.13 1.13 0 0 0-1.964 0L.165 13.233c-.457.778.091 1.767.982 1.767h13.706c.891 0 1.439-.99.982-1.767L8.982 1.566zM8 5.697a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 5.697zm0 7.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"})})}const nj={final_review:"Final review",attempts_exhausted:"Attempts exhausted",policy_escalation:"Policy escalation",product_scope_decision:"Product scope decision",deck_interaction_required:"Agent Deck interaction required",reflection_interaction_required:"Reflection interaction required",outbound_delivery_interaction_required:"Outbound delivery interaction required",muse_capability:"Muse capability",operator_verification:"Operator verification"};function lj(n){return nj[n]??n}function ij(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}function sj(n){const l=ij(n.responseOptionsJson);return Array.isArray(l)?l.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function rj(n){return n==="close"||n==="reject"||n==="abort"}function uj({options:n,disabled:l,onChoose:s}){return n.length===0?null:r.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(u=>r.jsx("button",{type:"button",className:`${rj(u.choice)?"btn-ghost-danger":"btn-gold"} px-3 py-1 text-xs disabled:opacity-50`,disabled:l,onClick:()=>s(u.choice),children:u.label},u.choice))})}function Ms({action:n,linkTo:l,onChoose:s,disabled:u,children:d,hideChoicesHint:f}){const m=$y(n),x=l?r.jsx(ra,{to:l,className:"text-sm text-white/85 hover:text-white hover:underline",children:m.title}):r.jsx("span",{className:"text-sm text-white/85",children:m.title});return r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs uppercase tracking-wide text-red-300/80",children:lj(n.actionType)}),r.jsx("span",{className:"text-xs text-white/35 shrink-0",children:new Date(n.requestedAt).toLocaleString()})]}),r.jsx("div",{children:x}),m.context&&r.jsx("p",{className:"text-xs text-white/55",children:m.context}),s?m.displayOptions.length>0?r.jsx(uj,{options:m.displayOptions,disabled:u,onChoose:s}):r.jsxs("p",{className:"text-xs text-amber-200/80",children:["This item declares no response options — resolve it from the CLI (",r.jsx("code",{children:"agent-dealer action"}),")."]}):!f&&m.displayOptions.length>0&&r.jsxs("p",{className:"text-xs text-white/50",children:["To decide: ",m.displayOptions.map(y=>y.label).join(" · ")]}),d,r.jsxs("details",{children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Details"}),r.jsxs("div",{className:"mt-1.5 space-y-1.5 rounded border border-white/10 bg-black/20 px-3 py-2",children:[r.jsx("p",{className:"text-xs text-white/60 whitespace-pre-wrap",children:m.details.question}),m.details.question!==m.details.reason&&r.jsx("p",{className:"text-xs text-white/60 whitespace-pre-wrap",children:m.details.reason}),m.details.factLines.map(y=>r.jsx("p",{className:"text-xs text-white/60",children:y},y)),m.details.paths.length>0&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Saved paths:"}),m.details.paths.map(y=>r.jsx("p",{className:"font-mono break-all",children:y},y))]}),m.details.commands.length>0&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Recovery commands:"}),r.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all",children:m.details.commands.join(`
|
|
64
|
+
`)})]}),m.details.evidencePretty&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Evidence:"}),r.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all",children:m.details.evidencePretty})]})]})]})]})}function cj({actions:n,busyActionId:l,onResolve:s}){const[u,d]=b.useState({});return n.length===0?null:r.jsxs("div",{className:"mb-4 rounded border border-red-400/30 bg-red-500/10",children:[r.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 border-b border-red-400/20",children:[r.jsx(wu,{className:"w-4 h-4 shrink-0 text-red-300"}),r.jsxs("span",{className:"font-ui-display text-sm font-medium text-red-200",children:[n.length," ",n.length===1?"item needs":"items need"," your attention"]})]}),r.jsx("div",{className:"divide-y divide-white/5",children:n.map(f=>{if(f.issueId)return r.jsx("div",{className:"px-4 py-3 hover:bg-white/5 transition-colors",children:r.jsx(Ms,{action:f,linkTo:`/issues/${f.issueId}`})},f.id);const m=f.actionType==="operator_verification",x=u[f.id]??"";return r.jsx("div",{className:"px-4 py-3",children:r.jsx(Ms,{action:f,disabled:l===f.id||m&&!x.trim(),onChoose:y=>s(f.id,y,m?x:void 0),children:m&&r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Result note (required) — paste the probe output, waiver reason, or repair note",value:x,disabled:l===f.id,onChange:y=>d(v=>({...v,[f.id]:y.target.value}))})})},f.id)})})]})}const oj="web";function dj(n){const l=Date.now()-new Date(n).getTime(),s=Math.floor(l/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const u=Math.floor(s/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}function fj({agents:n,humanActions:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=wy(),v=x.toString(),w=BS(v),j=b.useRef(w);j.current=w;const[D,X]=b.useState(()=>Ox(v)),[E,Y]=b.useState(!1),M=Dx(w),[$,F]=b.useState(!1),[W,se]=b.useState(!1),[Z,_e]=b.useState(!1),[I,ye]=b.useState("manual"),[ze,mt]=b.useState([]),[wt,st]=b.useState(!1),[dt,nt]=b.useState(""),Ve=b.useRef(dt);Ve.current=dt;const[U,J]=b.useState(""),[oe,Me]=b.useState(!1),[Ue,_]=b.useState([]),[z,B]=b.useState(""),[ae,he]=b.useState(""),[P,re]=b.useState("main"),[Ze,Be]=b.useState(""),[$t,Je]=b.useState(""),[Jt,St]=b.useState(""),[Fe,An]=b.useState(""),[Ra,Wa]=b.useState(!0),[Ca,qe]=b.useState(null),[Dt,Pa]=b.useState([]),[ke,zl]=b.useState(null),[_t,Ta]=b.useState(!1),[Bl,kn]=b.useState(null),[En,ul]=b.useState(()=>IS()),[Ft,en]=b.useState(null),[$a,Ct]=b.useState(null),Ae=ze.find(T=>T.id===dt)??null,Wt=I==="linear"&&Ae!=null,At=LS(I,Ae),ql=Tx({title:z,repo:ae,developerAgentId:Jt,reviewerAgentId:Fe}),cl=T=>{Y2(T).then(d).catch(ee=>qe(String(ee)))},Mi=()=>{Ax([...ud]).then(kn).catch(()=>{})},Rn=()=>{KS(),ul(!0)},Cn=XS({historyTotal:Bl,filtersActive:M,dismissed:En}),pt=()=>{cl(j.current),rd().then(Pa).catch(()=>{}),P2().then(zl).catch(()=>{}),Mi()},ca=async T=>{Ta(!0),qe(null);try{const ee=await eS(T);zl(ee),pt()}catch(ee){qe(String(ee))}finally{Ta(!1)}},Tn=async T=>{Ct(T),qe(null);try{const ee=await tv(T);en({issueId:T,developerAgentId:ee.issue.developerAgentId,reviewerAgentId:ee.issue.reviewerAgentId})}catch(ee){qe(String(ee))}finally{Ct(null)}},tn=async(T,ee)=>{if(Ft){Ct(Ft.issueId);try{await uu(Ft.issueId,{developerAgentId:T,reviewerAgentId:ee}),en(null),pt()}catch(Ne){en(null),qe(String(Ne)),pt()}finally{Ct(null)}}},Li=async T=>{Ct(T),qe(null);try{await av(T),pt()}catch(ee){qe(String(ee))}finally{Ct(null)}},On=async T=>{Ct(T),qe(null);try{await nv(T),pt()}catch(ee){qe(String(ee)),pt()}finally{Ct(null)}},ol=T=>{const ee=qS(HS(T));y(ee?Object.fromEntries(new URLSearchParams(ee)):{})},Ya=()=>{X(zS),y({})},dl=T=>{const ee=$S(v,T);y(ee?Object.fromEntries(new URLSearchParams(ee)):{})},Q=T=>X(ee=>({...ee,...T})),je=async(T,ee,Ne)=>{m(T),qe(null);try{await iv(T,oj,ee,Ne),s(),pt()}catch(Ut){qe(String(Ut))}finally{m(null)}};b.useEffect(()=>{X(Ox(v))},[v]),b.useEffect(()=>{cl(j.current),rd().then(Pa).catch(()=>{}),Ax([...ud]).then(kn).catch(()=>{});const T=setInterval(()=>{cl(j.current),rd().then(Pa).catch(()=>{})},5e3);return()=>clearInterval(T)},[v]);const tt=()=>{R2().then(T=>{st(T.hasMore),mt(ee=>DS(ee,T.candidates,Ve.current))}).catch(T=>qe(`Linear inbox: ${String(T)}`))};b.useEffect(()=>{$&&(V2().then(_).catch(()=>_([])),I==="linear"&&tt())},[$,I]),b.useEffect(()=>{Ae&&(B(`${Ae.identifier}: ${Ae.title}`),Be(Ae.description??""),Je(""),he(T=>MS(T,Ae)))},[Ae]);const kt=()=>{B(""),he(""),Be(""),Je(""),nt(""),J(""),Wa(!0),re("main")},Va=T=>{mt(ee=>US(ee,T).candidates),nt(T.id),J(T.identifier)},jt=async()=>{const T=U.trim();if(!T){qe("Paste a Linear id (e.g. NOT-103) or issue URL");return}Me(!0),qe(null);try{const ee=await C2(T);Va(ee)}catch(ee){qe(`Linear lookup: ${String(ee)}`)}finally{Me(!1)}},oa=async()=>{if(!Tx({title:z,repo:ae,developerAgentId:Jt,reviewerAgentId:Fe})){qe("Title, GitHub repository, developer, and reviewer are required");return}try{await X2({title:z.trim(),repo:ae.trim(),baseBranch:P.trim()||"main",description:Ze.trim()||void 0,acceptanceCriteria:$t.trim()||void 0,developerAgentId:Jt,reviewerAgentId:Fe,maxReviewRounds:3,maxInfraAttempts:3,autoMerge:Ra,source:I==="linear"&&Ae?"linear":"manual",externalId:Ae==null?void 0:Ae.id,externalLabel:Ae==null?void 0:Ae.identifier,externalUrl:Ae==null?void 0:Ae.url,linearAttachments:Ae==null?void 0:Ae.attachments}),F(!1),kt(),pt()}catch(T){qe(String(T))}};return r.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Issues"}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:()=>F(T=>!T),children:"New issue"})]}),Ca&&r.jsx("p",{className:"text-sm text-red-300 mb-3",children:Ca}),Cn&&r.jsx(JS,{agents:n,onStartIssue:()=>F(!0),onDismiss:Rn}),$&&r.jsxs("div",{className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsxs("p",{className:"text-xs text-white/50",children:["Workflow:"," ",r.jsxs("span",{className:"text-white/75",children:["developer → reviewer → ",Ra?"auto-merge on approve":"final human review"]}),"."]}),r.jsxs("div",{className:"flex gap-2 text-sm",children:[r.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${I==="manual"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>{ye("manual"),nt("")},children:"Manual"}),r.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${I==="linear"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>ye("linear"),children:"From Linear"})]}),I==="linear"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"NOT-103 or Linear URL",value:U,onChange:T=>J(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),jt())}}),r.jsx("button",{type:"button",className:"font-ui-display px-3 py-2 rounded border border-teal/40 text-teal text-sm disabled:opacity-50",disabled:oe||!U.trim(),onClick:()=>void jt(),children:oe?"…":"Lookup"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Or pick from open inbox…"}),r.jsx("button",{type:"button","aria-label":"Configure Linear intake filters",title:"Configure Linear intake filters","aria-expanded":Z,onClick:()=>_e(T=>!T),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6Z",stroke:"currentColor",strokeWidth:"1.3"}),r.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm","aria-label":"Or pick from open inbox",value:dt,onChange:T=>{const ee=T.target.value;nt(ee);const Ne=ze.find(Ut=>Ut.id===ee);Ne&&J(Ne.identifier)},children:[r.jsx("option",{value:"",children:"Select an issue…"}),ze.map(T=>r.jsxs("option",{value:T.id,children:[T.identifier,": ",T.title]},T.id))]}),Z&&r.jsx(aj,{onClose:()=>_e(!1),onSaved:tt}),wt&&r.jsx("p",{className:"text-xs text-white/40","data-testid":"linear-candidates-has-more",children:"Showing the 50 most recently updated matches. Use exact ID/URL lookup above for another issue."})]})]}),r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm disabled:opacity-60",placeholder:"Title",value:z,disabled:Wt,onChange:T=>B(T.target.value)}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm disabled:opacity-60",rows:3,placeholder:"Problem statement / description",value:Ze,disabled:Wt,onChange:T=>Be(T.target.value)}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:3,placeholder:"Acceptance criteria (derived from the ticket when left empty)",value:$t,onChange:T=>Je(T.target.value)}),r.jsxs("div",{className:"flex gap-2 items-stretch",children:[r.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Repository"}),r.jsx("button",{type:"button","aria-label":"Configure repository mappings",title:"Configure repository mappings","aria-expanded":W,onClick:()=>se(T=>!T),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6Z",stroke:"currentColor",strokeWidth:"1.3"}),r.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})})]}),r.jsx(fv,{value:ae,onChange:he,recentRepos:Ue}),W&&r.jsx(PS,{recentRepos:Ue,onClose:()=>se(!1)}),At&&r.jsx("p",{className:"text-xs text-amber-200/80","data-testid":"repo-label-warning",children:At})]}),r.jsx("input",{className:"w-32 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Base (seed)",title:"Seed only — managed GitHub clones use the remote default at first checkout",value:P,onChange:T=>re(T.target.value)})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:Jt,onChange:T=>St(T.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),n.map(T=>r.jsx("option",{value:T.id,children:T.name},T.id))]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:Fe,onChange:T=>An(T.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),n.map(T=>r.jsx("option",{value:T.id,children:T.name},T.id))]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:Ra,onChange:T=>Wa(T.target.checked),className:"accent-[#C4B643]"}),"Auto-merge when reviewer approves (skip final human review)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 disabled:opacity-40",disabled:!ql,title:ql?void 0:"Title, GitHub repository, developer, and reviewer are required",onClick:oa,children:I==="linear"?"Kick from Linear":"Create"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{F(!1),kt()},children:"Cancel"})]})]}),Dt.length>0?r.jsxs("div",{className:"mb-4 rounded border border-cyber-teal/25 bg-cyber-teal/5",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-cyber-teal/20 flex items-center justify-between gap-3",children:[r.jsx("span",{className:"font-ui-display text-sm font-medium text-cyber-teal",children:"Admission queue"}),r.jsx("span",{className:"flex items-center gap-2 text-xs text-white/40",children:ke?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[ke.active," active · ",ke.waiting," waiting · limit"," ",ke.limit,ke.overCap?" · over capacity":""]}),ke.options.length>0?r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-white/35",children:"limit"}),r.jsx("select",{className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/80 disabled:opacity-50",value:ke.options.includes(ke.maxActiveIssues)?ke.maxActiveIssues:ke.limit,disabled:_t,title:ke.ceiling<2?`Capped by the worker/spawn ceiling (${ke.ceiling})`:"How many issues may execute in parallel (max one per repository)",onChange:T=>void ca(Number(T.target.value)),children:ke.options.map(T=>r.jsx("option",{value:T,children:T},T))})]}):r.jsxs("span",{title:`Capped by the worker/spawn ceiling (${ke.ceiling})`,children:["max ",ke.ceiling]})]}):r.jsxs("span",{children:[Dt.length," waiting · sequential"]})})]}),r.jsx("div",{className:"divide-y divide-white/5",children:Dt.map((T,ee)=>r.jsxs("div",{children:[r.jsxs("div",{className:"px-4 py-2 flex items-start gap-3",children:[r.jsx("span",{className:"text-xs text-white/35 w-5 shrink-0 pt-0.5",children:T.position}),r.jsxs(ra,{to:`/issues/${T.issueId}`,className:"flex-1 min-w-0 text-left hover:text-cyber-teal",children:[r.jsx("span",{className:"text-sm text-white/85 truncate block",children:T.title??T.issueId.slice(0,8)}),T.waitReason?r.jsx("span",{className:"text-xs text-amber-200/80 block mt-0.5",children:T.waitReason}):r.jsxs("span",{className:"text-xs text-white/35 block mt-0.5",children:[T.issueStatus??"queued"," · next up"]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:$a===T.issueId,title:"Change the developer/reviewer agents — keeps queue position and rechecks the wait reason",onClick:()=>void Tn(T.issueId),children:"Edit"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:$a===T.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 Li(T.issueId),children:"Run next"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:$a===T.issueId,title:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:()=>void On(T.issueId),children:"Execute now"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===0,title:"Move to top",onClick:()=>{Pr(T.issueId,"top").then(pt).catch(Ne=>qe(String(Ne)))},children:"Top"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===0,title:"Move up",onClick:()=>{const Ne=Dt[ee-1];Ne&&Pr(T.issueId,{before:Ne.issueId}).then(pt).catch(Ut=>qe(String(Ut)))},children:"↑"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===Dt.length-1,title:"Move down",onClick:()=>{const Ne=Dt[ee+1];Ne&&Pr(T.issueId,{after:Ne.issueId}).then(pt).catch(Ut=>qe(String(Ut)))},children:"↓"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:ee===Dt.length-1,title:"Move to bottom",onClick:()=>{Pr(T.issueId,"bottom").then(pt).catch(Ne=>qe(String(Ne)))},children:"Bottom"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-white",onClick:()=>{lv(T.issueId).then(pt).catch(Ne=>qe(String(Ne)))},children:"Remove"})]})]}),(Ft==null?void 0:Ft.issueId)===T.issueId&&r.jsx("div",{className:"px-4 pb-3 pl-12",children:r.jsx(pv,{agents:n,initialDeveloperId:Ft.developerAgentId,initialReviewerId:Ft.reviewerAgentId,busy:$a===T.issueId,onSave:(Ne,Ut)=>void tn(Ne,Ut),onCancel:()=>en(null)})})]},T.id))})]}):ke?r.jsxs("p",{"data-testid":"admission-idle-status",className:"mb-4 text-xs text-white/35 tabular-nums",children:["Admission: ",ke.active," active · ",ke.waiting," waiting · limit"," ",ke.limit,ke.overCap?" · over capacity":"",ke.options.length>0&&r.jsxs("label",{className:"ml-2 inline-flex items-center gap-1",children:[r.jsx("span",{children:"limit"}),r.jsx("select",{className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/60 disabled:opacity-50",value:ke.options.includes(ke.maxActiveIssues)?ke.maxActiveIssues:ke.limit,disabled:_t,title:ke.ceiling<2?`Capped by the worker/spawn ceiling (${ke.ceiling})`:"How many issues may execute in parallel (max one per repository)",onChange:T=>void ca(Number(T.target.value)),children:ke.options.map(T=>r.jsx("option",{value:T,children:T},T))})]})]}):null,r.jsx(cj,{actions:l,busyActionId:f,onResolve:(T,ee,Ne)=>void je(T,ee,Ne)}),r.jsxs("div",{className:"mb-4 rounded border border-white/10 bg-panel-elevated/60",children:[r.jsxs("button",{type:"button","aria-expanded":E,"aria-controls":"issues-filter-form",onClick:()=>Y(T=>!T),className:"w-full flex items-center gap-2 px-4 py-2.5 text-sm text-white/70 hover:text-white",children:[r.jsx("span",{"aria-hidden":"true",className:"text-xs text-white/40 w-3 shrink-0",children:E?"▾":"▸"}),r.jsx("span",{className:"font-ui-display",children:E?"Hide filters":"Show filters"}),M&&r.jsx("span",{"data-testid":"filters-active-indicator",title:"The issue list is filtered",className:"text-xs px-2 py-0.5 rounded-full border border-[#C4B643]/50 text-[#C4B643]",children:"Filtered"})]}),E&&r.jsx("form",{id:"issues-filter-form","aria-label":"Issues filters",className:"px-4 pb-4",onSubmit:T=>{T.preventDefault(),ol(D)},children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Search"}),r.jsx("input",{type:"text",placeholder:"Title or label (e.g. NOT-175)",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.q,onChange:T=>Q({q:T.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Status"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.status,onChange:T=>Q({status:T.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),ud.map(T=>r.jsx("option",{value:T,children:T},T))]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Repository"}),r.jsx("input",{type:"text",placeholder:"github.com/owner/repo",title:"Exact repository identity",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.repo,onChange:T=>Q({repo:T.target.value})})]}),r.jsx("div",{className:"flex items-end gap-2",children:r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer pb-2",children:[r.jsx("input",{type:"checkbox",checked:D.needsAttention,onChange:T=>Q({needsAttention:T.target.checked}),className:"accent-[#C4B643]"}),"Needs attention"]})}),r.jsxs("div",{className:"flex items-end gap-2 sm:col-span-2 lg:col-span-4",children:[r.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),r.jsx("button",{type:"button",className:"px-4 py-2 text-sm text-white/60 hover:text-white",onClick:Ya,children:"Reset"})]})]})})]}),u===null?r.jsx("p",{className:"text-white/50 text-sm",children:"Loading…"}):u.total===0&&!Dx(w)?r.jsx("p",{className:"text-white/45 text-sm",children:"No issues yet — create one to get started."}):u.total===0?r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/40 px-4 py-3",children:[r.jsx("p",{className:"text-white/45 text-sm",children:Mx(u)}),r.jsx("button",{type:"button",className:"mt-2 px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white",onClick:Ya,children:"Reset filters"})]}):r.jsxs("div",{children:[r.jsx("div",{className:"flex justify-end mb-2",children:r.jsxs("p",{className:"text-xs text-white/40 tabular-nums",children:[Mx(u),Lx(u)?` · ${Lx(u)}`:""]})}),r.jsx("div",{className:"space-y-2",children:u.issues.map(T=>{const ee=Dt.find(Ne=>Ne.issueId===T.id);return r.jsxs(ra,{to:`/issues/${T.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:[T.hasOpenHumanAction&&r.jsx(wu,{className:"w-4 h-4 shrink-0 text-red-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-white/90 truncate",children:T.title}),ee!=null&&ee.waitReason?r.jsx("p",{className:"text-xs text-amber-200/80 truncate",title:ee.waitReason,children:ee.waitReason}):T.currentIntent&&r.jsx("p",{className:"text-xs text-white/50 truncate",children:T.currentIntent})]}),r.jsx("span",{className:"text-xs text-white/40 capitalize shrink-0",children:T.currentOwner}),ee&&r.jsxs("span",{className:"text-xs px-2 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal shrink-0",title:ee.waitReason??"Next up for admission",children:["Queued #",ee.position]}),r.jsx(cv,{status:T.status}),r.jsx("span",{className:"text-xs text-white/35 shrink-0 w-16 text-right",children:dj(T.updatedAt)})]},T.id)})}),u.totalPages>1&&r.jsxs("nav",{"aria-label":"Issues pages",className:"mt-3 flex items-center gap-2",children:[r.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white disabled:opacity-40",disabled:u.page<=1,onClick:()=>dl(u.page-1),children:"Previous"}),r.jsxs("span",{className:"text-xs text-white/45 tabular-nums",children:["Page ",u.page," of ",u.totalPages]}),r.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white disabled:opacity-40",disabled:u.page>=u.totalPages,onClick:()=>dl(u.page+1),children:"Next"})]})]})]})}const hj=["developer","reviewer","legacy"],zx=["claude_code","cursor_local","codex_local"],mj=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"];function _i(n,l){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:l(n.p50),p95Text:n.p95===null?null:l(n.p95),sampleText:Ky(n.n),sampleTitle:`Sample size ${n.n}${Cd(n.n)?" — fewer than 5 observations, compare with care":""}`,sparse:Cd(n.n)}}function Sa(n,l,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=l(n.sum),d=s!=null&&s.compact?p2(n.sum):u,f=n.known<n.total;return{available:!0,valueText:d,exactText:s!=null&&s.compact?u:null,noteText:f?`${Ke(n.known)}/${Ke(n.total)} known`:null,noteTitle:f?"Partial sample — missing provider metadata is excluded, never zero":null,incomplete:f}}function Us(n,l,s){return n===null||l===0?{available:!1,valueText:"N/A",evidenceCounts:null,evidenceNoun:null,title:`No ${s} in this cohort`}:{available:!0,valueText:Mu(n),evidenceCounts:`${Ke(Math.round(n*l))}/${Ke(l)}`,evidenceNoun:s,title:`Exact share over ${l} ${s}`}}function Bx(n,l,s){const u=Us(n,l,s);return u.available?{text:`${u.valueText} (${u.evidenceCounts} ${u.evidenceNoun})`,title:u.title}:{text:u.valueText,title:u.title}}function od(n){const l=Bx(n.issueSuccess,n.issueSuccessDenominator,"closed"),s=Bx(n.attemptSuccess,n.attemptSuccessDenominator,"terminal attempts");return{key:n.key,issuesText:Ke(n.issues),attemptsText:Ke(n.attempts),issueSuccessText:l.text,issueSuccessTitle:l.title,attemptSuccessText:s.text,attemptSuccessTitle:s.title,issueSuccessDisplay:Us(n.issueSuccess,n.issueSuccessDenominator,"closed"),attemptSuccessDisplay:Us(n.attemptSuccess,n.attemptSuccessDenominator,"terminal attempts"),wallText:_x(n.sessionWallMs,It),envelopeText:_x(n.spawnEnvelopeMs,It),retryText:n.retryRate===null?"N/A":Mu(n.retryRate),retryTitle:"Extra attempts after a terminal attempt in the same issue/role/round ÷ attempts",tokensInText:nl(n.tokensIn,Ke),tokensOutText:nl(n.tokensOut,Ke),costText:nl(n.costUsd,Rs),costIncomplete:n.costUsd.known<n.costUsd.total,durationText:nl(n.durationMs,It),failedCostText:nl(n.failedCostUsd,Rs),failedTokensText:`${nl(n.failedTokensIn,Ke)} in · ${nl(n.failedTokensOut,Ke)} out`,failedDurationText:nl(n.failedDurationMs,It),wall:_i(n.sessionWallMs,It),envelope:_i(n.spawnEnvelopeMs,It),tokensIn:Sa(n.tokensIn,Ke,{compact:!0}),tokensOut:Sa(n.tokensOut,Ke,{compact:!0}),cost:Sa(n.costUsd,Rs),duration:Sa(n.durationMs,It),failedCost:Sa(n.failedCostUsd,Rs),failedTokensIn:Sa(n.failedTokensIn,Ke,{compact:!0}),failedTokensOut:Sa(n.failedTokensOut,Ke,{compact:!0}),failedDuration:Sa(n.failedDurationMs,It),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&&Cd(n.attempts)}}function pj(n,l){const s=n.code==="unknown";return{code:n.code,domain:n.domain,countText:Ke(n.count),shareText:n.share===null?"N/A":Mu(n.share),shareTitle:l>0?`${Ke(n.count)} of ${Ke(l)} issues with a failed attempt`:"No issues with a failed attempt in scope",isUnknown:s,blurb:s?"Ambiguous evidence — not promoted to a specific cause.":`Primary cause · ${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 xj(n){const l=n.reduce((s,u)=>s+u.count,0);return n.map(s=>pj(s,l))}function yj(n){return`/issues/${n}`}function qx(n,l){if(n!=null&&n.trim()&&/^\d{4}-\d{2}-\d{2}$/.test(n.trim()))return l?`${n.trim()}T23:59:59.999Z`:`${n.trim()}T00:00:00.000Z`}function Hx(n){if(!n)return"";const l=n.match(/^(\d{4}-\d{2}-\d{2})/);return l?l[1]:""}function $x(n){const l=new URLSearchParams(n.startsWith("?")?n.slice(1):n),s=u=>{var d;return((d=l.get(u))==null?void 0:d.trim())??""};return{fromDate:Hx(s("from")),toDate:Hx(s("to")),repo:s("repo"),role:s("role"),runtime:s("runtime"),model:s("model"),status:s("status")}}function vj(n){const l=new URLSearchParams(n.startsWith("?")?n.slice(1):n),s=d=>{var m;const f=(m=l.get(d))==null?void 0:m.trim();return f||void 0},u={};for(const d of["from","to","repo","role","runtime","model","status"]){const f=s(d);f!==void 0&&(u[d]=f)}return u}function gj(n,l,s){const u=new URLSearchParams(n.startsWith("?")?n.slice(1):n);u.set(l,s),u.delete("page"),u.delete("limit"),u.sort();const d=u.toString();return`/reports/execution${d?`?${d}`:""}`}function bj(n){return{from:qx(n.fromDate,!1),to:qx(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 dd(n){return n===null?"N/A":Mu(n)}function Da({label:n,value:l,valueTitle:s,note:u}){return r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[r.jsx("p",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:n}),r.jsx("div",{className:"mt-1 font-mono text-lg font-semibold text-white/90 tabular-nums",title:s,children:l}),u&&r.jsx("div",{className:"mt-0.5 font-ui-display text-xs text-white/40",children:u})]})}function Su({display:n,compact:l}){if(!n.available)return r.jsx("span",{className:"font-mono text-white/45",title:n.title,children:"N/A"});const s=l?"font-mono text-sm font-medium text-white/85 tabular-nums leading-tight whitespace-nowrap":"font-mono text-base sm:text-lg font-semibold text-white/90 tabular-nums leading-tight whitespace-nowrap";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",title:n.title,children:[r.jsx("span",{className:s,"aria-label":n.title,children:n.valueText}),r.jsxs("span",{className:"font-ui-display min-w-0 break-words text-xs text-white/40",children:["(",r.jsx("span",{className:"font-mono tabular-nums",children:n.evidenceCounts})," ",n.evidenceNoun,")"]})]})}function Cs({display:n,compact:l}){if(!n.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=l?"font-ui-display text-[11px] uppercase tracking-wide text-white/40":"font-ui-display text-xs uppercase tracking-wide text-white/40",u=l?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-3 gap-y-0.5",children:[r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:s,children:"P50"}),r.jsx("span",{className:u,children:n.p50Text??"N/A"})]}),r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:s,children:"P95"}),r.jsx("span",{className:u,children:n.p95Text??"N/A"})]}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:n.sampleTitle,children:n.sampleText})]})}function ja({display:n,compact:l}){if(!n.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=n.exactText??n.valueText,u=l?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx("span",{className:u,title:s,"aria-label":s,children:n.valueText}),n.noteText&&r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:n.noteTitle??void 0,children:n.noteText})]})}function fd({caption:n,dimension:l,rows:s,cohortLink:u}){return s.length===0?r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[r.jsx("h4",{className:"font-ui-display text-sm font-medium text-white/80",children:n}),r.jsx("p",{className:"font-ui-display mt-1 text-sm text-white/45",children:"No attempts in this dimension for these filters."})]}):r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[1440px] text-sm",children:[r.jsxs("caption",{className:"sr-only",children:[n," — sorted by name, never by cost"]}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:n}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempts"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issue success"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempt success"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Session wall P50/P95"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Retry rate"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens in"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens out"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Cost"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Duration"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed cost"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed tokens"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed runtime"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:s.map(d=>r.jsxs("tr",{className:"tabular-nums",children:[r.jsxs("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:[u?r.jsx(ra,{to:u(l,d.key),className:"text-cyber-teal hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",title:`Filter the report to ${l} ${d.key}`,children:d.key}):d.key,d.sparse&&r.jsx("span",{className:"font-ui-display ml-2 text-xs font-normal text-amber-200/80",title:"Fewer than 5 attempts — compare with care",children:"sparse"})]}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.issuesText}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.attemptsText}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.issueSuccessTitle,children:r.jsx(Su,{display:d.issueSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.attemptSuccessTitle,children:r.jsx(Su,{display:d.attemptSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Cs,{display:d.wall,compact:!0})}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:d.retryTitle,children:d.retryText}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.tokensIn,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.tokensOut,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.cost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.duration,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.failedCost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-1.5",children:[r.jsx(ja,{display:d.failedTokensIn,compact:!0}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"in"}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"·"}),r.jsx(ja,{display:d.failedTokensOut,compact:!0}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"out"})]})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.failedDuration,compact:!0})})]},d.key))})]})})}const wj={fromDate:"",toDate:"",repo:"",role:"",runtime:"",model:"",status:""};function Sj({loading:n,error:l,report:s,onRetry:u,cohortLink:d}){const f=(s==null?void 0:s.summary)??null,m=b.useMemo(()=>s?xj(s.failures):[],[s]),x=b.useMemo(()=>s?s.failures.reduce((y,v)=>y+v.count,0):0,[s]);return r.jsxs("div",{"aria-live":"polite",children:[n&&r.jsx("p",{role:"status",className:"text-sm text-white/50",children:"Loading execution report…"}),!n&&l&&r.jsxs("div",{className:"rounded border border-red-400/30 bg-red-500/10 px-4 py-3",role:"alert",children:[r.jsxs("p",{className:"font-ui-display text-sm text-red-200",children:["Couldn’t load the execution report: ",l]}),r.jsx("button",{type:"button",className:"font-ui-display mt-2 px-3 py-1.5 text-sm rounded border border-red-300/40 text-red-100 hover:bg-red-500/20",onClick:u,children:"Retry"})]}),!n&&!l&&s&&f&&r.jsxs("div",{className:"space-y-6",children:[s.meta.partial&&r.jsxs("div",{className:"rounded border border-amber-300/30 bg-amber-400/10 px-4 py-3",children:[r.jsx("p",{className:"font-ui-display text-sm text-amber-100 font-medium",children:"Partial metadata"}),r.jsx("ul",{className:"font-ui-display mt-1 list-disc list-inside text-sm text-amber-100/80",children:s.meta.partialReasons.map(y=>r.jsx("li",{children:y},y))})]}),f.issues===0?r.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No issues match these filters in this window. Widen the date range or clear filters."}):r.jsxs(r.Fragment,{children:[r.jsx("section",{"aria-label":"Summary",children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-3",children:[r.jsx(Da,{label:"Issue success",value:r.jsx(Su,{display:Us(f.issueSuccess,f.closedIssues,"closed")}),valueTitle:`done / (done + closed), denominator ${f.closedIssues}`,note:`${Ke(f.issues)} issues · ${Ke(f.closedIssues)} closed`}),r.jsx(Da,{label:"Attempt success",value:r.jsx(Su,{display:Us(f.attemptSuccess,f.terminalAttempts,"terminal")}),valueTitle:`done sessions / terminal sessions, denominator ${f.terminalAttempts}`,note:`${Ke(f.attempts)} attempts · ${Ke(f.terminalAttempts)} terminal`}),r.jsx(Da,{label:"Retry rate",value:dd(f.retryRate),valueTitle:`${f.retryExtraAttempts} extra attempts after a terminal attempt in the same issue/role/round ÷ ${f.attempts} attempts`,note:`Reuse rate ${dd(f.reuseRate)} over ${Ke(f.reuseDenominator)} reviewer sessions with input SHA`}),r.jsx(Da,{label:"Human wait",value:It(f.humanWaitMs),note:`${Ke(f.interventions)} interventions`}),r.jsx(Da,{label:"Session wall P50/P95",value:r.jsx(Cs,{display:_i(f.sessionWallMs,It)}),note:"Session bookkeeping proxy — never CLI runtime"}),r.jsx(Da,{label:"Spawn envelope P50/P95",value:r.jsx(Cs,{display:_i(f.spawnEnvelopeMs,It)}),note:"Coordinator-measured; includes slot wait + post-exit work"}),r.jsx(Da,{label:"Checkpoint latency P50/P95",value:r.jsx(Cs,{display:_i(f.checkpointMs,It)}),note:"Session start → first heartbeat"}),r.jsx(Da,{label:"Reviewer rounds (avg)",value:f.avgReviewerRounds===null?"N/A":f.avgReviewerRounds.toFixed(1),note:`Change-request rate ${dd(f.changeRequestRate)} over ${Ke(f.reviewedIssues)} reviewed`})]})}),r.jsxs("section",{"aria-label":"Failed-attempt waste",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Failed-attempt waste (known values only)"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[r.jsx(Da,{label:"Failed cost",value:r.jsx(ja,{display:Sa(f.failedCostUsd,Rs)})}),r.jsx(Da,{label:"Failed tokens",value:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx(ja,{display:Sa(f.failedTokensIn,Ke,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"in"}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"·"}),r.jsx(ja,{display:Sa(f.failedTokensOut,Ke,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"out"})]})}),r.jsx(Da,{label:"Failed runtime",value:r.jsx(ja,{display:Sa(f.failedDurationMs,It)})})]})]}),r.jsxs("section",{"aria-label":"Phase wall time",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Phase wall time"}),r.jsx("p",{className:"font-ui-display text-xs text-white/40 mb-2",children:"Composed from the execution-analysis read model over the same issues: exact when agent start/complete events are recorded, inferred usage-envelope backfill otherwise. Rows without evidence read N/A — never a guess. See per-row reasons."}),r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[r.jsx("caption",{className:"sr-only",children:"Exclusive phase wall times. Boundaries without defensible evidence are N/A."}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Phase"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"P50 / P95"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Why"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:f.phaseWallMs.map(y=>r.jsxs("tr",{className:"tabular-nums",children:[r.jsx("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:y.phase}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Cs,{display:_i(y.stat,It),compact:!0})}),r.jsx("td",{className:"font-ui-display px-3 py-2 text-xs text-white/45",children:y.stat.reasons.join(", ")})]},y.phase))})]})})]}),r.jsxs("section",{"aria-label":"Comparisons",className:"space-y-4",children:[r.jsxs("h3",{className:"font-ui-display text-sm font-medium text-white/80",children:["Comparisons ",r.jsx("span",{className:"font-normal text-white/40",children:"— sorted by name, never by cost"})]}),r.jsx(fd,{caption:"By role",dimension:"role",rows:s.byRole.map(od),cohortLink:d}),r.jsx(fd,{caption:"By runtime",dimension:"runtime",rows:s.byRuntime.map(od),cohortLink:d}),r.jsx(fd,{caption:"By model",dimension:"model",rows:s.byModel.map(od),cohortLink:d})]}),r.jsxs("section",{"aria-label":"Why attempts failed",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Why attempts failed"}),r.jsxs("p",{className:"font-ui-display text-xs text-white/40 mb-2",children:["Each issue with a failed attempt is counted once using its primary actionable cause, and may later have recovered. Share is over"," ",Ke(x)," failed ",x===1?"issue":"issues"," in scope."]}),m.length===0?r.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No failed attempts in this window."}):r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[r.jsx("caption",{className:"sr-only",children:"Why attempts failed: each issue counted once by primary cause. Cause not recorded is its own bucket and is never promoted."}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Failure"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Domain"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Share"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Example issues"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:m.map(y=>r.jsxs("tr",{className:y.isUnknown?"bg-amber-400/5 tabular-nums":"tabular-nums",children:[r.jsxs("th",{scope:"row",className:"px-4 py-2 text-left text-white/85",children:[r.jsx("span",{className:"font-ui-display block font-medium",title:y.code,children:y.displayCode}),r.jsx("span",{className:`font-ui-display block text-xs font-normal ${y.isUnknown?"text-amber-200/90":"text-white/40"}`,children:y.displayNote})]}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:y.domain}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:y.countText}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:y.shareTitle,children:y.shareText}),r.jsx("td",{className:"px-3 py-2",children:r.jsxs("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[y.issueIds.map(v=>r.jsx(ra,{to:yj(v),className:"text-cyber-teal hover:underline font-mono text-xs",children:v.slice(0,8)},v)),y.hiddenIssueCount>0&&r.jsxs("span",{className:"font-ui-display text-xs text-white/40",children:["+",y.hiddenIssueCount," more"]})]})})]},y.code))})]})})]})]})]})]})}function jj(){const[n,l]=wy(),s=n.toString(),u=b.useMemo(()=>vj(s),[s]),[d,f]=b.useState(()=>$x(s)),[m,x]=b.useState(null),[y,v]=b.useState(!0),[w,j]=b.useState(null),[D,X]=b.useState(0);b.useEffect(()=>{f($x(s))},[s]),b.useEffect(()=>{let M=!1;return v(!0),j(null),aS(u).then($=>{M||(x($),v(!1))}).catch($=>{M||(j($ instanceof Error?$.message:String($)),v(!1))}),()=>{M=!0}},[s,D]);const E=M=>{const $=Iy(bj(M));l($?Object.fromEntries(new URLSearchParams($)):{})},Y=M=>f($=>({...$,...M}));return r.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[r.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2 mb-1",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Execution report"}),m&&r.jsxs("p",{className:"font-ui-display text-xs text-white/40",children:["Window ",new Date(m.window.from).toLocaleDateString()," –"," ",new Date(m.window.to).toLocaleDateString()," · generated"," ",new Date(m.meta.generatedAt).toLocaleTimeString()]})]}),r.jsx("p",{className:"font-ui-display text-sm text-white/50 mb-4",children:"Reliability, latency, retry waste, and metadata coverage by role, runtime, and model. Missing cost/token data reads as N/A — never as zero."}),r.jsx("form",{"aria-label":"Report filters",className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60",onSubmit:M=>{M.preventDefault(),E(d)},children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"From"}),r.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.fromDate,onChange:M=>Y({fromDate:M.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"To"}),r.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.toDate,onChange:M=>Y({toDate:M.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Repository"}),r.jsx("input",{type:"text",placeholder:"github.com/owner/repo",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.repo,onChange:M=>Y({repo:M.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Role"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.role,onChange:M=>Y({role:M.target.value}),children:[r.jsx("option",{value:"",children:"All roles"}),hj.map(M=>r.jsx("option",{value:M,children:M},M))]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Runtime"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.runtime,onChange:M=>{Y({runtime:M.target.value})},children:[r.jsx("option",{value:"",children:"All runtimes"}),zx.map(M=>r.jsx("option",{value:M,children:M},M)),r.jsx("option",{value:"unknown",children:"unknown (missing metadata)"}),d.runtime&&!zx.includes(d.runtime)&&r.jsxs("option",{value:d.runtime,children:[d.runtime," (from URL)"]})]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Model"}),r.jsx("input",{type:"text",placeholder:"Any model",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.model,onChange:M=>Y({model:M.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Issue status"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.status,onChange:M=>Y({status:M.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),mj.map(M=>r.jsx("option",{value:M,children:M},M))]})]}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{f(wj),l({})},children:"Reset"})]})]})}),r.jsx(Sj,{loading:y,error:w,report:m,onRetry:()=>X(M=>M+1),cohortLink:(M,$)=>gj(s,M,$)})]})}function Yx(n,l){var d;if(!n)return"Not assigned";const s=l.find(f=>f.id===n);if(!s)return"Unavailable — profile removed";const u=`${s.name} · ${Aa(s.runtime)}`;return s.healthy?u:`${u} (unhealthy: ${((d=s.issues[0])==null?void 0:d.message)??"needs attention"})`}function Vx(n,l){var u;if(!n)return;const s=l.find(d=>d.id===n);return s?`${s.name} · ${Aa(s.runtime)}${s.healthy?" · healthy":` · ${((u=s.issues[0])==null?void 0:u.message)??"unhealthy"}`}`:`Configured profile ${n} is not on record (deleted?)`}function Nj({agents:n,initialRepo:l,initialDeveloperId:s,initialReviewerId:u,busy:d,onSave:f,onCancel:m}){var W,se;const[x,y]=b.useState(l),[v,w]=b.useState(s??""),[j,D]=b.useState(u??""),X=mv(n),E=n.find(Z=>Z.id===v),Y=n.find(Z=>Z.id===j),M=bu(E),$=bu(Y),F=x.trim()===l&&v===(s??"")&&j===(u??"");return r.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("p",{className:"text-xs text-white/50",children:"Edit configuration — repository, developer, and reviewer save together. Queue position is kept, readiness and the wait reason are rechecked, and the change is recorded on the timeline."}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Repository"}),r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:x,disabled:d,placeholder:"GitHub URL or owner/repo",title:"GitHub URL or owner/repo — normalized to github.com/owner/repo, same validation as issue creation",onChange:Z=>y(Z.target.value)})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:v,disabled:d,title:E?`${E.name} · ${Aa(E.runtime)}${E.healthy?" · healthy":` · ${((W=E.issues[0])==null?void 0:W.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:Z=>w(Z.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),X.map(Z=>r.jsx("option",{value:Z.id,title:sl(Z),children:(Z.healthy?"● ":"○ ")+sl(Z)},Z.id))]}),M&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:M})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:j,disabled:d,title:Y?`${Y.name} · ${Aa(Y.runtime)}${Y.healthy?" · healthy":` · ${((se=Y.issues[0])==null?void 0:se.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:Z=>D(Z.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),X.map(Z=>Z.runtime==="muse_code"?r.jsx("option",{value:Z.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${Z.name} · ${Aa(Z.runtime)} — reviewer not supported`},Z.id):r.jsx("option",{value:Z.id,title:sl(Z),children:(Z.healthy?"● ":"○ ")+sl(Z)},Z.id))]}),$&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:$})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:d||!x.trim()||!v||!j||F,title:"Save via the issue PATCH contract — keeps queue position, rechecks readiness and the wait reason",onClick:()=>f(x.trim(),v,j),children:"Save configuration"}),r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:d,onClick:m,children:"Cancel"})]})]})}function _j({issue:n,agents:l,canEdit:s,editing:u,busy:d,onBeginEdit:f,onSave:m,onCancel:x}){return r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1.5",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Configuration"}),r.jsxs("p",{className:"text-sm text-white/85",title:`Exact repository identity: ${n.repo}`,children:[r.jsx("span",{className:"text-white/45",children:"Repository "}),n.repo]}),r.jsxs("p",{className:"text-sm text-white/85",title:Vx(n.developerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Developer "}),Yx(n.developerAgentId,l)]}),r.jsxs("p",{className:"text-sm text-white/85",title:Vx(n.reviewerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Reviewer "}),Yx(n.reviewerAgentId,l)]}),s&&!u&&r.jsx("button",{type:"button",className:"text-xs text-cyber-teal hover:underline disabled:opacity-50",disabled:d,onClick:f,children:"Edit configuration"}),s&&u&&r.jsx(Nj,{agents:l,initialRepo:n.repo,initialDeveloperId:n.developerAgentId,initialReviewerId:n.reviewerAgentId,busy:d,onSave:m,onCancel:x})]})}function Aj({contract:n}){return r.jsxs("section",{"aria-label":"Execution contract",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Execution contract"}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal",children:n.version}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 text-white/70",children:n.executionMode})]}),r.jsxs("div",{className:"text-sm text-white/85 space-y-1.5",children:[r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"Exit predicate: "}),n.exitPredicate]}),r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"One-PR stopping point: "}),n.onePrStoppingPoint]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45",children:"Non-goals:"}),r.jsx("ul",{className:"list-disc pl-5 text-white/75",children:n.nonGoals.map(l=>r.jsx("li",{children:l},l))})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45",children:"Acceptance criteria:"}),r.jsx("ul",{className:"space-y-1",children:n.acceptanceCriteria.map(l=>r.jsxs("li",{children:[r.jsxs("p",{className:"text-white/80",children:["☐ ",l.text]}),l.evidence&&r.jsxs("p",{className:"pl-5 text-xs text-white/55",children:["Evidence: ",l.evidence]})]},l.text))})]})]}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Compiled from the ticket description — edit the description to change it."})]})}function kj(n){return n===void 0?"unknown size":`${n.toLocaleString("en-US")} bytes`}function Ej({attachments:n}){if(!(n!=null&&n.length))return null;const l=n.filter(u=>u.kind==="file"),s=n.filter(u=>u.kind==="link");return r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1","data-testid":"source-attachments",children:[r.jsx("p",{className:"text-xs text-white/45 font-medium uppercase tracking-wide",children:"Source attachments"}),l.map(u=>r.jsxs("p",{className:"text-sm text-white/85","data-testid":"source-attachment-file",children:[r.jsx("span",{className:"text-cyber-teal",children:"file"})," ",u.safeFileName??u.title,r.jsxs("span",{className:"text-white/45",children:[" ","· ",kj(u.sizeBytes),u.sha256?` · sha256:${u.sha256.slice(0,16)}…`:"",u.contentType?` · ${u.contentType}`:""]})]},u.linearAttachmentId)),s.map(u=>r.jsxs("p",{className:"text-sm text-white/85","data-testid":"source-attachment-link",children:[r.jsx("span",{className:"text-amber-300",children:"link"})," ",u.title,r.jsxs("span",{className:"text-white/45",children:[" ","· ",u.url,u.subtitle?` · ${u.subtitle}`:""]})]},u.linearAttachmentId)),r.jsx("p",{className:"text-xs text-white/40",children:"Files are Dealer-stored snapshots — the Builder reads local bytes, never the expiring Linear URL. Links are metadata only, never downloaded. Files uploaded only inside Linear comments are not imported."})]})}function au(n){return n==="developer"?"Developer":n==="reviewer"?"Reviewer":"Worker"}const hd={"issue.created":()=>"Issue created","issue.reassigned":()=>"Configuration updated","issue.source_reloaded":()=>"Task text reloaded from Linear","workflow.started":()=>"Workflow started","worker.started":n=>`${au(n.actorType)} started${n.round?` (round ${n.round})`:""}`,"worker.completed":n=>`${au(n.actorType)} finished${n.round?` (round ${n.round})`:""}`,"worker.failed":n=>`${au(n.actorType)} failed${n.round?` (round ${n.round})`:""}`,"worker.deferred":n=>{var l;return((l=Ai(n.payloadJson))==null?void 0:l.outcome)==="deck_unavailable"?`Waiting for Agent Deck${n.round?` (round ${n.round})`:""}`:`${au(n.actorType)} deferred${n.round?` (round ${n.round})`:""}`},"worktree.ready":()=>"Worktree ready","worktree.deps_ready":()=>"Dependencies ready","deck.connected":()=>"Deck connected","brief.resolved":()=>"Brief resolved","base.probe":n=>{var s;const l=(s=Ai(n.payloadJson))==null?void 0:s.result;return l==="conflict"?"Base conflict found before publish":l==="skipped"?"Base conflict probe skipped":l==="deferred"?"Base conflict probe waiting on base fetch":l==="failed"?"Base conflict probe failed; not published":"Base conflict probe clean"},"branch.pushed":()=>"Branch pushed","checks.started":()=>"Checks started","pull_request.opened":()=>"Developer opened the PR","pull_request.updated":()=>"Developer updated the PR","checks.completed":()=>"Checks completed","review.submitted":()=>"Reviewer submitted a review","repair.started":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 Ai(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}const Rj={approved:"text-cyber-teal",changes_requested:"text-amber-300",escalated:"text-red-300"};function Cj({e:n}){var l;if(n.type==="pull_request.opened"||n.type==="pull_request.updated"){const s=Ai(n.payloadJson);return n.artifactRef?r.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=Ai(n.payloadJson);return s?r.jsxs("span",{className:"text-sm",children:[r.jsx("span",{className:Rj[s.verdict]??"text-white/70",children:s.verdict.replace("_"," ")}),(l=s.findings)!=null&&l.length?` · ${s.findings.length} finding(s)`:""]}):null}if(n.type==="guidance.added"){const s=Ai(n.payloadJson);return s!=null&&s.markdown?r.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=Ai(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:r.jsxs("span",{className:"text-xs text-white/40",children:["· ",u.join(" · ")]})}return null}function Tj(n){var l;return((l=hd[n.type])==null?void 0:l.call(hd,n))??n.type}const Zx={human:"You",system:"System",developer:"Developer",reviewer:"Reviewer"},Oj={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 Mj(n){return n.actorRef?`${Zx[n.actorType]} · ${n.actorRef}`:Zx[n.actorType]}function Lj({events:n}){return n.length===0?r.jsx("p",{className:"text-white/40 text-sm",children:"No activity yet."}):r.jsx("div",{className:"space-y-1",children:n.map(l=>r.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-white/5 last:border-0",children:[r.jsx("span",{className:"text-xs text-white/35 w-20 shrink-0 tabular-nums",children:new Date(l.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:`text-[11px] leading-none px-1.5 py-0.5 rounded shrink-0 ${Oj[l.actorType]}`,children:Mj(l)}),r.jsx("span",{className:"text-sm text-white/80",children:Tj(l)}),r.jsx(Cj,{e:l})]},l.id))})}function Ua(n){if(n==null||!Number.isFinite(n))return null;if(n<1e3)return"<1s";const l=Math.round(n/1e3);if(l<60)return`${l}s`;const s=Math.floor(l/60);if(s<60){const f=l%60;return f===0?`${s}m`:`${s}m ${f}s`}const u=Math.floor(s/60),d=s%60;return d===0?`${u}h`:`${u}h ${d}m`}function Gx(n){return n==null||!Number.isFinite(n)?null:`${Math.round(n).toLocaleString("en-US")} tokens`}function Dj(n){return n==null||!Number.isFinite(n)?null:`$${n.toFixed(2)}`}const Uj={queue_wait:"Queue / admission wait",coordinator_setup:"Setup",agent_process:"Agent process",coordinator_validation_publish:"Validation / publish",coordinator_work:"Coordinator work"},Qx={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"},Md={worktree:"worktree",commit:"commit",verification_receipt:"verification receipt",publish_only:"publish-only result"},zj=new Set(["failed","timed_out","error"]);function af(n){return n.replace(/_/g," ")}function zs(n,l){const s=`Evidence quality: ${n}`;return l.length>0?`${s} — ${l.join(", ")}`:s}function Na({quality:n,reasons:l}){return r.jsxs("span",{className:`text-[11px] tabular-nums ${n==="exact"?"text-white/60":n==="inferred"?"text-amber-300/90":"text-white/60 italic"}`,title:zs(n,l),children:["· ",n,l.length>0&&r.jsxs("span",{className:"sr-only",children:[" (",l.join(", "),")"]})]})}function il({reasons:n}){const l=n.length>0?n.join(", "):"no reason recorded";return r.jsxs("span",{className:"text-white/45 italic",title:`Unavailable — ${l}`,children:["Unavailable",r.jsxs("span",{className:"text-[11px]",children:[" — ",l]})]})}function nu({covered:n,format:l,unit:s}){if(n.value==null)return r.jsx(il,{reasons:n.reasons});const u=n.known<n.total;return r.jsxs("span",{title:`${zs(n.quality,n.reasons)} · known ${n.known} of ${n.total} ${s}`,children:[l(n.value),r.jsx(Na,{quality:n.quality,reasons:n.reasons}),u&&r.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 Xx({cause:n,primary:l}){return r.jsxs("div",{className:l?"p-2.5 rounded border border-red-400/30 bg-red-500/10 space-y-1":"p-2 rounded border border-white/10 bg-white/[0.02] space-y-1",children:[r.jsxs("p",{className:l?"text-sm font-medium text-red-200":"text-xs text-white/60",children:[l?"First failure: ":"Consequence: ",af(n.code)]}),r.jsx("p",{className:l?"text-sm text-white/85 whitespace-pre-wrap break-words":"text-xs text-white/55 whitespace-pre-wrap break-words",children:n.rawReason}),r.jsxs("p",{className:"text-[11px] text-white/60",title:zs(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 Bj({interval:n}){const l=Qx[n.category??"unknown"]??Qx.unknown,s=Ua(n.durationMs),u=n.category==="host_suspended";return r.jsxs("li",{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 py-1 border-b border-white/5 last:border-0 ${u?"text-amber-200/90":"text-white/70"}`,children:[r.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded border shrink-0 ${u?"border-amber-400/40 bg-amber-500/10":"border-white/15 bg-white/5"}`,title:u?"Overlapping durable host-sleep evidence split this gap — the host was suspended, not the agent.":"Observational gap with no new structured activity — not a diagnosis of what the agent was doing.",children:l}),r.jsx("span",{className:"text-xs tabular-nums",children:s??r.jsx(il,{reasons:n.reasons})}),r.jsx(Na,{quality:n.quality,reasons:n.reasons})]})}function qj({attempt:n}){const l=n.reuseKinds;return l===void 0?r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60 italic",title:"Reuse unknown for this retry — no reuse evidence recorded.",children:"reuse unknown"}):l.length===0?r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60",title:"Cold retry — no prior worktree, commit, or verification was reused.",children:"cold retry"}):r.jsx(r.Fragment,{children:l.map(s=>r.jsxs("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 bg-cyber-teal/10 text-cyber-teal",title:`This retry preserved the prior ${Md[s]??s} instead of starting cold.`,children:["reused ",Md[s]??s]},s))})}function Hj({attempt:n,isRetry:l}){const s=Ua(n.setup.durationMs),u=Ua(n.agentProcess.durationMs),d=Ua(n.validationPublish.durationMs),f=l&&n.role==="developer";return r.jsxs("li",{className:"py-1.5 border-b border-white/5 last:border-0 space-y-0.5",children:[r.jsxs("p",{className:"text-sm text-white/85",children:[r.jsx("span",{className:"capitalize",children:n.role}),r.jsxs("span",{className:"text-white/45",children:[n.runtime?` · ${n.runtime}`:"",n.model?` · ${n.model}`:"",` · round ${n.round} · ${n.status}`]}),n.publishOnly&&r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-cyber-violet/40 bg-cyber-violet/10 text-cyber-violet-light",title:"Publish-only attempt: no agent process ran — the coordinator published prior work.",children:"publish-only"}),f&&!n.publishOnly&&r.jsx(qj,{attempt:n})]}),r.jsxs("p",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:s?void 0:`Setup unavailable — ${n.setup.reasons.join(", ")||"no reason recorded"}`,children:["Setup ",s??r.jsxs("span",{className:"italic",children:["Unavailable — ",n.setup.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:n.setup.quality,reasons:n.setup.reasons})," · ",r.jsxs("span",{title:u?void 0:`Agent process unavailable — ${n.agentProcess.reasons.join(", ")||"no reason recorded"}`,children:["Agent ",u??r.jsxs("span",{className:"italic",children:["Unavailable — ",n.agentProcess.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:n.agentProcess.quality,reasons:n.agentProcess.reasons})," · ",r.jsxs("span",{title:d?void 0:`Validation/publish unavailable — ${n.validationPublish.reasons.join(", ")||"no reason recorded"}`,children:["Validation/publish ",d??r.jsxs("span",{className:"italic",children:["Unavailable — ",n.validationPublish.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:n.validationPublish.quality,reasons:n.validationPublish.reasons})]}),n.failureCauses.length>0&&r.jsxs("p",{className:"text-[11px] text-white/60",children:["Failures: ",n.failureCauses.map(m=>af(m.code)).join(", ")]})]})}function $j({analysis:n}){const l=Ua(n.elapsed.durationMs),s=Ua(n.exclusiveTotalMs),u=Ua(n.firstCheckpoint.msSinceWorkflowStart),d=n.nested.filter(E=>E.kind!=="unexplained_silence"),f=n.attempts.flatMap(E=>E.silence),m=n.attempts.length>0&&n.attempts.every(E=>E.silence.length===0&&E.silenceQuality==="unavailable"),x=n.attempts.filter(E=>E.silence.length===0&&E.silenceQuality==="unavailable"),y=n.waste.failedAttempts>0||n.waste.publishOnlyAttempts>0||n.attempts.some(E=>E.failureCauses.length>0||zj.has(E.status)),v=Ua(n.humanWaitMs),w=n.retry.reuseRate==null?null:`${Math.round(n.retry.reuseRate*100)}% reused`,D=(n.retry.preservedKinds??[]).map(E=>Md[E]??E),X=n.waste.failedAttempts>0||n.waste.publishOnlyAttempts>0;return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:["Elapsed ",l??r.jsx(il,{reasons:n.elapsed.reasons}),r.jsx(Na,{quality:n.elapsed.quality,reasons:n.elapsed.reasons})]}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums",title:"Unioned top-level phases with overlaps removed (human wait excluded). Nested waits below explain phases — they are never added to this total.",children:["Exclusive phase total ",s??r.jsx(il,{reasons:n.exclusiveTotalReasons}),r.jsx(Na,{quality:n.exclusiveTotalQuality,reasons:n.exclusiveTotalReasons}),r.jsx("span",{children:" · overlaps unioned, not summed"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Phase breakdown"}),r.jsx("ul",{children:n.unionedDurations.map(E=>{const Y=Ua(E.durationMs);return r.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 py-0.5 text-sm",children:[r.jsx("span",{className:"text-white/70 w-36 shrink-0",children:Uj[E.phase]??E.phase}),r.jsx("span",{className:"text-white/85 tabular-nums",children:Y??r.jsx(il,{reasons:E.reasons})}),r.jsx(Na,{quality:E.quality,reasons:E.reasons}),E.known<E.total&&r.jsxs("span",{className:"text-[11px] text-white/60",children:["(known ",E.known," of ",E.total,")"]})]},E.phase)})}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums mt-1",children:["Human wait ",v??r.jsx(il,{reasons:n.humanWaitReasons}),r.jsx(Na,{quality:n.humanWaitQuality,reasons:n.humanWaitReasons}),r.jsx("span",{title:"Human wait is tracked separately — it never adds to the phase total.",children:" · never additive"})]}),d.length>0&&r.jsx("ul",{className:"mt-1",children:d.map((E,Y)=>r.jsxs("li",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:"Nested drill-down: explains its parent phase, never adds to the total.",children:["↳ ",E.kind==="human_wait"?"Human wait":E.category??E.kind]})," ",Ua(E.durationMs)??r.jsx(il,{reasons:E.reasons}),r.jsx(Na,{quality:E.quality,reasons:E.reasons})]},Y))})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Attempts (",n.attempts.length,")"]}),n.attempts.length===0?r.jsx("p",{className:"text-xs text-white/45 italic",children:"No attempts recorded yet."}):r.jsx("ul",{children:n.attempts.map((E,Y)=>r.jsx(Hj,{attempt:E,isRetry:Y>0},E.sessionId))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Failure"}),n.primaryFailure?r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Xx,{cause:n.primaryFailure,primary:!0}),n.consequenceCauses.length>0&&r.jsx("div",{className:"space-y-1 opacity-80",children:n.consequenceCauses.map((E,Y)=>r.jsx(Xx,{cause:E,primary:!1},`${E.code}-${Y}`))})]}):y?r.jsxs("p",{className:"text-sm text-white/60 italic",title:zs("unavailable",n.primaryFailureReasons),children:["Unknown — ",n.primaryFailureReasons.join(", ")||"no failure evidence recorded"]}):r.jsx("p",{className:"text-sm text-white/45",children:"No failure recorded."})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Retry waste (",n.waste.failedAttempts," failed attempt",n.waste.failedAttempts===1?"":"s",")"]}),X?r.jsxs("p",{className:"text-sm text-white/85 flex flex-wrap gap-x-3 gap-y-0.5 tabular-nums",children:[r.jsxs("span",{title:"Failed-attempt agent-process time over known values only",children:["Runtime ",r.jsx(nu,{covered:n.waste.runtimeMs,format:E=>Ua(Math.round(E))??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt input tokens over known values only",children:["In ",r.jsx(nu,{covered:n.waste.tokensIn,format:E=>Gx(E)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt output tokens over known values only",children:["Out ",r.jsx(nu,{covered:n.waste.tokensOut,format:E=>Gx(E)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt known cost over known values only",children:["Cost ",r.jsx(nu,{covered:n.waste.costUsd,format:E=>Dj(E)??"?",unit:"attempts"})]})]}):r.jsx("p",{className:"text-sm text-white/45",children:"No failed attempts — no retry waste."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"First checkpoint"}),n.firstCheckpoint.msSinceWorkflowStart==null&&n.firstCheckpoint.kind==null?r.jsxs("p",{className:"text-sm text-white/60 italic",title:zs(n.firstCheckpoint.quality,n.firstCheckpoint.reasons),children:["Unavailable — ",n.firstCheckpoint.reasons.join(", ")||"no checkpoint recorded"]}):r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:[n.firstCheckpoint.kind?af(n.firstCheckpoint.kind):"Checkpoint",n.firstCheckpoint.observedSha?` · ${n.firstCheckpoint.observedSha.slice(0,12)}`:"",u?` · ${u} after workflow start`:"",r.jsx(Na,{quality:n.firstCheckpoint.quality,reasons:n.firstCheckpoint.reasons})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Retry reuse"}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Retry reuse summary",children:[r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 bg-cyber-teal/10 text-cyber-teal",title:"Retries that preserved prior work — a reused worktree, commit, or verification receipt.",children:["Reused ",n.retry.reused]}),r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60",title:"Retries that started cold — no prior worktree, commit, or verification was reused.",children:["Cold ",n.retry.cold]}),n.retry.unknown>0&&r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60 italic",title:`Unknown reuse for ${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&&r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-violet/40 bg-cyber-violet/10 text-cyber-violet-light",title:"Publish-only retries ran no agent process — the coordinator published already-verified work.",children:["Publish-only ",n.retry.publishOnly]}),r.jsxs("span",{className:"text-[11px] text-white/60 tabular-nums self-center",children:[n.retry.retries===0?"No retries":w??r.jsx(il,{reasons:n.retry.reasons}),r.jsx(Na,{quality:n.retry.quality,reasons:n.retry.reasons})]})]}),r.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."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Silence"}),r.jsx("p",{className:"text-[11px] text-white/60 mb-1",children:"Silence is observational — gaps with no new structured activity. It describes what was observed, never a diagnosis."}),f.length===0?m?r.jsx("p",{className:"text-sm text-white/60 italic",children:"Unknown — silence cannot be derived without agent-process bounds."}):r.jsx("p",{className:"text-sm text-white/45",children:"No silence observed."}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{"aria-label":"Observed silence intervals",children:f.map((E,Y)=>r.jsx(Bj,{interval:E},Y))}),x.length>0&&r.jsx("ul",{"aria-label":"Attempts with unknown silence",className:"mt-1",children:x.map(E=>r.jsxs("li",{className:"text-[11px] text-white/60 italic py-0.5",children:["Silence unknown for attempt ",E.sessionId.length>12?`${E.sessionId.slice(0,8)}…`:E.sessionId," —"," ",E.silenceReasons.join(", ")||"no silence evidence recorded"]},E.sessionId))})]})]})]})}function Yj({issueId:n}){const[l,s]=b.useState(null),[u,d]=b.useState(null),[f,m]=b.useState(!0);return b.useEffect(()=>{s(null),d(null),m(!0);let x=!1;return Z2(n).then(y=>{x||(s(y),m(!1))}).catch(y=>{x||(/not found/i.test(String(y))?(s(null),d(null)):d(String(y).replace(/^Error:\s*/i,"")),m(!1))}),()=>{x=!0}},[n]),r.jsxs("section",{"aria-labelledby":"execution-analysis-heading",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03]",children:[r.jsx("h3",{id:"execution-analysis-heading",className:"font-ui-display text-sm font-medium text-white/85 mb-2",children:"Execution analysis"}),f&&r.jsx("p",{className:"text-xs text-white/40",children:"Loading execution analysis…"}),!f&&u&&r.jsx("p",{className:"text-xs text-red-300",children:u}),!f&&!u&&!l&&r.jsx("p",{className:"text-xs text-white/45",children:"No execution analysis yet — start the workflow to see where time goes."}),!f&&!u&&l&&r.jsx($j,{analysis:l})]})}const Vj="web";function Zj(n){try{const l=JSON.parse(n);return typeof l.text=="string"?l.text:JSON.stringify(l,null,2)}catch{return n}}function md(n){const l=Math.floor(n/6e4);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function Gj(n){if(!n)return"no heartbeat yet";const l=Math.max(0,Math.floor((Date.now()-new Date(n).getTime())/1e3));return l<5?"just now":l<60?`${l}s ago`:`${Math.floor(l/60)}m ago`}function Ts(n){if(!n)return null;const l=n.split(/[/\\]/).filter(Boolean);return l.length<=2?n:l.slice(-2).join("/")}function pd(n){var l;return[n.branch,n.tipLabel,(l=n.worktree)!=null&&l.path?Ts(n.worktree.path):null].filter(Boolean).join(" · ")}function xd(n){var l;return[n.restartRisk?"restart risk":null,(l=n.worktree)!=null&&l.preserved?"dirty worktree preserved":null].filter(Boolean).map(s=>` · ${s}`).join("")}function yd(n){var l;return!!(n.restartRisk||(l=n.worktree)!=null&&l.preserved)}function Qj(n,l){return!n||!l?!1:n===l?!0:n.includes(l)}function Xj({busy:n,onConfirm:l,onCancel:s}){return r.jsxs("div",{className:"mt-2 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-sm text-white/90 font-medium",children:"Close this issue?"}),r.jsx("p",{className:"text-sm text-white/70",children:"It will not execute. Any queue entry will be removed. History is retained and can be found as closed work — filter the Issues list by status closed or open this page directly."}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm rounded border border-red-400/50 text-red-200 hover:bg-red-500/20 disabled:opacity-50",disabled:n,onClick:l,children:"Close issue"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:s,children:"Keep issue"})]})]})}const Ij="Agents updated. Resume to continue with the new agents.";function Kj(n,l,s,u){const d={};return s!==(n??"")&&(d.developerAgentId=s),u!==(l??"")&&(d.reviewerAgentId=u),d}function Jj(n){const l=n.humanActions.find(s=>s.status==="open");if(l)return $y(l).title;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 Fj({issueId:n,detail:l,agents:s,onHumanActionsChanged:u,refresh:d,onError:f}){var dl;const[m,x]=b.useState(null),[y,v]=b.useState({}),[w,j]=b.useState(""),[D,X]=b.useState(!1),[E,Y]=b.useState(""),[M,$]=b.useState(""),[F,W]=b.useState(""),[se,Z]=b.useState(!1),[_e,I]=b.useState(null),[ye,ze]=b.useState(!1),[mt,wt]=b.useState(null),[st,dt]=b.useState(!1),[nt,Ve]=b.useState(!1),[U,J]=b.useState(null),[oe,Me]=b.useState({}),[Ue,_]=b.useState({}),z=Q=>f(String(Q)),{issue:B,timeline:ae,humanActions:he,usageSummary:P,readiness:re,humanWaitMs:Ze,interventionCount:Be,latestWorkflowInstance:$t,activeWorkerSession:Je,liveProgress:Jt,latestSessionFailure:St,branchTipStatus:Fe,queued:An,queueEntry:Ra,capWait:Wa}=l,Ca=s.find(Q=>Q.id===B.developerAgentId),qe=Ca&&!Ca.healthy,Dt=((dl=Ca==null?void 0:Ca.issues[0])==null?void 0:dl.message)??"Developer agent is unhealthy",Pa=$t?new Date($t.completedAt??Date.now()).getTime()-new Date($t.startedAt).getTime():0,ke=he.filter(Q=>Q.status==="open"),zl=B.status==="needs_human"&&ke.some(Q=>Q.actionType==="attempts_exhausted"||Q.actionType==="policy_escalation"),_t=re.ok===!1||ke.some(Q=>Q.actionType==="product_scope_decision"),Ta=$t!=null&&$t.completedAt===null,Bl=B.status==="ready"&&!Ta,kn=_t||Bl,En=(Je==null?void 0:Je.status)==="running",ul=B.source==="linear"&&B.status==="ready"&&!Ta&&!En,Ft=B.status==="ready"&&!Ta,en=B.status==="ready"&&!Ta,$a=Je&&Je.status==="running"&&(B.status==="developing"||B.status==="reviewing"||B.status==="repairing"),Ct=!!St&&!$a,Ae=async()=>{w.trim()&&(await tS(n,w),j(""),d())},Wt=()=>{Y(B.title),$(B.description??""),W(B.acceptanceCriteria??""),X(!0)},At=async()=>{Z(!0),f(null);try{await uu(n,{title:E.trim()||void 0,description:M.trim()||null,acceptanceCriteria:F.trim()||null}),X(!1),d()}catch(Q){z(Q)}finally{Z(!1)}},ql=async()=>{Z(!0),f(null);try{await I2(n),Ve(!1),d()}catch(Q){Ve(!1),z(Q),d()}finally{Z(!1)}},cl=async()=>{Z(!0),f(null);try{const Q=await av(n);I(Q.state==="admitted"?null:`Queued at position ${Q.position}${Q.waitReason?` — ${Q.waitReason}`:""}`),d()}catch(Q){z(Q)}finally{Z(!1)}},Mi=async()=>{Z(!0),f(null);try{await W2(n),d()}catch(Q){z(Q)}finally{Z(!1)}},Rn=async()=>{Z(!0),f(null);try{await nv(n),I(null),ze(!1),d()}catch(Q){z(Q),d()}finally{Z(!1)}},Cn=async(Q,je,tt)=>{Z(!0),f(null);try{await uu(n,{repo:Q,developerAgentId:je,reviewerAgentId:tt}),ze(!1),d()}catch(kt){ze(!1),z(kt),d()}finally{Z(!1)}},pt=async(Q,je)=>{Z(!0),f(null);try{await uu(n,Kj(B.developerAgentId,B.reviewerAgentId,Q,je)),wt(Ij),d()}catch(tt){z(tt),d()}finally{Z(!1)}},ca=async()=>{Z(!0),f(null);try{await J2(n),u(),d()}catch(Q){z(Q)}finally{Z(!1)}},Tn=async()=>{Z(!0),f(null);try{await lv(n),d()}catch(Q){z(Q)}finally{Z(!1)}},tn=async()=>{Z(!0),f(null);try{await F2(n),dt(!1),J("Issue closed — it will not execute. History is retained and can be found as closed work."),d()}catch(Q){z(Q)}finally{Z(!1)}},Li=async()=>{if(confirm("Abort this workflow? The current worker will stop and the issue will close. History and evidence are kept.")){Z(!0),f(null);try{await K2(n),d()}catch(Q){z(Q)}finally{Z(!1)}}},On=async(Q,je,tt)=>{Z(!0),f(null);try{await iv(Q,Vj,je,tt),u(),d()}catch(kt){z(kt)}finally{Z(!1)}},ol=()=>{m||G2(n).then(x).catch(Q=>z(Q))},Ya=Q=>{y[Q]||(v(je=>({...je,[Q]:{content:"",loading:!0}})),Q2(n,Q).then(je=>v(tt=>({...tt,[Q]:{content:je.content,loading:!1}}))).catch(je=>v(tt=>({...tt,[Q]:{content:"",loading:!1,error:String(je)}}))))};return r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:r.jsxs("div",{className:"max-w-3xl",children:[r.jsx(ra,{to:"/issues",className:"font-ui-display inline-block text-sm text-white/50 hover:text-white mb-3",children:"← Issues"}),r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-white/90",children:B.title}),r.jsxs("p",{className:"text-xs text-white/45 mt-1",children:["Owner: ",r.jsx("span",{className:"capitalize",children:B.currentOwner}),B.currentIntent?` · ${B.currentIntent}`:""]}),r.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-white/40",children:[B.prUrl&&r.jsxs("a",{href:B.prUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:["PR #",B.prNumber]}),B.externalUrl&&r.jsx("a",{href:B.externalUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:B.externalLabel??"External link"}),r.jsxs("span",{children:["Round ",B.currentRound,"/",B.maxReviewRounds]}),r.jsxs("span",{children:["Infra attempts ",B.infraAttempts,"/",B.maxInfraAttempts]}),r.jsxs("span",{title:"Wall-clock time from workflow start to completion (or now)",children:[md(Pa)," elapsed"]}),r.jsxs("span",{title:`${P.totalTokensIn} in / ${P.totalTokensOut} out tokens`,children:["$",P.totalCostUsd.toFixed(2)]}),Ze>0&&r.jsxs("span",{title:"Time spent waiting on a human, excluding autonomous processing",children:[md(Ze)," human wait"]}),Be>0&&r.jsxs("span",{children:[Be," intervention",Be===1?"":"s"]})]})]}),r.jsx(cv,{status:B.status})]}),U&&r.jsx("div",{className:"mb-4 p-3 rounded border border-white/15 bg-white/[0.04]",children:r.jsx("p",{className:"text-sm text-white/85",children:U})}),r.jsx(_j,{issue:B,agents:s,canEdit:en,editing:ye,busy:se,onBeginEdit:()=>ze(!0),onSave:(Q,je,tt)=>void Cn(Q,je,tt),onCancel:()=>ze(!1)}),B.executionContract&&r.jsx(Aj,{contract:B.executionContract}),r.jsx(Ej,{attachments:l.sourceAttachments}),r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/40 flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-white/45",children:"Next"}),r.jsx("p",{className:"text-sm text-white/85",children:Jj(l)})]}),Ta&&r.jsx("button",{type:"button",className:"btn-ghost-danger px-3 py-1.5 text-xs shrink-0 disabled:cursor-not-allowed disabled:opacity-60",disabled:se,onClick:Li,children:"Abort workflow"})]}),Ra&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5",children:[r.jsxs("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:["Queued · position ",Ra.position]}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5",children:Ra.waitReason??"Next up — starts as soon as the coordinator ticks"})]}),Wa&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10 flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-xs text-amber-300 font-medium uppercase tracking-wide",children:Wa.kind==="usage_capped"?"Waiting on usage cap":"Waiting on Agent Deck"}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5 break-words",children:Wa.reason}),r.jsxs("p",{className:"text-xs text-white/45 mt-0.5",children:["Wait until ",new Date(Wa.until).toLocaleString()]})]}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1.5 text-xs shrink-0 disabled:opacity-50",disabled:se,title:"Park this issue for a human — cancels the wait without touching the worktree; a resume continues with whichever agents are then set",onClick:ca,children:"Park for human"})]}),$a&&Je&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/35 bg-cyber-teal/5 space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-cyber-teal animate-pulse","aria-hidden":!0}),r.jsx("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:"Running now"})]}),r.jsxs("p",{className:"text-sm text-white/90",children:[r.jsx("span",{className:"capitalize",children:Je.role}),Je.runtime?` · ${Je.runtime}`:"",Je.model?` · ${Je.model}`:"",` · round ${Je.round}`]}),r.jsxs("p",{className:"text-sm text-[#C4B643] truncate",title:Jt??B.currentIntent??"session started",children:["Last progress: ",Jt??B.currentIntent??"session started"]}),Fe&&r.jsxs("p",{className:`text-xs ${yd(Fe)?"text-amber-300":"text-white/55"}`,title:pd(Fe),children:["Branch tip: ",Fe.tipLabel,xd(Fe)]}),Jt&&B.currentIntent&&!/session running/i.test(B.currentIntent)&&!Qj(B.currentIntent,Jt)&&r.jsx("p",{className:"text-xs text-white/45 truncate",title:B.currentIntent,children:B.currentIntent}),r.jsxs("p",{className:"text-xs text-white/45",children:["Heartbeat ",Gj(Je.heartbeatAt),Ts(Je.worktreePath)?` · ${Ts(Je.worktreePath)}`:""]}),Je.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:Je.logPath,children:["Log: ",Ts(Je.logPath)??Je.logPath]})]}),Ct&&St&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-1.5",children:[r.jsx("p",{className:"text-xs text-red-300 font-medium uppercase tracking-wide",children:"Latest session failure"}),r.jsx("p",{className:"text-sm text-white/90 whitespace-pre-wrap break-words",children:St.reason}),r.jsxs("p",{className:"text-xs text-white/45",children:[St.role?r.jsx("span",{className:"capitalize",children:St.role}):"Worker",St.outcome?` · ${St.outcome}`:"",` · ${new Date(St.when).toLocaleString()}`,` · infra ${St.infraAttempts}/${St.maxInfraAttempts}`]}),Fe&&r.jsxs("p",{className:`text-xs ${yd(Fe)?"text-amber-300":"text-white/55"}`,title:pd(Fe),children:["Branch tip: ",Fe.tipLabel,xd(Fe)]}),St.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:St.logPath,children:["Log: ",Ts(St.logPath)??St.logPath]})]}),Fe&&!$a&&!Ct&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Branch tip"}),r.jsxs("p",{className:`text-sm ${yd(Fe)?"text-amber-300":"text-white/80"}`,title:pd(Fe),children:[Fe.tipLabel,xd(Fe)]})]}),!re.ok&&!ke.some(Q=>Q.actionType==="product_scope_decision")&&r.jsx("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10",children:r.jsxs("p",{className:"text-xs text-amber-300 font-medium",children:["Not startable yet — missing: ",re.missing.join(", ")]})}),ke.length>0&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-xs text-red-300 font-medium",children:"Human action needed"}),ke.map(Q=>{const je=Q.actionType==="product_scope_decision";if(Q.actionType==="operator_verification"){const tt=sj(Q),kt=Ue[Q.id]??"",Va=kt.trim().length>0;return r.jsx(Ms,{action:Q,hideChoicesHint:!0,children:r.jsxs("div",{className:"space-y-1",children:[r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Result note (required) — paste the probe output, waiver reason, or repair note",value:kt,disabled:se,onChange:jt=>_(oa=>({...oa,[Q.id]:jt.target.value}))}),r.jsx("div",{className:"flex flex-wrap gap-2",children:tt.map(jt=>r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs disabled:opacity-50",disabled:se||!Va,title:Va?void 0:"Enter the result note first — the server requires it",onClick:()=>On(Q.id,jt.choice,kt),children:jt.label},jt.choice))})]})},Q.id)}return je?r.jsx(Ms,{action:Q,hideChoicesHint:!0,children:re.ok&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Decision note (optional) — shown to the next developer round",value:oe[Q.id]??"",disabled:se,onChange:tt=>Me(kt=>({...kt,[Q.id]:tt.target.value}))}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs",disabled:se,onClick:()=>On(Q.id,"resume",oe[Q.id]),children:"Resume"})]})},Q.id):r.jsx(Ms,{action:Q,disabled:se,onChoose:tt=>On(Q.id,tt)},Q.id)})]}),zl&&r.jsx("div",{className:"mb-4",children:r.jsx(pv,{variant:"parked",agents:s,initialDeveloperId:B.developerAgentId,initialReviewerId:B.reviewerAgentId,busy:se,notice:mt,onSave:(Q,je)=>void pt(Q,je)},`${B.developerAgentId??""}:${B.reviewerAgentId??""}`)}),(kn||ul)&&!D&&!nt&&r.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-1",children:[kn&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",onClick:Wt,children:"Edit title / description / acceptance criteria"}),ul&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",title:"Pull the latest title, description, and acceptance criteria from the linked Linear ticket — local edits will be replaced",onClick:()=>Ve(!0),children:"Reload from Linear"})]}),ul&&nt&&!D&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5 space-y-2",children:[r.jsxs("p",{className:"text-sm text-white/90 font-medium",children:["Reload the latest task text from Linear",B.externalLabel?` ${B.externalLabel}`:"","?"]}),r.jsx("p",{className:"text-sm text-white/70",children:"This replaces the local title, description, and acceptance criteria with the latest ticket text. Local edits will be lost. Repository, agents, and queue position are unchanged, and nothing is written back to Linear."}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:se,onClick:ql,children:"Reload from Linear"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>Ve(!1),children:"Cancel"})]})]}),D&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:E,onChange:Q=>Y(Q.target.value),placeholder:"Title"}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:M,onChange:Q=>$(Q.target.value),placeholder:"Description"}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:F,onChange:Q=>W(Q.target.value),placeholder:"Acceptance criteria"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm",disabled:se,onClick:At,children:"Save"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>X(!1),children:"Cancel"})]})]}),(B.status==="ready"||B.status==="needs_human"&&ke.length===0)&&r.jsxs("div",{className:"mb-4 space-y-2",children:[qe&&r.jsxs("p",{className:"text-sm text-amber-200/90",children:["Fix before Start: ",Dt]}),_e&&r.jsx("p",{className:"text-sm text-amber-200/90",children:_e}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-2 disabled:opacity-50",disabled:!re.ok||se||!!qe,title:qe?Dt:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:cl,children:"Run next"}),r.jsx("button",{type:"button",className:"px-4 py-2 text-sm border border-cyber-teal/40 rounded text-cyber-teal hover:bg-cyber-teal/10 disabled:opacity-50",disabled:!re.ok||se||!!qe,title:qe?Dt:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:Rn,children:"Execute now"}),An?r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm border border-white/15 rounded text-white/60 hover:text-white disabled:opacity-50",disabled:se,onClick:Tn,children:"Remove from queue"}):r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm border border-white/15 rounded text-white/80 hover:border-cyber-teal/50 hover:text-cyber-teal disabled:opacity-50",disabled:se||Ta,title:"Add to queue — append to the end of the admission queue; does not start anything now",onClick:Mi,children:"Add to queue"})]}),An&&en&&!ye&&r.jsx("p",{className:"text-xs text-white/40",children:"Queued — edit repository / agents from the Configuration section above; position is kept."})]}),r.jsx(Yj,{issueId:n}),r.jsx("div",{className:"border-t border-white/10 pt-3",children:r.jsx(Lj,{events:ae})}),r.jsxs("div",{className:"mt-4 flex gap-2",children:[r.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Guide this issue…",value:w,onChange:Q=>j(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ae()}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:Ae,children:"Send"})]}),Ft&&r.jsxs("details",{className:"mt-6",children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"More actions"}),r.jsxs("div",{className:"mt-2 space-y-2",children:[r.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."}),st?r.jsx(Xj,{busy:se,onConfirm:()=>void tn(),onCancel:()=>dt(!1)}):r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/50 hover:text-red-300 underline underline-offset-2 disabled:opacity-50",disabled:se,title:"Retire this issue without running it — removes any queue entry, keeps history as closed work",onClick:()=>dt(!0),children:"Close issue"})]})]}),r.jsxs("details",{className:"mt-6",onToggle:Q=>Q.currentTarget.open&&ol(),children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Evidence & raw trace"}),m?r.jsxs("div",{className:"mt-2 space-y-3 text-xs text-white/60",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45 mb-1",children:"Worker sessions"}),m.workerSessions.map(Q=>{const je=m.usageEvents.filter(jt=>jt.workerSessionId===Q.id),tt=je.reduce((jt,oa)=>jt+(oa.costUsd??0),0),kt=je.reduce((jt,oa)=>jt+(oa.tokensIn??0),0),Va=je.reduce((jt,oa)=>jt+(oa.tokensOut??0),0);return r.jsxs("p",{children:[Q.role," round ",Q.round," · ",Q.status,Q.startedAt&&Q.completedAt?` · ${md(new Date(Q.completedAt).getTime()-new Date(Q.startedAt).getTime())}`:"",je.length>0?` · $${tt.toFixed(3)} · ${kt}→${Va} tok`:""]},Q.id)}),m.workerSessions.length===0&&r.jsx("p",{className:"text-white/35",children:"None yet."})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45 mb-1",children:"Artifacts"}),m.artifacts.map(Q=>{const je=y[Q.id];return r.jsxs("details",{className:"mb-1.5",onToggle:tt=>tt.currentTarget.open&&Q.blobPath&&Ya(Q.id),children:[r.jsxs("summary",{className:"cursor-pointer hover:text-white/80",children:[Q.kind," · ",new Date(Q.createdAt).toLocaleString()]}),r.jsxs("div",{className:"mt-1 pl-3 border-l border-white/10 space-y-1",children:[Q.contentJson&&r.jsx("pre",{className:"whitespace-pre-wrap break-words text-white/55",children:Zj(Q.contentJson)}),Q.blobPath&&r.jsxs("div",{children:[r.jsxs("p",{className:"text-white/40",children:["Raw trace: ",Q.blobPath]}),(je==null?void 0:je.loading)&&r.jsx("p",{className:"text-white/35",children:"Loading trace…"}),(je==null?void 0:je.error)&&r.jsx("p",{className:"text-red-300/80",children:je.error}),je&&!je.loading&&!je.error&&r.jsx("pre",{className:"mt-1 max-h-64 overflow-y-auto whitespace-pre-wrap break-words text-white/50 bg-black/20 rounded p-2",children:je.content||"(empty)"})]}),!Q.contentJson&&!Q.blobPath&&r.jsx("p",{className:"text-white/35",children:"No content recorded."})]})]},Q.id)}),m.artifacts.length===0&&r.jsx("p",{className:"text-white/35",children:"None yet."})]})]}):r.jsx("p",{className:"text-xs text-white/40 mt-2",children:"Loading…"})]})]})})}function Wj({issueId:n,agents:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=b.useState(!1),v=()=>tv(n).then(w=>{d(w),m(null),y(!1)}).catch(w=>{const j=String(w).replace(/^Error:\s*/i,"").trim();/^not found$/i.test(j)?(y(!0),m(null),d(null)):(m(j),y(!1))});return b.useEffect(()=>{d(null),m(null),y(!1),v();const w=setInterval(v,4e3);return()=>clearInterval(w)},[n]),x?r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:r.jsxs("div",{className:"max-w-md space-y-3",children:[r.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Issue not found"}),r.jsx("p",{className:"text-sm text-white/55",children:"No issue exists for this ID — it may have been deleted, or the link is wrong."}),r.jsx(ra,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})}):f?r.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-6 space-y-3",children:[r.jsx("p",{className:"text-red-300 text-sm",children:f}),r.jsx(ra,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]}):u?r.jsx(Fj,{issueId:n,detail:u,agents:l,onHumanActionsChanged:s,refresh:v,onError:w=>m(w)},n):r.jsx("div",{className:"p-6 text-white/50 text-sm",children:"Loading…"})}function Pj(){return r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:r.jsxs("div",{className:"max-w-md space-y-3",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Page not found"}),r.jsx("p",{className:"text-sm text-white/55",children:"That URL is not a destination in Agent Dealer."}),r.jsx(ra,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})})}function eN(){return r.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0 overflow-hidden","aria-hidden":!0,children:[r.jsx("div",{className:"absolute top-16 left-12",children:r.jsx("div",{className:"ambient-orb ambient-orb-a w-[26rem] h-[26rem] rounded-full bg-cyan-500/10 blur-3xl"})}),r.jsx("div",{className:"absolute bottom-20 right-12",children:r.jsx("div",{className:"ambient-orb ambient-orb-b w-[26rem] h-[26rem] rounded-full bg-pink-500/10 blur-3xl"})}),r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:r.jsx("div",{className:"ambient-orb ambient-orb-c w-[22rem] h-[22rem] rounded-full bg-blue-500/[0.07] blur-3xl"})})]})}function tN({className:n="w-5 h-5"}){return r.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:n,"aria-hidden":!0,children:[r.jsx("circle",{cx:"6.75",cy:"6.25",r:"3.25"}),r.jsx("circle",{cx:"13.5",cy:"6.75",r:"2.85",opacity:"0.85"}),r.jsx("path",{d:"M1.75 16v-1.1c0-2.35 1.928-4.25 4.3-4.25 1.16 0 2.21.456 3 1.2.79-.744 1.84-1.2 3-1.2 2.372 0 4.3 1.9 4.3 4.25V16H1.75z"})]})}const aN="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 nN({className:n="",size:l=36}){return r.jsx("img",{src:aN,alt:"",width:l,height:l,className:`shrink-0 object-contain ${n}`,"aria-hidden":!0,draggable:!1})}const ju={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},Ix="5H",Kx="1W",lN=new Set(["claude_code","codex_local","muse_code"]),iN="billing_cycle",sN="1M",rN=new Set(Ht.options),uN={critical:"font-medium text-red-300",warning:"font-medium text-yellow-300",normal:"font-medium text-white/75"};function cN(n){return{fiveHour:n.find(l=>l.criticalRole==="five_hour")??null,weekly:n.find(l=>l.criticalRole==="weekly")??null}}function xv(n,l,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<=l)return"expired"}if(n.freshUntil!==null){const u=Date.parse(n.freshUntil);if(!Number.isFinite(u)||u<=l)return"stale"}if(n.expiresAt!==null){const u=Date.parse(n.expiresAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(n.observedAt){const u=Date.parse(n.observedAt);if(!Number.isFinite(u)||u>l+6e4)return"stale"}return s??"missing"}function Jx(n,l,s,u,d=null){if(Yy(n,l)){const f=Math.round(n.remainingPercent??0),m=n.resetAt?`, resets ${new Date(n.resetAt).toLocaleString()}`:"",x=d?`, ${d}`:"";return`${u}: ${f}% available (${100-f}% used${x}${m})`}return`${u}: N/A (${ju[xv(n,l,s)]})`}function Ld(n,l,s,u,d,f=null){if(Yy(n,s)){const x=n.remainingPercent??0;return{key:n.windowKey,label:d,kind:"known",remaining:Math.round(x),rawRemaining:x,detail:Jx(n,s,l.unavailableReason,d,f),isCritical:u}}const m=xv(n,s,l.unavailableReason);return{key:n.windowKey,label:d,kind:"unknown",reason:m,detail:Jx(n,s,l.unavailableReason,d,f),isCritical:u}}function Fx(n,l){const s=l.unavailableReason??"missing";return{key:`missing:${n}`,label:n,kind:"unknown",reason:s,detail:`${n}: N/A (${ju[s]})`,isCritical:!0}}function oN(n,l,s){return Ld(n,l,s,!0,sN,"current billing cycle")}function dN(n,l=Date.now()){return n.runtimes.map(s=>{const u=Aa(s.runtime),d=s.runtime;if(s.runtime==="cursor_local"){const f=s.windows.find(x=>x.windowKey===iN)??null;if(f===null)return{runtime:u,runtimeKey:d,windows:[],exhausted:!1,detail:`N/A (${ju[s.unavailableReason??"missing"]})`};const m=oN(f,s,l);return{runtime:u,runtimeKey:d,windows:[m],exhausted:m.kind==="known"&&m.rawRemaining===0,detail:m.detail}}if(lN.has(s.runtime)){const{fiveHour:f,weekly:m}=cN(s.windows),x=f!==null?Ld(f,s,l,!0,Ix):Fx(Ix,s),y=m!==null?Ld(m,s,l,!0,Kx):Fx(Kx,s),v=[x,y],w=v.some(D=>D.kind==="known"&&D.rawRemaining===0),j=v.map(D=>D.detail).join("; ");return{runtime:u,runtimeKey:d,windows:v,exhausted:w,detail:j}}return{runtime:u,runtimeKey:d,windows:[],exhausted:!1,detail:`N/A (${ju[s.unavailableReason??"missing"]})`}})}function Wx(n){return n.exhausted?`${n.runtime} exhausted — a capacity window is at 0%: ${n.detail}`:`${n.runtime}: ${n.detail}`}function fN({state:n,nowMs:l}){if(n.status==="loading")return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":"loading",title:"Agent capacity is loading",className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-2 gap-y-1 whitespace-nowrap text-xs text-white/40",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),r.jsx("span",{"aria-live":"polite",children:"loading…"})]});if(n.status==="unavailable")return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":"unavailable",title:"Agent capacity is unavailable — the capacity read failed",className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-2 gap-y-1 whitespace-nowrap text-xs text-white/40",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),r.jsx("span",{children:"unavailable"})]});const s=dN(n.data,l),u=s.length===0||s.every(d=>!d.windows.some(f=>f.kind==="known"));return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":u?"unknown":"ready",title:s.length===0?"Agent capacity: no runtime accounts reported":s.map(Wx).join(" · "),className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),s.length===0?r.jsx("span",{className:"whitespace-nowrap text-white/35",children:"N/A"}):s.map(d=>{const f=d.windows.some(m=>m.kind==="known");return r.jsxs("span",{"data-testid":`topbar-capacity-${d.runtime}`,"data-known":f?"true":"false","data-exhausted":d.exhausted?"true":"false",title:Wx(d),role:"group","aria-label":`${rN.has(d.runtimeKey)?d.runtime:"Unknown runtime"} capacity`,className:d.exhausted?"inline-flex items-center gap-1.5 whitespace-nowrap rounded border border-red-400/40 bg-red-500/10 px-1.5 py-0.5":"inline-flex items-center gap-1.5 whitespace-nowrap",children:[r.jsx(uv,{runtime:d.runtimeKey,className:"h-4 w-4 shrink-0"}),d.windows.length===0?r.jsx("span",{className:"text-white/35",children:"N/A"}):r.jsx("span",{className:"inline-flex flex-col leading-tight",children:d.windows.map(m=>r.jsxs("span",{"data-window":m.label,"data-window-known":m.kind==="known"?"true":"false",className:"inline-flex items-center gap-1 whitespace-nowrap tabular-nums",children:[r.jsx("span",{className:"text-white/40",children:m.label}),m.kind==="known"?(()=>{const x=sv(m.rawRemaining);return r.jsxs("span",{"data-severity":x,className:uN[x],children:[m.remaining,"%"]})})():r.jsx("span",{className:"text-white/35",children:"N/A"})]},m.key))})]},d.runtime)})]})}const Px=5e3;function vd({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 hN({agents:n,onHumanActionsChanged:l}){const{issueId:s}=jb();return s?r.jsx(Wj,{issueId:s,agents:n,onHumanActionsChanged:l},s):r.jsx(vy,{to:"/issues",replace:!0})}function mN({openHumanActionCount:n,agentCount:l,agentIssueCount:s,capacity:u={status:"loading"}}){return r.jsxs("header",{className:"px-6 py-3 border-b border-white/10 flex flex-wrap gap-4 items-center justify-between glass-header shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-6",children:[r.jsxs(ra,{to:"/issues",className:"flex items-center gap-3 text-left rounded hover:opacity-90 transition-opacity focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45","aria-label":"AgentDealer — go to Issues",title:"AgentDealer — go to Issues",children:[r.jsx(nN,{size:40}),r.jsx("h1",{className:"font-mono text-xl font-bold sm:text-2xl",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDealer"})]}),r.jsxs("nav",{className:"flex gap-1",children:[r.jsxs(su,{to:"/issues",className:vd,children:["Issues",n>0&&r.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-0.5 font-mono text-xs leading-none bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded tabular-nums border border-red-400/30 align-middle",title:`${n} open human action${n===1?"":"s"}`,children:[r.jsx(wu,{className:"w-3 h-3 shrink-0"}),n]})]}),r.jsx(su,{to:"/reports/execution",className:vd,children:"Reports"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 min-w-0",children:[r.jsx(fN,{state:u}),r.jsxs(su,{to:"/agents",className:({isActive:d})=>`${vd({isActive:d})} inline-flex items-center gap-1.5 transition-colors`,"aria-label":"Agents",title:"Agents",children:[r.jsx(tN,{className:"w-6 h-6 shrink-0"}),r.jsx("span",{children:"Agents"}),l>0&&r.jsx("span",{className:"font-mono text-xs leading-none bg-white/10 text-white/55 px-1.5 py-0.5 rounded tabular-nums border border-white/10",title:`${l} configured agent${l===1?"":"s"}`,children:l}),s>0&&r.jsxs("span",{className:"inline-flex items-center gap-0.5 font-mono text-xs leading-none bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded tabular-nums border border-red-400/30",title:`${s} need${s===1?"s":""} attention`,children:[r.jsx(wu,{className:"w-3 h-3 shrink-0"}),s]})]})]})]})}function pN(){const[n,l]=b.useState([]),[s,u]=b.useState(0),[d,f]=b.useState(!1),[m,x]=b.useState([]),[y,v]=b.useState({status:"loading"}),w=b.useCallback(()=>{U2().then(({agents:E,issueCount:Y})=>{l(E),u(Y)}).catch(console.error),ev().then(E=>f(E.connected)).catch(()=>f(!1)),Py().then(E=>v({status:"ready",data:E})).catch(()=>v({status:"unavailable"}))},[]),j=b.useCallback(()=>nS().then(x).catch(()=>{}),[]);b.useEffect(()=>{w();const E=setInterval(w,Px);return()=>clearInterval(E)},[w]),b.useEffect(()=>{j();const E=setInterval(()=>void j(),Px);return()=>clearInterval(E)},[j]);const D=m.length,X=n.length;return r.jsxs(r.Fragment,{children:[r.jsx(eN,{}),r.jsxs("div",{className:"relative z-10 min-h-screen flex flex-col",children:[r.jsx(mN,{openHumanActionCount:D,agentCount:X,agentIssueCount:s,capacity:y}),r.jsx("main",{className:"flex-1 flex overflow-hidden",children:r.jsxs(Bb,{children:[r.jsx(Rl,{path:"/",element:r.jsx(vy,{to:"/issues",replace:!0})}),r.jsx(Rl,{path:"/issues",element:r.jsx(fj,{agents:n,humanActions:m,onHumanActionsChanged:j})}),r.jsx(Rl,{path:"/issues/:issueId",element:r.jsx(hN,{agents:n,onHumanActionsChanged:j})}),r.jsx(Rl,{path:"/agents",element:r.jsx(CS,{agents:n,agentDeckOnline:d,onRefresh:w})}),r.jsx(Rl,{path:"/reports/execution",element:r.jsx(jj,{})}),r.jsx(Rl,{path:"*",element:r.jsx(Pj,{})})]})})]})]})}function xN(){return typeof document>"u"?Promise.resolve():document.fonts.load('13px "Monaco"').then(()=>{}).catch(()=>{})}xN();z0.createRoot(document.getElementById("root")).render(r.jsx(b.StrictMode,{children:r.jsx(c1,{children:r.jsx(pN,{})})}));
|