gossipcat 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist-dashboard/assets/index-BSpZTn_T.js +78 -0
- package/dist-dashboard/assets/index-D622Bi2n.css +1 -0
- package/dist-dashboard/index.html +2 -2
- package/dist-mcp/mcp-server.js +2872 -1809
- package/docs/HANDBOOK.md +13 -0
- package/package.json +3 -2
- package/dist-dashboard/assets/index-BggwL1Da.css +0 -1
- package/dist-dashboard/assets/index-BxhrNkau.js +0 -78
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var Yp=Object.defineProperty;var Xp=(i,r,u)=>r in i?Yp(i,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[r]=u;var tt=(i,r,u)=>Xp(i,typeof r!="symbol"?r+"":r,u);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const v of m.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function u(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(d){if(d.ep)return;d.ep=!0;const m=u(d);fetch(d.href,m)}})();var Fr={exports:{}},as={};/**
|
|
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 Mm;function Vp(){if(Mm)return as;Mm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(o,d,m){var v=null;if(m!==void 0&&(v=""+m),d.key!==void 0&&(v=""+d.key),"key"in d){m={};for(var p in d)p!=="key"&&(m[p]=d[p])}else m=d;return d=m.ref,{$$typeof:i,type:o,key:v,ref:d!==void 0?d:null,props:m}}return as.Fragment=r,as.jsx=u,as.jsxs=u,as}var Am;function Qp(){return Am||(Am=1,Fr.exports=Vp()),Fr.exports}var a=Qp(),Ir={exports:{}},he={};/**
|
|
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 wm;function Zp(){if(wm)return he;wm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),v=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),O=Symbol.iterator;function Q(y){return y===null||typeof y!="object"?null:(y=O&&y[O]||y["@@iterator"],typeof y=="function"?y:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,M={};function I(y,R,V){this.props=y,this.context=R,this.refs=M,this.updater=V||L}I.prototype.isReactComponent={},I.prototype.setState=function(y,R){if(typeof y!="object"&&typeof y!="function"&&y!=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,y,R,"setState")},I.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function K(){}K.prototype=I.prototype;function ee(y,R,V){this.props=y,this.context=R,this.refs=M,this.updater=V||L}var J=ee.prototype=new K;J.constructor=ee,X(J,I.prototype),J.isPureReactComponent=!0;var A=Array.isArray;function q(){}var w={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function te(y,R,V){var G=V.ref;return{$$typeof:i,type:y,key:R,ref:G!==void 0?G:null,props:V}}function ne(y,R){return te(y.type,R,y.props)}function de(y){return typeof y=="object"&&y!==null&&y.$$typeof===i}function F(y){var R={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(V){return R[V]})}var ae=/\/+/g;function me(y,R){return typeof y=="object"&&y!==null&&y.key!=null?F(""+y.key):R.toString(36)}function E(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(q,q):(y.status="pending",y.then(function(R){y.status==="pending"&&(y.status="fulfilled",y.value=R)},function(R){y.status==="pending"&&(y.status="rejected",y.reason=R)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function T(y,R,V,G,le){var re=typeof y;(re==="undefined"||re==="boolean")&&(y=null);var ve=!1;if(y===null)ve=!0;else switch(re){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(y.$$typeof){case i:case r:ve=!0;break;case b:return ve=y._init,T(ve(y._payload),R,V,G,le)}}if(ve)return le=le(y),ve=G===""?"."+me(y,0):G,A(le)?(V="",ve!=null&&(V=ve.replace(ae,"$&/")+"/"),T(le,R,V,"",function(qt){return qt})):le!=null&&(de(le)&&(le=ne(le,V+(le.key==null||y&&y.key===le.key?"":(""+le.key).replace(ae,"$&/")+"/")+ve)),R.push(le)),1;ve=0;var Re=G===""?".":G+":";if(A(y))for(var Me=0;Me<y.length;Me++)G=y[Me],re=Re+me(G,Me),ve+=T(G,R,V,re,le);else if(Me=Q(y),typeof Me=="function")for(y=Me.call(y),Me=0;!(G=y.next()).done;)G=G.value,re=Re+me(G,Me++),ve+=T(G,R,V,re,le);else if(re==="object"){if(typeof y.then=="function")return T(E(y),R,V,G,le);throw R=String(y),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return ve}function H(y,R,V){if(y==null)return y;var G=[],le=0;return T(y,G,"","",function(re){return R.call(V,re,le++)}),G}function W(y){if(y._status===-1){var R=y._result;R=R(),R.then(function(V){(y._status===0||y._status===-1)&&(y._status=1,y._result=V)},function(V){(y._status===0||y._status===-1)&&(y._status=2,y._result=V)}),y._status===-1&&(y._status=0,y._result=R)}if(y._status===1)return y._result.default;throw y._result}var ce=typeof reportError=="function"?reportError:function(y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof y=="object"&&y!==null&&typeof y.message=="string"?String(y.message):String(y),error:y});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",y);return}console.error(y)},ue={map:H,forEach:function(y,R,V){H(y,function(){R.apply(this,arguments)},V)},count:function(y){var R=0;return H(y,function(){R++}),R},toArray:function(y){return H(y,function(R){return R})||[]},only:function(y){if(!de(y))throw Error("React.Children.only expected to receive a single React element child.");return y}};return he.Activity=S,he.Children=ue,he.Component=I,he.Fragment=u,he.Profiler=d,he.PureComponent=ee,he.StrictMode=o,he.Suspense=x,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,he.__COMPILER_RUNTIME={__proto__:null,c:function(y){return w.H.useMemoCache(y)}},he.cache=function(y){return function(){return y.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(y,R,V){if(y==null)throw Error("The argument must be a React element, but you passed "+y+".");var G=X({},y.props),le=y.key;if(R!=null)for(re in R.key!==void 0&&(le=""+R.key),R)!Z.call(R,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&R.ref===void 0||(G[re]=R[re]);var re=arguments.length-2;if(re===1)G.children=V;else if(1<re){for(var ve=Array(re),Re=0;Re<re;Re++)ve[Re]=arguments[Re+2];G.children=ve}return te(y.type,le,G)},he.createContext=function(y){return y={$$typeof:v,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null},y.Provider=y,y.Consumer={$$typeof:m,_context:y},y},he.createElement=function(y,R,V){var G,le={},re=null;if(R!=null)for(G in R.key!==void 0&&(re=""+R.key),R)Z.call(R,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(le[G]=R[G]);var ve=arguments.length-2;if(ve===1)le.children=V;else if(1<ve){for(var Re=Array(ve),Me=0;Me<ve;Me++)Re[Me]=arguments[Me+2];le.children=Re}if(y&&y.defaultProps)for(G in ve=y.defaultProps,ve)le[G]===void 0&&(le[G]=ve[G]);return te(y,re,le)},he.createRef=function(){return{current:null}},he.forwardRef=function(y){return{$$typeof:p,render:y}},he.isValidElement=de,he.lazy=function(y){return{$$typeof:b,_payload:{_status:-1,_result:y},_init:W}},he.memo=function(y,R){return{$$typeof:g,type:y,compare:R===void 0?null:R}},he.startTransition=function(y){var R=w.T,V={};w.T=V;try{var G=y(),le=w.S;le!==null&&le(V,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(q,ce)}catch(re){ce(re)}finally{R!==null&&V.types!==null&&(R.types=V.types),w.T=R}},he.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},he.use=function(y){return w.H.use(y)},he.useActionState=function(y,R,V){return w.H.useActionState(y,R,V)},he.useCallback=function(y,R){return w.H.useCallback(y,R)},he.useContext=function(y){return w.H.useContext(y)},he.useDebugValue=function(){},he.useDeferredValue=function(y,R){return w.H.useDeferredValue(y,R)},he.useEffect=function(y,R){return w.H.useEffect(y,R)},he.useEffectEvent=function(y){return w.H.useEffectEvent(y)},he.useId=function(){return w.H.useId()},he.useImperativeHandle=function(y,R,V){return w.H.useImperativeHandle(y,R,V)},he.useInsertionEffect=function(y,R){return w.H.useInsertionEffect(y,R)},he.useLayoutEffect=function(y,R){return w.H.useLayoutEffect(y,R)},he.useMemo=function(y,R){return w.H.useMemo(y,R)},he.useOptimistic=function(y,R){return w.H.useOptimistic(y,R)},he.useReducer=function(y,R,V){return w.H.useReducer(y,R,V)},he.useRef=function(y){return w.H.useRef(y)},he.useState=function(y){return w.H.useState(y)},he.useSyncExternalStore=function(y,R,V){return w.H.useSyncExternalStore(y,R,V)},he.useTransition=function(){return w.H.useTransition()},he.version="19.2.6",he}var Cm;function So(){return Cm||(Cm=1,Ir.exports=Zp()),Ir.exports}var k=So(),Wr={exports:{}},ss={},Pr={exports:{}},eo={};/**
|
|
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 zm;function Kp(){return zm||(zm=1,(function(i){function r(T,H){var W=T.length;T.push(H);e:for(;0<W;){var ce=W-1>>>1,ue=T[ce];if(0<d(ue,H))T[ce]=H,T[W]=ue,W=ce;else break e}}function u(T){return T.length===0?null:T[0]}function o(T){if(T.length===0)return null;var H=T[0],W=T.pop();if(W!==H){T[0]=W;e:for(var ce=0,ue=T.length,y=ue>>>1;ce<y;){var R=2*(ce+1)-1,V=T[R],G=R+1,le=T[G];if(0>d(V,W))G<ue&&0>d(le,V)?(T[ce]=le,T[G]=W,ce=G):(T[ce]=V,T[R]=W,ce=R);else if(G<ue&&0>d(le,W))T[ce]=le,T[G]=W,ce=G;else break e}}return H}function d(T,H){var W=T.sortIndex-H.sortIndex;return W!==0?W:T.id-H.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var v=Date,p=v.now();i.unstable_now=function(){return v.now()-p}}var x=[],g=[],b=1,S=null,O=3,Q=!1,L=!1,X=!1,M=!1,I=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,ee=typeof setImmediate<"u"?setImmediate:null;function J(T){for(var H=u(g);H!==null;){if(H.callback===null)o(g);else if(H.startTime<=T)o(g),H.sortIndex=H.expirationTime,r(x,H);else break;H=u(g)}}function A(T){if(X=!1,J(T),!L)if(u(x)!==null)L=!0,q||(q=!0,F());else{var H=u(g);H!==null&&E(A,H.startTime-T)}}var q=!1,w=-1,Z=5,te=-1;function ne(){return M?!0:!(i.unstable_now()-te<Z)}function de(){if(M=!1,q){var T=i.unstable_now();te=T;var H=!0;try{e:{L=!1,X&&(X=!1,K(w),w=-1),Q=!0;var W=O;try{t:{for(J(T),S=u(x);S!==null&&!(S.expirationTime>T&&ne());){var ce=S.callback;if(typeof ce=="function"){S.callback=null,O=S.priorityLevel;var ue=ce(S.expirationTime<=T);if(T=i.unstable_now(),typeof ue=="function"){S.callback=ue,J(T),H=!0;break t}S===u(x)&&o(x),J(T)}else o(x);S=u(x)}if(S!==null)H=!0;else{var y=u(g);y!==null&&E(A,y.startTime-T),H=!1}}break e}finally{S=null,O=W,Q=!1}H=void 0}}finally{H?F():q=!1}}}var F;if(typeof ee=="function")F=function(){ee(de)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,me=ae.port2;ae.port1.onmessage=de,F=function(){me.postMessage(null)}}else F=function(){I(de,0)};function E(T,H){w=I(function(){T(i.unstable_now())},H)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(T){T.callback=null},i.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<T?Math.floor(1e3/T):5},i.unstable_getCurrentPriorityLevel=function(){return O},i.unstable_next=function(T){switch(O){case 1:case 2:case 3:var H=3;break;default:H=O}var W=O;O=H;try{return T()}finally{O=W}},i.unstable_requestPaint=function(){M=!0},i.unstable_runWithPriority=function(T,H){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var W=O;O=T;try{return H()}finally{O=W}},i.unstable_scheduleCallback=function(T,H,W){var ce=i.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ce+W:ce):W=ce,T){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=W+ue,T={id:b++,callback:H,priorityLevel:T,startTime:W,expirationTime:ue,sortIndex:-1},W>ce?(T.sortIndex=W,r(g,T),u(x)===null&&T===u(g)&&(X?(K(w),w=-1):X=!0,E(A,W-ce))):(T.sortIndex=ue,r(x,T),L||Q||(L=!0,q||(q=!0,F()))),T},i.unstable_shouldYield=ne,i.unstable_wrapCallback=function(T){var H=O;return function(){var W=O;O=H;try{return T.apply(this,arguments)}finally{O=W}}}})(eo)),eo}var Dm;function Jp(){return Dm||(Dm=1,Pr.exports=Kp()),Pr.exports}var to={exports:{}},ct={};/**
|
|
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 Rm;function Fp(){if(Rm)return ct;Rm=1;var i=So();function r(x){var g="https://react.dev/errors/"+x;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+x+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(r(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(x,g,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:S==null?null:""+S,children:x,containerInfo:g,implementation:b}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(x,g){if(x==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ct.createPortal=function(x,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return m(x,g,null,b)},ct.flushSync=function(x){var g=v.T,b=o.p;try{if(v.T=null,o.p=2,x)return x()}finally{v.T=g,o.p=b,o.d.f()}},ct.preconnect=function(x,g){typeof x=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(x,g))},ct.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},ct.preinit=function(x,g){if(typeof x=="string"&&g&&typeof g.as=="string"){var b=g.as,S=p(b,g.crossOrigin),O=typeof g.integrity=="string"?g.integrity:void 0,Q=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?o.d.S(x,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:S,integrity:O,fetchPriority:Q}):b==="script"&&o.d.X(x,{crossOrigin:S,integrity:O,fetchPriority:Q,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ct.preinitModule=function(x,g){if(typeof x=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=p(g.as,g.crossOrigin);o.d.M(x,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(x)},ct.preload=function(x,g){if(typeof x=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,S=p(b,g.crossOrigin);o.d.L(x,b,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},ct.preloadModule=function(x,g){if(typeof x=="string")if(g){var b=p(g.as,g.crossOrigin);o.d.m(x,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(x)},ct.requestFormReset=function(x){o.d.r(x)},ct.unstable_batchedUpdates=function(x,g){return x(g)},ct.useFormState=function(x,g,b){return v.H.useFormState(x,g,b)},ct.useFormStatus=function(){return v.H.useHostTransitionStatus()},ct.version="19.2.6",ct}var Om;function Ip(){if(Om)return to.exports;Om=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),to.exports=Fp(),to.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 Um;function Wp(){if(Um)return ss;Um=1;var i=Jp(),r=So(),u=Ip();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(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 p(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 x(e){if(m(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var s=n.return;if(s===null)break;var c=s.alternate;if(c===null){if(l=s.return,l!==null){n=l;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===n)return x(s),e;if(c===l)return x(s),t;c=c.sibling}throw Error(o(188))}if(n.return!==l.return)n=s,l=c;else{for(var f=!1,h=s.child;h;){if(h===n){f=!0,n=s,l=c;break}if(h===l){f=!0,l=s,n=c;break}h=h.sibling}if(!f){for(h=c.child;h;){if(h===n){f=!0,n=c,l=s;break}if(h===l){f=!0,l=c,n=s;break}h=h.sibling}if(!f)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,O=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function me(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case I:return"Profiler";case M:return"StrictMode";case A:return"Suspense";case q:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case L:return"Portal";case ee:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case J:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case w:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var E=Array.isArray,T=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},ce=[],ue=-1;function y(e){return{current:e}}function R(e){0>ue||(e.current=ce[ue],ce[ue]=null,ue--)}function V(e,t){ue++,ce[ue]=e.current,e.current=t}var G=y(null),le=y(null),re=y(null),ve=y(null);function Re(e,t){switch(V(re,t),V(le,e),V(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?If(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=If(t),e=Wf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}R(G),V(G,e)}function Me(){R(G),R(le),R(re)}function qt(e){e.memoizedState!==null&&V(ve,e);var t=G.current,n=Wf(t,e.type);t!==n&&(V(le,e),V(G,n))}function Ae(e){le.current===e&&(R(G),R(le)),ve.current===e&&(R(ve),es._currentValue=W)}var yn,Zn;function Lt(e){if(yn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yn=t&&t[1]||"",Zn=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+yn+e+Zn}var Yt=!1;function jl(e,t){if(!e||Yt)return"";Yt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(U){var D=U}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(U){D=U}e.call(Y.prototype)}}else{try{throw Error()}catch(U){D=U}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(U){if(U&&D&&typeof U.stack=="string")return[U.stack,D.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),f=c[0],h=c[1];if(f&&h){var j=f.split(`
|
|
44
|
+
`),z=h.split(`
|
|
45
|
+
`);for(s=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;if(l===j.length||s===z.length)for(l=j.length-1,s=z.length-1;1<=l&&0<=s&&j[l]!==z[s];)s--;for(;1<=l&&0<=s;l--,s--)if(j[l]!==z[s]){if(l!==1||s!==1)do if(l--,s--,0>s||j[l]!==z[s]){var B=`
|
|
46
|
+
`+j[l].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=l&&0<=s);break}}}finally{Yt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Lt(n):""}function Kn(e,t){switch(e.tag){case 26:case 27:case 5:return Lt(e.type);case 16:return Lt("Lazy");case 13:return e.child!==t&&t!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return jl(e.type,!1);case 11:return jl(e.type.render,!1);case 1:return jl(e.type,!0);case 31:return Lt("Activity");default:return""}}function Nl(e){try{var t="",n=null;do t+=Kn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var P=Object.prototype.hasOwnProperty,we=i.unstable_scheduleCallback,Ve=i.unstable_cancelCallback,Fe=i.unstable_shouldYield,Bt=i.unstable_requestPaint,Le=i.unstable_now,Jn=i.unstable_getCurrentPriorityLevel,Fn=i.unstable_ImmediatePriority,Ao=i.unstable_UserBlockingPriority,ds=i.unstable_NormalPriority,kh=i.unstable_LowPriority,wo=i.unstable_IdlePriority,_h=i.log,Eh=i.unstable_setDisableYieldValue,fa=null,vt=null;function bn(e){if(typeof _h=="function"&&Eh(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(fa,e)}catch{}}var gt=Math.clz32?Math.clz32:Ah,Th=Math.log,Mh=Math.LN2;function Ah(e){return e>>>=0,e===0?32:31-(Th(e)/Mh|0)|0}var fs=256,ms=262144,hs=4194304;function In(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 xs(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var s=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var h=l&134217727;return h!==0?(l=h&~c,l!==0?s=In(l):(f&=h,f!==0?s=In(f):n||(n=h&~e,n!==0&&(s=In(n))))):(h=l&~c,h!==0?s=In(h):f!==0?s=In(f):n||(n=l&~e,n!==0&&(s=In(n)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:s}function ma(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function wh(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 Co(){var e=hs;return hs<<=1,(hs&62914560)===0&&(hs=4194304),e}function Li(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ha(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ch(e,t,n,l,s,c){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var h=e.entanglements,j=e.expirationTimes,z=e.hiddenUpdates;for(n=f&~n;0<n;){var B=31-gt(n),Y=1<<B;h[B]=0,j[B]=-1;var D=z[B];if(D!==null)for(z[B]=null,B=0;B<D.length;B++){var U=D[B];U!==null&&(U.lane&=-536870913)}n&=~Y}l!==0&&zo(e,l,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function zo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Do(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-gt(n),s=1<<l;s&t|e[l]&t&&(e[l]|=t),n&=~s}}function Ro(e,t){var n=t&-t;return n=(n&42)!==0?1:Bi(n),(n&(e.suspendedLanes|t))!==0?0:n}function Bi(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 Hi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Oo(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:jm(e.type))}function Uo(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var jn=Math.random().toString(36).slice(2),nt="__reactFiber$"+jn,ut="__reactProps$"+jn,Sl="__reactContainer$"+jn,$i="__reactEvents$"+jn,zh="__reactListeners$"+jn,Dh="__reactHandles$"+jn,qo="__reactResources$"+jn,xa="__reactMarker$"+jn;function Gi(e){delete e[nt],delete e[ut],delete e[$i],delete e[zh],delete e[Dh]}function kl(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sl]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=sm(e);e!==null;){if(n=e[nt])return n;e=sm(e)}return t}e=n,n=e.parentNode}return null}function _l(e){if(e=e[nt]||e[Sl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function El(e){var t=e[qo];return t||(t=e[qo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[xa]=!0}var Lo=new Set,Bo={};function Wn(e,t){Tl(e,t),Tl(e+"Capture",t)}function Tl(e,t){for(Bo[e]=t,e=0;e<t.length;e++)Lo.add(t[e])}var Rh=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]*$"),Ho={},$o={};function Oh(e){return P.call($o,e)?!0:P.call(Ho,e)?!1:Rh.test(e)?$o[e]=!0:(Ho[e]=!0,!1)}function ps(e,t,n){if(Oh(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function vs(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function It(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Go(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uh(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){n=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yi(e){if(!e._valueTracker){var t=Go(e)?"checked":"value";e._valueTracker=Uh(e,t,""+e[t])}}function Yo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Go(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function gs(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 qh=/[\n"\\]/g;function Tt(e){return e.replace(qh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xi(e,t,n,l,s,c,f,h){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Vi(e,f,Et(t)):n!=null?Vi(e,f,Et(n)):l!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+Et(h):e.removeAttribute("name")}function Xo(e,t,n,l,s,c,f,h){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Yi(e);return}n=n!=null?""+Et(n):"",t=t!=null?""+Et(t):n,h||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=h?e.checked:!!l,e.defaultChecked=!!l,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Yi(e)}function Vi(e,t,n){t==="number"&&gs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ml(e,t,n,l){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Et(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Vo(e,t,n){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Et(n):""}function Qo(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(E(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Et(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Yi(e)}function Al(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lh=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 Zo(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Lh.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ko(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var s in t)l=t[s],t.hasOwnProperty(s)&&n[s]!==l&&Zo(e,s,l)}else for(var c in t)t.hasOwnProperty(c)&&Zo(e,c,t[c])}function Qi(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 Bh=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"]]),Hh=/^[\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 ys(e){return Hh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Zi=null;function Ki(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wl=null,Cl=null;function Jo(e){var t=_l(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Xi(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Tt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var s=l[ut]||null;if(!s)throw Error(o(90));Xi(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Yo(l)}break e;case"textarea":Vo(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ml(e,!!n.multiple,t,!1)}}}var Ji=!1;function Fo(e,t,n){if(Ji)return e(t,n);Ji=!0;try{var l=e(t);return l}finally{if(Ji=!1,(wl!==null||Cl!==null)&&(ii(),wl&&(t=wl,e=Cl,Cl=wl=null,Jo(t),e)))for(t=0;t<e.length;t++)Jo(e[t])}}function va(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ut]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Pt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fi=!1;if(Pt)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){Fi=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{Fi=!1}var Nn=null,Ii=null,bs=null;function Io(){if(bs)return bs;var e,t=Ii,n=t.length,l,s="value"in Nn?Nn.value:Nn.textContent,c=s.length;for(e=0;e<n&&t[e]===s[e];e++);var f=n-e;for(l=1;l<=f&&t[n-l]===s[c-l];l++);return bs=s.slice(e,1<l?1-l:void 0)}function js(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 Ns(){return!0}function Wo(){return!1}function dt(e){function t(n,l,s,c,f){this._reactName=n,this._targetInst=s,this.type=l,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(n=e[h],this[h]=n?n(c):c[h]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ns:Wo,this.isPropagationStopped=Wo,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ns)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ns)},persist:function(){},isPersistent:Ns}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ss=dt(Pn),ya=S({},Pn,{view:0,detail:0}),$h=dt(ya),Wi,Pi,ba,ks=S({},ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tc,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!==ba&&(ba&&e.type==="mousemove"?(Wi=e.screenX-ba.screenX,Pi=e.screenY-ba.screenY):Pi=Wi=0,ba=e),Wi)},movementY:function(e){return"movementY"in e?e.movementY:Pi}}),Po=dt(ks),Gh=S({},ks,{dataTransfer:0}),Yh=dt(Gh),Xh=S({},ya,{relatedTarget:0}),ec=dt(Xh),Vh=S({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0}),Qh=dt(Vh),Zh=S({},Pn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kh=dt(Zh),Jh=S({},Pn,{data:0}),eu=dt(Jh),Fh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ih={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"},Wh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ph(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wh[e])?!!t[e]:!1}function tc(){return Ph}var ex=S({},ya,{key:function(e){if(e.key){var t=Fh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ih[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tc,charCode:function(e){return e.type==="keypress"?js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tx=dt(ex),nx=S({},ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tu=dt(nx),lx=S({},ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tc}),ax=dt(lx),sx=S({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ix=dt(sx),cx=S({},ks,{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}),rx=dt(cx),ox=S({},Pn,{newState:0,oldState:0}),ux=dt(ox),dx=[9,13,27,32],nc=Pt&&"CompositionEvent"in window,ja=null;Pt&&"documentMode"in document&&(ja=document.documentMode);var fx=Pt&&"TextEvent"in window&&!ja,nu=Pt&&(!nc||ja&&8<ja&&11>=ja),lu=" ",au=!1;function su(e,t){switch(e){case"keyup":return dx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zl=!1;function mx(e,t){switch(e){case"compositionend":return iu(t);case"keypress":return t.which!==32?null:(au=!0,lu);case"textInput":return e=t.data,e===lu&&au?null:e;default:return null}}function hx(e,t){if(zl)return e==="compositionend"||!nc&&su(e,t)?(e=Io(),bs=Ii=Nn=null,zl=!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 nu&&t.locale!=="ko"?null:t.data;default:return null}}var xx={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 cu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xx[e.type]:t==="textarea"}function ru(e,t,n,l){wl?Cl?Cl.push(l):Cl=[l]:wl=l,t=mi(t,"onChange"),0<t.length&&(n=new Ss("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Na=null,Sa=null;function px(e){Vf(e,0)}function _s(e){var t=pa(e);if(Yo(t))return e}function ou(e,t){if(e==="change")return t}var uu=!1;if(Pt){var lc;if(Pt){var ac="oninput"in document;if(!ac){var du=document.createElement("div");du.setAttribute("oninput","return;"),ac=typeof du.oninput=="function"}lc=ac}else lc=!1;uu=lc&&(!document.documentMode||9<document.documentMode)}function fu(){Na&&(Na.detachEvent("onpropertychange",mu),Sa=Na=null)}function mu(e){if(e.propertyName==="value"&&_s(Sa)){var t=[];ru(t,Sa,e,Ki(e)),Fo(px,t)}}function vx(e,t,n){e==="focusin"?(fu(),Na=t,Sa=n,Na.attachEvent("onpropertychange",mu)):e==="focusout"&&fu()}function gx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _s(Sa)}function yx(e,t){if(e==="click")return _s(t)}function bx(e,t){if(e==="input"||e==="change")return _s(t)}function jx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:jx;function ka(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var s=n[l];if(!P.call(t,s)||!yt(e[s],t[s]))return!1}return!0}function hu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xu(e,t){var n=hu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hu(n)}}function pu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gs(e.document)}return t}function sc(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 Nx=Pt&&"documentMode"in document&&11>=document.documentMode,Dl=null,ic=null,_a=null,cc=!1;function gu(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cc||Dl==null||Dl!==gs(l)||(l=Dl,"selectionStart"in l&&sc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),_a&&ka(_a,l)||(_a=l,l=mi(ic,"onSelect"),0<l.length&&(t=new Ss("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Dl)))}function el(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rl={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},rc={},yu={};Pt&&(yu=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function tl(e){if(rc[e])return rc[e];if(!Rl[e])return e;var t=Rl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yu)return rc[e]=t[n];return e}var bu=tl("animationend"),ju=tl("animationiteration"),Nu=tl("animationstart"),Sx=tl("transitionrun"),kx=tl("transitionstart"),_x=tl("transitioncancel"),Su=tl("transitionend"),ku=new Map,oc="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(" ");oc.push("scrollEnd");function Ht(e,t){ku.set(e,t),Wn(t,[e])}var Es=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)},Mt=[],Ol=0,uc=0;function Ts(){for(var e=Ol,t=uc=Ol=0;t<e;){var n=Mt[t];Mt[t++]=null;var l=Mt[t];Mt[t++]=null;var s=Mt[t];Mt[t++]=null;var c=Mt[t];if(Mt[t++]=null,l!==null&&s!==null){var f=l.pending;f===null?s.next=s:(s.next=f.next,f.next=s),l.pending=s}c!==0&&_u(n,s,c)}}function Ms(e,t,n,l){Mt[Ol++]=e,Mt[Ol++]=t,Mt[Ol++]=n,Mt[Ol++]=l,uc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function dc(e,t,n,l){return Ms(e,t,n,l),As(e)}function nl(e,t){return Ms(e,null,null,t),As(e)}function _u(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var s=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-gt(n),e=c.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=n|536870912),c):null}function As(e){if(50<Za)throw Za=0,br=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ul={};function Ex(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,l){return new Ex(e,t,n,l)}function fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function en(e,t){var n=e.alternate;return n===null?(n=bt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Eu(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ws(e,t,n,l,s,c){var f=0;if(l=e,typeof e=="function")fc(e)&&(f=1);else if(typeof e=="string")f=Cp(e,n,G.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=bt(31,n,t,s),e.elementType=te,e.lanes=c,e;case X:return ll(n.children,s,c,t);case M:f=8,s|=24;break;case I:return e=bt(12,n,t,s|2),e.elementType=I,e.lanes=c,e;case A:return e=bt(13,n,t,s),e.elementType=A,e.lanes=c,e;case q:return e=bt(19,n,t,s),e.elementType=q,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:f=10;break e;case K:f=9;break e;case J:f=11;break e;case w:f=14;break e;case Z:f=16,l=null;break e}f=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=bt(f,n,t,s),t.elementType=e,t.type=l,t.lanes=c,t}function ll(e,t,n,l){return e=bt(7,e,l,t),e.lanes=n,e}function mc(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function Tu(e){var t=bt(18,null,null,0);return t.stateNode=e,t}function hc(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Mu=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var n=Mu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Nl(t)},Mu.set(e,t),t)}return{value:e,source:t,stack:Nl(t)}}var ql=[],Ll=0,Cs=null,Ea=0,wt=[],Ct=0,Sn=null,Xt=1,Vt="";function tn(e,t){ql[Ll++]=Ea,ql[Ll++]=Cs,Cs=e,Ea=t}function Au(e,t,n){wt[Ct++]=Xt,wt[Ct++]=Vt,wt[Ct++]=Sn,Sn=e;var l=Xt;e=Vt;var s=32-gt(l)-1;l&=~(1<<s),n+=1;var c=32-gt(t)+s;if(30<c){var f=s-s%5;c=(l&(1<<f)-1).toString(32),l>>=f,s-=f,Xt=1<<32-gt(t)+s|n<<s|l,Vt=c+e}else Xt=1<<c|n<<s|l,Vt=e}function xc(e){e.return!==null&&(tn(e,1),Au(e,1,0))}function pc(e){for(;e===Cs;)Cs=ql[--Ll],ql[Ll]=null,Ea=ql[--Ll],ql[Ll]=null;for(;e===Sn;)Sn=wt[--Ct],wt[Ct]=null,Vt=wt[--Ct],wt[Ct]=null,Xt=wt[--Ct],wt[Ct]=null}function wu(e,t){wt[Ct++]=Xt,wt[Ct++]=Vt,wt[Ct++]=Sn,Xt=t.id,Vt=t.overflow,Sn=e}var lt=null,Ue=null,Ne=!1,kn=null,zt=!1,vc=Error(o(519));function _n(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ta(At(t,e)),vc}function Cu(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[nt]=e,t[ut]=l,n){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(n=0;n<Ja.length;n++)ye(Ja[n],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),Xo(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),Qo(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Jf(t.textContent,n)?(l.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),l.onScroll!=null&&ye("scroll",t),l.onScrollEnd!=null&&ye("scrollend",t),l.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||_n(e,!0)}function zu(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:zt=!1;return;case 27:case 3:zt=!0;return;default:lt=lt.return}}function Bl(e){if(e!==lt)return!1;if(!Ne)return zu(e),Ne=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Or(e.type,e.memoizedProps)),n=!n),n&&Ue&&_n(e),zu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ue=am(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ue=am(e)}else t===27?(t=Ue,Bn(e.type)?(e=Hr,Hr=null,Ue=e):Ue=t):Ue=lt?Rt(e.stateNode.nextSibling):null;return!0}function al(){Ue=lt=null,Ne=!1}function gc(){var e=kn;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),kn=null),e}function Ta(e){kn===null?kn=[e]:kn.push(e)}var yc=y(null),sl=null,nn=null;function En(e,t,n){V(yc,t._currentValue),t._currentValue=n}function ln(e){e._currentValue=yc.current,R(yc)}function bc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function jc(e,t,n,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var f=s.child;c=c.firstContext;e:for(;c!==null;){var h=c;c=s;for(var j=0;j<t.length;j++)if(h.context===t[j]){c.lanes|=n,h=c.alternate,h!==null&&(h.lanes|=n),bc(c.return,n,e),l||(f=null);break e}c=h.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(o(341));f.lanes|=n,c=f.alternate,c!==null&&(c.lanes|=n),bc(f,n,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function Hl(e,t,n,l){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(o(387));if(f=f.memoizedProps,f!==null){var h=s.type;yt(s.pendingProps.value,f.value)||(e!==null?e.push(h):e=[h])}}else if(s===ve.current){if(f=s.alternate,f===null)throw Error(o(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(es):e=[es])}s=s.return}e!==null&&jc(t,e,n,l),t.flags|=262144}function zs(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function il(e){sl=e,nn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return Du(sl,e)}function Ds(e,t){return sl===null&&il(e),Du(e,t)}function Du(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},nn===null){if(e===null)throw Error(o(308));nn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else nn=nn.next=t;return n}var Tx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Mx=i.unstable_scheduleCallback,Ax=i.unstable_NormalPriority,Qe={$$typeof:ee,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nc(){return{controller:new Tx,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Mx(Ax,function(){e.controller.abort()})}var Aa=null,Sc=0,$l=0,Gl=null;function wx(e,t){if(Aa===null){var n=Aa=[];Sc=0,$l=Er(),Gl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Sc++,t.then(Ru,Ru),t}function Ru(){if(--Sc===0&&Aa!==null){Gl!==null&&(Gl.status="fulfilled");var e=Aa;Aa=null,$l=0,Gl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Cx(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),l}var Ou=T.S;T.S=function(e,t){yf=Le(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wx(e,t),Ou!==null&&Ou(e,t)};var cl=y(null);function kc(){var e=cl.current;return e!==null?e:Oe.pooledCache}function Rs(e,t){t===null?V(cl,cl.current):V(cl,t.pool)}function Uu(){var e=kc();return e===null?null:{parent:Qe._currentValue,pool:e}}var Yl=Error(o(460)),_c=Error(o(474)),Os=Error(o(542)),Us={then:function(){}};function qu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Lu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Wt,Wt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hu(e),e;default:if(typeof t.status=="string")t.then(Wt,Wt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hu(e),e}throw ol=t,Yl}}function rl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ol=n,Yl):n}}var ol=null;function Bu(){if(ol===null)throw Error(o(459));var e=ol;return ol=null,e}function Hu(e){if(e===Yl||e===Os)throw Error(o(483))}var Xl=null,wa=0;function qs(e){var t=wa;return wa+=1,Xl===null&&(Xl=[]),Lu(Xl,e,t)}function Ca(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ls(e,t){throw t.$$typeof===O?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function $u(e){function t(_,N){if(e){var C=_.deletions;C===null?(_.deletions=[N],_.flags|=16):C.push(N)}}function n(_,N){if(!e)return null;for(;N!==null;)t(_,N),N=N.sibling;return null}function l(_){for(var N=new Map;_!==null;)_.key!==null?N.set(_.key,_):N.set(_.index,_),_=_.sibling;return N}function s(_,N){return _=en(_,N),_.index=0,_.sibling=null,_}function c(_,N,C){return _.index=C,e?(C=_.alternate,C!==null?(C=C.index,C<N?(_.flags|=67108866,N):C):(_.flags|=67108866,N)):(_.flags|=1048576,N)}function f(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function h(_,N,C,$){return N===null||N.tag!==6?(N=mc(C,_.mode,$),N.return=_,N):(N=s(N,C),N.return=_,N)}function j(_,N,C,$){var oe=C.type;return oe===X?B(_,N,C.props.children,$,C.key):N!==null&&(N.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Z&&rl(oe)===N.type)?(N=s(N,C.props),Ca(N,C),N.return=_,N):(N=ws(C.type,C.key,C.props,null,_.mode,$),Ca(N,C),N.return=_,N)}function z(_,N,C,$){return N===null||N.tag!==4||N.stateNode.containerInfo!==C.containerInfo||N.stateNode.implementation!==C.implementation?(N=hc(C,_.mode,$),N.return=_,N):(N=s(N,C.children||[]),N.return=_,N)}function B(_,N,C,$,oe){return N===null||N.tag!==7?(N=ll(C,_.mode,$,oe),N.return=_,N):(N=s(N,C),N.return=_,N)}function Y(_,N,C){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=mc(""+N,_.mode,C),N.return=_,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case Q:return C=ws(N.type,N.key,N.props,null,_.mode,C),Ca(C,N),C.return=_,C;case L:return N=hc(N,_.mode,C),N.return=_,N;case Z:return N=rl(N),Y(_,N,C)}if(E(N)||F(N))return N=ll(N,_.mode,C,null),N.return=_,N;if(typeof N.then=="function")return Y(_,qs(N),C);if(N.$$typeof===ee)return Y(_,Ds(_,N),C);Ls(_,N)}return null}function D(_,N,C,$){var oe=N!==null?N.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return oe!==null?null:h(_,N,""+C,$);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Q:return C.key===oe?j(_,N,C,$):null;case L:return C.key===oe?z(_,N,C,$):null;case Z:return C=rl(C),D(_,N,C,$)}if(E(C)||F(C))return oe!==null?null:B(_,N,C,$,null);if(typeof C.then=="function")return D(_,N,qs(C),$);if(C.$$typeof===ee)return D(_,N,Ds(_,C),$);Ls(_,C)}return null}function U(_,N,C,$,oe){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return _=_.get(C)||null,h(N,_,""+$,oe);if(typeof $=="object"&&$!==null){switch($.$$typeof){case Q:return _=_.get($.key===null?C:$.key)||null,j(N,_,$,oe);case L:return _=_.get($.key===null?C:$.key)||null,z(N,_,$,oe);case Z:return $=rl($),U(_,N,C,$,oe)}if(E($)||F($))return _=_.get(C)||null,B(N,_,$,oe,null);if(typeof $.then=="function")return U(_,N,C,qs($),oe);if($.$$typeof===ee)return U(_,N,C,Ds(N,$),oe);Ls(N,$)}return null}function se(_,N,C,$){for(var oe=null,Se=null,ie=N,pe=N=0,je=null;ie!==null&&pe<C.length;pe++){ie.index>pe?(je=ie,ie=null):je=ie.sibling;var ke=D(_,ie,C[pe],$);if(ke===null){ie===null&&(ie=je);break}e&&ie&&ke.alternate===null&&t(_,ie),N=c(ke,N,pe),Se===null?oe=ke:Se.sibling=ke,Se=ke,ie=je}if(pe===C.length)return n(_,ie),Ne&&tn(_,pe),oe;if(ie===null){for(;pe<C.length;pe++)ie=Y(_,C[pe],$),ie!==null&&(N=c(ie,N,pe),Se===null?oe=ie:Se.sibling=ie,Se=ie);return Ne&&tn(_,pe),oe}for(ie=l(ie);pe<C.length;pe++)je=U(ie,_,pe,C[pe],$),je!==null&&(e&&je.alternate!==null&&ie.delete(je.key===null?pe:je.key),N=c(je,N,pe),Se===null?oe=je:Se.sibling=je,Se=je);return e&&ie.forEach(function(Xn){return t(_,Xn)}),Ne&&tn(_,pe),oe}function fe(_,N,C,$){if(C==null)throw Error(o(151));for(var oe=null,Se=null,ie=N,pe=N=0,je=null,ke=C.next();ie!==null&&!ke.done;pe++,ke=C.next()){ie.index>pe?(je=ie,ie=null):je=ie.sibling;var Xn=D(_,ie,ke.value,$);if(Xn===null){ie===null&&(ie=je);break}e&&ie&&Xn.alternate===null&&t(_,ie),N=c(Xn,N,pe),Se===null?oe=Xn:Se.sibling=Xn,Se=Xn,ie=je}if(ke.done)return n(_,ie),Ne&&tn(_,pe),oe;if(ie===null){for(;!ke.done;pe++,ke=C.next())ke=Y(_,ke.value,$),ke!==null&&(N=c(ke,N,pe),Se===null?oe=ke:Se.sibling=ke,Se=ke);return Ne&&tn(_,pe),oe}for(ie=l(ie);!ke.done;pe++,ke=C.next())ke=U(ie,_,pe,ke.value,$),ke!==null&&(e&&ke.alternate!==null&&ie.delete(ke.key===null?pe:ke.key),N=c(ke,N,pe),Se===null?oe=ke:Se.sibling=ke,Se=ke);return e&&ie.forEach(function(Gp){return t(_,Gp)}),Ne&&tn(_,pe),oe}function De(_,N,C,$){if(typeof C=="object"&&C!==null&&C.type===X&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Q:e:{for(var oe=C.key;N!==null;){if(N.key===oe){if(oe=C.type,oe===X){if(N.tag===7){n(_,N.sibling),$=s(N,C.props.children),$.return=_,_=$;break e}}else if(N.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Z&&rl(oe)===N.type){n(_,N.sibling),$=s(N,C.props),Ca($,C),$.return=_,_=$;break e}n(_,N);break}else t(_,N);N=N.sibling}C.type===X?($=ll(C.props.children,_.mode,$,C.key),$.return=_,_=$):($=ws(C.type,C.key,C.props,null,_.mode,$),Ca($,C),$.return=_,_=$)}return f(_);case L:e:{for(oe=C.key;N!==null;){if(N.key===oe)if(N.tag===4&&N.stateNode.containerInfo===C.containerInfo&&N.stateNode.implementation===C.implementation){n(_,N.sibling),$=s(N,C.children||[]),$.return=_,_=$;break e}else{n(_,N);break}else t(_,N);N=N.sibling}$=hc(C,_.mode,$),$.return=_,_=$}return f(_);case Z:return C=rl(C),De(_,N,C,$)}if(E(C))return se(_,N,C,$);if(F(C)){if(oe=F(C),typeof oe!="function")throw Error(o(150));return C=oe.call(C),fe(_,N,C,$)}if(typeof C.then=="function")return De(_,N,qs(C),$);if(C.$$typeof===ee)return De(_,N,Ds(_,C),$);Ls(_,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,N!==null&&N.tag===6?(n(_,N.sibling),$=s(N,C),$.return=_,_=$):(n(_,N),$=mc(C,_.mode,$),$.return=_,_=$),f(_)):n(_,N)}return function(_,N,C,$){try{wa=0;var oe=De(_,N,C,$);return Xl=null,oe}catch(ie){if(ie===Yl||ie===Os)throw ie;var Se=bt(29,ie,null,_.mode);return Se.lanes=$,Se.return=_,Se}finally{}}}var ul=$u(!0),Gu=$u(!1),Tn=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tc(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 Mn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(_e&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=As(e),_u(e,null,n),t}return Ms(e,l,t,n),As(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Do(e,n)}}function Mc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var s=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=f:c=c.next=f,n=n.next}while(n!==null);c===null?s=c=t:c=c.next=t}else s=c=t;n={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ac=!1;function Da(){if(Ac){var e=Gl;if(e!==null)throw e}}function Ra(e,t,n,l){Ac=!1;var s=e.updateQueue;Tn=!1;var c=s.firstBaseUpdate,f=s.lastBaseUpdate,h=s.shared.pending;if(h!==null){s.shared.pending=null;var j=h,z=j.next;j.next=null,f===null?c=z:f.next=z,f=j;var B=e.alternate;B!==null&&(B=B.updateQueue,h=B.lastBaseUpdate,h!==f&&(h===null?B.firstBaseUpdate=z:h.next=z,B.lastBaseUpdate=j))}if(c!==null){var Y=s.baseState;f=0,B=z=j=null,h=c;do{var D=h.lane&-536870913,U=D!==h.lane;if(U?(be&D)===D:(l&D)===D){D!==0&&D===$l&&(Ac=!0),B!==null&&(B=B.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var se=e,fe=h;D=t;var De=n;switch(fe.tag){case 1:if(se=fe.payload,typeof se=="function"){Y=se.call(De,Y,D);break e}Y=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=fe.payload,D=typeof se=="function"?se.call(De,Y,D):se,D==null)break e;Y=S({},Y,D);break e;case 2:Tn=!0}}D=h.callback,D!==null&&(e.flags|=64,U&&(e.flags|=8192),U=s.callbacks,U===null?s.callbacks=[D]:U.push(D))}else U={lane:D,tag:h.tag,payload:h.payload,callback:h.callback,next:null},B===null?(z=B=U,j=Y):B=B.next=U,f|=D;if(h=h.next,h===null){if(h=s.shared.pending,h===null)break;U=h,h=U.next,U.next=null,s.lastBaseUpdate=U,s.shared.pending=null}}while(!0);B===null&&(j=Y),s.baseState=j,s.firstBaseUpdate=z,s.lastBaseUpdate=B,c===null&&(s.shared.lanes=0),Rn|=f,e.lanes=f,e.memoizedState=Y}}function Yu(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Yu(n[e],t)}var Vl=y(null),Bs=y(0);function Vu(e,t){e=mn,V(Bs,e),V(Vl,t),mn=e|t.baseLanes}function wc(){V(Bs,mn),V(Vl,Vl.current)}function Cc(){mn=Bs.current,R(Vl),R(Bs)}var jt=y(null),Dt=null;function wn(e){var t=e.alternate;V(Ye,Ye.current&1),V(jt,e),Dt===null&&(t===null||Vl.current!==null||t.memoizedState!==null)&&(Dt=e)}function zc(e){V(Ye,Ye.current),V(jt,e),Dt===null&&(Dt=e)}function Qu(e){e.tag===22?(V(Ye,Ye.current),V(jt,e),Dt===null&&(Dt=e)):Cn()}function Cn(){V(Ye,Ye.current),V(jt,jt.current)}function Nt(e){R(jt),Dt===e&&(Dt=null),R(Ye)}var Ye=y(0);function Hs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Lr(n)||Br(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var an=0,xe=null,Ce=null,Ze=null,$s=!1,Ql=!1,dl=!1,Gs=0,Oa=0,Zl=null,zx=0;function He(){throw Error(o(321))}function Dc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yt(e[n],t[n]))return!1;return!0}function Rc(e,t,n,l,s,c){return an=c,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?Ad:Jc,dl=!1,c=n(l,s),dl=!1,Ql&&(c=Ku(t,n,l,s)),Zu(e),c}function Zu(e){T.H=La;var t=Ce!==null&&Ce.next!==null;if(an=0,Ze=Ce=xe=null,$s=!1,Oa=0,Zl=null,t)throw Error(o(300));e===null||Ke||(e=e.dependencies,e!==null&&zs(e)&&(Ke=!0))}function Ku(e,t,n,l){xe=e;var s=0;do{if(Ql&&(Zl=null),Oa=0,Ql=!1,25<=s)throw Error(o(301));if(s+=1,Ze=Ce=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}T.H=wd,c=t(n,l)}while(Ql);return c}function Dx(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?Ua(t):t,e=e.useState()[0],(Ce!==null?Ce.memoizedState:null)!==e&&(xe.flags|=1024),t}function Oc(){var e=Gs!==0;return Gs=0,e}function Uc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function qc(e){if($s){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}$s=!1}an=0,Ze=Ce=xe=null,Ql=!1,Oa=Gs=0,Zl=null}function rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(Ce===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=Ze===null?xe.memoizedState:Ze.next;if(t!==null)Ze=t,Ce=e;else{if(e===null)throw xe.alternate===null?Error(o(467)):Error(o(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Ys(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ua(e){var t=Oa;return Oa+=1,Zl===null&&(Zl=[]),e=Lu(Zl,e,t),t=xe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?Ad:Jc),e}function Xs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ua(e);if(e.$$typeof===ee)return at(e)}throw Error(o(438,String(e)))}function Lc(e){var t=null,n=xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=xe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ys(),xe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ne;return t.index++,n}function sn(e,t){return typeof t=="function"?t(e):t}function Vs(e){var t=Xe();return Bc(t,Ce,e)}function Bc(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var s=e.baseQueue,c=l.pending;if(c!==null){if(s!==null){var f=s.next;s.next=c.next,c.next=f}t.baseQueue=s=c,l.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var h=f=null,j=null,z=t,B=!1;do{var Y=z.lane&-536870913;if(Y!==z.lane?(be&Y)===Y:(an&Y)===Y){var D=z.revertLane;if(D===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Y===$l&&(B=!0);else if((an&D)===D){z=z.next,D===$l&&(B=!0);continue}else Y={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},j===null?(h=j=Y,f=c):j=j.next=Y,xe.lanes|=D,Rn|=D;Y=z.action,dl&&n(c,Y),c=z.hasEagerState?z.eagerState:n(c,Y)}else D={lane:Y,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},j===null?(h=j=D,f=c):j=j.next=D,xe.lanes|=Y,Rn|=Y;z=z.next}while(z!==null&&z!==t);if(j===null?f=c:j.next=h,!yt(c,e.memoizedState)&&(Ke=!0,B&&(n=Gl,n!==null)))throw n;e.memoizedState=c,e.baseState=f,e.baseQueue=j,l.lastRenderedState=c}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Hc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,s=n.pending,c=t.memoizedState;if(s!==null){n.pending=null;var f=s=s.next;do c=e(c,f.action),f=f.next;while(f!==s);yt(c,t.memoizedState)||(Ke=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function Ju(e,t,n){var l=xe,s=Xe(),c=Ne;if(c){if(n===void 0)throw Error(o(407));n=n()}else n=t();var f=!yt((Ce||s).memoizedState,n);if(f&&(s.memoizedState=n,Ke=!0),s=s.queue,Yc(Wu.bind(null,l,s,e),[e]),s.getSnapshot!==t||f||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Kl(9,{destroy:void 0},Iu.bind(null,l,s,n,t),null),Oe===null)throw Error(o(349));c||(an&127)!==0||Fu(l,t,n)}return n}function Fu(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t=Ys(),xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Iu(e,t,n,l){t.value=n,t.getSnapshot=l,Pu(t)&&ed(e)}function Wu(e,t,n){return n(function(){Pu(t)&&ed(e)})}function Pu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function ed(e){var t=nl(e,2);t!==null&&pt(t,e,2)}function $c(e){var t=rt();if(typeof e=="function"){var n=e;if(e=n(),dl){bn(!0);try{n()}finally{bn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:e},t}function td(e,t,n,l){return e.baseState=n,Bc(e,Ce,typeof l=="function"?l:sn)}function Rx(e,t,n,l,s){if(Ks(e))throw Error(o(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};T.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,nd(t,c)):(c.next=n.next,t.pending=n.next=c)}}function nd(e,t){var n=t.action,l=t.payload,s=e.state;if(t.isTransition){var c=T.T,f={};T.T=f;try{var h=n(s,l),j=T.S;j!==null&&j(f,h),ld(e,t,h)}catch(z){Gc(e,t,z)}finally{c!==null&&f.types!==null&&(c.types=f.types),T.T=c}}else try{c=n(s,l),ld(e,t,c)}catch(z){Gc(e,t,z)}}function ld(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){ad(e,t,l)},function(l){return Gc(e,t,l)}):ad(e,t,n)}function ad(e,t,n){t.status="fulfilled",t.value=n,sd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,nd(e,n)))}function Gc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,sd(t),t=t.next;while(t!==l)}e.action=null}function sd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function id(e,t){return t}function cd(e,t){if(Ne){var n=Oe.formState;if(n!==null){e:{var l=xe;if(Ne){if(Ue){t:{for(var s=Ue,c=zt;s.nodeType!==8;){if(!c){s=null;break t}if(s=Rt(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Ue=Rt(s.nextSibling),l=s.data==="F!";break e}}_n(l)}l=!1}l&&(t=n[0])}}return n=rt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:id,lastRenderedState:t},n.queue=l,n=Ed.bind(null,xe,l),l.dispatch=n,l=$c(!1),c=Kc.bind(null,xe,!1,l.queue),l=rt(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,n=Rx.bind(null,xe,s,c,n),s.dispatch=n,l.memoizedState=e,[t,n,!1]}function rd(e){var t=Xe();return od(t,Ce,e)}function od(e,t,n){if(t=Bc(e,t,id)[0],e=Vs(sn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ua(t)}catch(f){throw f===Yl?Os:f}else l=t;t=Xe();var s=t.queue,c=s.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Kl(9,{destroy:void 0},Ox.bind(null,s,n),null)),[l,c,e]}function Ox(e,t){e.action=t}function ud(e){var t=Xe(),n=Ce;if(n!==null)return od(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Kl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Ys(),xe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function dd(){return Xe().memoizedState}function Qs(e,t,n,l){var s=rt();xe.flags|=e,s.memoizedState=Kl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Zs(e,t,n,l){var s=Xe();l=l===void 0?null:l;var c=s.memoizedState.inst;Ce!==null&&l!==null&&Dc(l,Ce.memoizedState.deps)?s.memoizedState=Kl(t,c,n,l):(xe.flags|=e,s.memoizedState=Kl(1|t,c,n,l))}function fd(e,t){Qs(8390656,8,e,t)}function Yc(e,t){Zs(2048,8,e,t)}function Ux(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Ys(),xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function md(e){var t=Xe().memoizedState;return Ux({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function hd(e,t){return Zs(4,2,e,t)}function xd(e,t){return Zs(4,4,e,t)}function pd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vd(e,t,n){n=n!=null?n.concat([e]):null,Zs(4,4,pd.bind(null,t,e),n)}function Xc(){}function gd(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Dc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function yd(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Dc(t,l[1]))return l[0];if(l=e(),dl){bn(!0);try{e()}finally{bn(!1)}}return n.memoizedState=[l,t],l}function Vc(e,t,n){return n===void 0||(an&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=jf(),xe.lanes|=e,Rn|=e,n)}function bd(e,t,n,l){return yt(n,t)?n:Vl.current!==null?(e=Vc(e,n,l),yt(e,t)||(Ke=!0),e):(an&42)===0||(an&1073741824)!==0&&(be&261930)===0?(Ke=!0,e.memoizedState=n):(e=jf(),xe.lanes|=e,Rn|=e,t)}function jd(e,t,n,l,s){var c=H.p;H.p=c!==0&&8>c?c:8;var f=T.T,h={};T.T=h,Kc(e,!1,t,n);try{var j=s(),z=T.S;if(z!==null&&z(h,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var B=Cx(j,l);qa(e,t,B,_t(e))}else qa(e,t,l,_t(e))}catch(Y){qa(e,t,{then:function(){},status:"rejected",reason:Y},_t())}finally{H.p=c,f!==null&&h.types!==null&&(f.types=h.types),T.T=f}}function qx(){}function Qc(e,t,n,l){if(e.tag!==5)throw Error(o(476));var s=Nd(e).queue;jd(e,s,t,W,n===null?qx:function(){return Sd(e),n(l)})}function Nd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:W},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Sd(e){var t=Nd(e);t.next===null&&(t=e.alternate.memoizedState),qa(e,t.next.queue,{},_t())}function Zc(){return at(es)}function kd(){return Xe().memoizedState}function _d(){return Xe().memoizedState}function Lx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_t();e=Mn(n);var l=An(t,e,n);l!==null&&(pt(l,t,n),za(l,t,n)),t={cache:Nc()},e.payload=t;return}t=t.return}}function Bx(e,t,n){var l=_t();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ks(e)?Td(t,n):(n=dc(e,t,n,l),n!==null&&(pt(n,e,l),Md(n,t,l)))}function Ed(e,t,n){var l=_t();qa(e,t,n,l)}function qa(e,t,n,l){var s={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ks(e))Td(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,h=c(f,n);if(s.hasEagerState=!0,s.eagerState=h,yt(h,f))return Ms(e,t,s,0),Oe===null&&Ts(),!1}catch{}finally{}if(n=dc(e,t,s,l),n!==null)return pt(n,e,l),Md(n,t,l),!0}return!1}function Kc(e,t,n,l){if(l={lane:2,revertLane:Er(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ks(e)){if(t)throw Error(o(479))}else t=dc(e,n,l,2),t!==null&&pt(t,e,2)}function Ks(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Td(e,t){Ql=$s=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Md(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Do(e,n)}}var La={readContext:at,use:Xs,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};La.useEffectEvent=He;var Ad={readContext:at,use:Xs,useCallback:function(e,t){return rt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:fd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Qs(4194308,4,pd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qs(4194308,4,e,t)},useInsertionEffect:function(e,t){Qs(4,2,e,t)},useMemo:function(e,t){var n=rt();t=t===void 0?null:t;var l=e();if(dl){bn(!0);try{e()}finally{bn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=rt();if(n!==void 0){var s=n(t);if(dl){bn(!0);try{n(t)}finally{bn(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=Bx.bind(null,xe,e),[l.memoizedState,e]},useRef:function(e){var t=rt();return e={current:e},t.memoizedState=e},useState:function(e){e=$c(e);var t=e.queue,n=Ed.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xc,useDeferredValue:function(e,t){var n=rt();return Vc(n,e,t)},useTransition:function(){var e=$c(!1);return e=jd.bind(null,xe,e.queue,!0,!1),rt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=xe,s=rt();if(Ne){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Oe===null)throw Error(o(349));(be&127)!==0||Fu(l,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,fd(Wu.bind(null,l,c,e),[e]),l.flags|=2048,Kl(9,{destroy:void 0},Iu.bind(null,l,c,n,t),null),n},useId:function(){var e=rt(),t=Oe.identifierPrefix;if(Ne){var n=Vt,l=Xt;n=(l&~(1<<32-gt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Gs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=zx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zc,useFormState:cd,useActionState:cd,useOptimistic:function(e){var t=rt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Kc.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lc,useCacheRefresh:function(){return rt().memoizedState=Lx.bind(null,xe)},useEffectEvent:function(e){var t=rt(),n={impl:e};return t.memoizedState=n,function(){if((_e&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Jc={readContext:at,use:Xs,useCallback:gd,useContext:at,useEffect:Yc,useImperativeHandle:vd,useInsertionEffect:hd,useLayoutEffect:xd,useMemo:yd,useReducer:Vs,useRef:dd,useState:function(){return Vs(sn)},useDebugValue:Xc,useDeferredValue:function(e,t){var n=Xe();return bd(n,Ce.memoizedState,e,t)},useTransition:function(){var e=Vs(sn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Ua(e),t]},useSyncExternalStore:Ju,useId:kd,useHostTransitionStatus:Zc,useFormState:rd,useActionState:rd,useOptimistic:function(e,t){var n=Xe();return td(n,Ce,e,t)},useMemoCache:Lc,useCacheRefresh:_d};Jc.useEffectEvent=md;var wd={readContext:at,use:Xs,useCallback:gd,useContext:at,useEffect:Yc,useImperativeHandle:vd,useInsertionEffect:hd,useLayoutEffect:xd,useMemo:yd,useReducer:Hc,useRef:dd,useState:function(){return Hc(sn)},useDebugValue:Xc,useDeferredValue:function(e,t){var n=Xe();return Ce===null?Vc(n,e,t):bd(n,Ce.memoizedState,e,t)},useTransition:function(){var e=Hc(sn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Ua(e),t]},useSyncExternalStore:Ju,useId:kd,useHostTransitionStatus:Zc,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var n=Xe();return Ce!==null?td(n,Ce,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Lc,useCacheRefresh:_d};wd.useEffectEvent=md;function Fc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ic={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=_t(),s=Mn(l);s.payload=t,n!=null&&(s.callback=n),t=An(e,s,l),t!==null&&(pt(t,e,l),za(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=_t(),s=Mn(l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=An(e,s,l),t!==null&&(pt(t,e,l),za(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_t(),l=Mn(n);l.tag=2,t!=null&&(l.callback=t),t=An(e,l,n),t!==null&&(pt(t,e,n),za(t,e,n))}};function Cd(e,t,n,l,s,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,f):t.prototype&&t.prototype.isPureReactComponent?!ka(n,l)||!ka(s,c):!0}function zd(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Ic.enqueueReplaceState(t,t.state,null)}function fl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=S({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function Dd(e){Es(e)}function Rd(e){console.error(e)}function Od(e){Es(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Ud(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Wc(e,t,n){return n=Mn(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function qd(e){return e=Mn(e),e.tag=3,e}function Ld(e,t,n,l){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var c=l.value;e.payload=function(){return s(c)},e.callback=function(){Ud(t,n,l)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Ud(t,n,l),typeof s!="function"&&(On===null?On=new Set([this]):On.add(this));var h=l.stack;this.componentDidCatch(l.value,{componentStack:h!==null?h:""})})}function Hx(e,t,n,l,s){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Hl(t,n,s,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:return Dt===null?ci():n.alternate===null&&$e===0&&($e=3),n.flags&=-257,n.flags|=65536,n.lanes=s,l===Us?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Sr(e,l,s)),!1;case 22:return n.flags|=65536,l===Us?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Sr(e,l,s)),!1}throw Error(o(435,n.tag))}return Sr(e,l,s),ci(),!1}if(Ne)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==vc&&(e=Error(o(422),{cause:l}),Ta(At(e,n)))):(l!==vc&&(t=Error(o(423),{cause:l}),Ta(At(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=At(l,n),s=Wc(e.stateNode,l,s),Mc(e,s),$e!==4&&($e=2)),!1;var c=Error(o(520),{cause:l});if(c=At(c,n),Qa===null?Qa=[c]:Qa.push(c),$e!==4&&($e=2),t===null)return!0;l=At(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=Wc(n.stateNode,l,e),Mc(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(On===null||!On.has(c))))return n.flags|=65536,s&=-s,n.lanes|=s,s=qd(s),Ld(s,e,n,l),Mc(n,s),!1}n=n.return}while(n!==null);return!1}var Pc=Error(o(461)),Ke=!1;function st(e,t,n,l){t.child=e===null?Gu(t,null,n,l):ul(t,e.child,n,l)}function Bd(e,t,n,l,s){n=n.render;var c=t.ref;if("ref"in l){var f={};for(var h in l)h!=="ref"&&(f[h]=l[h])}else f=l;return il(t),l=Rc(e,t,n,f,c,s),h=Oc(),e!==null&&!Ke?(Uc(e,t,s),cn(e,t,s)):(Ne&&h&&xc(t),t.flags|=1,st(e,t,l,s),t.child)}function Hd(e,t,n,l,s){if(e===null){var c=n.type;return typeof c=="function"&&!fc(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,$d(e,t,c,l,s)):(e=ws(n.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!cr(e,s)){var f=c.memoizedProps;if(n=n.compare,n=n!==null?n:ka,n(f,l)&&e.ref===t.ref)return cn(e,t,s)}return t.flags|=1,e=en(c,l),e.ref=t.ref,e.return=t,t.child=e}function $d(e,t,n,l,s){if(e!==null){var c=e.memoizedProps;if(ka(c,l)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=l=c,cr(e,s))(e.flags&131072)!==0&&(Ke=!0);else return t.lanes=e.lanes,cn(e,t,s)}return er(e,t,n,l,s)}function Gd(e,t,n,l){var s=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~c}else l=0,t.child=null;return Yd(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Rs(t,c!==null?c.cachePool:null),c!==null?Vu(t,c):wc(),Qu(t);else return l=t.lanes=536870912,Yd(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(Rs(t,c.cachePool),Vu(t,c),Cn(),t.memoizedState=null):(e!==null&&Rs(t,null),wc(),Cn());return st(e,t,s,n),t.child}function Ba(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yd(e,t,n,l,s){var c=kc();return c=c===null?null:{parent:Qe._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Rs(t,null),wc(),Qu(t),e!==null&&Hl(e,t,l,!0),t.childLanes=s,null}function Fs(e,t){return t=Ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xd(e,t,n){return ul(t,e.child,null,n),e=Fs(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function $x(e,t,n){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(l.mode==="hidden")return e=Fs(t,l),t.lanes=536870912,Ba(null,e);if(zc(t),(e=Ue)?(e=lm(e,zt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sn!==null?{id:Xt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},n=Tu(e),n.return=t,t.child=n,lt=t,Ue=null)):e=null,e===null)throw _n(t);return t.lanes=536870912,null}return Fs(t,l)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(zc(t),s)if(t.flags&256)t.flags&=-257,t=Xd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ke||Hl(e,t,n,!1),s=(n&e.childLanes)!==0,Ke||s){if(l=Oe,l!==null&&(f=Ro(l,n),f!==0&&f!==c.retryLane))throw c.retryLane=f,nl(e,f),pt(l,e,f),Pc;ci(),t=Xd(e,t,n)}else e=c.treeContext,Ue=Rt(f.nextSibling),lt=t,Ne=!0,kn=null,zt=!1,e!==null&&wu(t,e),t=Fs(t,l),t.flags|=4096;return t}return e=en(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Is(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function er(e,t,n,l,s){return il(t),n=Rc(e,t,n,l,void 0,s),l=Oc(),e!==null&&!Ke?(Uc(e,t,s),cn(e,t,s)):(Ne&&l&&xc(t),t.flags|=1,st(e,t,n,s),t.child)}function Vd(e,t,n,l,s,c){return il(t),t.updateQueue=null,n=Ku(t,l,n,s),Zu(e),l=Oc(),e!==null&&!Ke?(Uc(e,t,c),cn(e,t,c)):(Ne&&l&&xc(t),t.flags|=1,st(e,t,n,c),t.child)}function Qd(e,t,n,l,s){if(il(t),t.stateNode===null){var c=Ul,f=n.contextType;typeof f=="object"&&f!==null&&(c=at(f)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ic,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},Ec(t),f=n.contextType,c.context=typeof f=="object"&&f!==null?at(f):Ul,c.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Fc(t,n,f,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&Ic.enqueueReplaceState(c,c.state,null),Ra(t,l,c,s),Da(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var h=t.memoizedProps,j=fl(n,h);c.props=j;var z=c.context,B=n.contextType;f=Ul,typeof B=="object"&&B!==null&&(f=at(B));var Y=n.getDerivedStateFromProps;B=typeof Y=="function"||typeof c.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,B||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h||z!==f)&&zd(t,c,l,f),Tn=!1;var D=t.memoizedState;c.state=D,Ra(t,l,c,s),Da(),z=t.memoizedState,h||D!==z||Tn?(typeof Y=="function"&&(Fc(t,n,Y,l),z=t.memoizedState),(j=Tn||Cd(t,n,j,l,D,z,f))?(B||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=z),c.props=l,c.state=z,c.context=f,l=j):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,Tc(e,t),f=t.memoizedProps,B=fl(n,f),c.props=B,Y=t.pendingProps,D=c.context,z=n.contextType,j=Ul,typeof z=="object"&&z!==null&&(j=at(z)),h=n.getDerivedStateFromProps,(z=typeof h=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==Y||D!==j)&&zd(t,c,l,j),Tn=!1,D=t.memoizedState,c.state=D,Ra(t,l,c,s),Da();var U=t.memoizedState;f!==Y||D!==U||Tn||e!==null&&e.dependencies!==null&&zs(e.dependencies)?(typeof h=="function"&&(Fc(t,n,h,l),U=t.memoizedState),(B=Tn||Cd(t,n,B,l,D,U,j)||e!==null&&e.dependencies!==null&&zs(e.dependencies))?(z||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,U,j),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,U,j)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=U),c.props=l,c.state=U,c.context=j,l=B):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Is(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=ul(t,e.child,null,s),t.child=ul(t,null,n,s)):st(e,t,n,s),t.memoizedState=c.state,e=t.child):e=cn(e,t,s),e}function Zd(e,t,n,l){return al(),t.flags|=256,st(e,t,n,l),t.child}var tr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nr(e){return{baseLanes:e,cachePool:Uu()}}function lr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=kt),e}function Kd(e,t,n){var l=t.pendingProps,s=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(s?wn(t):Cn(),(e=Ue)?(e=lm(e,zt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sn!==null?{id:Xt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},n=Tu(e),n.return=t,t.child=n,lt=t,Ue=null)):e=null,e===null)throw _n(t);return Br(e)?t.lanes=32:t.lanes=536870912,null}var h=l.children;return l=l.fallback,s?(Cn(),s=t.mode,h=Ws({mode:"hidden",children:h},s),l=ll(l,s,n,null),h.return=t,l.return=t,h.sibling=l,t.child=h,l=t.child,l.memoizedState=nr(n),l.childLanes=lr(e,f,n),t.memoizedState=tr,Ba(null,l)):(wn(t),ar(t,h))}var j=e.memoizedState;if(j!==null&&(h=j.dehydrated,h!==null)){if(c)t.flags&256?(wn(t),t.flags&=-257,t=sr(e,t,n)):t.memoizedState!==null?(Cn(),t.child=e.child,t.flags|=128,t=null):(Cn(),h=l.fallback,s=t.mode,l=Ws({mode:"visible",children:l.children},s),h=ll(h,s,n,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,ul(t,e.child,null,n),l=t.child,l.memoizedState=nr(n),l.childLanes=lr(e,f,n),t.memoizedState=tr,t=Ba(null,l));else if(wn(t),Br(h)){if(f=h.nextSibling&&h.nextSibling.dataset,f)var z=f.dgst;f=z,l=Error(o(419)),l.stack="",l.digest=f,Ta({value:l,source:null,stack:null}),t=sr(e,t,n)}else if(Ke||Hl(e,t,n,!1),f=(n&e.childLanes)!==0,Ke||f){if(f=Oe,f!==null&&(l=Ro(f,n),l!==0&&l!==j.retryLane))throw j.retryLane=l,nl(e,l),pt(f,e,l),Pc;Lr(h)||ci(),t=sr(e,t,n)}else Lr(h)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ue=Rt(h.nextSibling),lt=t,Ne=!0,kn=null,zt=!1,e!==null&&wu(t,e),t=ar(t,l.children),t.flags|=4096);return t}return s?(Cn(),h=l.fallback,s=t.mode,j=e.child,z=j.sibling,l=en(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,z!==null?h=en(z,h):(h=ll(h,s,n,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,Ba(null,l),l=t.child,h=e.child.memoizedState,h===null?h=nr(n):(s=h.cachePool,s!==null?(j=Qe._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=Uu(),h={baseLanes:h.baseLanes|n,cachePool:s}),l.memoizedState=h,l.childLanes=lr(e,f,n),t.memoizedState=tr,Ba(e.child,l)):(wn(t),n=e.child,e=n.sibling,n=en(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function ar(e,t){return t=Ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ws(e,t){return e=bt(22,e,null,t),e.lanes=0,e}function sr(e,t,n){return ul(t,e.child,null,n),e=ar(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),bc(e.return,t,n)}function ir(e,t,n,l,s,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:s,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=n,f.tailMode=s,f.treeForkCount=c)}function Fd(e,t,n){var l=t.pendingProps,s=l.revealOrder,c=l.tail;l=l.children;var f=Ye.current,h=(f&2)!==0;if(h?(f=f&1|2,t.flags|=128):f&=1,V(Ye,f),st(e,t,l,n),l=Ne?Ea:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jd(e,n,t);else if(e.tag===19)Jd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Hs(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ir(t,!1,s,n,c,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Hs(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ir(t,!0,n,null,c,l);break;case"together":ir(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function cn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Rn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=en(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=en(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&zs(e)))}function Gx(e,t,n){switch(t.tag){case 3:Re(t,t.stateNode.containerInfo),En(t,Qe,e.memoizedState.cache),al();break;case 27:case 5:qt(t);break;case 4:Re(t,t.stateNode.containerInfo);break;case 10:En(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(wn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Kd(e,t,n):(wn(t),e=cn(e,t,n),e!==null?e.sibling:null);wn(t);break;case 19:var s=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Hl(e,t,n,!1),l=(n&t.childLanes)!==0),s){if(l)return Fd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),V(Ye,Ye.current),l)break;return null;case 22:return t.lanes=0,Gd(e,t,n,t.pendingProps);case 24:En(t,Qe,e.memoizedState.cache)}return cn(e,t,n)}function Id(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ke=!0;else{if(!cr(e,n)&&(t.flags&128)===0)return Ke=!1,Gx(e,t,n);Ke=(e.flags&131072)!==0}else Ke=!1,Ne&&(t.flags&1048576)!==0&&Au(t,Ea,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=rl(t.elementType),t.type=e,typeof e=="function")fc(e)?(l=fl(e,l),t.tag=1,t=Qd(null,t,e,l,n)):(t.tag=0,t=er(null,t,e,l,n));else{if(e!=null){var s=e.$$typeof;if(s===J){t.tag=11,t=Bd(null,t,e,l,n);break e}else if(s===w){t.tag=14,t=Hd(null,t,e,l,n);break e}}throw t=me(e)||e,Error(o(306,t,""))}}return t;case 0:return er(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,s=fl(l,t.pendingProps),Qd(e,t,l,s,n);case 3:e:{if(Re(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var c=t.memoizedState;s=c.element,Tc(e,t),Ra(t,l,null,n);var f=t.memoizedState;if(l=f.cache,En(t,Qe,l),l!==c.cache&&jc(t,[Qe],n,!0),Da(),l=f.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Zd(e,t,l,n);break e}else if(l!==s){s=At(Error(o(424)),t),Ta(s),t=Zd(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ue=Rt(e.firstChild),lt=t,Ne=!0,kn=null,zt=!0,n=Gu(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(al(),l===s){t=cn(e,t,n);break e}st(e,t,l,n)}t=t.child}return t;case 26:return Is(e,t),e===null?(n=om(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,l=hi(re.current).createElement(n),l[nt]=t,l[ut]=e,it(l,n,e),Pe(l),t.stateNode=l):t.memoizedState=om(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qt(t),e===null&&Ne&&(l=t.stateNode=im(t.type,t.pendingProps,re.current),lt=t,zt=!0,s=Ue,Bn(t.type)?(Hr=s,Ue=Rt(l.firstChild)):Ue=s),st(e,t,t.pendingProps.children,n),Is(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((s=l=Ue)&&(l=gp(l,t.type,t.pendingProps,zt),l!==null?(t.stateNode=l,lt=t,Ue=Rt(l.firstChild),zt=!1,s=!0):s=!1),s||_n(t)),qt(t),s=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,l=c.children,Or(s,c)?l=null:f!==null&&Or(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Rc(e,t,Dx,null,null,n),es._currentValue=s),Is(e,t),st(e,t,l,n),t.child;case 6:return e===null&&Ne&&((e=n=Ue)&&(n=yp(n,t.pendingProps,zt),n!==null?(t.stateNode=n,lt=t,Ue=null,e=!0):e=!1),e||_n(t)),null;case 13:return Kd(e,t,n);case 4:return Re(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ul(t,null,l,n):st(e,t,l,n),t.child;case 11:return Bd(e,t,t.type,t.pendingProps,n);case 7:return st(e,t,t.pendingProps,n),t.child;case 8:return st(e,t,t.pendingProps.children,n),t.child;case 12:return st(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,En(t,t.type,l.value),st(e,t,l.children,n),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,il(t),s=at(s),l=l(s),t.flags|=1,st(e,t,l,n),t.child;case 14:return Hd(e,t,t.type,t.pendingProps,n);case 15:return $d(e,t,t.type,t.pendingProps,n);case 19:return Fd(e,t,n);case 31:return $x(e,t,n);case 22:return Gd(e,t,n,t.pendingProps);case 24:return il(t),l=at(Qe),e===null?(s=kc(),s===null&&(s=Oe,c=Nc(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=n),s=c),t.memoizedState={parent:l,cache:s},Ec(t),En(t,Qe,s)):((e.lanes&n)!==0&&(Tc(e,t),Ra(t,null,null,n),Da()),s=e.memoizedState,c=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),En(t,Qe,l)):(l=c.cache,En(t,Qe,l),l!==s.cache&&jc(t,[Qe],n,!0))),st(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function rn(e){e.flags|=4}function rr(e,t,n,l,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(_f())e.flags|=8192;else throw ol=Us,_c}else e.flags&=-16777217}function Wd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hm(t))if(_f())e.flags|=8192;else throw ol=Us,_c}function Ps(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Co():536870912,e.lanes|=t,Wl|=t)}function Ha(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags&65011712,l|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Yx(e,t,n){var l=t.pendingProps;switch(pc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ln(Qe),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Bl(t)?rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,gc())),qe(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(rn(t),c!==null?(qe(t),Wd(t,c)):(qe(t),rr(t,s,null,l,n))):c?c!==e.memoizedState?(rn(t),qe(t),Wd(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&rn(t),qe(t),rr(t,s,e,l,n)),null;case 27:if(Ae(t),n=re.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&rn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return qe(t),null}e=G.current,Bl(t)?Cu(t):(e=im(s,l,n),t.stateNode=e,rn(t))}return qe(t),null;case 5:if(Ae(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&rn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return qe(t),null}if(c=G.current,Bl(t))Cu(t);else{var f=hi(re.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?f.createElement(s,{is:l.is}):f.createElement(s)}}c[nt]=t,c[ut]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(it(c,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&rn(t)}}return qe(t),rr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&rn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=re.current,Bl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,s=lt,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Jf(e.nodeValue,n)),e||_n(t,!0)}else e=hi(e).createTextNode(l),e[nt]=t,t.stateNode=e}return qe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Bl(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[nt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else n=gc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return qe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Bl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[nt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),s=!1}else s=gc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==s&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ps(t,t.updateQueue),qe(t),null);case 4:return Me(),e===null&&wr(t.stateNode.containerInfo),qe(t),null;case 10:return ln(t.type),qe(t),null;case 19:if(R(Ye),l=t.memoizedState,l===null)return qe(t),null;if(s=(t.flags&128)!==0,c=l.rendering,c===null)if(s)Ha(l,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Hs(e),c!==null){for(t.flags|=128,Ha(l,!1),e=c.updateQueue,t.updateQueue=e,Ps(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Eu(n,e),n=n.sibling;return V(Ye,Ye.current&1|2),Ne&&tn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Le()>ai&&(t.flags|=128,s=!0,Ha(l,!1),t.lanes=4194304)}else{if(!s)if(e=Hs(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ps(t,e),Ha(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ne)return qe(t),null}else 2*Le()-l.renderingStartTime>ai&&n!==536870912&&(t.flags|=128,s=!0,Ha(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Le(),e.sibling=null,n=Ye.current,V(Ye,s?n&1|2:n&1),Ne&&tn(t,l.treeForkCount),e):(qe(t),null);case 22:case 23:return Nt(t),Cc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),n=t.updateQueue,n!==null&&Ps(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&R(cl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ln(Qe),qe(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Xx(e,t){switch(pc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ln(Qe),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(o(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(Ye),null;case 4:return Me(),null;case 10:return ln(t.type),null;case 22:case 23:return Nt(t),Cc(),e!==null&&R(cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ln(Qe),null;case 25:return null;default:return null}}function Pd(e,t){switch(pc(t),t.tag){case 3:ln(Qe),Me();break;case 26:case 27:case 5:Ae(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:R(Ye);break;case 10:ln(t.type);break;case 22:case 23:Nt(t),Cc(),e!==null&&R(cl);break;case 24:ln(Qe)}}function $a(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var s=l.next;n=s;do{if((n.tag&e)===e){l=void 0;var c=n.create,f=n.inst;l=c(),f.destroy=l}n=n.next}while(n!==s)}}catch(h){Te(t,t.return,h)}}function zn(e,t,n){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){var f=l.inst,h=f.destroy;if(h!==void 0){f.destroy=void 0,s=t;var j=n,z=h;try{z()}catch(B){Te(s,j,B)}}}l=l.next}while(l!==c)}}catch(B){Te(t,t.return,B)}}function ef(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xu(t,n)}catch(l){Te(e,e.return,l)}}}function tf(e,t,n){n.props=fl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Te(e,t,l)}}function Ga(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(s){Te(e,t,s)}}function Qt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(s){Te(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){Te(e,t,s)}else n.current=null}function nf(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(s){Te(e,e.return,s)}}function or(e,t,n){try{var l=e.stateNode;fp(l,e.type,n,t),l[ut]=t}catch(s){Te(e,e.return,s)}}function lf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bn(e.type)||e.tag===4}function ur(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lf(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&&Bn(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 dr(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wt));else if(l!==4&&(l===27&&Bn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(dr(e,t,n),e=e.sibling;e!==null;)dr(e,t,n),e=e.sibling}function ei(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Bn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ei(e,t,n),e=e.sibling;e!==null;)ei(e,t,n),e=e.sibling}function af(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);it(t,l,n),t[nt]=e,t[ut]=n}catch(c){Te(e,e.return,c)}}var on=!1,Je=!1,fr=!1,sf=typeof WeakSet=="function"?WeakSet:Set,et=null;function Vx(e,t){if(e=e.containerInfo,Dr=ji,e=vu(e),sc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var s=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var f=0,h=-1,j=-1,z=0,B=0,Y=e,D=null;t:for(;;){for(var U;Y!==n||s!==0&&Y.nodeType!==3||(h=f+s),Y!==c||l!==0&&Y.nodeType!==3||(j=f+l),Y.nodeType===3&&(f+=Y.nodeValue.length),(U=Y.firstChild)!==null;)D=Y,Y=U;for(;;){if(Y===e)break t;if(D===n&&++z===s&&(h=f),D===c&&++B===l&&(j=f),(U=Y.nextSibling)!==null)break;Y=D,D=Y.parentNode}Y=U}n=h===-1||j===-1?null:{start:h,end:j}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rr={focusedElem:e,selectionRange:n},ji=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,s=c.memoizedProps,c=c.memoizedState,l=n.stateNode;try{var se=fl(n.type,s);e=l.getSnapshotBeforeUpdate(se,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(fe){Te(n,n.return,fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)qr(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":qr(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,et=e;break}et=t.return}}function cf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:dn(e,n),l&4&&$a(5,n);break;case 1:if(dn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){Te(n,n.return,f)}else{var s=fl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Te(n,n.return,f)}}l&64&&ef(n),l&512&&Ga(n,n.return);break;case 3:if(dn(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xu(e,t)}catch(f){Te(n,n.return,f)}}break;case 27:t===null&&l&4&&af(n);case 26:case 5:dn(e,n),t===null&&l&4&&nf(n),l&512&&Ga(n,n.return);break;case 12:dn(e,n);break;case 31:dn(e,n),l&4&&uf(e,n);break;case 13:dn(e,n),l&4&&df(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ep.bind(null,n),bp(e,n))));break;case 22:if(l=n.memoizedState!==null||on,!l){t=t!==null&&t.memoizedState!==null||Je,s=on;var c=Je;on=l,(Je=t)&&!c?fn(e,n,(n.subtreeFlags&8772)!==0):dn(e,n),on=s,Je=c}break;case 30:break;default:dn(e,n)}}function rf(e){var t=e.alternate;t!==null&&(e.alternate=null,rf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Gi(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 Be=null,ft=!1;function un(e,t,n){for(n=n.child;n!==null;)of(e,t,n),n=n.sibling}function of(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(fa,n)}catch{}switch(n.tag){case 26:Je||Qt(n,t),un(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Je||Qt(n,t);var l=Be,s=ft;Bn(n.type)&&(Be=n.stateNode,ft=!1),un(e,t,n),Ia(n.stateNode),Be=l,ft=s;break;case 5:Je||Qt(n,t);case 6:if(l=Be,s=ft,Be=null,un(e,t,n),Be=l,ft=s,Be!==null)if(ft)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(c){Te(n,t,c)}else try{Be.removeChild(n.stateNode)}catch(c){Te(n,t,c)}break;case 18:Be!==null&&(ft?(e=Be,tm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ia(e)):tm(Be,n.stateNode));break;case 4:l=Be,s=ft,Be=n.stateNode.containerInfo,ft=!0,un(e,t,n),Be=l,ft=s;break;case 0:case 11:case 14:case 15:zn(2,n,t),Je||zn(4,n,t),un(e,t,n);break;case 1:Je||(Qt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&tf(n,t,l)),un(e,t,n);break;case 21:un(e,t,n);break;case 22:Je=(l=Je)||n.memoizedState!==null,un(e,t,n),Je=l;break;default:un(e,t,n)}}function uf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ia(e)}catch(n){Te(t,t.return,n)}}}function df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ia(e)}catch(n){Te(t,t.return,n)}}function Qx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sf),t;default:throw Error(o(435,e.tag))}}function ti(e,t){var n=Qx(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var s=tp.bind(null,e,l);l.then(s,s)}})}function mt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var s=n[l],c=e,f=t,h=f;e:for(;h!==null;){switch(h.tag){case 27:if(Bn(h.type)){Be=h.stateNode,ft=!1;break e}break;case 5:Be=h.stateNode,ft=!1;break e;case 3:case 4:Be=h.stateNode.containerInfo,ft=!0;break e}h=h.return}if(Be===null)throw Error(o(160));of(c,f,s),Be=null,ft=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ff(t,e),t=t.sibling}var $t=null;function ff(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mt(t,e),ht(e),l&4&&(zn(3,e,e.return),$a(3,e),zn(5,e,e.return));break;case 1:mt(t,e),ht(e),l&512&&(Je||n===null||Qt(n,n.return)),l&64&&on&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var s=$t;if(mt(t,e),ht(e),l&512&&(Je||n===null||Qt(n,n.return)),l&4){var c=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(l){case"title":c=s.getElementsByTagName("title")[0],(!c||c[xa]||c[nt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(l),s.head.insertBefore(c,s.querySelector("head > title"))),it(c,l,n),c[nt]=e,Pe(c),l=c;break e;case"link":var f=fm("link","href",s).get(l+(n.href||""));if(f){for(var h=0;h<f.length;h++)if(c=f[h],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(h,1);break t}}c=s.createElement(l),it(c,l,n),s.head.appendChild(c);break;case"meta":if(f=fm("meta","content",s).get(l+(n.content||""))){for(h=0;h<f.length;h++)if(c=f[h],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(h,1);break t}}c=s.createElement(l),it(c,l,n),s.head.appendChild(c);break;default:throw Error(o(468,l))}c[nt]=e,Pe(c),l=c}e.stateNode=l}else mm(s,e.type,e.stateNode);else e.stateNode=dm(s,l,e.memoizedProps);else c!==l?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,l===null?mm(s,e.type,e.stateNode):dm(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&or(e,e.memoizedProps,n.memoizedProps)}break;case 27:mt(t,e),ht(e),l&512&&(Je||n===null||Qt(n,n.return)),n!==null&&l&4&&or(e,e.memoizedProps,n.memoizedProps);break;case 5:if(mt(t,e),ht(e),l&512&&(Je||n===null||Qt(n,n.return)),e.flags&32){s=e.stateNode;try{Al(s,"")}catch(se){Te(e,e.return,se)}}l&4&&e.stateNode!=null&&(s=e.memoizedProps,or(e,s,n!==null?n.memoizedProps:s)),l&1024&&(fr=!0);break;case 6:if(mt(t,e),ht(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(se){Te(e,e.return,se)}}break;case 3:if(vi=null,s=$t,$t=xi(t.containerInfo),mt(t,e),$t=s,ht(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ia(t.containerInfo)}catch(se){Te(e,e.return,se)}fr&&(fr=!1,mf(e));break;case 4:l=$t,$t=xi(e.stateNode.containerInfo),mt(t,e),ht(e),$t=l;break;case 12:mt(t,e),ht(e);break;case 31:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ti(e,l)));break;case 13:mt(t,e),ht(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(li=Le()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ti(e,l)));break;case 22:s=e.memoizedState!==null;var j=n!==null&&n.memoizedState!==null,z=on,B=Je;if(on=z||s,Je=B||j,mt(t,e),Je=B,on=z,ht(e),l&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||j||on||Je||ml(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){j=n=t;try{if(c=j.stateNode,s)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{h=j.stateNode;var Y=j.memoizedProps.style,D=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;h.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(se){Te(j,j.return,se)}}}else if(t.tag===6){if(n===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(se){Te(j,j.return,se)}}}else if(t.tag===18){if(n===null){j=t;try{var U=j.stateNode;s?nm(U,!0):nm(j.stateNode,!1)}catch(se){Te(j,j.return,se)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,ti(e,n))));break;case 19:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ti(e,l)));break;case 30:break;case 21:break;default:mt(t,e),ht(e)}}function ht(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(lf(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var s=n.stateNode,c=ur(e);ei(e,c,s);break;case 5:var f=n.stateNode;n.flags&32&&(Al(f,""),n.flags&=-33);var h=ur(e);ei(e,h,f);break;case 3:case 4:var j=n.stateNode.containerInfo,z=ur(e);dr(e,z,j);break;default:throw Error(o(161))}}catch(B){Te(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function dn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cf(e,t.alternate,t),t=t.sibling}function ml(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zn(4,t,t.return),ml(t);break;case 1:Qt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&tf(t,t.return,n),ml(t);break;case 27:Ia(t.stateNode);case 26:case 5:Qt(t,t.return),ml(t);break;case 22:t.memoizedState===null&&ml(t);break;case 30:ml(t);break;default:ml(t)}e=e.sibling}}function fn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,s=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:fn(s,c,n),$a(4,c);break;case 1:if(fn(s,c,n),l=c,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(z){Te(l,l.return,z)}if(l=c,s=l.updateQueue,s!==null){var h=l.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)Yu(j[s],h)}catch(z){Te(l,l.return,z)}}n&&f&64&&ef(c),Ga(c,c.return);break;case 27:af(c);case 26:case 5:fn(s,c,n),n&&l===null&&f&4&&nf(c),Ga(c,c.return);break;case 12:fn(s,c,n);break;case 31:fn(s,c,n),n&&f&4&&uf(s,c);break;case 13:fn(s,c,n),n&&f&4&&df(s,c);break;case 22:c.memoizedState===null&&fn(s,c,n),Ga(c,c.return);break;case 30:break;default:fn(s,c,n)}t=t.sibling}}function mr(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ma(n))}function hr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Gt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hf(e,t,n,l),t=t.sibling}function hf(e,t,n,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Gt(e,t,n,l),s&2048&&$a(9,t);break;case 1:Gt(e,t,n,l);break;case 3:Gt(e,t,n,l),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e)));break;case 12:if(s&2048){Gt(e,t,n,l),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,h=c.onPostCommit;typeof h=="function"&&h(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Te(t,t.return,j)}}else Gt(e,t,n,l);break;case 31:Gt(e,t,n,l);break;case 13:Gt(e,t,n,l);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?Gt(e,t,n,l):Ya(e,t):c._visibility&2?Gt(e,t,n,l):(c._visibility|=2,Jl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&mr(f,t);break;case 24:Gt(e,t,n,l),s&2048&&hr(t.alternate,t);break;default:Gt(e,t,n,l)}}function Jl(e,t,n,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,h=n,j=l,z=f.flags;switch(f.tag){case 0:case 11:case 15:Jl(c,f,h,j,s),$a(8,f);break;case 23:break;case 22:var B=f.stateNode;f.memoizedState!==null?B._visibility&2?Jl(c,f,h,j,s):Ya(c,f):(B._visibility|=2,Jl(c,f,h,j,s)),s&&z&2048&&mr(f.alternate,f);break;case 24:Jl(c,f,h,j,s),s&&z&2048&&hr(f.alternate,f);break;default:Jl(c,f,h,j,s)}t=t.sibling}}function Ya(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,s=l.flags;switch(l.tag){case 22:Ya(n,l),s&2048&&mr(l.alternate,l);break;case 24:Ya(n,l),s&2048&&hr(l.alternate,l);break;default:Ya(n,l)}t=t.sibling}}var Xa=8192;function Fl(e,t,n){if(e.subtreeFlags&Xa)for(e=e.child;e!==null;)xf(e,t,n),e=e.sibling}function xf(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Xa&&e.memoizedState!==null&&zp(n,$t,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var l=$t;$t=xi(e.stateNode.containerInfo),Fl(e,t,n),$t=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Xa,Xa=16777216,Fl(e,t,n),Xa=l):Fl(e,t,n));break;default:Fl(e,t,n)}}function pf(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 Va(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];et=l,gf(l,e)}pf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vf(e),e=e.sibling}function vf(e){switch(e.tag){case 0:case 11:case 15:Va(e),e.flags&2048&&zn(9,e,e.return);break;case 3:Va(e);break;case 12:Va(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ni(e)):Va(e);break;default:Va(e)}}function ni(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];et=l,gf(l,e)}pf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zn(8,t,t.return),ni(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ni(t));break;default:ni(t)}e=e.sibling}}function gf(e,t){for(;et!==null;){var n=et;switch(n.tag){case 0:case 11:case 15:zn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ma(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,et=l;else e:for(n=e;et!==null;){l=et;var s=l.sibling,c=l.return;if(rf(l),l===n){et=null;break e}if(s!==null){s.return=c,et=s;break e}et=c}}}var Zx={getCacheForType:function(e){var t=at(Qe),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return at(Qe).controller.signal}},Kx=typeof WeakMap=="function"?WeakMap:Map,_e=0,Oe=null,ge=null,be=0,Ee=0,St=null,Dn=!1,Il=!1,xr=!1,mn=0,$e=0,Rn=0,hl=0,pr=0,kt=0,Wl=0,Qa=null,xt=null,vr=!1,li=0,yf=0,ai=1/0,si=null,On=null,Ie=0,Un=null,Pl=null,hn=0,gr=0,yr=null,bf=null,Za=0,br=null;function _t(){return(_e&2)!==0&&be!==0?be&-be:T.T!==null?Er():Oo()}function jf(){if(kt===0)if((be&536870912)===0||Ne){var e=ms;ms<<=1,(ms&3932160)===0&&(ms=262144),kt=e}else kt=536870912;return e=jt.current,e!==null&&(e.flags|=32),kt}function pt(e,t,n){(e===Oe&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)&&(ea(e,0),qn(e,be,kt,!1)),ha(e,n),((_e&2)===0||e!==Oe)&&(e===Oe&&((_e&2)===0&&(hl|=n),$e===4&&qn(e,be,kt,!1)),Zt(e))}function Nf(e,t,n){if((_e&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ma(e,t),s=l?Ix(e,t):Nr(e,t,!0),c=l;do{if(s===0){Il&&!l&&qn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Jx(n)){s=Nr(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var h=e;s=Qa;var j=h.current.memoizedState.isDehydrated;if(j&&(ea(h,f).flags|=256),f=Nr(h,f,!1),f!==2){if(xr&&!j){h.errorRecoveryDisabledLanes|=c,hl|=c,s=4;break e}c=xt,xt=s,c!==null&&(xt===null?xt=c:xt.push.apply(xt,c))}s=f}if(c=!1,s!==2)continue}}if(s===1){ea(e,0),qn(e,t,0,!0);break}e:{switch(l=e,c=s,c){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:qn(l,t,kt,!Dn);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=li+300-Le(),10<s)){if(qn(l,t,kt,!Dn),xs(l,0,!0)!==0)break e;hn=t,l.timeoutHandle=Pf(Sf.bind(null,l,n,xt,si,vr,t,kt,hl,Wl,Dn,c,"Throttled",-0,0),s);break e}Sf(l,n,xt,si,vr,t,kt,hl,Wl,Dn,c,null,-0,0)}}break}while(!0);Zt(e)}function Sf(e,t,n,l,s,c,f,h,j,z,B,Y,D,U){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},xf(t,c,Y);var se=(c&62914560)===c?li-Le():(c&4194048)===c?yf-Le():0;if(se=Dp(Y,se),se!==null){hn=c,e.cancelPendingCommit=se(Cf.bind(null,e,t,c,n,l,s,f,h,j,B,Y,null,D,U)),qn(e,c,f,!z);return}}Cf(e,t,c,n,l,s,f,h,j)}function Jx(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var s=n[l],c=s.getSnapshot;s=s.value;try{if(!yt(c(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qn(e,t,n,l){t&=~pr,t&=~hl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var c=31-gt(s),f=1<<c;l[c]=-1,s&=~f}n!==0&&zo(e,n,t)}function ii(){return(_e&6)===0?(Ka(0),!1):!0}function jr(){if(ge!==null){if(Ee===0)var e=ge.return;else e=ge,nn=sl=null,qc(e),Xl=null,wa=0,e=ge;for(;e!==null;)Pd(e.alternate,e),e=e.return;ge=null}}function ea(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hn=0,jr(),Oe=e,ge=n=en(e.current,null),be=t,Ee=0,St=null,Dn=!1,Il=ma(e,t),xr=!1,Wl=kt=pr=hl=Rn=$e=0,xt=Qa=null,vr=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var s=31-gt(l),c=1<<s;t|=e[s],l&=~c}return mn=t,Ts(),n}function kf(e,t){xe=null,T.H=La,t===Yl||t===Os?(t=Bu(),Ee=3):t===_c?(t=Bu(),Ee=4):Ee=t===Pc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,St=t,ge===null&&($e=1,Js(e,At(t,e.current)))}function _f(){var e=jt.current;return e===null?!0:(be&4194048)===be?Dt===null:(be&62914560)===be||(be&536870912)!==0?e===Dt:!1}function Ef(){var e=T.H;return T.H=La,e===null?La:e}function Tf(){var e=T.A;return T.A=Zx,e}function ci(){$e=4,Dn||(be&4194048)!==be&&jt.current!==null||(Il=!0),(Rn&134217727)===0&&(hl&134217727)===0||Oe===null||qn(Oe,be,kt,!1)}function Nr(e,t,n){var l=_e;_e|=2;var s=Ef(),c=Tf();(Oe!==e||be!==t)&&(si=null,ea(e,t)),t=!1;var f=$e;e:do try{if(Ee!==0&&ge!==null){var h=ge,j=St;switch(Ee){case 8:jr(),f=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var z=Ee;if(Ee=0,St=null,ta(e,h,j,z),n&&Il){f=0;break e}break;default:z=Ee,Ee=0,St=null,ta(e,h,j,z)}}Fx(),f=$e;break}catch(B){kf(e,B)}while(!0);return t&&e.shellSuspendCounter++,nn=sl=null,_e=l,T.H=s,T.A=c,ge===null&&(Oe=null,be=0,Ts()),f}function Fx(){for(;ge!==null;)Mf(ge)}function Ix(e,t){var n=_e;_e|=2;var l=Ef(),s=Tf();Oe!==e||be!==t?(si=null,ai=Le()+500,ea(e,t)):Il=ma(e,t);e:do try{if(Ee!==0&&ge!==null){t=ge;var c=St;t:switch(Ee){case 1:Ee=0,St=null,ta(e,t,c,1);break;case 2:case 9:if(qu(c)){Ee=0,St=null,Af(t);break}t=function(){Ee!==2&&Ee!==9||Oe!==e||(Ee=7),Zt(e)},c.then(t,t);break e;case 3:Ee=7;break e;case 4:Ee=5;break e;case 7:qu(c)?(Ee=0,St=null,Af(t)):(Ee=0,St=null,ta(e,t,c,7));break;case 5:var f=null;switch(ge.tag){case 26:f=ge.memoizedState;case 5:case 27:var h=ge;if(f?hm(f):h.stateNode.complete){Ee=0,St=null;var j=h.sibling;if(j!==null)ge=j;else{var z=h.return;z!==null?(ge=z,ri(z)):ge=null}break t}}Ee=0,St=null,ta(e,t,c,5);break;case 6:Ee=0,St=null,ta(e,t,c,6);break;case 8:jr(),$e=6;break e;default:throw Error(o(462))}}Wx();break}catch(B){kf(e,B)}while(!0);return nn=sl=null,T.H=l,T.A=s,_e=n,ge!==null?0:(Oe=null,be=0,Ts(),$e)}function Wx(){for(;ge!==null&&!Fe();)Mf(ge)}function Mf(e){var t=Id(e.alternate,e,mn);e.memoizedProps=e.pendingProps,t===null?ri(e):ge=t}function Af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vd(n,t,t.pendingProps,t.type,void 0,be);break;case 11:t=Vd(n,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:qc(t);default:Pd(n,t),t=ge=Eu(t,mn),t=Id(n,t,mn)}e.memoizedProps=e.pendingProps,t===null?ri(e):ge=t}function ta(e,t,n,l){nn=sl=null,qc(t),Xl=null,wa=0;var s=t.return;try{if(Hx(e,s,t,n,be)){$e=1,Js(e,At(n,e.current)),ge=null;return}}catch(c){if(s!==null)throw ge=s,c;$e=1,Js(e,At(n,e.current)),ge=null;return}t.flags&32768?(Ne||l===1?e=!0:Il||(be&536870912)!==0?e=!1:(Dn=e=!0,(l===2||l===9||l===3||l===6)&&(l=jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),wf(t,e)):ri(t)}function ri(e){var t=e;do{if((t.flags&32768)!==0){wf(t,Dn);return}e=t.return;var n=Yx(t.alternate,t,mn);if(n!==null){ge=n;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);$e===0&&($e=5)}function wf(e,t){do{var n=Xx(e.alternate,e);if(n!==null){n.flags&=32767,ge=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=n}while(e!==null);$e=6,ge=null}function Cf(e,t,n,l,s,c,f,h,j){e.cancelPendingCommit=null;do oi();while(Ie!==0);if((_e&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(c=t.lanes|t.childLanes,c|=uc,Ch(e,n,c,f,h,j),e===Oe&&(ge=Oe=null,be=0),Pl=t,Un=e,hn=n,gr=c,yr=s,bf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,np(ds,function(){return Uf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=T.T,T.T=null,s=H.p,H.p=2,f=_e,_e|=4;try{Vx(e,t,n)}finally{_e=f,H.p=s,T.T=l}}Ie=1,zf(),Df(),Rf()}}function zf(){if(Ie===1){Ie=0;var e=Un,t=Pl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=T.T,T.T=null;var l=H.p;H.p=2;var s=_e;_e|=4;try{ff(t,e);var c=Rr,f=vu(e.containerInfo),h=c.focusedElem,j=c.selectionRange;if(f!==h&&h&&h.ownerDocument&&pu(h.ownerDocument.documentElement,h)){if(j!==null&&sc(h)){var z=j.start,B=j.end;if(B===void 0&&(B=z),"selectionStart"in h)h.selectionStart=z,h.selectionEnd=Math.min(B,h.value.length);else{var Y=h.ownerDocument||document,D=Y&&Y.defaultView||window;if(D.getSelection){var U=D.getSelection(),se=h.textContent.length,fe=Math.min(j.start,se),De=j.end===void 0?fe:Math.min(j.end,se);!U.extend&&fe>De&&(f=De,De=fe,fe=f);var _=xu(h,fe),N=xu(h,De);if(_&&N&&(U.rangeCount!==1||U.anchorNode!==_.node||U.anchorOffset!==_.offset||U.focusNode!==N.node||U.focusOffset!==N.offset)){var C=Y.createRange();C.setStart(_.node,_.offset),U.removeAllRanges(),fe>De?(U.addRange(C),U.extend(N.node,N.offset)):(C.setEnd(N.node,N.offset),U.addRange(C))}}}}for(Y=[],U=h;U=U.parentNode;)U.nodeType===1&&Y.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<Y.length;h++){var $=Y[h];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}ji=!!Dr,Rr=Dr=null}finally{_e=s,H.p=l,T.T=n}}e.current=t,Ie=2}}function Df(){if(Ie===2){Ie=0;var e=Un,t=Pl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=T.T,T.T=null;var l=H.p;H.p=2;var s=_e;_e|=4;try{cf(e,t.alternate,t)}finally{_e=s,H.p=l,T.T=n}}Ie=3}}function Rf(){if(Ie===4||Ie===3){Ie=0,Bt();var e=Un,t=Pl,n=hn,l=bf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,Pl=Un=null,Of(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(On=null),Hi(n),t=t.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(fa,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=T.T,s=H.p,H.p=2,T.T=null;try{for(var c=e.onRecoverableError,f=0;f<l.length;f++){var h=l[f];c(h.value,{componentStack:h.stack})}}finally{T.T=t,H.p=s}}(hn&3)!==0&&oi(),Zt(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===br?Za++:(Za=0,br=e):Za=0,Ka(0)}}function Of(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function oi(){return zf(),Df(),Rf(),Uf()}function Uf(){if(Ie!==5)return!1;var e=Un,t=gr;gr=0;var n=Hi(hn),l=T.T,s=H.p;try{H.p=32>n?32:n,T.T=null,n=yr,yr=null;var c=Un,f=hn;if(Ie=0,Pl=Un=null,hn=0,(_e&6)!==0)throw Error(o(331));var h=_e;if(_e|=4,vf(c.current),hf(c,c.current,f,n),_e=h,Ka(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(fa,c)}catch{}return!0}finally{H.p=s,T.T=l,Of(e,t)}}function qf(e,t,n){t=At(n,t),t=Wc(e.stateNode,t,2),e=An(e,t,2),e!==null&&(ha(e,2),Zt(e))}function Te(e,t,n){if(e.tag===3)qf(e,e,n);else for(;t!==null;){if(t.tag===3){qf(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(On===null||!On.has(l))){e=At(n,e),n=qd(2),l=An(t,n,2),l!==null&&(Ld(n,l,t,e),ha(l,2),Zt(l));break}}t=t.return}}function Sr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Kx;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(n)||(xr=!0,s.add(n),e=Px.bind(null,e,t,n),t.then(e,e))}function Px(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Oe===e&&(be&n)===n&&($e===4||$e===3&&(be&62914560)===be&&300>Le()-li?(_e&2)===0&&ea(e,0):pr|=n,Wl===be&&(Wl=0)),Zt(e)}function Lf(e,t){t===0&&(t=Co()),e=nl(e,t),e!==null&&(ha(e,t),Zt(e))}function ep(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lf(e,n)}function tp(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Lf(e,n)}function np(e,t){return we(e,t)}var ui=null,na=null,kr=!1,di=!1,_r=!1,Ln=0;function Zt(e){e!==na&&e.next===null&&(na===null?ui=na=e:na=na.next=e),di=!0,kr||(kr=!0,ap())}function Ka(e,t){if(!_r&&di){_r=!0;do for(var n=!1,l=ui;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var c=0;else{var f=l.suspendedLanes,h=l.pingedLanes;c=(1<<31-gt(42|e)+1)-1,c&=s&~(f&~h),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Gf(l,c))}else c=be,c=xs(l,l===Oe?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||ma(l,c)||(n=!0,Gf(l,c));l=l.next}while(n);_r=!1}}function lp(){Bf()}function Bf(){di=kr=!1;var e=0;Ln!==0&&hp()&&(e=Ln);for(var t=Le(),n=null,l=ui;l!==null;){var s=l.next,c=Hf(l,t);c===0?(l.next=null,n===null?ui=s:n.next=s,s===null&&(na=n)):(n=l,(e!==0||(c&3)!==0)&&(di=!0)),l=s}Ie!==0&&Ie!==5||Ka(e),Ln!==0&&(Ln=0)}function Hf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-gt(c),h=1<<f,j=s[f];j===-1?((h&n)===0||(h&l)!==0)&&(s[f]=wh(h,t)):j<=t&&(e.expiredLanes|=h),c&=~h}if(t=Oe,n=be,n=xs(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Ve(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ma(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Ve(l),Hi(n)){case 2:case 8:n=Ao;break;case 32:n=ds;break;case 268435456:n=wo;break;default:n=ds}return l=$f.bind(null,e),n=we(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Ve(l),e.callbackPriority=2,e.callbackNode=null,2}function $f(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(oi()&&e.callbackNode!==n)return null;var l=be;return l=xs(e,e===Oe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Nf(e,l,t),Hf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?$f.bind(null,e):null)}function Gf(e,t){if(oi())return null;Nf(e,t,!0)}function ap(){pp(function(){(_e&6)!==0?we(Fn,lp):Bf()})}function Er(){if(Ln===0){var e=$l;e===0&&(e=fs,fs<<=1,(fs&261888)===0&&(fs=256)),Ln=e}return Ln}function Yf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ys(""+e)}function Xf(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function sp(e,t,n,l,s){if(t==="submit"&&n&&n.stateNode===s){var c=Yf((s[ut]||null).action),f=l.submitter;f&&(t=(t=f[ut]||null)?Yf(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var h=new Ss("action","action",null,l,s);e.push({event:h,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ln!==0){var j=f?Xf(s,f):new FormData(s);Qc(n,{pending:!0,data:j,method:s.method,action:c},null,j)}}else typeof c=="function"&&(h.preventDefault(),j=f?Xf(s,f):new FormData(s),Qc(n,{pending:!0,data:j,method:s.method,action:c},c,j))},currentTarget:s}]})}}for(var Tr=0;Tr<oc.length;Tr++){var Mr=oc[Tr],ip=Mr.toLowerCase(),cp=Mr[0].toUpperCase()+Mr.slice(1);Ht(ip,"on"+cp)}Ht(bu,"onAnimationEnd"),Ht(ju,"onAnimationIteration"),Ht(Nu,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(Sx,"onTransitionRun"),Ht(kx,"onTransitionStart"),Ht(_x,"onTransitionCancel"),Ht(Su,"onTransitionEnd"),Tl("onMouseEnter",["mouseout","mouseover"]),Tl("onMouseLeave",["mouseout","mouseover"]),Tl("onPointerEnter",["pointerout","pointerover"]),Tl("onPointerLeave",["pointerout","pointerover"]),Wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ja="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(" "),rp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ja));function Vf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],s=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var f=l.length-1;0<=f;f--){var h=l[f],j=h.instance,z=h.currentTarget;if(h=h.listener,j!==c&&s.isPropagationStopped())break e;c=h,s.currentTarget=z;try{c(s)}catch(B){Es(B)}s.currentTarget=null,c=j}else for(f=0;f<l.length;f++){if(h=l[f],j=h.instance,z=h.currentTarget,h=h.listener,j!==c&&s.isPropagationStopped())break e;c=h,s.currentTarget=z;try{c(s)}catch(B){Es(B)}s.currentTarget=null,c=j}}}}function ye(e,t){var n=t[$i];n===void 0&&(n=t[$i]=new Set);var l=e+"__bubble";n.has(l)||(Qf(t,e,2,!1),n.add(l))}function Ar(e,t,n){var l=0;t&&(l|=4),Qf(n,e,l,t)}var fi="_reactListening"+Math.random().toString(36).slice(2);function wr(e){if(!e[fi]){e[fi]=!0,Lo.forEach(function(n){n!=="selectionchange"&&(rp.has(n)||Ar(n,!1,e),Ar(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fi]||(t[fi]=!0,Ar("selectionchange",!1,t))}}function Qf(e,t,n,l){switch(jm(t)){case 2:var s=Up;break;case 8:s=qp;break;default:s=Vr}n=s.bind(null,t,n,e),s=void 0,!Fi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Cr(e,t,n,l,s){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var f=l.tag;if(f===3||f===4){var h=l.stateNode.containerInfo;if(h===s)break;if(f===4)for(f=l.return;f!==null;){var j=f.tag;if((j===3||j===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;h!==null;){if(f=kl(h),f===null)return;if(j=f.tag,j===5||j===6||j===26||j===27){l=c=f;continue e}h=h.parentNode}}l=l.return}Fo(function(){var z=c,B=Ki(n),Y=[];e:{var D=ku.get(e);if(D!==void 0){var U=Ss,se=e;switch(e){case"keypress":if(js(n)===0)break e;case"keydown":case"keyup":U=tx;break;case"focusin":se="focus",U=ec;break;case"focusout":se="blur",U=ec;break;case"beforeblur":case"afterblur":U=ec;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=Po;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=Yh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=ax;break;case bu:case ju:case Nu:U=Qh;break;case Su:U=ix;break;case"scroll":case"scrollend":U=$h;break;case"wheel":U=rx;break;case"copy":case"cut":case"paste":U=Kh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=tu;break;case"toggle":case"beforetoggle":U=ux}var fe=(t&4)!==0,De=!fe&&(e==="scroll"||e==="scrollend"),_=fe?D!==null?D+"Capture":null:D;fe=[];for(var N=z,C;N!==null;){var $=N;if(C=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||C===null||_===null||($=va(N,_),$!=null&&fe.push(Fa(N,$,C))),De)break;N=N.return}0<fe.length&&(D=new U(D,se,null,n,B),Y.push({event:D,listeners:fe}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",D&&n!==Zi&&(se=n.relatedTarget||n.fromElement)&&(kl(se)||se[Sl]))break e;if((U||D)&&(D=B.window===B?B:(D=B.ownerDocument)?D.defaultView||D.parentWindow:window,U?(se=n.relatedTarget||n.toElement,U=z,se=se?kl(se):null,se!==null&&(De=m(se),fe=se.tag,se!==De||fe!==5&&fe!==27&&fe!==6)&&(se=null)):(U=null,se=z),U!==se)){if(fe=Po,$="onMouseLeave",_="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(fe=tu,$="onPointerLeave",_="onPointerEnter",N="pointer"),De=U==null?D:pa(U),C=se==null?D:pa(se),D=new fe($,N+"leave",U,n,B),D.target=De,D.relatedTarget=C,$=null,kl(B)===z&&(fe=new fe(_,N+"enter",se,n,B),fe.target=C,fe.relatedTarget=De,$=fe),De=$,U&&se)t:{for(fe=op,_=U,N=se,C=0,$=_;$;$=fe($))C++;$=0;for(var oe=N;oe;oe=fe(oe))$++;for(;0<C-$;)_=fe(_),C--;for(;0<$-C;)N=fe(N),$--;for(;C--;){if(_===N||N!==null&&_===N.alternate){fe=_;break t}_=fe(_),N=fe(N)}fe=null}else fe=null;U!==null&&Zf(Y,D,U,fe,!1),se!==null&&De!==null&&Zf(Y,De,se,fe,!0)}}e:{if(D=z?pa(z):window,U=D.nodeName&&D.nodeName.toLowerCase(),U==="select"||U==="input"&&D.type==="file")var Se=ou;else if(cu(D))if(uu)Se=bx;else{Se=gx;var ie=vx}else U=D.nodeName,!U||U.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?z&&Qi(z.elementType)&&(Se=ou):Se=yx;if(Se&&(Se=Se(e,z))){ru(Y,Se,n,B);break e}ie&&ie(e,D,z),e==="focusout"&&z&&D.type==="number"&&z.memoizedProps.value!=null&&Vi(D,"number",D.value)}switch(ie=z?pa(z):window,e){case"focusin":(cu(ie)||ie.contentEditable==="true")&&(Dl=ie,ic=z,_a=null);break;case"focusout":_a=ic=Dl=null;break;case"mousedown":cc=!0;break;case"contextmenu":case"mouseup":case"dragend":cc=!1,gu(Y,n,B);break;case"selectionchange":if(Nx)break;case"keydown":case"keyup":gu(Y,n,B)}var pe;if(nc)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else zl?su(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(nu&&n.locale!=="ko"&&(zl||je!=="onCompositionStart"?je==="onCompositionEnd"&&zl&&(pe=Io()):(Nn=B,Ii="value"in Nn?Nn.value:Nn.textContent,zl=!0)),ie=mi(z,je),0<ie.length&&(je=new eu(je,e,null,n,B),Y.push({event:je,listeners:ie}),pe?je.data=pe:(pe=iu(n),pe!==null&&(je.data=pe)))),(pe=fx?mx(e,n):hx(e,n))&&(je=mi(z,"onBeforeInput"),0<je.length&&(ie=new eu("onBeforeInput","beforeinput",null,n,B),Y.push({event:ie,listeners:je}),ie.data=pe)),sp(Y,e,z,n,B)}Vf(Y,t)})}function Fa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mi(e,t){for(var n=t+"Capture",l=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=va(e,n),s!=null&&l.unshift(Fa(e,s,c)),s=va(e,t),s!=null&&l.push(Fa(e,s,c))),e.tag===3)return l;e=e.return}return[]}function op(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(e,t,n,l,s){for(var c=t._reactName,f=[];n!==null&&n!==l;){var h=n,j=h.alternate,z=h.stateNode;if(h=h.tag,j!==null&&j===l)break;h!==5&&h!==26&&h!==27||z===null||(j=z,s?(z=va(n,c),z!=null&&f.unshift(Fa(n,z,j))):s||(z=va(n,c),z!=null&&f.push(Fa(n,z,j)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var up=/\r\n?/g,dp=/\u0000|\uFFFD/g;function Kf(e){return(typeof e=="string"?e:""+e).replace(up,`
|
|
49
|
+
`).replace(dp,"")}function Jf(e,t){return t=Kf(t),Kf(e)===t}function ze(e,t,n,l,s,c){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Al(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Al(e,""+l);break;case"className":vs(e,"class",l);break;case"tabIndex":vs(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(e,n,l);break;case"style":Ko(e,l,c);break;case"data":if(t!=="object"){vs(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ys(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&ze(e,t,"name",s.name,s,null),ze(e,t,"formEncType",s.formEncType,s,null),ze(e,t,"formMethod",s.formMethod,s,null),ze(e,t,"formTarget",s.formTarget,s,null)):(ze(e,t,"encType",s.encType,s,null),ze(e,t,"method",s.method,s,null),ze(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ys(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Wt);break;case"onScroll":l!=null&&ye("scroll",e);break;case"onScrollEnd":l!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=ys(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ye("beforetoggle",e),ye("toggle",e),ps(e,"popover",l);break;case"xlinkActuate":It(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":It(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":It(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":It(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":It(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":It(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":It(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":It(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":It(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ps(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Bh.get(n)||n,ps(e,n,l))}}function zr(e,t,n,l,s,c){switch(n){case"style":Ko(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Al(e,l):(typeof l=="number"||typeof l=="bigint")&&Al(e,""+l);break;case"onScroll":l!=null&&ye("scroll",e);break;case"onScrollEnd":l!=null&&ye("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),c=e[ut]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,s),typeof l=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,s);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):ps(e,n,l)}}}function it(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("load",e);var l=!1,s=!1,c;for(c in n)if(n.hasOwnProperty(c)){var f=n[c];if(f!=null)switch(c){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ze(e,t,c,f,n,null)}}s&&ze(e,t,"srcSet",n.srcSet,n,null),l&&ze(e,t,"src",n.src,n,null);return;case"input":ye("invalid",e);var h=c=f=s=null,j=null,z=null;for(l in n)if(n.hasOwnProperty(l)){var B=n[l];if(B!=null)switch(l){case"name":s=B;break;case"type":f=B;break;case"checked":j=B;break;case"defaultChecked":z=B;break;case"value":c=B;break;case"defaultValue":h=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:ze(e,t,l,B,n,null)}}Xo(e,c,h,j,z,f,s,!1);return;case"select":ye("invalid",e),l=f=c=null;for(s in n)if(n.hasOwnProperty(s)&&(h=n[s],h!=null))switch(s){case"value":c=h;break;case"defaultValue":f=h;break;case"multiple":l=h;default:ze(e,t,s,h,n,null)}t=c,n=f,e.multiple=!!l,t!=null?Ml(e,!!l,t,!1):n!=null&&Ml(e,!!l,n,!0);return;case"textarea":ye("invalid",e),c=s=l=null;for(f in n)if(n.hasOwnProperty(f)&&(h=n[f],h!=null))switch(f){case"value":l=h;break;case"defaultValue":s=h;break;case"children":c=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(o(91));break;default:ze(e,t,f,h,n,null)}Qo(e,l,s,c);return;case"option":for(j in n)if(n.hasOwnProperty(j)&&(l=n[j],l!=null))switch(j){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ze(e,t,j,l,n,null)}return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(l=0;l<Ja.length;l++)ye(Ja[l],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("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(z in n)if(n.hasOwnProperty(z)&&(l=n[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ze(e,t,z,l,n,null)}return;default:if(Qi(t)){for(B in n)n.hasOwnProperty(B)&&(l=n[B],l!==void 0&&zr(e,t,B,l,n,void 0));return}}for(h in n)n.hasOwnProperty(h)&&(l=n[h],l!=null&&ze(e,t,h,l,n,null))}function fp(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,f=null,h=null,j=null,z=null,B=null;for(U in n){var Y=n[U];if(n.hasOwnProperty(U)&&Y!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":j=Y;default:l.hasOwnProperty(U)||ze(e,t,U,null,l,Y)}}for(var D in l){var U=l[D];if(Y=n[D],l.hasOwnProperty(D)&&(U!=null||Y!=null))switch(D){case"type":c=U;break;case"name":s=U;break;case"checked":z=U;break;case"defaultChecked":B=U;break;case"value":f=U;break;case"defaultValue":h=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:U!==Y&&ze(e,t,D,U,l,Y)}}Xi(e,f,h,j,z,B,c,s);return;case"select":U=f=h=D=null;for(c in n)if(j=n[c],n.hasOwnProperty(c)&&j!=null)switch(c){case"value":break;case"multiple":U=j;default:l.hasOwnProperty(c)||ze(e,t,c,null,l,j)}for(s in l)if(c=l[s],j=n[s],l.hasOwnProperty(s)&&(c!=null||j!=null))switch(s){case"value":D=c;break;case"defaultValue":h=c;break;case"multiple":f=c;default:c!==j&&ze(e,t,s,c,l,j)}t=h,n=f,l=U,D!=null?Ml(e,!!n,D,!1):!!l!=!!n&&(t!=null?Ml(e,!!n,t,!0):Ml(e,!!n,n?[]:"",!1));return;case"textarea":U=D=null;for(h in n)if(s=n[h],n.hasOwnProperty(h)&&s!=null&&!l.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:ze(e,t,h,null,l,s)}for(f in l)if(s=l[f],c=n[f],l.hasOwnProperty(f)&&(s!=null||c!=null))switch(f){case"value":D=s;break;case"defaultValue":U=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==c&&ze(e,t,f,s,l,c)}Vo(e,D,U);return;case"option":for(var se in n)if(D=n[se],n.hasOwnProperty(se)&&D!=null&&!l.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:ze(e,t,se,null,l,D)}for(j in l)if(D=l[j],U=n[j],l.hasOwnProperty(j)&&D!==U&&(D!=null||U!=null))switch(j){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:ze(e,t,j,D,l,U)}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 fe in n)D=n[fe],n.hasOwnProperty(fe)&&D!=null&&!l.hasOwnProperty(fe)&&ze(e,t,fe,null,l,D);for(z in l)if(D=l[z],U=n[z],l.hasOwnProperty(z)&&D!==U&&(D!=null||U!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(o(137,t));break;default:ze(e,t,z,D,l,U)}return;default:if(Qi(t)){for(var De in n)D=n[De],n.hasOwnProperty(De)&&D!==void 0&&!l.hasOwnProperty(De)&&zr(e,t,De,void 0,l,D);for(B in l)D=l[B],U=n[B],!l.hasOwnProperty(B)||D===U||D===void 0&&U===void 0||zr(e,t,B,D,l,U);return}}for(var _ in n)D=n[_],n.hasOwnProperty(_)&&D!=null&&!l.hasOwnProperty(_)&&ze(e,t,_,null,l,D);for(Y in l)D=l[Y],U=n[Y],!l.hasOwnProperty(Y)||D===U||D==null&&U==null||ze(e,t,Y,D,l,U)}function Ff(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var s=n[l],c=s.transferSize,f=s.initiatorType,h=s.duration;if(c&&h&&Ff(f)){for(f=0,h=s.responseEnd,l+=1;l<n.length;l++){var j=n[l],z=j.startTime;if(z>h)break;var B=j.transferSize,Y=j.initiatorType;B&&Ff(Y)&&(j=j.responseEnd,f+=B*(j<h?1:(h-z)/(j-z)))}if(--l,t+=8*(c+f)/(s.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 Dr=null,Rr=null;function hi(e){return e.nodeType===9?e:e.ownerDocument}function If(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 Wf(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 Or(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 Ur=null;function hp(){var e=window.event;return e&&e.type==="popstate"?e===Ur?!1:(Ur=e,!0):(Ur=null,!1)}var Pf=typeof setTimeout=="function"?setTimeout:void 0,xp=typeof clearTimeout=="function"?clearTimeout:void 0,em=typeof Promise=="function"?Promise:void 0,pp=typeof queueMicrotask=="function"?queueMicrotask:typeof em<"u"?function(e){return em.resolve(null).then(e).catch(vp)}:Pf;function vp(e){setTimeout(function(){throw e})}function Bn(e){return e==="head"}function tm(e,t){var n=t,l=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(s),ia(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Ia(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ia(n);for(var c=n.firstChild;c;){var f=c.nextSibling,h=c.nodeName;c[xa]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=f}}else n==="body"&&Ia(e.ownerDocument.body);n=s}while(n);ia(t)}function nm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function qr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":qr(n),Gi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function gp(e,t,n,l){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[xa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Rt(e.nextSibling),e===null)break}return null}function yp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rt(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rt(e.nextSibling),e===null))return null;return e}function Lr(e){return e.data==="$?"||e.data==="$~"}function Br(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function bp(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Rt(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 Hr=null;function am(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function sm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function im(e,t,n){switch(t=hi(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ia(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Gi(e)}var Ot=new Map,cm=new Set;function xi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xn=H.d;H.d={f:jp,r:Np,D:Sp,C:kp,L:_p,m:Ep,X:Mp,S:Tp,M:Ap};function jp(){var e=xn.f(),t=ii();return e||t}function Np(e){var t=_l(e);t!==null&&t.tag===5&&t.type==="form"?Sd(t):xn.r(e)}var la=typeof document>"u"?null:document;function rm(e,t,n){var l=la;if(l&&typeof t=="string"&&t){var s=Tt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),cm.has(s)||(cm.add(s),e={rel:e,crossOrigin:n,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),it(t,"link",e),Pe(t),l.head.appendChild(t)))}}function Sp(e){xn.D(e),rm("dns-prefetch",e,null)}function kp(e,t){xn.C(e,t),rm("preconnect",e,t)}function _p(e,t,n){xn.L(e,t,n);var l=la;if(l&&e&&t){var s='link[rel="preload"][as="'+Tt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Tt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Tt(n.imageSizes)+'"]')):s+='[href="'+Tt(e)+'"]';var c=s;switch(t){case"style":c=aa(e);break;case"script":c=sa(e)}Ot.has(c)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ot.set(c,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(Wa(c))||t==="script"&&l.querySelector(Pa(c))||(t=l.createElement("link"),it(t,"link",e),Pe(t),l.head.appendChild(t)))}}function Ep(e,t){xn.m(e,t);var n=la;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Tt(l)+'"][href="'+Tt(e)+'"]',c=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=sa(e)}if(!Ot.has(c)&&(e=S({rel:"modulepreload",href:e},t),Ot.set(c,e),n.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Pa(c)))return}l=n.createElement("link"),it(l,"link",e),Pe(l),n.head.appendChild(l)}}}function Tp(e,t,n){xn.S(e,t,n);var l=la;if(l&&e){var s=El(l).hoistableStyles,c=aa(e);t=t||"default";var f=s.get(c);if(!f){var h={loading:0,preload:null};if(f=l.querySelector(Wa(c)))h.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ot.get(c))&&$r(e,n);var j=f=l.createElement("link");Pe(j),it(j,"link",e),j._p=new Promise(function(z,B){j.onload=z,j.onerror=B}),j.addEventListener("load",function(){h.loading|=1}),j.addEventListener("error",function(){h.loading|=2}),h.loading|=4,pi(f,t,l)}f={type:"stylesheet",instance:f,count:1,state:h},s.set(c,f)}}}function Mp(e,t){xn.X(e,t);var n=la;if(n&&e){var l=El(n).hoistableScripts,s=sa(e),c=l.get(s);c||(c=n.querySelector(Pa(s)),c||(e=S({src:e,async:!0},t),(t=Ot.get(s))&&Gr(e,t),c=n.createElement("script"),Pe(c),it(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function Ap(e,t){xn.M(e,t);var n=la;if(n&&e){var l=El(n).hoistableScripts,s=sa(e),c=l.get(s);c||(c=n.querySelector(Pa(s)),c||(e=S({src:e,async:!0,type:"module"},t),(t=Ot.get(s))&&Gr(e,t),c=n.createElement("script"),Pe(c),it(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function om(e,t,n,l){var s=(s=re.current)?xi(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=aa(n.href),n=El(s).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=aa(n.href);var c=El(s).hoistableStyles,f=c.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=s.querySelector(Wa(e)))&&!c._p&&(f.instance=c,f.state.loading=5),Ot.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ot.set(e,n),c||wp(s,e,n,f.state))),t&&l===null)throw Error(o(528,""));return f}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=sa(n),n=El(s).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function aa(e){return'href="'+Tt(e)+'"'}function Wa(e){return'link[rel="stylesheet"]['+e+"]"}function um(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function wp(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),it(t,"link",n),Pe(t),e.head.appendChild(t))}function sa(e){return'[src="'+Tt(e)+'"]'}function Pa(e){return"script[async]"+e}function dm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Tt(n.href)+'"]');if(l)return t.instance=l,Pe(l),l;var s=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Pe(l),it(l,"style",s),pi(l,n.precedence,e),t.instance=l;case"stylesheet":s=aa(n.href);var c=e.querySelector(Wa(s));if(c)return t.state.loading|=4,t.instance=c,Pe(c),c;l=um(n),(s=Ot.get(s))&&$r(l,s),c=(e.ownerDocument||e).createElement("link"),Pe(c);var f=c;return f._p=new Promise(function(h,j){f.onload=h,f.onerror=j}),it(c,"link",l),t.state.loading|=4,pi(c,n.precedence,e),t.instance=c;case"script":return c=sa(n.src),(s=e.querySelector(Pa(c)))?(t.instance=s,Pe(s),s):(l=n,(s=Ot.get(c))&&(l=S({},n),Gr(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),Pe(s),it(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,pi(l,n.precedence,e));return t.instance}function pi(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,c=s,f=0;f<l.length;f++){var h=l[f];if(h.dataset.precedence===t)c=h;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $r(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Gr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var vi=null;function fm(e,t,n){if(vi===null){var l=new Map,s=vi=new Map;s.set(n,l)}else s=vi,l=s.get(n),l||(l=new Map,s.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var c=n[s];if(!(c[xa]||c[nt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var h=l.get(f);h?h.push(c):l.set(f,[c])}}return l}function mm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Cp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function hm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function zp(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=aa(l.href),c=t.querySelector(Wa(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=gi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Pe(c);return}c=t.ownerDocument||t,l=um(l),(s=Ot.get(s))&&$r(l,s),c=c.createElement("link"),Pe(c);var f=c;f._p=new Promise(function(h,j){f.onload=h,f.onerror=j}),it(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=gi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Yr=0;function Dp(e,t){return e.stylesheets&&e.count===0&&bi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&bi(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Yr===0&&(Yr=62500*mp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bi(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Yr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yi=null;function bi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yi=new Map,t.forEach(Rp,e),yi=null,gi.call(e))}function Rp(e,t){if(!(t.state.loading&4)){var n=yi.get(e);if(n)var l=n.get(null);else{n=new Map,yi.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var f=s[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),l=f)}l&&n.set(null,l)}s=t.instance,f=s.getAttribute("data-precedence"),c=n.get(f)||l,c===l&&n.set(null,s),n.set(f,s),this.count++,l=gi.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var es={$$typeof:ee,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function Op(e,t,n,l,s,c,f,h,j){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=Li(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Li(0),this.hiddenUpdates=Li(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function xm(e,t,n,l,s,c,f,h,j,z,B,Y){return e=new Op(e,t,n,f,j,z,B,Y,h),t=1,c===!0&&(t|=24),c=bt(3,null,null,t),e.current=c,c.stateNode=e,t=Nc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},Ec(c),e}function pm(e){return e?(e=Ul,e):Ul}function vm(e,t,n,l,s,c){s=pm(s),l.context===null?l.context=s:l.pendingContext=s,l=Mn(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=An(e,l,t),n!==null&&(pt(n,e,t),za(n,e,t))}function gm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Xr(e,t){gm(e,t),(e=e.alternate)&&gm(e,t)}function ym(e){if(e.tag===13||e.tag===31){var t=nl(e,67108864);t!==null&&pt(t,e,67108864),Xr(e,67108864)}}function bm(e){if(e.tag===13||e.tag===31){var t=_t();t=Bi(t);var n=nl(e,t);n!==null&&pt(n,e,t),Xr(e,t)}}var ji=!0;function Up(e,t,n,l){var s=T.T;T.T=null;var c=H.p;try{H.p=2,Vr(e,t,n,l)}finally{H.p=c,T.T=s}}function qp(e,t,n,l){var s=T.T;T.T=null;var c=H.p;try{H.p=8,Vr(e,t,n,l)}finally{H.p=c,T.T=s}}function Vr(e,t,n,l){if(ji){var s=Qr(l);if(s===null)Cr(e,t,l,Ni,n),Nm(e,l);else if(Bp(s,e,t,n,l))l.stopPropagation();else if(Nm(e,l),t&4&&-1<Lp.indexOf(e)){for(;s!==null;){var c=_l(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=In(c.pendingLanes);if(f!==0){var h=c;for(h.pendingLanes|=2,h.entangledLanes|=2;f;){var j=1<<31-gt(f);h.entanglements[1]|=j,f&=~j}Zt(c),(_e&6)===0&&(ai=Le()+500,Ka(0))}}break;case 31:case 13:h=nl(c,2),h!==null&&pt(h,c,2),ii(),Xr(c,2)}if(c=Qr(l),c===null&&Cr(e,t,l,Ni,n),c===s)break;s=c}s!==null&&l.stopPropagation()}else Cr(e,t,l,null,n)}}function Qr(e){return e=Ki(e),Zr(e)}var Ni=null;function Zr(e){if(Ni=null,e=kl(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ni=e,null}function jm(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(Jn()){case Fn:return 2;case Ao:return 8;case ds:case kh:return 32;case wo:return 268435456;default:return 32}default:return 32}}var Kr=!1,Hn=null,$n=null,Gn=null,ts=new Map,ns=new Map,Yn=[],Lp="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 Nm(e,t){switch(e){case"focusin":case"focusout":Hn=null;break;case"dragenter":case"dragleave":$n=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":ts.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ns.delete(t.pointerId)}}function ls(e,t,n,l,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[s]},t!==null&&(t=_l(t),t!==null&&ym(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Bp(e,t,n,l,s){switch(t){case"focusin":return Hn=ls(Hn,e,t,n,l,s),!0;case"dragenter":return $n=ls($n,e,t,n,l,s),!0;case"mouseover":return Gn=ls(Gn,e,t,n,l,s),!0;case"pointerover":var c=s.pointerId;return ts.set(c,ls(ts.get(c)||null,e,t,n,l,s)),!0;case"gotpointercapture":return c=s.pointerId,ns.set(c,ls(ns.get(c)||null,e,t,n,l,s)),!0}return!1}function Sm(e){var t=kl(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Uo(e.priority,function(){bm(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Uo(e.priority,function(){bm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Si(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qr(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Zi=l,n.target.dispatchEvent(l),Zi=null}else return t=_l(n),t!==null&&ym(t),e.blockedOn=n,!1;t.shift()}return!0}function km(e,t,n){Si(e)&&n.delete(t)}function Hp(){Kr=!1,Hn!==null&&Si(Hn)&&(Hn=null),$n!==null&&Si($n)&&($n=null),Gn!==null&&Si(Gn)&&(Gn=null),ts.forEach(km),ns.forEach(km)}function ki(e,t){e.blockedOn===t&&(e.blockedOn=null,Kr||(Kr=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Hp)))}var _i=null;function _m(e){_i!==e&&(_i=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){_i===e&&(_i=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Zr(l||n)===null)continue;break}var c=_l(n);c!==null&&(e.splice(t,3),t-=3,Qc(c,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function ia(e){function t(j){return ki(j,e)}Hn!==null&&ki(Hn,e),$n!==null&&ki($n,e),Gn!==null&&ki(Gn,e),ts.forEach(t),ns.forEach(t);for(var n=0;n<Yn.length;n++){var l=Yn[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Yn.length&&(n=Yn[0],n.blockedOn===null);)Sm(n),n.blockedOn===null&&Yn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var s=n[l],c=n[l+1],f=s[ut]||null;if(typeof c=="function")f||_m(n);else if(f){var h=null;if(c&&c.hasAttribute("formAction")){if(s=c,f=c[ut]||null)h=f.formAction;else if(Zr(s)!==null)continue}else h=f.action;typeof h=="function"?n[l+1]=h:(n.splice(l,3),l-=3),_m(n)}}}function Em(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Jr(e){this._internalRoot=e}Ei.prototype.render=Jr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=_t();vm(n,l,e,t,null,null)},Ei.prototype.unmount=Jr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vm(e.current,2,null,e,null,null),ii(),t[Sl]=null}};function Ei(e){this._internalRoot=e}Ei.prototype.unstable_scheduleHydration=function(e){if(e){var t=Oo();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yn.length&&t!==0&&t<Yn[n].priority;n++);Yn.splice(n,0,e),n===0&&Sm(e)}};var Tm=r.version;if(Tm!=="19.2.6")throw Error(o(527,Tm,"19.2.6"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var $p={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ti.isDisabled&&Ti.supportsFiber)try{fa=Ti.inject($p),vt=Ti}catch{}}return ss.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",s=Dd,c=Rd,f=Od;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=xm(e,1,!1,null,null,n,l,null,s,c,f,Em),e[Sl]=t.current,wr(e),new Jr(t)},ss.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,s="",c=Dd,f=Rd,h=Od,j=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(h=n.onRecoverableError),n.formState!==void 0&&(j=n.formState)),t=xm(e,1,!0,t,n??null,l,s,j,c,f,h,Em),t.context=pm(null),n=t.current,l=_t(),l=Bi(l),s=Mn(l),s.callback=null,An(n,s,l),n=l,t.current.lanes=n,ha(t,n),Zt(t),e[Sl]=t.current,wr(e),new Ei(t)},ss.version="19.2.6",ss}var qm;function Pp(){if(qm)return Wr.exports;qm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),Wr.exports=Wp(),Wr.exports}var e0=Pp();const vl="/dashboard";function Lm(){const i=window.location.pathname;return i===vl||i===vl+"/"?"/":i.startsWith(vl+"/")?i.slice(vl.length):i||"/"}function vn(i){return i==="/"||i===""?vl+"/":vl+(i.startsWith("/")?i:"/"+i)}function rs(i){const r=vn(i);r!==window.location.pathname+window.location.search&&window.history.pushState({},"",r),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",i=>{var o,d;if(i.defaultPrevented||i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;const r=(d=(o=i.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!r)return;const u=r.getAttribute("href");u&&(r.hasAttribute("target")||r.hasAttribute("download")||u.startsWith(vl)&&(i.preventDefault(),u!==window.location.pathname+window.location.search&&window.history.pushState({},"",u),window.dispatchEvent(new Event("dashboard:navigate"))))}),window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("dashboard:navigate"))}));function rh(){const[i,r]=k.useState(Lm());return k.useEffect(()=>{const u=()=>r(Lm());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),i}function t0(i){let r=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");r=r.replace(/```(\w*)\n?([\s\S]*?)```/g,(m,v,p)=>`<pre class="md-code-block"><code>${p.trimEnd()}</code></pre>`),r=r.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),r=r.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),r=r.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=r.split(`
|
|
50
|
+
`),o=[];let d=!1;for(let m=0;m<u.length;m++){const v=u[m],p=v.match(/^###\s+(.+)$/),x=v.match(/^##\s+(.+)$/),g=v.match(/^#\s+(.+)$/);if(p){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${p[1]}</h3>`);continue}if(x){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${x[1]}</h2>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const b=v.match(/^(\s*)[*-]\s+(.+)$/);if(b){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${b[2]}</li>`);continue}if(v.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(v)}return d&&o.push("</ul>"),o.join(`
|
|
51
|
+
`)}function Oi(i){let r=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");r=r.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),r=r.replace(/<agent_finding[^&]*>/g,""),r=r.replace(/<\/agent_finding>/g,""),r=r.replace(/<cite\s+tag="file">([^&]+)<\/cite>/g,'<code class="cite-file">$1</code>'),r=r.replace(/<cite\s+tag="fn">([^&]+)<\/cite>/g,'<code class="cite-fn">$1</code>'),r=r.replace(/<fn>([^&]+)<\/fn>/g,'<code class="cite-fn">$1</code>'),r=r.replace(/```(\w*)\n?([\s\S]*?)```/g,'<pre class="md-code-block"><code>$2</code></pre>'),r=r.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),r=r.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),r=r.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=r.split(`
|
|
52
|
+
`),o=[];let d=!1;for(const m of u){const v=m.match(/^###\s+(.+)$/),p=m.match(/^##\s+(.+)$/),x=m.match(/^#\s+(.+)$/);if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${v[1]}</h3>`);continue}if(p){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${p[1]}</h2>`);continue}if(x){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${x[1]}</h1>`);continue}const g=m.match(/^(\s*)[*-]\s+(.+)$/);if(g){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${g[2]}</li>`);continue}if(m.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(m)}return d&&o.push("</ul>"),o.join(`
|
|
53
|
+
`)}function We(i){const r=Date.now(),u=typeof i=="string"?new Date(i).getTime():i,o=Math.max(0,Math.floor((r-u)/1e3));return o<60?"just now":o<3600?Math.floor(o/60)+"m ago":o<86400?Math.floor(o/3600)+"h ago":Math.floor(o/86400)+"d ago"}function n0(i){if(!i)return"—";const r=Math.round(i/1e3);return r<60?r+"s":Math.floor(r/60)+"m "+r%60+"s"}function ho(i){const r=i.split("-").filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(r[0]||i).slice(0,2).toUpperCase()}const Bm=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],Hm={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function gn(i){if(Hm[i])return Hm[i];let r=0;for(let u=0;u<i.length;u++)r=r*31+i.charCodeAt(u)>>>0;return Bm[r%Bm.length]}function da({title:i,hint:r,compact:u=!1}){return a.jsxs("div",{className:`text-center ${u?"py-3":"py-6"}`,children:[a.jsx("div",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:i}),r&&a.jsx("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:r})]})}function l0(i){return i==null||i<=0?"—":i<1e3?`${i}ms`:i<6e4?`${(i/1e3).toFixed(1)}s`:`${(i/6e4).toFixed(1)}m`}function xl({value:i,unit:r,label:u,valueClass:o="",valueColor:d,pulse:m,tooltip:v}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":v,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[m&&a.jsxs("span",{className:"relative mr-1 inline-flex h-2 w-2",children:[a.jsx("span",{className:"absolute inline-flex h-2 w-2 animate-ping rounded-full bg-unverified/60"}),a.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-unverified"})]}),a.jsx("span",{className:`font-mono text-2xl font-medium leading-none tracking-[-0.025em] ${o}`,style:d?{color:d}:void 0,children:i}),r&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--ink-3)"},children:r})]}),a.jsx("div",{className:"h-section mt-1.5",style:{color:"var(--ink-3)",fontSize:"10px"},children:u})]})}function a0({overview:i,activeTasks:r,mode:u="dense",showActivity:o}){const d=i.relayCount+i.nativeCount,m=i.tasksCompleted+i.tasksFailed>0?Math.round(i.tasksCompleted/(i.tasksCompleted+i.tasksFailed)*100):null,v=i.totalFindings>0?Math.round(i.confirmedFindings/i.totalFindings*100):0,p=u==="calm",x=o??!p,g=p&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-3",children:[a.jsx("div",{className:"h-section",children:"System Pulse"}),a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-confirmed"}),"LIVE"]})]}),g?a.jsx(da,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):p?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(xl,{value:i.agentsOnline,label:"Agents Working",valueColor:i.agentsOnline>0?"var(--ok)":"var(--text)"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(xl,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0})}),a.jsx(xl,{value:`${v}%`,label:"Confirmed",valueClass:v>=50?"text-confirmed":v>0?"text-unverified":"",valueColor:v===0?"var(--ink-3)":void 0})]}):a.jsxs("div",{className:"border-b border-border",children:[a.jsxs("div",{className:"relative grid grid-cols-2",children:[a.jsx("span",{className:"pointer-events-none absolute left-0 right-0 top-1/2 h-px bg-border"}),a.jsx("span",{className:"pointer-events-none absolute bottom-0 left-1/2 top-0 w-px bg-border"}),a.jsxs("div",{className:"flex flex-col items-stretch justify-center gap-1.5 px-4 py-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:i.agentsOnline>0?"var(--ok)":"var(--text)"},children:i.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${i.relayConnected>0?"text-confirmed":""}`,style:i.relayConnected>0?void 0:{color:"var(--ink-3)"},children:i.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:"var(--ink-3)"},children:d})]})]}),a.jsx(xl,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0}),a.jsx(xl,{value:i.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(xl,{value:`${v}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:vn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/10","aria-label":"View actionable findings on Signals page",children:a.jsx(xl,{value:i.actionableFindings,label:"Actionable",valueClass:i.actionableFindings>0?"text-unverified":"",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!p&&a.jsxs("div",{className:"px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks completed"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:i.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"signals total"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:i.totalSignals})]}),i.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-destructive tabular-nums",children:i.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"avg duration"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:l0(i.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${m!==null&&m>=95?"text-confirmed":m!==null&&m>=80?"text-unverified":m!==null?"text-destructive":""}`,style:m===null?{color:"var(--ink-3)"}:void 0,children:m===null?"—":`${m}%`})]})]}),x&&a.jsx(s0,{hourly:i.hourlyActivity||[]}),i.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)"},children:["last consensus ",We(i.lastConsensusTimestamp)]})]})}function s0({hourly:i}){const r=i.length===12?i:new Array(12).fill(0),u=Math.max(1,...r);return a.jsxs("div",{className:"border-t border-border px-3.5 py-3",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("div",{className:"h-section mb-2",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)",fontSize:"11px"},children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:r.map((o,d)=>{const m=11-d,v=o/u*100,p=d===11,x=m===0?"last hour":`${m}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${o===0?"opacity-0":p?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:o===0?"0%":`${Math.max(8,v)}%`},"data-tooltip":`${x}
|
|
54
|
+
${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--ink-3) 40%, transparent)"},children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const Ft=24;function i0(i,r){const u=new Map;for(const o of r)u.set(o.id,new Array(Ft).fill(0));for(const o of(i==null?void 0:i.agents)??[]){const d=u.get(o.id);if(!d)continue;const m=o.buckets??[];for(let v=0;v<Ft;v++)d[v]=m[v]??0}return u}function c0(i,r){if(r<=0||i<=0)return 0;const u=i/r;return u<.18?1:u<.4?2:u<.68?3:4}const r0={0:.18,1:.35,2:.55,3:.78,4:1};function o0({agents:i,activity:r,loading:u=!1,error:o=null}){const d=k.useMemo(()=>i0(r,i),[r,i]),m=k.useMemo(()=>{const p=new Map;for(const[x,g]of d)p.set(x,g.reduce((b,S)=>b+S,0));return p},[d]),v=k.useMemo(()=>{let p=0;for(const x of m.values())p+=x;return p},[m]);if(u&&i.length===0)return a.jsx(Mi,{error:null,fleetTotal:null,children:Array.from({length:4}).map((p,x)=>a.jsx(u0,{},x))});if(i.length===0)return a.jsx(Mi,{error:o,fleetTotal:null,children:a.jsxs("div",{className:"px-5 py-6 font-mono text-xs",style:{color:"var(--ink-3)"},children:["No agents registered yet — run ",a.jsx("code",{className:"rounded bg-[var(--surface-sunk)] px-1.5 py-0.5",children:"gossip_setup"})," to spin up the fleet."]})});if(v===0){const p=r==null?"Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.":"No active dispatches — fleet idle.";return a.jsxs(Mi,{error:o,fleetTotal:0,children:[i.map(x=>a.jsx(d0,{agent:x},x.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:p})]})}return a.jsx(Mi,{error:o,fleetTotal:v,children:i.map(p=>{const x=d.get(p.id)??new Array(Ft).fill(0),g=Math.max(0,...x),b=m.get(p.id)??0,S=v>0?Math.round(b/v*100):0,O=gn(p.id);return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px]",style:{color:"var(--ink)"},children:[a.jsx("span",{className:"inline-block h-2 w-2 flex-shrink-0 rounded-full",style:{background:O}}),a.jsx("span",{className:"truncate",children:p.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Ft}, 1fr)`},role:"img","aria-label":`${p.id} 24h activity — ${b} signals`,children:x.map((Q,L)=>{const X=c0(Q,g);return a.jsx("div",{className:"rounded-sm",title:`hour ${L}: ${Q} signal${Q===1?"":"s"}`,style:{background:X===0?"var(--surface-sunk)":O,opacity:r0[X]}},L)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[b,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[S,"%"]})]})]},p.id)})})}function Mi({children:i,error:r,fleetTotal:u}){return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"grid items-end gap-3 border-b border-border px-5 py-3",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsx("div",{className:"h-section",children:"Agent · 24h activity"}),a.jsx("div",{className:"grid font-mono text-[9px]",style:{gridTemplateColumns:`repeat(${Ft}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:Ft}).map((o,d)=>a.jsx("span",{className:"text-center",children:d%2===0?String(d).padStart(2,"0"):""},d))}),a.jsx("div",{className:"flex items-center justify-end gap-2",children:r?a.jsx("span",{className:"rounded-sm border px-2 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--danger)",background:"color-mix(in oklch, var(--danger) 12%, transparent)",color:"var(--danger)"},children:r}):u!==null?a.jsxs("div",{className:"h-section",style:{color:"var(--ink-3)"},children:["Signals · 24h ",a.jsx("span",{className:"ml-1.5 tabular-nums",style:{color:"var(--ink)"},children:u})]}):null})]}),i]})}function u0(){return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsx("div",{className:"h-3 w-32 rounded",style:{background:"var(--border)",opacity:.4}}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Ft}, 1fr)`},children:Array.from({length:Ft}).map((i,r)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--border)",opacity:.4}},r))}),a.jsx("div",{className:"ml-auto h-3 w-12 rounded",style:{background:"var(--border)",opacity:.4}})]})}function d0({agent:i}){const r=gn(i.id);return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{className:"inline-block h-2 w-2 flex-shrink-0 rounded-full",style:{background:r,opacity:.5}}),a.jsx("span",{className:"truncate",children:i.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Ft}, 1fr)`},children:Array.from({length:Ft}).map((u,o)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--surface-sunk)",opacity:.4}},o))}),a.jsx("div",{className:"text-right font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"—"})]})}const ko="/dashboard/api";async function Ge(i,r){const u=await fetch(`${ko}/${i}`,{credentials:"include",...r});if(u.status===401)throw new Error("unauthorized");if(!u.ok)throw new Error(`API error: ${u.status}`);return u.json()}async function f0(i){try{const r=await fetch(`${ko}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:i})});return r.ok?{ok:!0}:r.status===401||r.status===403?{ok:!1,kind:"bad_key"}:{ok:!1,kind:"network"}}catch{return{ok:!1,kind:"network"}}}async function m0(){try{return(await fetch(`${ko}/overview`,{credentials:"include"})).ok}catch{return!1}}const h0=7200*1e3;function x0(i){const r=Date.now()-new Date(i).getTime();return r<0?"0s":r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}function p0({onCountChange:i}){const[r,u]=k.useState([]),[,o]=k.useState(0);k.useEffect(()=>{let p=!1;const x=async()=>{var b;try{const S=await Ge("active-tasks");p||(u(S.tasks||[]),i==null||i(((b=S.tasks)==null?void 0:b.length)||0))}catch{}};x();const g=setInterval(x,5e3);return()=>{p=!0,clearInterval(g)}},[i]),k.useEffect(()=>{if(r.length===0)return;const p=setInterval(()=>o(x=>x+1),1e3);return()=>clearInterval(p)},[r.length]);const d=Date.now(),m=r.filter(p=>d-new Date(p.startedAt).getTime()<h0),v=r.length-m.length;return m.length===0?v===0?null:a.jsx("div",{className:"rounded-lg border border-border px-4 py-2.5",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:a.jsxs("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:[v," stale task",v===1?"":"s"," — likely orphaned (>2h since last update)"]})}):a.jsxs("div",{className:"rounded-lg border border-border px-4 py-2.5",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),a.jsx("span",{className:"h-section",children:"Live"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--text-dim)"},children:[m.length," active"]}),v>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",v," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:m.map(p=>a.jsxs("div",{className:"grid items-center gap-3",style:{gridTemplateColumns:"minmax(120px, auto) 1fr auto"},children:[a.jsx("span",{className:"font-mono text-[11px] font-semibold truncate",style:{color:"var(--text)"},children:p.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px]",style:{color:"var(--text-dim)"},children:p.task}),a.jsx("span",{className:"font-mono text-[11px] whitespace-nowrap tabular-nums",style:{color:"var(--text-dim)"},children:x0(p.startedAt)})]},p.taskId))})]})}function v0(i,r,u,o){const d=Math.max(0,Math.min(.9999,o)),m=-Math.PI/2,v=m+d*2*Math.PI,p=i+u*Math.cos(m),x=r+u*Math.sin(m),g=i+u*Math.cos(v),b=r+u*Math.sin(v),S=d>.5?1:0;return`M ${p.toFixed(2)} ${x.toFixed(2)} A ${u} ${u} 0 ${S} 1 ${g.toFixed(2)} ${b.toFixed(2)}`}function g0(i,r,u){return`M ${i} ${r-u} A ${u} ${u} 0 1 1 ${i} ${r+u} A ${u} ${u} 0 1 1 ${i} ${r-u}`}function y0({accuracy:i,size:r=90,color:u="var(--ink)"}){const o=Number.isFinite(i)?Math.max(0,Math.min(1,i)):0,d=r/2,m=r/2,v=r*.089,p=(r-v)/2-2,x=Math.round(o*100),g=Math.round(r*.22);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":`Accuracy ${x}%`,children:[a.jsx("path",{d:g0(d,m,p),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:v,strokeLinecap:"round"}),o>0&&a.jsx("path",{d:v0(d,m,p,o),fill:"none",stroke:u,strokeWidth:v,strokeLinecap:"round"}),a.jsxs("text",{x:d,y:m,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:g,fontFamily:"'Fraunces', serif",fontVariantNumeric:"tabular-nums",fontWeight:700},children:[x,"%"]})]}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"accuracy"})]})}const $m={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--idle)"},Gm=["critical","high","medium","low"];function b0({counts:i,height:r=10}){const u=i??{critical:0,high:0,medium:0,low:0},o=u.critical+u.high+u.medium+u.low,d=`critical: ${u.critical}, high: ${u.high}, medium: ${u.medium}, low: ${u.low}`;return o===0?a.jsx("div",{role:"img","aria-label":`Severity distribution: no findings yet (${d})`,title:`${d} (no findings yet)`,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",gap:2,border:"1px solid color-mix(in oklch, var(--border) 60%, transparent)",width:"100%"},children:Gm.map(m=>a.jsx("div",{style:{flex:1,background:$m[m],opacity:.4}},m))}):a.jsx("div",{role:"img","aria-label":`Severity distribution — ${d}`,title:d,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",width:"100%"},children:Gm.map(m=>{const v=u[m];if(v===0)return null;const p=v/o*100;return a.jsx("div",{style:{width:`${p.toFixed(2)}%`,background:$m[m],flexShrink:0}},m)})})}function j0(i){return i.map(r=>r.signals)}function N0(i,r,u){if(i.length===0)return{line:`M 0 ${u} L ${r} ${u}`,area:""};if(i.length===1){const x=u/2;return{line:`M 0 ${x} L ${r} ${x}`,area:`M 0 ${u} L 0 ${x} L ${r} ${x} L ${r} ${u} Z`}}const o=Math.max(...i,1),d=r/(i.length-1),m=i.map((x,g)=>{const b=(g*d).toFixed(2),S=(u-x/o*u).toFixed(2);return`${b},${S}`}),v=`M ${m.join(" L ")}`,p=`M 0,${u} L ${m.join(" L ")} L ${((i.length-1)*d).toFixed(2)},${u} Z`;return{line:v,area:p}}const S0=5,xo=999;function k0(i){if(i.length<2)return null;const r=Math.floor(i.length/2),u=i.slice(0,r),o=i.slice(i.length-r),d=b=>b.reduce((S,O)=>S+O.signals,0),m=d(u),v=d(o);if(m<S0)return null;const p=m/u.length,x=v/o.length,g=Math.round((x-p)/p*100);return Math.max(-xo,Math.min(xo,g))}function _0({points:i,width:r=80,height:u=20,reducedMotion:o=!1,color:d="var(--c1)"}){const m=k.useMemo(()=>j0(i),[i]),{line:v,area:p}=k.useMemo(()=>N0(m,r,u),[m,r,u]),x=k.useMemo(()=>k0(i),[i]),g=m.length===0||m.every(b=>b===0);return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[a.jsxs("svg",{width:"100%",height:u,viewBox:`0 0 ${r} ${u}`,preserveAspectRatio:"none","aria-hidden":"true",style:{overflow:"visible",flex:1,minWidth:0},children:[!o&&!g&&p&&a.jsx("path",{d:p,fill:d,fillOpacity:.3}),a.jsx("path",{d:v,fill:"none",stroke:g?"var(--idle)":d,strokeOpacity:g?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),x!==null&&!g&&a.jsxs("span",{title:"7d dispatch volume change — neutral indicator, not a quality metric",style:{fontSize:10,fontFamily:"Geist, Inter, sans-serif",fontVariantNumeric:"tabular-nums",fontWeight:600,color:"var(--ink-3)",flexShrink:0},children:[x>=0?"+":"",x,"%",Math.abs(x)>=xo?"+":""]})]})}function _o(i){var r,u;return((r=i.bench)==null?void 0:r.state)==="benched"?"benched":i.circuitOpen?"struggling":((u=i.bench)==null?void 0:u.state)==="kept-for-coverage"?"kept-for-coverage":null}function E0(i){var r;return((r=i.scores.bench)==null?void 0:r.state)==="benched"||i.scores.circuitOpen}function po(i){return`${Math.round(i*100)}%`}function T0(i){var r,u,o;return i.accuracy>=.7&&((r=i.bench)==null?void 0:r.state)==="none"?{label:"healthy",dotColor:"var(--ok)",tooltip:`Accuracy ${Math.round(i.accuracy*100)}% — above 70% baseline.`}:{label:"needs skills",dotColor:"var(--warn)",tooltip:((u=i.bench)==null?void 0:u.state)!=="none"?`Benched (${((o=i.bench)==null?void 0:o.reason)??"auto"})`:`Accuracy ${Math.round(i.accuracy*100)}% — below 70% baseline.`}}function Ym({label:i,value:r,color:u,tooltip:o}){const d=Number.isFinite(r)?Math.max(0,Math.min(1,r)):0;return a.jsxs("div",{className:"grid items-center gap-2",style:{gridTemplateColumns:"56px 1fr 32px"},children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":o,children:i}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--ink) 8%, transparent)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.round(d*100)}%`,background:u}})}),a.jsx("span",{className:"text-right tabular-nums",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-2)"},children:po(d)})]})}function M0({agent:i,severityCounts:r,trendPoints:u}){var p;const o=i.scores,d=(p=i.lastTask)!=null&&p.timestamp?We(i.lastTask.timestamp):"",m=gn(i.id),v=T0(o);return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(i.id)}`,className:"group relative block rounded-lg border border-border p-3 transition-all hover:-translate-y-0.5 hover:border-[color-mix(in_oklch,var(--ink)_30%,transparent)]",style:{background:"var(--surface-elev)"},children:[a.jsx("div",{style:{position:"absolute",top:10,right:12,zIndex:1},children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-sm border border-border/60 px-2 py-0.5",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--ink-2)",fontFamily:"Geist, Inter, sans-serif",fontSize:11,fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":v.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:v.dotColor,flexShrink:0}}),v.label]})}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:12,alignItems:"stretch"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:8,paddingBottom:2},children:[a.jsx(y0,{accuracy:o.accuracy,size:90,color:m}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(b0,{counts:r}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"severity mix"})]})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[a.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:a.jsx("div",{style:{minWidth:0,flex:1},children:a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexWrap:"wrap"},children:[a.jsx("span",{className:"truncate",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:14,fontWeight:600,color:"var(--ink)",minWidth:0,flex:1},children:i.id}),(()=>{const x=_o(o);return x==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-destructive/10 px-1 py-0.5 font-mono text-[8px] font-bold text-destructive","aria-label":`Benched (${o.bench.reason??"auto"}). Excluded from dispatch until recovery.`,"data-tooltip":`Benched (${o.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):x==="struggling"?a.jsx("span",{className:"shrink-0 rounded-sm bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":"Struggling: consecutive failures tripped the circuit breaker.","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):x==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded-sm border border-unverified/40 bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":`Would bench (${o.bench.reason??"rule"}), but kept as sole provider of a category.`,"data-tooltip":`Would bench (${o.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"KEPT"}):null})()]})})}),a.jsxs("div",{className:"rounded-md border border-border/30 px-2 py-2 space-y-1.5",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)"},children:[a.jsx(Ym,{label:"unique",value:o.uniqueness,color:m,tooltip:`Uniqueness ${po(o.uniqueness)}
|
|
55
|
+
Findings others missed.`}),a.jsx(Ym,{label:"impact",value:o.impactScore,color:m,tooltip:`Impact ${po(o.impactScore)}
|
|
56
|
+
Severity-weighted findings.`})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[u&&u.length>0&&a.jsx("div",{style:{width:"100%"},children:a.jsx(_0,{points:u,width:240,height:28,color:m})}),a.jsxs("div",{style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-3)",display:"flex",alignItems:"center",gap:4},children:[a.jsxs("span",{className:"tabular-nums",children:[o.signals," signals"]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{children:d})]})]})]})]})]})]})}function A0({agents:i,highlightedAgentId:r,severityMap:u,trendByAgent:o}){const d=[...i].sort((p,x)=>{var Q,L,X,M;const g=((Q=p.lastTask)==null?void 0:Q.timestamp)??"",b=((L=x.lastTask)==null?void 0:L.timestamp)??"";if(g!==b)return b.localeCompare(g);const S=((X=p.scores)==null?void 0:X.signals)||0,O=((M=x.scores)==null?void 0:M.signals)||0;return S!==O?O-S:p.id.localeCompare(x.id)}),m=d.slice(0,4),v=d.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Team ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.length})]}),v&&a.jsx("a",{href:"/dashboard/team",className:"text-xs transition hover:[color:var(--accent)]",style:{color:"var(--text-dim)"},children:"view all"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:m.map(p=>{const x=p.id===r;return a.jsx("div",{style:{borderRadius:"0.5rem",boxShadow:x?"0 0 0 2px var(--border-strong)":void 0,transition:"box-shadow 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(M0,{agent:p,severityCounts:u==null?void 0:u.get(p.id),trendPoints:o==null?void 0:o.get(p.id)})},p.id)})})]})}const w0=8;function C0(i){const r=i.toLowerCase();return r==="completed"||r==="done"||r==="success"||r==="succeeded"?"completed":r==="running"||r==="active"||r==="in_progress"||r==="pending"?"running":r==="failed"||r==="error"||r==="errored"||r==="timeout"||r==="timed_out"?"failed":r==="cancelled"||r==="canceled"||r==="queued"||r==="waiting"?"cancelled":"unknown"}const z0={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1},unknown:{label:"Unknown",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1}},D0={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function R0(i){return i.length>8?i.slice(0,8):i}function O0(i){return i.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:i.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:i.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:i.endsWith("-researcher")?{label:"RESEARCH",cls:"",clsStyle:{color:"var(--text-dim)"}}:i.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function U0({tasks:i,limit:r=w0}){const u=i.items.slice(0,r),o=i.items.length>r;return a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.total})]}),o&&a.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),a.jsx("div",{className:"flex-1 rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:u.length===0?a.jsx(da,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):u.map((d,m)=>{const v=C0(d.status),p=z0[v],x=O0(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${m>0?"border-t border-border/20":""}`,children:[a.jsx("span",{className:`mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border ${p.iconBox} ${p.text} ${p.pulse?"animate-pulse":""}`,style:p.textStyle,"aria-label":`Status: ${p.label}`,"data-tooltip":p.label,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:D0[v]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--text-dim)"},"data-tooltip":d.taskId,children:R0(d.taskId)}),x&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${x.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...x.clsStyle},"data-tooltip":d.agentId,children:x.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug",style:{color:"var(--text)"},children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] font-normal",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:We(d.timestamp)})]},d.taskId)})})]})}function Eo({message:i,className:r}){return a.jsxs("span",{role:"alert",className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${r??""}`,style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 12%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:[a.jsx("span",{"aria-hidden":!0,style:{fontWeight:700},children:"!"}),a.jsxs("span",{children:["error · ",i]})]})}const q0={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},L0={agreement:"var(--ok)",consensus_verified:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",unique_confirmed:"var(--info)",unique_unconfirmed:"var(--warn)",new_finding:"var(--info)",unverified:"var(--info)"},B0={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"};function H0(i,r){return i?i.length>r?i.slice(0,r-1)+"…":i:""}function $0(i){return i.split(/(`[^`]+`)/g).map((u,o)=>u.startsWith("`")&&u.endsWith("`")&&u.length>2?a.jsx("code",{style:{background:"color-mix(in oklch, var(--ink) 6%, transparent)",padding:"0 4px",borderRadius:3,fontFamily:"var(--font-mono)",fontSize:12,color:"var(--ink)"},children:u.slice(1,-1)},o):a.jsx("span",{children:u},o))}function G0(){const[i,r]=k.useState(null),[u,o]=k.useState(null);k.useEffect(()=>{Ge("signals?limit=7").then(m=>r(m.items??[])).catch(m=>o(String((m==null?void 0:m.message)??m)))},[]);const d=i?i.filter(m=>Date.now()-Date.parse(m.timestamp)<36e5).length:0;return a.jsxs("section",{children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h3",{className:"h-section",children:"Signal stream"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--info)",visibility:d===0?"hidden":"visible"},children:["+",d," in last hour"]})]}),a.jsx("button",{type:"button",onClick:()=>rs("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"}),u&&a.jsx(Eo,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[!u&&i===null&&a.jsx("div",{"aria-busy":"true",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"py-2 pl-4 pr-3",style:{width:80},children:a.jsx("div",{className:"h-2 w-8 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:160},children:a.jsx("div",{className:"h-2 w-12 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:180},children:a.jsx("div",{className:"h-2 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-4",children:a.jsx("div",{className:"h-2 w-14 rounded",style:{background:"var(--border)",opacity:.4}})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((m,v)=>a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3",children:a.jsx("div",{className:"h-2.5 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{style:{width:3,height:14,background:"var(--border)",opacity:.4,borderRadius:1,flexShrink:0}}),a.jsx("div",{className:"h-2.5 w-14 rounded",style:{background:"var(--border)",opacity:.4}})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("div",{className:"h-2.5 w-24 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-4",children:a.jsx("div",{className:"h-2.5 rounded",style:{background:"var(--border)",opacity:.4,width:"75%"}})})]},v))})]})}),!u&&i&&i.length===0&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no signals recorded"}),u&&(!i||i.length===0)&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no cached signals to display"}),i&&i.length>0&&a.jsxs("table",{className:"w-full",style:u?{opacity:.5}:void 0,children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"h-section py-2 pl-4 pr-3 text-left",style:{fontSize:10,width:80},children:"time"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:160},children:"verdict"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:180},children:"agent"}),a.jsx("th",{className:"h-section py-2 pr-4 text-left",style:{fontSize:10},children:"finding"})]})}),a.jsx("tbody",{children:i.map((m,v)=>{const p=m.severity?B0[m.severity]:"transparent",x=L0[m.signal]??"var(--ink-2)",g=q0[m.signal]??m.signal;return a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3 align-middle font-mono text-[12px] tabular-nums",style:{color:"var(--text-dim)"},children:We(m.timestamp)}),a.jsx("td",{className:"py-2.5 pr-3 align-middle",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{role:"img","aria-label":m.severity?`severity: ${m.severity}`:"severity: unspecified",style:{display:"inline-block",width:3,height:14,background:p,borderRadius:1,flexShrink:0},title:m.severity??""}),a.jsx("span",{className:"h-section truncate",style:{color:x,fontSize:11},title:g,children:g})]})}),a.jsx("td",{className:"py-2.5 pr-3 align-middle font-mono text-[12px]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"truncate",children:m.agentId})}),a.jsx("td",{className:"py-2.5 pr-4 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:$0(H0(m.evidence??"",120))})]},`${m.timestamp}-${v}`)})})]})]})]})}const no=[{key:"passed",label:"passed",color:"var(--ok)"},{key:"pending",label:"pending",color:"var(--info)"},{key:"insufficient_evidence",label:"insufficient",color:"var(--idle)"},{key:"inconclusive",label:"inconclusive",color:"var(--warn)"},{key:"silent_skill",label:"silent",color:"var(--ink-3)"},{key:"failed",label:"failed",color:"var(--bad)"}];function Y0({overview:i}){const r=i==null?void 0:i.skillVerdictSummary,u=r?no.reduce((o,d)=>o+(r[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border p-4",style:{background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"h-section",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[u," total"]})]}),!r||u===0?a.jsx("p",{className:"font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"no skill verdicts yet"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-2 w-full gap-px overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:no.map(o=>{const d=r[o.key]??0;if(d===0)return null;const m=d/u*100;return a.jsx("div",{style:{width:`${m}%`,background:o.color},title:`${o.label}: ${d}`},o.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:no.map(o=>{const d=r[o.key]??0,m=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${m?"opacity-40":""}`,children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:o.color}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:o.label}),a.jsx("span",{className:"ml-auto tabular-nums",style:m?{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}:{color:o.color},children:d})]},o.key)})})]})]})}const pl=1,cs=2,X0=5;function V0({curve:i,threshold:r,stroke:u,width:o=140,height:d=30}){const m=k.useMemo(()=>Z0(i),[i]),v=m.reduce((O,Q)=>O+Q.length,0);if(i.length===0||v<X0)return a.jsx(Q0,{width:o,height:d,threshold:r});const p=o-pl*2,x=d-cs*2,g=cs+(1-vo(r))*x,b=O=>i.length<=1?pl+p/2:pl+O/(i.length-1)*p,S=O=>cs+(1-vo(O))*x;return a.jsxs("svg",{width:o,height:d,viewBox:`0 0 ${o} ${d}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:pl,x2:o-pl,y1:g,y2:g,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),m.map((O,Q)=>{if(O.length===1){const{idx:X,value:M}=O[0];return a.jsx("circle",{cx:b(X),cy:S(M),r:1.4,fill:u},Q)}const L=O.map((X,M)=>`${M===0?"M":"L"} ${b(X.idx).toFixed(2)} ${S(X.value).toFixed(2)}`).join(" ");return a.jsx("path",{d:L,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},Q)})]})}function Q0({width:i,height:r,threshold:u}){const o=r-cs*2,d=u!==void 0?cs+(1-vo(u))*o:r/2;return a.jsx("svg",{width:i,height:r,viewBox:`0 0 ${i} ${r}`,"aria-hidden":!0,style:{display:"block"},children:a.jsx("line",{x1:pl,x2:i-pl,y1:d,y2:d,stroke:"var(--ok)",strokeWidth:1,strokeDasharray:"2 2",opacity:.4})})}function Z0(i){const r=[];let u=[];for(let o=0;o<i.length;o++){const d=i[o].value;if(d==null||!Number.isFinite(d)){u.length>0&&(r.push(u),u=[]);continue}u.push({idx:o,value:d})}return u.length>0&&r.push(u),r}function vo(i){return!Number.isFinite(i)||i<0?0:i>1?1:i}const oh={passed:"var(--ok)",pending:"var(--info)",insufficient_evidence:"var(--idle)",inconclusive:"var(--warn)",silent_skill:"var(--ink-3)",failed:"var(--bad)"},K0={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed"},J0="var(--ink-4)";function zi(i){return i!=null&&i in oh}function F0({skills:i,loading:r,error:u}){const{known:o,unknown:d,total:m,transitions:v}=k.useMemo(()=>I0(i==null?void 0:i.effectiveness),[i]),p=m;return a.jsxs("section",{className:"space-y-2",children:[a.jsxs("header",{className:"flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("h3",{className:"h-section",children:"Skill Graduation"}),a.jsx("span",{className:"font-mono text-[11px] tabular-nums font-bold",style:{color:"var(--ink)"},children:p}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},children:["skills · ",v," transitions /24h"]})]}),a.jsx("a",{href:vn("/"),className:"font-mono text-[11px] transition hover:underline",style:{color:"var(--ink-3)"},children:"skill detail →"}),u&&a.jsx(Eo,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border p-4",style:{background:"var(--surface-elev)"},children:[a.jsx("p",{className:"mb-3 text-[11px]",style:{color:"var(--ink-3)"},children:"Each cell shows the post-bind effectiveness curve. Dashed line = graduation threshold. Verdict is from the latest evidence window."}),r&&!i&&a.jsx(tv,{}),!r&&m===0&&!u&&a.jsx("p",{className:"text-[12px]",style:{color:"var(--ink-3)"},children:"No skills bound yet — agents need at least one dispatch with a skill match."}),m>0&&a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6",style:u?{opacity:.5}:void 0,children:o.map(x=>a.jsx(Vm,{entry:x},Xm(x)))}),d.length>0&&a.jsxs("details",{className:"mt-4 group",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 select-none",style:{color:"var(--ink-3)"},children:[a.jsx("span",{"aria-hidden":!0,className:"chevron inline-block transition-transform",style:{fontSize:"10px",lineHeight:1},children:"▶"}),a.jsxs("span",{className:"text-[11px]",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},children:[d.length," unknown"]})]}),a.jsx("ul",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6",children:d.map(x=>a.jsx(Vm,{entry:x},Xm(x)))}),a.jsx("style",{children:`
|
|
57
|
+
details[open] > summary > .chevron { transform: rotate(90deg); }
|
|
58
|
+
`})]})]})]})}function Xm(i){return`${i.agentId}::${i.skill}`}function I0(i){if(!i)return{known:[],unknown:[],total:0,transitions:0};const r=[],u=[];let o=0;for(const m of i)if(zi(m.status)?r.push(m):u.push(m),m.curve.length>=2){const v=m.curve.slice(-2),p=v.filter(g=>g.value!=null&&g.value>=m.threshold).length,x=v.filter(g=>g.value!=null&&g.value<m.threshold).length;p>=1&&x>=1&&o++}const d={failed:0,inconclusive:1,silent_skill:2,insufficient_evidence:3,pending:4,passed:5};return r.sort((m,v)=>{const p=zi(m.status)?d[m.status]:99,x=zi(v.status)?d[v.status]:99;return p!==x?p-x:m.skill.localeCompare(v.skill)}),u.sort((m,v)=>m.skill.localeCompare(v.skill)),{known:r,unknown:u,total:r.length+u.length,transitions:o}}function Vm({entry:i}){const r=zi(i.status)?i.status:null,u=r?oh[r]:J0,o=r?K0[r]:i.status??"unknown",d=r==="passed"?P0(i.curve):null,m=ev(i.curve),v=m==null?"—":m.toFixed(2),p=i.threshold.toFixed(2);return a.jsxs("li",{className:"flex flex-col gap-1.5 rounded-sm border border-border p-2.5",style:{background:"var(--surface)"},title:`${i.agentId} · ${i.skill} · ${o} · N=${i.n}`,children:[a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("div",{className:"truncate text-[13px]",style:{color:"var(--ink)"},children:i.skill}),a.jsx("span",{className:"shrink-0 rounded-sm border border-border px-1 font-mono text-[9px] tabular-nums",style:{color:"var(--ink-3)"},title:"7-day effectiveness window",children:"7d"})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{"aria-hidden":!0,className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:gn(i.agentId)}}),a.jsx("span",{className:"truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:i.agentId})]})]}),a.jsx(V0,{curve:i.curve,threshold:i.threshold,stroke:u}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"truncate text-[10px]",style:{color:u,fontVariant:"small-caps",letterSpacing:"0.04em"},children:o}),a.jsxs("div",{className:"flex items-baseline gap-2",children:[d!==null&&a.jsxs("span",{className:"font-mono text-[10px] tabular-nums",style:{color:d>0?"var(--ok)":d<0?"var(--bad)":"var(--ink-3)"},title:`Trend ${d>0?"up":d<0?"down":"flat"} ${Math.abs(d)} percentage points across the 7d window`,"aria-label":`Trend ${d>0?"up":d<0?"down":"flat"} ${Math.abs(d)} percentage points`,children:[d>0?"+":"",d,"pp"]}),a.jsxs("span",{className:"font-mono text-[10px] tabular-nums",style:{color:"var(--ink)"},title:`current ${v} · threshold ${p}`,children:[v,a.jsxs("span",{style:{color:"var(--ink-3)"},children:[" / ",p]})]}),a.jsxs("span",{className:"font-mono text-[10px] tabular-nums",style:{color:"var(--ink-3)"},children:["N=",i.n]})]})]})]})}const W0=4;function P0(i){const r=i.filter(u=>u.value!=null&&Number.isFinite(u.value));return r.length<W0?null:Math.round((r[r.length-1].value-r[0].value)*100)}function ev(i){for(let r=i.length-1;r>=0;r--){const u=i[r].value;if(u!=null&&Number.isFinite(u))return u}return null}function tv(){return a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6","aria-hidden":!0,children:Array.from({length:6}).map((i,r)=>a.jsxs("li",{className:"flex h-[88px] flex-col gap-1.5 rounded-sm border border-border p-2.5",style:{background:"var(--surface)"},children:[a.jsx("span",{className:"h-3 w-3/4 rounded-sm",style:{background:"color-mix(in oklch, var(--text-dim) 18%, transparent)"}}),a.jsx("span",{className:"h-[30px] w-full rounded-sm",style:{background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"}}),a.jsx("span",{className:"h-3 w-1/2 rounded-sm",style:{background:"color-mix(in oklch, var(--text-dim) 14%, transparent)"}})]},r))})}function nv(i){let r=0;for(let u=0;u<i.length;u++)r=(r<<5)-r+i.charCodeAt(u)|0;return Math.abs(r)}class lv{constructor(r){tt(this,"s");this.s=r}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(r,u){return r+this.next()*(u-r)}}function ot(i,r){const u=parseInt(i.slice(1,3),16),o=parseInt(i.slice(3,5),16),d=parseInt(i.slice(5,7),16);return`rgba(${u},${o},${d},${Math.max(0,Math.min(1,r))})`}function av(i){const r=Math.max(0,i);return Math.min(1.4,Math.pow(r/2e3,.55))}class sv{constructor(r,u,o,d,m,v,p=.5){tt(this,"ctx");tt(this,"size");tt(this,"accuracy");tt(this,"uniqueness");tt(this,"impact");tt(this,"colorHex");tt(this,"time",0);tt(this,"variant");tt(this,"scale");tt(this,"exp");tt(this,"particles",[]);tt(this,"baseRotation");tt(this,"armSeeds");tt(this,"binaryCenters");tt(this,"jetAxis");tt(this,"tailAngle");const x=r.getContext("2d");if(!x)throw new Error("Canvas 2D context unavailable");this.ctx=x,this.size=r.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,m)),this.impact=Math.max(0,Math.min(1,p)),this.colorHex=v;const g=nv(u);this.variant=g%12;const b=new lv(g),S=av(o);this.exp=S,this.scale=.2+S*.95;const O=Math.max(3,Math.round(4+S*180));this._buildVariant(b,O),this.baseRotation=b.next()*Math.PI*2}_buildVariant(r,u){const o=this.variant;if(o===0){this.armSeeds=[];for(let m=0;m<2;m++)this.armSeeds.push(r.next()*Math.PI*2);for(let m=0;m<u;m++){const v=m%2,p=r.next(),x=this.armSeeds[v]+p*Math.PI*2.4,g=r.range(-.04,.04)*Math.PI*2,b=x+g,S=(.08+p*.38)*this.size*this.scale;this.particles.push(this._mkParticle(r,S,b,1,1))}}else if(o===1)for(let d=0;d<u;d++){const m=r.range(.34,.42)*this.size*this.scale,v=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,m,v,1,1))}else if(o===2){const d=[.16,.28,.42];for(let m=0;m<u;m++){const v=m%3,p=(d[v]+r.range(-.015,.015))*this.size*this.scale,x=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,p,x,1,1))}}else if(o===3){const d=.18*this.size*this.scale;this.binaryCenters=[{x:-d,y:0},{x:d,y:0}];for(let m=0;m<u;m++){const v=m%2,p=r.range(.04,.22)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,p,x,1,1);g.binaryCore=v,g.angularVelocity*=v===0?1:-1,this.particles.push(g)}}else if(o===4)for(let d=0;d<u;d++){const m=r.range(.05,.32)*this.size*this.scale,v=r.next()*Math.PI*2,p=r.range(.7,1.3),x=r.range(.7,1.3),g=this._mkParticle(r,m,v,p,x);g.orbitTilt=r.range(0,Math.PI),this.particles.push(g)}else if(o===5){this.jetAxis=r.next()*Math.PI*2;const d=Math.floor(u*.7),m=u-d;for(let v=0;v<d;v++){const p=v%2===0?1:-1,x=r.next(),g=r.range(-.18,.18),b=this._mkParticle(r,x*.44*this.size*this.scale,0,1,1);b.jetSide=p,b.jetProgress=x,b.jetSpread=g,b.jetSpeed=r.range(.15,.35)*.001,b.size=r.range(.6,1.4),this.particles.push(b)}for(let v=0;v<m;v++){const p=r.range(.35,.42)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,p,x,1,1);g.isDisk=!0,g.brightness*=.35,this.particles.push(g)}}else if(o===6)for(let d=0;d<u;d++){const m=r.next()*Math.PI*2,v=r.range(.05,.45)*this.size*this.scale,p=this._mkParticle(r,v,m,1,1);p.isNebula=!0,p.driftAngle=r.next()*Math.PI*2,p.driftSpeed=r.range(6e-4,.0014),p.driftPhase=r.next()*Math.PI*2,p.size=r.range(.8,2.2),p.brightness*=.6,this.particles.push(p)}else if(o===7){this.tailAngle=r.next()*Math.PI*2;const d=.1*this.size*this.scale,m=Math.floor(u*.3);for(let p=0;p<m;p++){const x=r.range(0,d),g=r.next()*Math.PI*2,b=this._mkParticle(r,x,g,1,1);b.size=r.range(.8,1.8),this.particles.push(b)}const v=u-m;for(let p=0;p<v;p++){const x=r.next(),g=d+x*.26*this.size*this.scale,b=(1-x*.5)*r.range(-.05,.05)*this.size*this.scale,S=this._mkParticle(r,0,0,1,1);S.isComet=!0,S.cometTailDist=g,S.cometPerp=b,S.cometT=x,S.brightness*=1-x*.6,S.size=(1-x*.5)*r.range(.6,1.2),this.particles.push(S)}}else if(o===8)for(let d=0;d<u;d++){const m=d%3,v=r.range(.3,.42)*this.size*this.scale,p=r.next()*Math.PI*2,x=this._mkParticle(r,v,p,1,1);x.gyroPlane=m,x.gyroAxis=m===0?"z":m===1?"x":"y",this.particles.push(x)}else if(o===9)for(let d=0;d<u;d++){const m=r.range(.06,.42)*this.size*this.scale,p=m/(.42*this.size*this.scale)*4*Math.PI+r.range(-.2,.2),x=this._mkParticle(r,m,p,1,1);x.isMaelstrom=!0,this.particles.push(x)}else if(o===10)for(let d=0;d<u;d++){const m=d/u,v=r.range(.35,.4)*this.size*this.scale,p=m*Math.PI*2+r.range(-.03,.03),x=this._mkParticle(r,v,p,1,1);x.ouroT=m,this.particles.push(x)}else for(let d=0;d<u;d++){const m=d%2,v=r.next(),p=this._mkParticle(r,0,0,1,1);p.isHelix=!0,p.helixStrand=m,p.helixT=v,p.helixSpeed=r.range(.3,.6)*.001,this.particles.push(p)}}_mkParticle(r,u,o,d,m){const v=8e-4+(.42*this.size-u)*4e-5,p=r.next()*Math.PI*2,x=r.range(.05,.3)*this.size;return{baseRadius:u,angle:o,angularVelocity:v*(r.next()>.5?1:.85),size:r.range(.5,1.8),brightness:r.range(.4,1),wobblePhase:r.next()*Math.PI*2,wobbleSpeed:r.range(.5,1.2),ellipX:d,ellipY:m,orbitTilt:0,binaryCore:0,chaosX:Math.cos(p)*x,chaosY:Math.sin(p)*x,chaosDriftPhase:r.next()*Math.PI*2,chaosDriftSpeed:r.range(3e-4,8e-4)}}update(r){this.time+=r}draw(){const{ctx:r,size:u,time:o,accuracy:d,uniqueness:m,impact:v,colorHex:p,variant:x}=this,g=u/2,b=u/2;r.clearRect(0,0,u,u);const S=.4+this.exp*.6,O=d*S,Q=m*S,L=v*S,X=.2+O*.8,M=.3+L*1.9,I=Q,K=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),ee=1-K,J=r.createRadialGradient(g,b,0,g,b,u*.45);if(J.addColorStop(0,ot(p,.05*X)),J.addColorStop(.4,ot(p,.015)),J.addColorStop(1,"transparent"),r.fillStyle=J,r.fillRect(0,0,u,u),x===0&&this.armSeeds){const A=o*5e-4*M;for(const q of this.armSeeds){const w=q+A;r.beginPath();for(let Z=0;Z<1;Z+=.02){const te=w+Z*Math.PI*2.4,ne=(.08+Z*.38)*u*this.scale,de=g+Math.cos(te)*ne,F=b+Math.sin(te)*ne;Z===0?r.moveTo(de,F):r.lineTo(de,F)}r.strokeStyle=ot(p,.12*X),r.lineWidth=1,r.stroke()}}for(const A of this.particles){const q=Math.sin(o*A.wobbleSpeed*.001+A.wobblePhase)*1.2,w=A.baseRadius+q,Z=A.angle+o*A.angularVelocity*M;let te,ne;if(x===3&&this.binaryCenters){const F=this.binaryCenters[A.binaryCore];te=g+F.x+Math.cos(Z)*w,ne=b+F.y+Math.sin(Z)*w}else if(x===4){const F=Math.cos(A.orbitTilt),ae=Math.sin(A.orbitTilt),me=Math.cos(Z)*w*A.ellipX,E=Math.sin(Z)*w*A.ellipY;te=g+me*F-E*ae,ne=b+me*ae+E*F}else if(x===5&&A.jetSide!==void 0&&!A.isDisk&&this.jetAxis!==void 0){const F=(A.jetProgress+o*A.jetSpeed*M)%1,ae=F*.44*u*this.scale,me=this.jetAxis+Math.PI/2;te=g+Math.cos(this.jetAxis)*ae*A.jetSide+Math.cos(me)*A.jetSpread*ae,ne=b+Math.sin(this.jetAxis)*ae*A.jetSide+Math.sin(me)*A.jetSpread*ae,A._fadeMul=Math.sin(F*Math.PI)*.9+.1}else if(x===6&&A.isNebula){const F=o*A.driftSpeed*M,ae=Math.sin(F+A.driftPhase)*2;te=g+Math.cos(A.angle+F*.3)*w+Math.cos(A.driftAngle)*ae,ne=b+Math.sin(A.angle+F*.3)*w+Math.sin(A.driftAngle)*ae}else if(x===7&&A.isComet&&this.tailAngle!==void 0){const F=(A.cometT+o*3e-4*M)%1,ae=A.cometTailDist+F*.06*u*this.scale,me=this.tailAngle+Math.PI/2;te=g+Math.cos(this.tailAngle)*ae+Math.cos(me)*A.cometPerp,ne=b+Math.sin(this.tailAngle)*ae+Math.sin(me)*A.cometPerp}else if(x===8&&A.gyroAxis){const F=o*1e-4*M;A.gyroAxis==="z"?(te=g+Math.cos(Z)*w,ne=b+Math.sin(Z)*w*.3):A.gyroAxis==="x"?(te=g+Math.cos(Z)*w*.3+Math.sin(F)*w*.1,ne=b+Math.sin(Z)*w):(te=g+Math.sin(Z+F)*w*.6,ne=b+Math.cos(Z+F)*w*.8)}else if(x===9){const F=(o*5e-4*M+A.wobblePhase)%1,ae=w*(1-F*.85);te=g+Math.cos(Z)*ae,ne=b+Math.sin(Z)*ae,A._fadeMul=1-F}else if(x===10&&A.ouroT!==void 0){const F=(A.ouroT+o*3e-4*M)%1,ae=F*Math.PI*2;te=g+Math.cos(ae)*w,ne=b+Math.sin(ae)*w;const me=Math.cos(F*Math.PI*2)*.5+.5;A._fadeMul=.3+me*.9}else if(x===11&&A.helixT!==void 0){const F=(A.helixT+o*A.helixSpeed*M)%1,ae=(F-.5)*.65*u*this.scale,me=A.helixStrand===0?0:Math.PI,E=.15*u*this.scale,T=Math.sin(F*Math.PI*3+me)*E;te=g+T,ne=b+ae,A._fadeMul=.4+(Math.cos(F*Math.PI*3+me)+1)/2*.6}else te=g+Math.cos(Z)*w*A.ellipX,ne=b+Math.sin(Z)*w*A.ellipY;if(ee>.01){const F=o*A.chaosDriftSpeed,ae=Math.cos(F+A.chaosDriftPhase)*2,me=Math.sin(F*1.13+A.chaosDriftPhase)*2,E=g+A.chaosX+ae,T=b+A.chaosY+me;te=E*ee+te*K,ne=T*ee+ne*K}const de=A._fadeMul!==void 0?A._fadeMul:1;if(x<=4&&K>.5){const F=2+Math.floor(v*3);for(let ae=0;ae<F;ae++){const me=A.angularVelocity*M*(ae+1)*80,E=Z-me;let T,H;if(x===3&&this.binaryCenters){const ce=this.binaryCenters[A.binaryCore];T=g+ce.x+Math.cos(E)*w,H=b+ce.y+Math.sin(E)*w}else if(x===4){const ce=Math.cos(A.orbitTilt),ue=Math.sin(A.orbitTilt),y=Math.cos(E)*w*A.ellipX,R=Math.sin(E)*w*A.ellipY;T=g+y*ce-R*ue,H=b+y*ue+R*ce}else T=g+Math.cos(E)*w*A.ellipX,H=b+Math.sin(E)*w*A.ellipY;const W=(1-ae/F)*.3*A.brightness*X*K;r.beginPath(),r.arc(T,H,A.size*(1-ae*.25),0,Math.PI*2),r.fillStyle=ot(p,W),r.fill()}}else if(x===6&&A.isNebula){const F=A.size*3,ae=r.createRadialGradient(te,ne,0,te,ne,F);ae.addColorStop(0,ot(p,A.brightness*X*.4)),ae.addColorStop(1,"transparent"),r.fillStyle=ae,r.beginPath(),r.arc(te,ne,F,0,Math.PI*2),r.fill()}r.beginPath(),r.arc(te,ne,A.size,0,Math.PI*2),r.fillStyle=ot(p,A.brightness*X*de),r.fill()}if(I>.05)for(let q=0;q<3;q++){const w=(o*7e-4*I+q*.33)%1;if(w>.5)continue;const Z=(q*1.618*Math.PI+o*1e-4)%(Math.PI*2),te=u*.5*(1-w*1.6);if(te<3)continue;const ne=g+Math.cos(Z)*te,de=b+Math.sin(Z)*te,F=w<.2?w/.2:1-(w-.2)/.3,ae=5+(1-w)*4,me=r.createRadialGradient(ne,de,0,ne,de,ae);me.addColorStop(0,ot("#ffffff",F*.95)),me.addColorStop(.3,ot(p,F*.7)),me.addColorStop(1,"transparent"),r.fillStyle=me,r.beginPath(),r.arc(ne,de,ae,0,Math.PI*2),r.fill()}if(x!==3){const A=.9+.1*Math.sin(o*.003),q=(1+this.exp*9+d*2)*this.scale,w=Math.min(q*(3+v*2),u*.4),Z=r.createRadialGradient(g,b,0,g,b,w);Z.addColorStop(0,ot("#ffffff",.95*A*X)),Z.addColorStop(.2,ot(p,.75*A*X)),Z.addColorStop(.5,ot(p,.2*X)),Z.addColorStop(1,"transparent"),r.fillStyle=Z,r.beginPath(),r.arc(g,b,w,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(g,b,q*A,0,Math.PI*2),r.fillStyle=ot("#ffffff",.95),r.fill()}else if(this.binaryCenters)for(const A of this.binaryCenters){const q=g+A.x,w=b+A.y,Z=(.8+this.exp*5+d*1.5)*this.scale,te=Math.min(Z*3.5,u*.22),ne=r.createRadialGradient(q,w,0,q,w,te);ne.addColorStop(0,ot("#ffffff",.9*X)),ne.addColorStop(.3,ot(p,.6*X)),ne.addColorStop(1,"transparent"),r.fillStyle=ne,r.beginPath(),r.arc(q,w,te,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(q,w,Z,0,Math.PI*2),r.fillStyle=ot("#ffffff",.9),r.fill()}}}const bl=globalThis,ca=new Set;let yl=0,ra=0;const iv=100;function uh(i){const r=ra===0?16:Math.min(iv,Math.max(0,i-ra));ra=i;for(const u of ca)try{u(r)}catch(o){console.error("[AnimationScheduler] subscriber threw, continuing",o)}ca.size>0?yl=bl.requestAnimationFrame(uh):(yl=0,ra=0)}function cv(){yl===0&&(ra=0,yl=bl.requestAnimationFrame(uh))}function rv(){yl!==0&&(bl.cancelAnimationFrame&&bl.cancelAnimationFrame(yl),yl=0,ra=0)}function ov(){return bl.matchMedia?bl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function dh(i){if(!bl.requestAnimationFrame)return()=>{};if(ov())return()=>{};ca.add(i),ca.size===1&&cv();let r=!1;return function(){r||(r=!0,ca.delete(i),ca.size===0&&rv())}}function us({agentId:i,size:r=64,animate:u=!0,signals:o=0,accuracy:d=.5,uniqueness:m=.5,impact:v=.5}){const p=k.useRef(null),x=k.useRef(null),g=k.useRef(!0),b=k.useRef(u);return b.current=u,k.useEffect(()=>{const S=p.current;if(!S)return;S.width=r*2,S.height=r*2;const O=S.getContext("2d");if(!O)return;O.scale(2,2);const Q=gn(i),L=new sv(S,i,o,d,m,Q,v);x.current=L,L.draw();const X=dh(M=>{g.current&&b.current&&(L.update(M),L.draw())});return()=>{X(),x.current=null}},[i,r,o,d,m,v]),k.useEffect(()=>{const S=p.current;if(!S)return;const O=new IntersectionObserver(([Q])=>{g.current=Q.isIntersecting},{threshold:.1});return O.observe(S),()=>O.disconnect()},[]),a.jsx("canvas",{ref:p,"aria-hidden":"true",className:"shrink-0",style:{width:r,height:r,borderRadius:"50%"}})}function uv(i){return i.hallucinationsCaught>0?"catch":i.disputed>0?"mixed":i.confirmed>0?"trust":null}function dv(i){return Math.max(1,Math.min(2.5,1+i*.15))}function os(i,r){return i<=r?`${i}::${r}`:`${r}::${i}`}const fv=new Set(["agreement","unique_confirmed","impl_peer_approved"]),mv=new Set(["disagreement","impl_peer_rejected"]),hv=new Set(["hallucination_caught"]);function xv(i){const r=new Map,u=new Map;for(const o of i)if(!o.retracted)for(const d of o.signals){if(!d.counterpartId||!d.agentId)continue;const m=fv.has(d.signal),v=mv.has(d.signal),p=hv.has(d.signal);if(!m&&!v&&!p)continue;const x=os(d.agentId,d.counterpartId);let g=r.get(x);g||(g={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:o.timestamp},r.set(x,g)),m&&(g.confirmed+=1),v&&(g.disputed+=1),p&&(g.hallucinationsCaught+=1);let b=u.get(x);b||(b=new Set,u.set(x,b)),b.has(o.taskId)||(b.add(o.taskId),g.rounds+=1),o.timestamp>g.lastInteraction&&(g.lastInteraction=o.timestamp)}return r}function Di(i){return i>=2e3?84:i>=800?72:i>=200?60:48}function pv(i,r,u){var b;const o={x:r/2,y:u/2},m=Math.max(80,Math.min(r,u)/2-24),v=new Map;if(i.length===0)return v;const p=[...i].sort((S,O)=>{var X,M;const Q=((X=O.scores)==null?void 0:X.accuracy)??0,L=((M=S.scores)==null?void 0:M.accuracy)??0;return Q!==L?L-Q:S.id.localeCompare(O.id)}),x=p.length,g=Math.PI*(3-Math.sqrt(5));for(let S=0;S<x;S++){const O=p[S],Q=vv(((b=O.scores)==null?void 0:b.accuracy)??0,0,1),L=Math.max(m*.22,(1-Q)*m),X=-Math.PI/2+S*g;v.set(O.id,{x:o.x+L*Math.cos(X),y:o.y+L*Math.sin(X),role:"fleet",angle:X})}return v}function vv(i,r,u){return Math.min(Math.max(i,r),u)}function Qm(i){let r=i>>>0;return()=>{r=r+1831565813>>>0;let u=r;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function gv({width:i,height:r,agentPositions:u}){const o=k.useRef(null),d=k.useRef([]),m=k.useRef([]);k.useEffect(()=>{if(i<=0||r<=0)return;const p=Qm(7311),x=170;d.current=Array.from({length:x},()=>{const g=p();let b,S;return g<.07?(b=2+p()*.6,S=.75+p()*.25):g<.32?(b=1.2+p()*.4,S=.45+p()*.35):(b=.5+p()*.4,S=.25+p()*.3),{x:p()*i,y:p()*r,baseR:b,r:b,baseO:S,o:S,consumed:null,phase:p()*Math.PI*2,twinkleHz:.25+p()*1.4}})},[i,r]),k.useEffect(()=>{if(i<=0||r<=0)return;const p=Qm(919),x=60,g=90,b=1.5,S=1.8;let O=0;const L=dh(X=>{const M=X/1e3;O+=M;const I=d.current,K=m.current;for(let ee=0;ee<I.length;ee++){const J=I[ee];if(J.consumed===null)for(let q=0;q<u.length;q++){const w=u[q].x-J.x,Z=u[q].y-J.y;if(w*w+Z*Z<x*x){J.consumed=q;break}}if(J.consumed===null){const q=.8+.35*Math.sin(O*J.twinkleHz*Math.PI*2+J.phase);J.o=Math.min(1,J.baseO*q)}if(J.consumed!==null){const q=u[J.consumed];if(q){const w=q.x-J.x,Z=q.y-J.y,te=Math.sqrt(w*w+Z*Z)||1,ne=Math.min(te,g*M);J.x+=w/te*ne,J.y+=Z/te*ne,J.o=Math.max(0,J.o-b*M),J.r=Math.max(0,J.r-S*M)}if(J.o<=.01||J.r<=.1){let w=0,Z=0,te=!1;for(let ne=0;ne<8;ne++){w=p()*i,Z=p()*r,te=!0;for(const de of u){const F=de.x-w,ae=de.y-Z;if(F*F+ae*ae<x*x*1.5){te=!1;break}}if(te)break}J.x=w,J.y=Z,J.r=J.baseR,J.o=J.baseO,J.consumed=null}}const A=K[ee];A&&(A.setAttribute("cx",String(J.x)),A.setAttribute("cy",String(J.y)),A.setAttribute("r",String(J.r)),A.setAttribute("opacity",String(J.o)))}});return()=>L()},[i,r,u]);const v=d.current;return a.jsx("svg",{ref:o,width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:v.map((p,x)=>a.jsx("circle",{ref:g=>{m.current[x]=g},cx:p.x,cy:p.y,r:p.r,fill:"#F2EDE3",opacity:p.o},x))})}function yv({variant:i}){const r=(()=>{switch(i){case 1:return a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M 19 24 L 25 24",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("path",{d:"M 20 31 Q 28 36 36 31",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})]});case 2:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"23",r:"1.6",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"23",r:"1.6",fill:"#F2EDE3"}),a.jsx("path",{d:"M 19 30 Q 28 38 37 30 Q 28 33 19 30 Z",fill:"#F2EDE3",opacity:"0.92"})]});case 3:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"24",r:"1.4",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.4",fill:"#F2EDE3"}),a.jsx("path",{d:"M 22 30 Q 26 33 28 30 Q 30 33 34 30",stroke:"#F2EDE3",strokeWidth:"1.4",strokeLinecap:"round",fill:"none"})]});default:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("path",{d:"M 20 31 Q 28 36 36 31",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})]})}})();return a.jsx("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{position:"absolute",top:0,left:0,animation:"orch-smile-pop 900ms ease-out forwards",pointerEvents:"none"},"aria-hidden":!0,children:r})}function bv(){return a.jsx("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{position:"absolute",top:0,left:0,animation:"orch-ripple 700ms ease-out forwards",pointerEvents:"none"},"aria-hidden":!0,children:a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"none",stroke:"var(--accent)",strokeWidth:"1.2"})})}function jv({width:i,height:r,hideLabels:u=!1}){const o=i/2,d=r/2,v=Math.max(80,Math.min(i,r)/2-40),p=[{r:v,accLabel:"0%"},{r:v*.75,accLabel:"25%"},{r:v*.5,accLabel:"50%"},{r:v*.25,accLabel:"75%"}];return a.jsx("svg",{width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:p.map(({r:x,accLabel:g})=>a.jsxs("g",{children:[a.jsx("circle",{cx:o,cy:d,r:x,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:o+6,y:d-x-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:g})]},g))})}function Nv(i,r,u,o,d){const m={x:o/2,y:d/2},v=new Map;v.set(i,{x:m.x,y:m.y,role:"center"});const p=[];for(const Q of r){if(Q===i)continue;const L=u.get(os(i,Q));L&&p.push({id:Q,rel:L})}const x=Math.max(1,...p.map(Q=>Q.rel.rounds)),g=Math.max(120,Math.min(o,d)*.2),b=Math.min(o,d)*.42,S=p.slice().sort((Q,L)=>Q.id.localeCompare(L.id)),O=S.length;for(let Q=0;Q<O;Q++){const{id:L,rel:X}=S[Q],M=Q/Math.max(1,O)*Math.PI*2-Math.PI/2,I=X.rounds/x,K=b-I*(b-g);v.set(L,{x:m.x+K*Math.cos(M),y:m.y+K*Math.sin(M),role:"peer"})}for(const Q of r)v.has(Q)||v.set(Q,{x:m.x,y:m.y,role:"hidden"});return v}function Sv({agents:i,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:d=420}){if(i.length===0)return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)",color:"var(--stage-text-dim)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-2 h-section",children:"No agents configured"}),a.jsxs("div",{className:"font-mono text-xs",children:["Run ",a.jsx("code",{children:"gossip_setup"})," to spin up the fleet."]})]})});if(i.length===1){const m=i[0];return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-block",children:a.jsx(us,{agentId:m.id,signals:m.scores.signals,accuracy:m.scores.accuracy,uniqueness:m.scores.uniqueness,impact:m.scores.impactScore,size:Di(m.scores.signals)})}),a.jsx("div",{className:"mt-3 font-mono text-xs",style:{color:"var(--stage-text-dim)"},children:"Dispatch a task to see the network form."})]})})}return a.jsx(kv,{agents:i,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:d})}function kv({agents:i,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:d=420}){const m=k.useRef(null),[v,p]=k.useState(800),[x,g]=k.useState(d),[b,S]=k.useState(0);k.useEffect(()=>{const M=m.current;if(!M)return;const I=new ResizeObserver(([K])=>{const ee=K.contentRect.width,J=K.contentRect.height;ee>0&&p(ee),J>0&&g(J)});return I.observe(M),()=>I.disconnect()},[]);const O=k.useMemo(()=>{const M=i.map(I=>I.id);return u&&M.includes(u)?Nv(u,M,r,v,x):pv(i,v,x)},[i,r,u,v,x]),Q=k.useMemo(()=>{if(!u)return[];const M=O.get(u);if(!M)return[];const I=[];for(const ee of i){if(ee.id===u)continue;const J=O.get(ee.id);if(!J||J.role!=="peer")continue;const A=r.get(os(u,ee.id));if(!A)continue;const q=uv(A);q&&I.push({peerId:ee.id,x1:M.x,y1:M.y,x2:J.x,y2:J.y,cls:q,width:dv(A.rounds),rounds:A.rounds})}const K={mixed:0,trust:1,catch:2};return I.sort((ee,J)=>K[ee.cls]-K[J.cls]),I},[i,r,u,O]),L=u?Q.length:0,X=k.useMemo(()=>{const M=[];for(const I of i){const K=O.get(I.id);K&&M.push({x:K.x,y:K.y})}return M},[i,O]);return a.jsxs("div",{ref:m,className:"relative overflow-hidden rounded-lg border",style:{minHeight:d,height:"100%",background:"#14120F",borderColor:"#2B2823","--stage-bg":"#14120F","--stage-text-dim":"#B8B0A1","--stage-grid":"rgba(255,255,255,0.03)"},onClick:()=>o(null),children:[a.jsx(gv,{width:v,height:x,agentPositions:X}),a.jsx(jv,{width:v,height:x,hideLabels:!!u}),a.jsx("div",{className:"absolute z-10 flex items-center gap-2 h-section",style:{top:10,left:12,pointerEvents:"none",color:"var(--stage-text-dim)",background:"color-mix(in oklch, var(--stage-bg) 70%, transparent)",padding:"2px 6px",borderRadius:"3px"},children:u?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Focus"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:u}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:L}),a.jsxs("span",{style:{opacity:.7},children:["peer",L===1?"":"s"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Fleet"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:i.length}),a.jsx("span",{style:{opacity:.7},children:"agents"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{opacity:.7},children:"click an avatar to focus"})]})}),!u&&a.jsx("div",{className:"absolute z-10 h-section",style:{bottom:12,right:12,fontSize:"10px",color:"var(--stage-text-dim)",background:"color-mix(in oklch, var(--stage-bg) 70%, transparent)",padding:"2px 6px",borderRadius:"3px",pointerEvents:"none"},children:"closer to center = higher accuracy"}),a.jsx("svg",{width:"100%",height:x,style:{position:"absolute",inset:0,pointerEvents:"none"},children:Q.map(M=>{const I=i.find(T=>T.id===u),K=i.find(T=>T.id===M.peerId);if(!I||!K)return null;const ee=Di(I.scores.signals)/2,J=Di(K.scores.signals)/2,A=M.x2-M.x1,q=M.y2-M.y1,w=Math.max(1,Math.hypot(A,q)),Z=A/w,te=q/w,ne=M.x1+Z*ee,de=M.y1+te*ee,F=M.x2-Z*J,ae=M.y2-te*J,me=M.cls==="trust"?"var(--success)":M.cls==="mixed"?"var(--warn)":"var(--danger)",E=M.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:ne,y1:de,x2:F,y2:ae,stroke:me,strokeWidth:M.width,strokeDasharray:E,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},M.peerId)})}),u&&a.jsxs("div",{className:"absolute z-10 flex flex-col gap-1 rounded font-mono text-[10px]",style:{bottom:10,left:12,color:"var(--stage-text-dim)",pointerEvents:"none"},children:[a.jsx(lo,{stroke:"var(--success)",label:"Trust"}),a.jsx(lo,{stroke:"var(--warn)",label:"Mixed",dash:"8,2"}),a.jsx(lo,{stroke:"var(--danger)",label:"Caught"})]}),!u&&x>0&&a.jsxs("div",{className:"absolute z-[1] -translate-x-1/2 -translate-y-1/2",style:{left:v/2,top:x/2,cursor:"pointer"},onClick:M=>{M.stopPropagation(),S(I=>I+1)},title:b>=10?"♥":b>=5?"ok ok":"orchestrator",children:[a.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{display:"block",pointerEvents:"none"},"aria-hidden":!0,children:[a.jsx("circle",{cx:"28",cy:"28",r:"26",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.6",opacity:"0.35"}),a.jsx("circle",{cx:"28",cy:"28",r:"22",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.4",opacity:"0.25"}),a.jsx("circle",{cx:"28",cy:"28",r:"12",fill:"none",stroke:"#F2EDE3",strokeWidth:"1.1",opacity:"0.75"}),a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"#000"}),a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.5",opacity:"0.6"})]}),b>0&&a.jsx(yv,{variant:(b-1)%4},b),b>0&&a.jsx(bv,{},`ripple-${b}`),a.jsx("div",{className:"font-mono",style:{position:"absolute",top:"calc(100% + 4px)",left:"50%",transform:"translateX(-50%)",fontSize:"9px",letterSpacing:"0.18em",textTransform:"uppercase",color:b>=10?"var(--accent)":"var(--stage-text-dim)",whiteSpace:"nowrap",opacity:.7,pointerEvents:"none",transition:"color 400ms ease-out"},children:b>=10?"♥ orchestrator ♥":"orchestrator"})]}),i.map(M=>{const I=O.get(M.id);if(!I)return null;const K=Di(M.scores.signals),ee=I.role==="center",J=I.role==="hidden",A=I.role==="peer",q=J?0:1,w=ee?"#F2EDE3":"var(--stage-text-dim)",Z=I.angle??Math.PI/2,te=K/2+14,ne=Math.cos(Z)*te,de=Math.sin(Z)*te,F=Math.abs(Math.cos(Z))>.7?Math.cos(Z)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:ae=>{ae.stopPropagation(),o(M.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:I.x,top:I.y,opacity:q,pointerEvents:J?"none":"auto",border:"none",background:"transparent",padding:0,cursor:"pointer",transition:"left 320ms cubic-bezier(0.4,0,0.2,1), top 320ms cubic-bezier(0.4,0,0.2,1), opacity 200ms cubic-bezier(0.4,0,0.2,1)"},"aria-label":`Select agent ${M.id}`,title:M.id,children:[a.jsx("div",{className:"rounded-full",style:{width:K,height:K,boxShadow:ee?"0 0 0 1.5px rgba(242, 237, 227, 0.45), 0 0 0 6px color-mix(in oklch, var(--border-strong) 18%, transparent), 0 0 28px -4px color-mix(in oklch, var(--border-strong) 35%, transparent)":void 0,transition:"box-shadow 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(us,{agentId:M.id,signals:M.scores.signals,accuracy:M.scores.accuracy,uniqueness:M.scores.uniqueness,impact:M.scores.impactScore,size:K})}),a.jsx("div",{className:"absolute font-mono text-[10px] font-bold tracking-wider",style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${ne}px), calc(-50% + ${de}px))${F==="left"?" translateX(calc(50% + 4px))":F==="right"?" translateX(calc(-50% - 4px))":""}`,color:w,textAlign:F==="right"?"right":F==="left"?"left":"center",whiteSpace:"nowrap",pointerEvents:"none",transition:"color 200ms cubic-bezier(0.4,0,0.2,1), transform 320ms cubic-bezier(0.4,0,0.2,1)"},children:M.id}),A&&a.jsx("div",{className:"font-mono text-[9px]",style:{color:"var(--stage-text-dim)",textAlign:"center",whiteSpace:"nowrap",marginTop:2},children:(()=>{const ae=r.get(os(u??"",M.id));return ae?`${ae.rounds} round${ae.rounds===1?"":"s"}`:""})()})]},M.id)})]})}function lo({stroke:i,label:r,dash:u}){return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("svg",{width:"22",height:"6",style:{display:"block"},children:a.jsx("line",{x1:"0",y1:"3",x2:"22",y2:"3",stroke:i,strokeWidth:"1.5",strokeDasharray:u})}),a.jsx("span",{children:r})]})}function Zm(i){const r=new URLSearchParams(i).get("agent");return r&&r.length>0?r:null}function _v(i,r,u){const o=new URLSearchParams(r);u===null?o.delete("agent"):o.set("agent",u);const d=o.toString();return d.length>0?`${i}?${d}`:i}function fh(i){const r=globalThis;if(typeof r.window>"u")return;const u=r.window,o=_v(u.location.pathname,u.location.search,i);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function Ev({selectedAgent:i,agents:r,peerRelationships:u,height:o=420}){return a.jsx("aside",{className:"flex-shrink-0 overflow-y-auto rounded-lg border",style:{width:320,minHeight:o,background:"var(--surface-elev)",borderColor:"var(--border)"},"aria-label":i?`Agent detail: ${i.id}`:"Fleet summary",children:i?a.jsx(Av,{agent:i,peerRelationships:u,agents:r}):a.jsx(Tv,{agents:r,peerRelationships:u})})}function Tv({agents:i,peerRelationships:r}){const u=[...i].filter(m=>m.scores.signals>0).sort((m,v)=>v.scores.accuracy-m.scores.accuracy).slice(0,3),o=[];for(const[m,v]of r.entries())if(v.hallucinationsCaught>0){const[p,x]=m.split("::");o.push({pair:[p,x],catches:v.hallucinationsCaught,ts:v.lastInteraction})}o.sort((m,v)=>new Date(v.ts).getTime()-new Date(m.ts).getTime());const d=o.slice(0,5);return a.jsxs("div",{className:"flex h-full flex-col p-4",children:[a.jsx("div",{className:"mb-2 h-section",children:"Fleet at a glance"}),a.jsx("p",{className:"mb-4 font-mono text-[12px]",style:{color:"var(--ink-4)"},children:"Click a node to see detail."}),a.jsx(Km,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(go,{text:"No agent has logged a signal yet."}):u.map(m=>a.jsxs("button",{type:"button",onClick:()=>fh(m.id),className:"group flex w-full items-center gap-2 rounded px-2 py-2 text-left transition hover:[background:color-mix(in_oklch,var(--accent)_8%,transparent)]",style:{cursor:"pointer"},children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[12px] font-semibold",style:{color:"var(--text)"},children:m.id}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[Math.round(m.scores.accuracy*100),"% accuracy · ",m.scores.signals," signals"]})]}),a.jsx("span",{className:"opacity-0 transition group-hover:opacity-100 font-mono text-[11px]",style:{color:"var(--accent)"},children:"→"})]},m.id))}),a.jsx(Km,{label:"Recent hallucination catches",tone:"danger",children:d.length===0?a.jsx(go,{text:"No catches in the active window."}):d.map(m=>a.jsxs("div",{className:"rounded px-2 py-2",children:[a.jsxs("div",{className:"font-mono text-[12px]",style:{color:"var(--text)"},children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",m.pair[0]," ↔ ",m.pair[1]]}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[m.catches," caught · ",Mv(m.ts)]})]},`${m.pair[0]}::${m.pair[1]}`))})]})}function Km({label:i,tone:r,children:u}){const o=r==="success"?"var(--success)":r==="danger"?"var(--danger)":"var(--ink-4)";return a.jsxs("section",{className:"mb-4",children:[a.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 h-section",children:[a.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:o,display:"inline-block",flexShrink:0}}),i]}),a.jsx("div",{className:"space-y-1",children:u})]})}function go({text:i}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--ink-4)"},children:i})}function Mv(i){const r=new Date(i).getTime(),u=Date.now(),o=Math.max(0,Math.floor((u-r)/1e3));return o<60?`${o}s ago`:o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:`${Math.floor(o/86400)}d ago`}function Av({agent:i,peerRelationships:r,agents:u}){const o=i.scores.bench.state==="benched"?{label:"BENCHED",color:"var(--danger)"}:i.native?{label:"READY",color:"var(--success)"}:i.online?{label:"ONLINE",color:"var(--success)"}:{label:"OFFLINE",color:"var(--ink-3)"},d=[];for(const v of u){if(v.id===i.id)continue;const p=r.get(os(i.id,v.id));if(!p)continue;const x=p.confirmed+p.disputed+p.hallucinationsCaught;d.push({other:v.id,rel:p,total:x})}d.sort((v,p)=>p.total-v.total);const m=d.slice(0,3);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 h-section",style:{color:o.color,borderBottom:"1px solid var(--border)",background:`color-mix(in oklch, ${o.color} 6%, transparent)`},children:[a.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:o.color,display:"inline-block"}}),o.label]}),a.jsxs("div",{className:"flex items-center gap-3 px-4 pt-4",children:[a.jsx(us,{agentId:i.id,signals:i.scores.signals,accuracy:i.scores.accuracy,uniqueness:i.scores.uniqueness,impact:i.scores.impactScore,size:48}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[14px] font-semibold",style:{color:"var(--ink)"},children:i.id}),a.jsx("div",{className:"truncate font-mono text-[11px]",style:{color:"var(--ink-3)"},children:i.model})]})]}),a.jsxs("div",{className:"mx-4 mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Ai,{label:"Accuracy",value:`${Math.round(i.scores.accuracy*100)}%`}),a.jsx(Ai,{label:"Reliability",value:i.scores.taskCompletionRate==null?"—":`${Math.round(i.scores.taskCompletionRate*100)}%`}),a.jsx(Ai,{label:"Signals",value:i.scores.signals.toLocaleString()}),a.jsx(Ai,{label:"Impact",value:`${Math.round(i.scores.impactScore*100)}%`})]}),a.jsxs("div",{className:"mt-4 px-4",children:[a.jsx("div",{className:"mb-1.5 h-section",children:"Top peers"}),m.length===0?a.jsx(go,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:m.map(({other:v,rel:p})=>a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"truncate font-mono text-[12px]",style:{color:"var(--ink)"},children:v}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[p.confirmed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--success)"},children:"✓"})," ",p.confirmed]}),p.disputed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--warn)"},children:"≠"})," ",p.disputed]}),p.hallucinationsCaught>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",p.hallucinationsCaught]}),a.jsxs("span",{style:{opacity:.6},children:["· ",p.rounds," rounds"]})]})]},v))})]}),i.skills.length>0&&a.jsxs("div",{className:"mt-4 px-4",children:[a.jsxs("div",{className:"mb-1.5 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.skills.length})]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:i.skills.slice(0,6).map(v=>a.jsx("span",{className:"rounded-sm border px-1.5 py-0.5 font-mono text-[11px]",style:{borderColor:"var(--border)",color:"var(--ink-3)"},children:v},v))})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t p-3",style:{borderColor:"var(--border)"},children:[a.jsx(ao,{label:"Open dispatch log",kbd:"⏎",href:`/agent/${encodeURIComponent(i.id)}`}),a.jsx(ao,{label:"View skill graph",kbd:"G",href:`/agent/${encodeURIComponent(i.id)}#skills`,disabled:i.skills.length===0}),a.jsx(ao,{label:"Dispatch consensus",kbd:"⌘D",href:"#",disabled:!0})]})]})}function Ai({label:i,value:r}){return a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"h-section",children:i}),a.jsx("div",{className:"mt-0.5 font-mono text-[16px] font-medium tabular-nums",style:{color:"var(--text)"},children:r})]})}function ao({label:i,kbd:r,href:u,disabled:o}){return a.jsxs("a",{href:o?void 0:`/dashboard${u}`,"aria-disabled":o,tabIndex:o?-1:void 0,className:"flex items-center justify-between rounded px-2 py-2 font-mono text-[12px] transition",style:{background:o?"transparent":"color-mix(in oklch, var(--surface) 50%, transparent)",color:o?"var(--ink-4)":"var(--text)",pointerEvents:o?"none":"auto",opacity:o?.5:1},children:[a.jsx("span",{children:i}),a.jsx("kbd",{className:"rounded border px-1 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--border)",background:"var(--surface-sunk)",color:"var(--ink-3)"},children:r})]})}let Ut=null,wi=3e3,so=null;const yo=new Set;function mh(){if((Ut==null?void 0:Ut.readyState)===WebSocket.OPEN||(Ut==null?void 0:Ut.readyState)===WebSocket.CONNECTING)return;const i=location.protocol==="https:"?"wss:":"ws:";Ut=new WebSocket(`${i}//${location.host}/dashboard/ws`),Ut.onopen=()=>{wi=3e3},Ut.onmessage=r=>{try{const u=JSON.parse(r.data);yo.forEach(o=>o(u))}catch{}},Ut.onclose=()=>{Ut=null,so&&clearTimeout(so),so=setTimeout(()=>{wi=Math.min(wi*1.5,3e4),mh()},wi)},Ut.onerror=()=>{}}function hh(i){return yo.add(i),()=>yo.delete(i)}function xh(i){const r=k.useRef(i);r.current=i,k.useEffect(()=>(mh(),hh(u=>r.current(u))),[])}const wv=6e4;function Cv(){const[i,r]=k.useState(null),[u,o]=k.useState(null),d=k.useRef(null),m=()=>{r(null),o(null),d.current!=null&&(window.clearTimeout(d.current),d.current=null)};if(xh(p=>{if(p.type==="task_dispatched"){r(p.taskId),o(p.agentId),d.current!=null&&window.clearTimeout(d.current),d.current=window.setTimeout(m,wv);return}if(p.type==="consensus_complete"||p.type==="task_completed"||p.type==="task_failed"){if(p.taskId!==i)return;m()}}),k.useEffect(()=>()=>m(),[]),i===null)return null;const v=i.slice(0,8);return a.jsxs("div",{role:"status","aria-live":"polite",className:"flex items-center gap-3 rounded-md border px-3 py-2 font-mono text-[11px]",style:{background:"color-mix(in oklch, var(--info) 8%, transparent)",borderColor:"color-mix(in oklch, var(--info) 30%, transparent)",color:"var(--text)",animation:"beat-pulse-narrative calc(var(--beat) * 2) ease-in-out infinite"},children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:"var(--info)",boxShadow:"0 0 6px var(--info)"}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"Round in flight"}),a.jsx("span",{className:"font-bold",style:{color:"var(--info)"},children:v}),u&&a.jsxs("span",{style:{color:"var(--text-dim)"},children:["→ ",a.jsx("span",{style:{color:"var(--text)"},children:u})]}),a.jsx("button",{type:"button",onClick:()=>{const p=document.getElementById("consensus-rounds-section");p&&p.scrollIntoView({behavior:"smooth",block:"start"})},className:"ml-auto rounded px-1.5 py-0.5 font-mono text-[10px] transition hover:[background:color-mix(in_oklch,var(--info)_12%,transparent)]",style:{color:"var(--text-faint)",cursor:"pointer"},children:"watch ↓"})]})}const gl=24,zv={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function ph(i){return zv[i]}function Dv(i,r,u){const o=ph(r),d=o/gl,m=u-o,v=new Array(gl).fill(0);for(const p of i){const x=new Date(p).getTime();if(!Number.isFinite(x)||x<m||x>u)continue;const g=x-m;let b=Math.floor(g/d);b>=gl&&(b=gl-1),v[b]+=1}return v}const Rv=["1h","24h","7d","30d"],Ov={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function Uv({runs:i,range:r,onRangeChange:u,height:o=52}){const[d,m]=k.useState(()=>Date.now());k.useEffect(()=>{const x=ph(r)/gl,g=window.setInterval(()=>m(Date.now()),x);return()=>window.clearInterval(g)},[r]);const v=k.useMemo(()=>{var g;const x=[];for(const b of i){const S=((g=b.signals)==null?void 0:g.length)??0;for(let O=0;O<S;O++)x.push(b.timestamp)}return Dv(x,r,d)},[i,r,d]),p=Math.max(1,...v);return a.jsxs("div",{className:"rounded-md border px-3 py-2",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsx("div",{className:"h-section",children:"Signal volume"}),a.jsx("div",{className:"flex gap-1",children:Rv.map(x=>{const g=x===r;return a.jsx("button",{type:"button",onClick:()=>u(x),"aria-pressed":g,className:"rounded px-2 py-0.5 font-mono text-[10px] transition",style:{background:g?"var(--surface-sunk)":"transparent",color:g?"var(--text)":"var(--text-dim)",border:"1px solid",borderColor:g?"var(--border-strong)":"transparent"},children:x},x)})})]}),a.jsxs("svg",{viewBox:`0 0 ${gl} 1`,preserveAspectRatio:"none",style:{width:"100%",height:o,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:gl,height:.015,fill:"var(--ink)",opacity:.08}),v.map((x,g)=>{const b=x===0?0:x/p,S=1-b;return a.jsx("rect",{x:g+.15,y:S,width:.7,height:Math.max(b,x>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:x===0?0:.9},g)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between font-mono text-[10px] tabular-nums",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:Ov[r]}),a.jsx("span",{children:"now"})]})]})}function qv(i){const r=[];for(const[u,o]of i.entries())r.push(`${u}:${o.rounds}:${o.confirmed}:${o.disputed}:${o.hallucinationsCaught}`);return r.sort(),r.join("|")}function Lv(i){const r=k.useRef(""),u=k.useRef(new Map);return k.useMemo(()=>{const o=xv(i??[]),d=qv(o);return d===r.current?u.current:(r.current=d,u.current=o,o)},[i])}function Bv(i){const r=[];for(const[u,o]of i.entries())r.push(`${u}:${o.critical}:${o.high}:${o.medium}:${o.low}`);return r.sort(),r.join("|")}function vh(i){const r=k.useRef(""),u=k.useRef(new Map);return k.useMemo(()=>{const o=new Map;if(i)for(const m of i){const v=[...m.confirmed??[],...m.disputed??[],...m.unique??[],...m.unverified??[]];for(const p of v){const x=p.originalAgentId;if(!x)continue;const g=o.get(x)??{critical:0,high:0,medium:0,low:0},b=p.severity??"low";b==="critical"?g.critical+=1:b==="high"?g.high+=1:b==="medium"?g.medium+=1:g.low+=1,o.set(x,g)}}const d=Bv(o);return d===r.current?u.current:(r.current=d,u.current=o,o)},[i])}function Hv(){const[i,r]=k.useState(()=>typeof window>"u"?null:Zm(window.location.search));return k.useEffect(()=>{const u=()=>{const o=typeof window>"u"?null:Zm(window.location.search);r(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[i,fh]}const $v=["1h","24h","7d","30d"];function Gv(i){return typeof i=="string"&&$v.includes(i)}function io(i){const r=new URLSearchParams(i).get("range");return Gv(r)?r:null}function Yv(i,r,u){const o=new URLSearchParams(r);u===null?o.delete("range"):o.set("range",u);const d=o.toString();return d.length>0?`${i}?${d}`:i}function Jm(i){const r=globalThis;if(!r.window)return;const u=r.window,o=Yv(u.location.pathname,u.location.search,i);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function Xv(){const[i,r]=k.useState(()=>typeof window>"u"?"7d":io(window.location.search)??"7d");return k.useEffect(()=>{typeof window<"u"&&io(window.location.search)===null&&Jm(i);const u=()=>{const o=typeof window>"u"?"7d":io(window.location.search)??"7d";r(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[i,Jm]}const Vv=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function Qv(i){if(!(i instanceof Element))return!1;const r=i.tagName;if(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||i.isContentEditable===!0)return!0;const u=i.getAttribute("role");return u!==null&&Vv.has(u)}function Zv(i){k.useEffect(()=>{if(!i)return;function r(u){Qv(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),rs("/agent/"+encodeURIComponent(i))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),rs("/agent/"+encodeURIComponent(i)+"#skills")))}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[i])}function Kv(i){const r=globalThis.window,u=r!=null?r.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function Jv({overview:i,agents:r,tasks:u,consensus:o,consensusReports:d,fleetTrend:m,signalActivity:v,skills:p,activeTaskCount:x,setActiveTaskCount:g}){const b=i.actionableFindings,S=Kv(),O=Lv(o==null?void 0:o.runs),Q=vh(d==null?void 0:d.reports),L=k.useMemo(()=>{const w=new Map;if(m){for(const Z of m.points){const te=w.get(Z.agentId)??[];te.push(Z),w.set(Z.agentId,te)}for(const Z of w.values())Z.sort((te,ne)=>te.day.localeCompare(ne.day))}return w},[m]),[X,M]=Hv(),[I,K]=Xv();Zv(X);const ee=r&&X?r.find(w=>w.id===X)??null:null,[J,A]=k.useState(!S);function q(){const w=!J;A(w);const Z=new URL(window.location.href);w?Z.searchParams.delete("graph"):Z.searchParams.set("graph","0"),window.history.replaceState(null,"",Z.toString())}return a.jsxs("div",{className:"mx-auto max-w-6xl space-y-6",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[a.jsx("h1",{className:"h-route h-route--lg",children:"Overview"}),a.jsxs("div",{className:"flex items-baseline gap-4",children:[b>0&&a.jsxs("a",{href:vn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] transition hover:underline",style:{color:"var(--warn)"},"data-tooltip":"Findings open for operator review",children:[b," actionable →"]}),r&&a.jsx("button",{type:"button",onClick:q,className:"font-mono text-[10px] transition hover:underline",style:{color:"var(--text-dim)"},children:J?"[hide graph]":"[show graph]"})]})]}),a.jsx("p",{className:"mt-1 font-mono text-[13px]",style:{color:"var(--text-dim)"},children:"What your agents are doing right now."})]}),J&&r&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(Cv,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(Sv,{agents:r,peerRelationships:O,selectedAgentId:X,onSelectAgent:M})}),a.jsx(Ev,{selectedAgent:ee,agents:r,peerRelationships:O})]}),o&&a.jsx(Uv,{runs:o.runs,range:I,onRangeChange:K})]}),a.jsx(a0,{overview:i,activeTasks:x,mode:"calm"}),a.jsx(p0,{onCountChange:g}),r&&a.jsx(o0,{agents:r,activity:v}),a.jsx(G0,{}),u&&a.jsx(U0,{tasks:u,limit:3}),r&&a.jsx(A0,{agents:r,highlightedAgentId:J?X:null,severityMap:Q,trendByAgent:L}),a.jsx(Y0,{overview:i}),a.jsx(F0,{skills:p??null})]})}const ua={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},Ui={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},To={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},oa=["confirmed","disputed","unverified","unique"],Fv=.01;function Iv({consensusId:i,data:r,onError:u}){const[o,d]=k.useState(r?{kind:"full",data:r}:i?{kind:"loading"}:{kind:"empty"});return k.useEffect(()=>{if(r)return;let m=!1;return d(v=>v.kind==="error"?v:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(i)}`).then(async v=>{const p=await v.json().catch(()=>({}));if(!v.ok){const x=typeof(p==null?void 0:p.error)=="string"?p.error:`HTTP ${v.status}`;throw new Error(x)}return p}).then(v=>{m||d({kind:"full",data:v})}).catch(v=>{m||(d(p=>({kind:"error",error:v.message,stale:p.kind==="full"?p.data:void 0})),u==null||u(v))}),()=>{m=!0}},[i,r,u]),o.kind==="loading"?a.jsx(lg,{}):o.kind==="empty"?a.jsx(ag,{}):o.kind==="error"?a.jsx(sg,{error:o.error,stale:o.stale}):a.jsx(gh,{data:o.data})}function gh({data:i}){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-4 flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"h-section",style:{color:"var(--ink)"},children:"Consensus flow"}),a.jsxs("p",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[i.summary.totalFindings," findings across ",i.agentCount," agents"]})]}),i.coverageDegraded&&a.jsx(Wv,{degraded:i.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(Pv,{data:i})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(tg,{data:i})}),a.jsx(ng,{data:i})]})}function Wv({degraded:i}){return a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn)",border:"1px solid var(--warn)"},"data-tooltip":`Coverage degraded: expected ${i.expected}, received ${i.received}. Dropped: ${i.droppedAgents.join(", ")||"none"}`,children:"coverage degraded"})}const Mo=720,Ri=320,pn=120,bo=0,jo=(Mo-pn)/2,Fm=Mo-pn,co=8;function Pv({data:i}){const r=k.useMemo(()=>eg(i),[i]),u=k.useMemo(()=>r.edges,[r.edges]),o=ig();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Mo} ${Ri}`,width:"100%",height:Ri,role:"img","aria-label":`Consensus flow: ${i.summary.confirmed} confirmed, ${i.summary.disputed} disputed, ${i.summary.unverified} unverified, ${i.summary.unique} unique of ${i.summary.totalFindings} findings across ${i.agentCount} agents`,style:{display:"block"},children:[a.jsx("g",{children:u.map((d,m)=>a.jsx("path",{d:d.path,fill:d.color,fillOpacity:.55,stroke:"none",style:o?void 0:{animation:`consensus-flow-ribbon-in 480ms ease-out ${m*40}ms both`},children:a.jsx("title",{children:d.tooltip})},`${d.fromFamily}-${d.toVerdict}`))}),a.jsx("g",{children:r.left.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:bo,y:d.y,width:pn,height:d.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:bo+pn-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[To[d.family]," · ",d.agentCount]})]},d.family))}),a.jsx("g",{children:r.right.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:jo,y:d.y,width:pn,height:d.h,fill:ua[d.verdict],fillOpacity:.16}),a.jsxs("text",{x:jo+pn/2,y:d.y+d.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:[Ui[d.verdict]," · ",d.count]})]},d.verdict))}),a.jsx("g",{children:r.right.map(d=>{const m=i.summary.totalFindings>0?Math.round(d.count/i.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:Fm,y:d.y,width:pn,height:d.h,fill:ua[d.verdict],fillOpacity:.32}),a.jsxs("text",{x:Fm+pn-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[d.count," · ",m,"%"]})]},d.verdict)})})]}),a.jsx("style",{children:`
|
|
59
|
+
@keyframes consensus-flow-ribbon-in {
|
|
60
|
+
from { opacity: 0; }
|
|
61
|
+
to { opacity: 1; }
|
|
62
|
+
}
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
svg * { animation: none !important; }
|
|
65
|
+
}
|
|
66
|
+
`})]})}function eg(i){const r=i.summary.totalFindings,u=Ri-co*2,o=new Map;for(const L of i.familyToOutcome)o.set(L.from.family,(o.get(L.from.family)??0)+L.to.count);const d=i.modelFamilyToFindings.reduce((L,X)=>L+(o.get(X.family)??0),0)||1;let m=co;const v=i.modelFamilyToFindings.map(L=>{const X=o.get(L.family)??0,M=Math.max(20,X/d*u),I={family:L.family,y:m,h:M,agentCount:L.agentCount};return m+=M,I}),p=24;let x=co;const g=oa.map(L=>{const X=i.summary[L],M=r>0?X/r:0,I=Math.max(p,M*u),K={verdict:L,y:x,h:I,count:X};return x+=I,K}),b=new Map,S=new Map,O=[],Q=[...i.familyToOutcome].sort((L,X)=>L.from.family!==X.from.family?L.from.family.localeCompare(X.from.family):oa.indexOf(L.to.verdict)-oa.indexOf(X.to.verdict));for(const L of Q){const X=v.find(W=>W.family===L.from.family),M=g.find(W=>W.verdict===L.to.verdict);if(!X||!M)continue;const I=o.get(L.from.family)??0,K=I>0?L.to.count/I*X.h:0,ee=M.count||1,J=L.to.count/ee*M.h,A=b.get(L.from.family)??0,q=S.get(L.to.verdict)??0;if(b.set(L.from.family,A+K),S.set(L.to.verdict,q+J),L.weight<Fv)continue;const w=X.y+A,Z=w+K,te=M.y+q,ne=te+J,de=bo+pn,F=jo,ae=de+(F-de)*.5,me=F-(F-de)*.5,E=`M ${de} ${w} C ${ae} ${w}, ${me} ${te}, ${F} ${te} L ${F} ${ne} C ${me} ${ne}, ${ae} ${Z}, ${de} ${Z} Z`,T=i.modelFamilyToFindings.find(W=>W.family===L.from.family),H=(T==null?void 0:T.agentCount)??0;O.push({path:E,color:ua[L.to.verdict],tooltip:`${H} ${To[L.from.family]} agent${H===1?"":"s"} → ${L.to.count} ${Ui[L.to.verdict]} finding${L.to.count===1?"":"s"} (${Math.round(L.weight*100)}%)`,fromFamily:L.from.family,toVerdict:L.to.verdict})}return{left:v,right:g,edges:O}}function tg({data:i}){const r=i.summary.totalFindings||1;return a.jsxs("div",{className:"space-y-4",children:[a.jsx(ro,{label:"Model families",items:i.modelFamilyToFindings.map(u=>({key:u.family,label:`${To[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(ro,{label:"Findings reviewed",items:oa.map(u=>({key:u,label:`${Ui[u]} (${i.summary[u]})`,value:i.summary[u],color:ua[u]}))}),a.jsx(ro,{label:"Outcome verdicts",items:oa.map(u=>({key:u,label:`${i.summary[u]} · ${Math.round(i.summary[u]/r*100)}%`,value:i.summary[u],color:ua[u]}))})]})}function ro({label:i,items:r}){const u=r.reduce((o,d)=>o+d.value,0)||1;return a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[10px]",style:{color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:i}),a.jsx("div",{className:"flex h-6 overflow-hidden rounded-sm border",style:{borderColor:"var(--border)"},children:r.map(o=>{const d=o.value/u*100;return d<.5?null:a.jsx("div",{title:o.label,style:{width:`${d}%`,background:o.color,opacity:.7,color:"var(--surface)",fontFamily:"var(--font-mono)",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",overflow:"hidden"},children:d>12?o.label:""},o.key)})})]})}function ng({data:i}){return a.jsxs("div",{className:"mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t pt-3 font-mono text-[10px]",style:{borderColor:"var(--border)",color:"var(--ink-3)"},children:[oa.map(r=>a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:ua[r]}}),Ui[r]," · ",i.summary[r]]},r)),i.summary.newFindings>0&&a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:"var(--warn)"}}),"new · ",i.summary.newFindings]})]})}function lg(){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},"aria-busy":"true","aria-label":"Loading consensus flow",children:[a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsx("div",{className:"h-3 w-32 animate-pulse rounded-sm",style:{background:"var(--border)"}}),a.jsx("div",{className:"h-2 w-48 animate-pulse rounded-sm",style:{background:"var(--border)"}})]}),a.jsx("div",{className:"grid grid-cols-3 gap-3",style:{height:Ri},children:[0,1,2].map(i=>a.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2,3].map(r=>a.jsx("div",{className:"flex-1 animate-pulse rounded-sm",style:{background:"var(--border)",opacity:.6}},r))},i))}),a.jsx("style",{children:`
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
.animate-pulse { animation: none !important; }
|
|
69
|
+
}
|
|
70
|
+
`})]})}function ag(){return a.jsx("div",{className:"rounded-md border p-10 text-center",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:a.jsx("p",{className:"font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"No consensus rounds yet — dispatch your first review to see the consensus flow."})})}function sg({error:i,stale:r}){return a.jsxs("div",{className:"relative rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsx("div",{className:"absolute right-3 top-3",children:a.jsxs("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--bad-soft)",color:"var(--bad)",border:"1px solid var(--bad)"},title:i,children:["error · ",i]})}),r?a.jsx("div",{style:{opacity:.5,pointerEvents:"none"},children:a.jsx(gh,{data:r})}):a.jsx("p",{className:"py-10 text-center font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"Failed to load consensus flow."})]})}function ig(){const[i,r]=k.useState(!1);return k.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)");r(u.matches);const o=d=>r(d.matches);return u.addEventListener("change",o),()=>u.removeEventListener("change",o)},[]),i}function cg({consensusId:i}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("nav",{className:"mb-2 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},"aria-label":"Breadcrumb",children:[a.jsx("a",{href:vn("/"),className:"hover:underline",style:{color:"var(--ink-3)"},children:"Overview"}),a.jsx("span",{"aria-hidden":"true",children:"›"}),a.jsx("span",{style:{color:"var(--ink)"},children:i})]}),a.jsx("h1",{className:"h-route",children:"Consensus flow"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"Model families on the left, findings reviewed in the middle, verdicts on the right."})]}),a.jsx(Iv,{consensusId:i})]})}function rg({onLogin:i,error:r}){const[u,o]=k.useState(""),[d,m]=k.useState(!1),v=async x=>{if(x.preventDefault(),!(!u.trim()||d)){m(!0);try{await i(u.trim())}finally{m(!1)}}},p=r==="bad_key"?"Invalid key. Check your terminal for the correct key.":r==="network"?"Connection error — relay may be offline.":null;return a.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--surface)"},children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border [border-color:var(--border)] p-8 text-center",style:{background:"var(--surface-elev)"},children:[a.jsx("div",{className:"crt-logo mx-auto mb-4",style:{width:"fit-content"},children:a.jsx("img",{src:"/dashboard/assets/gossip-mini.png",alt:"gossipcat",className:"crt-logo-img h-56 w-56 object-contain",style:{filter:"drop-shadow(0 0 28px var(--accent))"}})}),a.jsx("p",{className:"h-route mb-1",style:{letterSpacing:"-0.02em",textShadow:"0 0 24px var(--accent)"},children:"Gossipcat"}),a.jsx("p",{className:"mb-6 text-[13px]",style:{color:"var(--ink-3)"},children:"Authenticate to access the dashboard"}),a.jsxs("form",{onSubmit:v,children:[a.jsx("input",{type:"password",value:u,onChange:x=>o(x.target.value),placeholder:"Dashboard key",autoFocus:!0,disabled:d,className:"w-full rounded-lg border [border-color:var(--border)] px-4 py-3 font-mono text-sm outline-none focus:[border-color:var(--ink-3)] focus:ring-2 focus:[--tw-ring-color:color-mix(in_oklch,var(--ink-3)_20%,transparent)] disabled:opacity-50",style:{background:"var(--surface)",color:"var(--ink)"}}),a.jsx("button",{type:"submit",disabled:d,className:"mt-4 w-full rounded-lg px-4 py-3 text-sm font-semibold transition hover:opacity-90 disabled:opacity-60",style:{background:"var(--accent)",color:"#fff"},children:d?"Unlocking…":"Unlock"})]}),p&&a.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--bad)"},children:p})]})})}const yh="dashboard:theme",og=["light","dark"];function ug(i){return i==="light"||i==="dark"?i:i==="editorial"?"light":i==="default"?"dark":null}function dg(i,r){const u=ug(i);return u!==null?u:r?"dark":"light"}function fg(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function mg(){if(typeof window>"u")return"light";let i=null;try{i=window.localStorage.getItem(yh)}catch{}return dg(i,fg())}function hg(){const[i,r]=k.useState(mg);k.useEffect(()=>{typeof document>"u"||(i==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=i)},[i]);function u(d){if(og.includes(d)&&(r(d),typeof window<"u"))try{window.localStorage.setItem(yh,d)}catch{}}return{theme:i,setTheme:u,toggle:()=>{u(i==="light"?"dark":"light")}}}const xg=[{term:"Consensus Round",definition:"A structured multi-agent review session. Each agent independently reviews the target code or output, then all agents cross-review each other's findings. The result is a set of findings tagged by how many agents agreed. The /debates URL in the dashboard lists all past consensus rounds.",seeAlso:"Finding, Signal"},{term:"Finding",definition:"A verifiable claim about a specific line of code, always cited with a file path and line number. Agents emit findings during a consensus round. A finding that cannot be located in the code is a hallucination.",seeAlso:"Insight, Hallucination"},{term:"Insight",definition:"An observation that does not point to a specific code location. Insights are informational — they cannot be confirmed or disputed by other agents and are excluded from accuracy scoring.",seeAlso:"Finding"},{term:"Signal",definition:"A scored event recorded against an agent, such as agreement, hallucination_caught, or unique_confirmed. Each signal adjusts the agent's accuracy and dispatch weight over time. Signals are the primary feedback mechanism that drives agent improvement.",seeAlso:"Accuracy (Adjusted), Dispatch Weight"},{term:"Hallucination",definition:"A fabricated finding: the cited file and line exist, but the code does not support the claim the agent made. Caught during cross-review by a peer agent. Each hallucination lowers the emitting agent's accuracy score.",seeAlso:"Finding, Signal"},{term:"Confirmed / Disputed / Unverified / Unique",definition:"The four statuses assigned to a finding after cross-review. Confirmed = two or more agents independently verified it. Disputed = at least one agent found contradictory evidence. Unverified = peer agents could not check it (no code anchor, out of scope). Unique = only one agent surfaced it; not yet confirmed or denied.",seeAlso:"Consensus Round"},{term:"Dispatch Weight",definition:"How likely an agent is to be selected for the next task. Ranges from 0.3 (rarely dispatched) to 2.0 (strongly preferred). Updated after every task based on accuracy and uniqueness signals. Visible on the Team page.",seeAlso:"Accuracy (Adjusted), Uniqueness"},{term:"Accuracy (Adjusted)",definition:"The fraction of an agent's findings that survived cross-review, with a penalty applied for hallucinations. Category Competency on the agent page shows the raw per-category ratio without the penalty; the Metrics section shows the penalized aggregate used for dispatch decisions.",seeAlso:"Hallucination, Dispatch Weight"},{term:"Uniqueness",definition:"How often this agent surfaces findings that no other agent in the same round found. High uniqueness with low accuracy is a useful combination: always include such agents in a consensus round, but never send them solo.",seeAlso:"Accuracy (Adjusted), Consensus Round"},{term:"Reliability",definition:"Task completion rate — the fraction of dispatched tasks that finished without a pipeline error or timeout. Distinct from accuracy, which measures finding correctness.",seeAlso:"Accuracy (Adjusted)"},{term:"Impact",definition:"A severity-weighted score for an agent's findings. Critical and high findings contribute more than medium or low ones. Impact reflects not just how many findings an agent produces, but how serious those findings tend to be.",seeAlso:"Finding"},{term:"Benched / Struggling / Kept for coverage",definition:"Circuit-breaker states that limit dispatch when an agent underperforms. Benched = fully excluded from dispatch (chronic = sustained low accuracy; burst = recent failure streak). Struggling = consecutive failures tripped the breaker; agent is deprioritized until it recovers. Kept for coverage = the agent would be benched, but it is the only agent with a required skill category, so it stays in the pool.",seeAlso:"Dispatch Weight, Skill"},{term:"Skill",definition:"A markdown file injected into an agent's prompt for a specific task category (e.g. input_validation, trust_boundaries). Skills are generated from an agent's actual failure history and override generic defaults. A skill graduates from pending to passed or failed after 120 post-bind signals.",seeAlso:"bound_at"},{term:"bound_at",definition:"The timestamp when a skill was attached to an agent. This anchors the effectiveness window: only signals recorded after bound_at count toward the skill's graduation verdict.",seeAlso:"Skill"},{term:"Invalid Output Types",definition:"Agent finding tags with a type= attribute outside the allowed set (finding, suggestion, insight). The pipeline silently rejects these — they never reach the consensus round or the dashboard. The count is tracked so skill development can address systematic format drift.",seeAlso:"Finding"},{term:"Process Violation",definition:"A guardrail breach detected outside normal code review. Examples: an agent pushed a commit directly to master bypassing the PR process, or an agent wrote to a file outside its declared scope. Process violations are logged separately from code findings."}],pg={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function vg({open:i,onClose:r}){const u=k.useRef(null);return k.useEffect(()=>{if(!i)return;const o=requestAnimationFrame(()=>{var m;(m=u.current)==null||m.focus()}),d=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[i,r]),i?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:r,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden",style:pg,role:"dialog","aria-modal":"true","aria-labelledby":"glossary-title",onClick:o=>o.stopPropagation(),children:[a.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-5 py-3.5",children:[a.jsx("h2",{id:"glossary-title",className:"font-mono text-sm font-semibold",style:{color:"var(--text)"},children:"Gossipcat Glossary"}),a.jsx("button",{ref:u,onClick:r,"aria-label":"Close glossary",className:"flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 font-mono text-xs transition hover:[color:var(--text)] hover:[background:var(--surface-sunk)]",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:"×"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a.jsx("dl",{className:"space-y-5",children:xg.map(({term:o,definition:d,seeAlso:m})=>a.jsxs("div",{className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)"},children:[a.jsx("dt",{className:"h-section",children:o}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:d}),m&&a.jsxs("dd",{className:"mt-1.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:["See also: ",m]})]},o))})}),a.jsx("div",{className:"shrink-0 border-t border-border/60 px-5 py-3",children:a.jsx("a",{href:"https://github.com/gossipcat-ai/gossipcat-ai/blob/master/docs/HANDBOOK.md",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs transition hover:underline",style:{color:"var(--accent)"},children:"Read the full HANDBOOK →"})})]})}):null}const gg=[{to:"/",label:"Dashboard",match:i=>i==="/"||i==="/overview"},{to:"/team",label:"Team",match:i=>i==="/team"||i.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:i=>i==="/debates"},{to:"/tasks",label:"Tasks",match:i=>i==="/tasks"},{to:"/signals",label:"Signals",match:i=>i==="/signals"},{to:"/logs",label:"Logs",match:i=>i==="/logs"}];function Im(){const[i,r]=k.useState(!1),u=rh(),{theme:o,toggle:d}=hg();return a.jsxs("nav",{className:"relative flex items-center justify-between border-b border-border px-6 py-3.5",children:[a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("a",{href:vn("/"),className:"flex items-center gap-3 leading-none",children:[a.jsx("img",{src:"/dashboard/assets/gossip-mini.png",alt:"",className:"h-10 w-10 object-contain"}),a.jsx("span",{className:"text-[17px] font-bold",style:{color:"var(--accent)"},children:"gossipcat"})]}),a.jsx("div",{className:"flex gap-1",children:gg.map(m=>{const v=m.match(u);return a.jsx("a",{href:vn(m.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${v?"font-semibold":"hover:bg-accent/10"}`,style:v?{background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"var(--accent)"}:{color:"var(--ink-3)"},children:m.label},m.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{"aria-hidden":"true",title:"Search — coming soon",style:{display:"inline-flex",alignItems:"center",gap:"8px",height:"32px",padding:"0 12px",minWidth:"220px",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontSize:"13px",cursor:"default"},children:[a.jsx("span",{style:{opacity:.7},children:"Search…"}),a.jsx("kbd",{style:{marginLeft:"auto",padding:"1px 6px",borderRadius:"4px",background:"var(--surface-sunk)",border:"1px solid var(--border)",fontFamily:"var(--font-mono)",fontSize:"11px",color:"var(--ink-3)"},children:"⌘K"})]}),a.jsx("button",{type:"button",onClick:d,title:`Switch to ${o==="light"?"dark":"light"} theme`,"aria-label":`Switch to ${o==="light"?"dark":"light"} theme`,style:{width:"32px",height:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink)",cursor:"pointer",fontSize:"16px",lineHeight:1},children:o==="light"?"◐":"◑"}),a.jsx("button",{type:"button",onClick:()=>r(!0),"aria-label":"Open glossary",title:"Glossary",style:{width:"32px",height:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink)",cursor:"pointer",lineHeight:1},children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),a.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})]})})]}),a.jsx(vg,{open:i,onClose:()=>r(!1)})]})}const yg={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"",clsStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"}},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function bh({task:i,onClose:r}){if(k.useEffect(()=>{if(!i)return;const d=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[i,r]),!i)return null;const u=yg[i.status],o=(i.inputTokens||0)+(i.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:r,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border",style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-overlay)"},onClick:d=>d.stopPropagation(),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border/60 px-5 py-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.cls}`,style:u.clsStyle,children:u.label}),a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",children:i.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"truncate font-mono text-xs transition",style:{color:"var(--text-dim)"},children:i.agentId})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("span",{children:We(i.timestamp)}),i.duration!=null&&a.jsxs("span",{children:["· ",n0(i.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(i.inputTokens||0).toLocaleString()," in / ",(i.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:r,className:"shrink-0 rounded-md border border-border/40 px-2 py-1 font-mono text-xs transition hover:bg-accent/10",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},"aria-label":"Close",children:"✕"})]}),a.jsxs("div",{className:"max-h-[calc(100vh-220px)] space-y-5 overflow-y-auto px-5 py-4",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Task"}),a.jsx("div",{className:"task-md rounded-md border border-border/40 p-3 text-xs leading-relaxed overflow-x-auto",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"color-mix(in oklch, var(--text) 90%, transparent)"},dangerouslySetInnerHTML:{__html:t0(i.task)}})]}),i.result?a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Result"}),a.jsx("div",{className:"finding-md rounded-md border border-border/40 p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-[color-mix(in_oklch,var(--surface-sunk)_40%,transparent)] [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-[color-mix(in_oklch,var(--surface-sunk)_30%,transparent)] [&_.inline-code-block]:p-2",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"color-mix(in oklch, var(--text) 90%, transparent)"},dangerouslySetInnerHTML:{__html:Oi(i.result)}})]}):a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Result"}),a.jsx("div",{className:"rounded-md border border-border/40 p-3 text-center font-mono text-xs",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"var(--text-dim)"},children:i.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}function No(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const oo=5,uo={agreement:{label:"CONFIRMED",filter:"confirmed",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",filter:"confirmed",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",filter:"disputed",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",filter:"disputed",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",filter:"unverified",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",filter:"unique",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE?",filter:"unique",cls:"text-unverified bg-unverified/10"},new_finding:{label:"NEW",filter:"unique",cls:"text-unique bg-unique/10"}},Wm=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"confirmed",label:"Confirmed",cls:"text-confirmed/50 border-confirmed/20 hover:border-confirmed/40",activeCls:"text-confirmed bg-confirmed/10 border-confirmed/40"},{key:"unique",label:"Unique",cls:"text-unique/50 border-unique/20 hover:border-unique/40",activeCls:"text-unique bg-unique/10 border-unique/40"},{key:"disputed",label:"Disputed",cls:"text-disputed/50 border-disputed/20 hover:border-disputed/40",activeCls:"text-disputed bg-disputed/10 border-disputed/40"},{key:"unverified",label:"Unverified",cls:"text-unverified/50 border-unverified/20 hover:border-unverified/40",activeCls:"text-unverified bg-unverified/10 border-unverified/40"},{key:"insight",label:"Insight",cls:"text-insight/60 border-insight/20 hover:border-insight/40",activeCls:"text-insight bg-insight/10 border-insight/40",tooltip:"Observations without a specific file:line anchor. Not scored — cannot be confirmed or disputed by peers."}],bg=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"critical",label:"Critical",cls:"text-bad/50 border-bad/20 hover:border-bad/40",activeCls:"text-bad bg-bad/10 border-bad/40"},{key:"high",label:"High",cls:"text-severity-high/50 border-severity-high/20 hover:border-severity-high/40",activeCls:"text-severity-high bg-severity-high/10 border-severity-high/40"},{key:"medium",label:"Medium",cls:"text-warn/50 border-warn/20 hover:border-warn/40",activeCls:"text-warn bg-warn/10 border-warn/40"},{key:"low",label:"Low",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},inactiveStyle:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}}],jg={critical:"text-bad bg-bad/10",high:"text-severity-high bg-severity-high/10",medium:"text-warn bg-warn/10",low:""},Ng={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Sg="[&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:[background:var(--surface-sunk)] [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:[color:color-mix(in_oklch,var(--text)_80%,transparent)] [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:[background:color-mix(in_oklch,var(--surface-sunk)_70%,transparent)] [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:[color:color-mix(in_oklch,var(--text)_70%,transparent)] [&_.inline-code-block]:overflow-x-auto",kg={HTML_ENTITY_ENCODED_TAGS:"HTML-entity-encoded <agent_finding> tags — parser saw 0 tags",HTML_ENTITY_MIXED_PAYLOAD:"Mixed raw + HTML-entity-encoded tags — some findings dropped",SCHEMA_DRIFT_PHASE2_VERDICT_TOKENS:"Schema drift — Phase-2 consensus verdict types emitted (confirmed/disputed/unique/verdict)",SCHEMA_DRIFT_INVENTED_TYPE_TOKENS:"Schema drift — invented <agent_finding> type names (valid: finding | suggestion | insight)",SCHEMA_DRIFT_NESTED_SUBTAGS:'Schema drift — nested <type>...</type> subtags instead of type="..." attribute'};function _g({f:i,reviewInfo:r,diagnostics:u}){const o=i.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":i.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":i.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=i.severity&&jg[i.severity]||"",m=i.severity==="low"?Ng:void 0,v=i.findingType==="suggestion"?"SUGGESTION":i.findingType==="insight"?"INSIGHT":null,p=i.findingType==="suggestion"?"text-info bg-info/10":i.findingType==="insight"?"text-text-dim bg-text-dim/10":"",x=i.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=x?x[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors px-4 py-3.5",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${o}`,children:i.tag.toUpperCase()}),i.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,style:m,children:i.severity.toUpperCase()}),v&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${p}`,children:v}),g&&a.jsx("span",{className:"bg-info/10 px-2 py-1 font-mono text-[10px] text-info border border-info/15 rounded",children:g}),a.jsx("span",{className:"ml-auto font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:i.originalAgentId}),i.confirmedBy&&i.confirmedBy.length>0&&(()=>{const b=[...new Set(i.confirmedBy)];return a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-confirmed/50 transition hover:bg-confirmed/10","data-tooltip":`Verified by:
|
|
71
|
+
${b.join(", ")}`,"data-tooltip-pos":"left",children:["+",b.length," ✓"]})})(),i.disputedBy&&i.disputedBy.length>0&&a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-disputed/50 transition hover:bg-disputed/10","data-tooltip":`Disputed by:
|
|
72
|
+
${i.disputedBy.map(b=>b.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[i.disputedBy.length," ⚡"]}),i.unverifiedBy&&i.unverifiedBy.length>0&&a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-unverified/50 transition hover:bg-unverified/10","data-tooltip":`Unverified by:
|
|
73
|
+
${i.unverifiedBy.map(b=>b.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[i.unverifiedBy.length," ◇"]})]}),u&&u.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:u.map((b,S)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":b.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",b.code]}),a.jsx("div",{className:"mt-0.5 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},dangerouslySetInnerHTML:{__html:No(kg[b.code])+" — "+No(b.message)}})]},S))}),i.disputedBy&&i.disputedBy.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 rounded border border-disputed/10 bg-disputed/5 px-2.5 py-1.5",children:i.disputedBy.map((b,S)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:b.agentId}),a.jsxs("span",{style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[" — ",b.reason||b.evidence||"No reason given"]})]},S))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed ${Sg}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:Oi(i.finding)}}),r&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[r.reviewers.map(b=>a.jsx("span",{title:b,className:"inline-flex h-5 w-5 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background opacity-70",style:{backgroundColor:gn(b)},children:ho(b)},b)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${r.assigned>=r.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[r.assigned>=r.targetK?"✓":"⚠"," ",r.assigned,"/",r.targetK]})]})]})}function Eg({consensus:i,reports:r,showAll:u=!1,hideHeader:o=!1,filteredRuns:d}){const m=d??i.runs,v=u?m:m.slice(0,oo);!u&&m.length>oo;const[p,x]=k.useState(null),[g,b]=k.useState("all"),[S,O]=k.useState("all"),[Q,L]=k.useState(1),[X,M]=k.useState([]),[I,K]=k.useState(0),[ee,J]=k.useState(!1),[A,q]=k.useState({});k.useEffect(()=>{if(!u&&(r!=null&&r.reports)&&(M(r.reports),K(r.totalReports??r.reports.length),L(1)),r!=null&&r.roundRetractions){const E={};for(const T of r.roundRetractions)E[T.consensus_id]={reason:T.reason,retracted_at:T.retracted_at};q(E)}},[r,u]),k.useEffect(()=>{if(!u)return;let E=!1;return(async()=>{var T;try{const H=await Ge("consensus-reports?page=1&pageSize=200");if(E)return;if(M(H.reports||[]),K(H.totalReports??(((T=H.reports)==null?void 0:T.length)||0)),L(1),H.roundRetractions){const W={};for(const ce of H.roundRetractions)W[ce.consensus_id]={reason:ce.reason,retracted_at:ce.retracted_at};q(W)}}catch{}})(),()=>{E=!0}},[u]);const w=X.slice().sort((E,T)=>T.timestamp.localeCompare(E.timestamp)),Z=10,[te,ne]=k.useState(0),de=Math.max(1,Math.ceil(w.length/Z)),F=Math.min(te,de-1),ae=u?w.slice(F*Z,(F+1)*Z):w.slice(0,oo),me=E=>{const T=new Date,H=new Date(E),W=ue=>new Date(ue.getFullYear(),ue.getMonth(),ue.getDate()).getTime(),ce=Math.round((W(T)-W(H))/864e5);return ce<=0?"Today":ce===1?"Yesterday":ce<7?`${ce} days ago`:ce<30?`${Math.floor(ce/7)} weeks ago`:H.toISOString().slice(0,10)};return a.jsxs("section",{children:[!o&&a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Consensus Rounds ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.totalRuns??i.runs.length})]}),!u&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),ae.length>0?a.jsxs("div",{className:"space-y-2",children:[ae.map((E,T)=>{const H=T>0?ae[T-1]:null,W=u?me(E.timestamp):null,ce=u&&H?me(H.timestamp):null,ue=u&&W!==ce,y={};if(E.crossReviewAssignments||E.crossReviewCoverage){const P={};if(E.crossReviewAssignments)for(const[we,Ve]of Object.entries(E.crossReviewAssignments))for(const Fe of Ve)(P[Fe]??(P[Fe]=[])).push(we);if(E.crossReviewCoverage)for(const we of E.crossReviewCoverage)y[we.findingId]={reviewers:P[we.findingId]||[],assigned:we.assigned,targetK:we.targetK};else for(const[we,Ve]of Object.entries(P))y[we]={reviewers:Ve,assigned:Ve.length,targetK:Ve.length}}const R=[...E.confirmed,...E.disputed,...E.unverified,...E.unique,...E.insights||[]],V=g==="all"?R:g==="insight"?R.filter(P=>P.findingType==="insight"||P.findingType==="suggestion"):R.filter(P=>P.tag===g),G=S==="all"?V:V.filter(P=>P.severity===S),le=p===E.id,re=(()=>{const P=new Set;return we=>{var Bt;const Ve=(Bt=E.authorDiagnostics)==null?void 0:Bt[we.originalAgentId];if(!Ve||Ve.length===0)return;const Fe=Ve.filter(Le=>{const Jn=`${we.originalAgentId}:${Le.code}`;return P.has(Jn)?!1:(P.add(Jn),!0)});return Fe.length>0?Fe:void 0}})(),ve=R.length||1,Re=E.confirmed.length,Me=E.disputed.length,qt=E.unverified.length,Ae=E.unique.length,yn=(E.insights||[]).length,Zn=(()=>{if(ve===0)return"border-l-border/40";const P=Re/ve,we=Me/ve;return P>=.5?"border-l-confirmed/60":we>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),Lt=[{count:Re,textCls:"text-confirmed",label:"confirmed"},{count:Me,textCls:"text-disputed",label:"disputed"},{count:qt,textCls:"text-unverified",label:"unverified"},{count:Ae,textCls:"text-unique",label:"unique"},{count:yn,textCls:"text-zinc-400",label:"insights"}].filter(P=>P.count>0),Yt=[...new Set(R.map(P=>P.originalAgentId).filter(Boolean))],jl=Yt.slice(0,5),Kn=A[E.id],Nl=!!Kn;return a.jsxs("div",{children:[ue&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${T>0?"mt-4":""}`,children:[a.jsx("span",{className:"h-section",children:W}),a.jsx("div",{className:"h-px flex-1 bg-border/30"})]}),a.jsxs("div",{className:`group rounded-md border-l-2 border border-border/40 transition-all duration-150
|
|
74
|
+
${Zn}
|
|
75
|
+
${Nl?"opacity-60 line-through decoration-disputed/40":""}
|
|
76
|
+
${le?"border-r-border/60 border-t-border/60 border-b-border/60":"hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:-translate-y-px"}`,style:{background:le?"var(--surface-elev)":"color-mix(in oklch, var(--surface-elev) 50%, transparent)"},"data-retracted":Nl?"true":void 0,children:[Nl&&a.jsxs("div",{className:"no-underline rounded-t-md border-b border-disputed/30 bg-disputed/10 px-3 py-2 font-mono text-[11px] text-disputed",style:{textDecoration:"none"},children:[a.jsx("span",{className:"font-bold",children:"⚠ RETRACTED"}),Kn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Kn.retracted_at.slice(0,10)]}),Kn.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",Kn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":le,onClick:()=>{const P=!le;x(P?E.id:null),P&&(b("all"),O("all"))},children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm font-bold",style:{color:"var(--text)"},children:R.length}),a.jsx("span",{className:"text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"findings"}),a.jsx("span",{className:"text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 30%, transparent)"},children:"·"}),a.jsxs("span",{className:"text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[E.rounds,"r"]}),jl.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[jl.map(P=>a.jsx("span",{title:P,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:gn(P)},children:ho(P)},P)),Yt.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",Yt.length-5]})]}),a.jsx("span",{className:"shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)",color:"var(--text-dim)"},title:E.id,children:E.id.slice(0,8)}),E.zeroTagAgents&&E.zeroTagAgents.length>0&&(()=>{const P=E.zeroTagAgents,we=E.zeroTagOverflow??0,Ve=P.length+we,Fe=we>0?`${P.join(", ")} (+${we} more)`:P.join(", ");return a.jsxs("span",{className:"shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified",title:`Zero-tag agents — emitted no parseable <agent_finding> tags (likely paraphrased relay or HTML-entity encoding). See HANDBOOK invariant #12. Agents: ${Fe}`,children:[Ve," zero-tag"]})})(),E.droppedFindingsByType&&Object.keys(E.droppedFindingsByType).length>0&&(()=>{const P=Object.entries(E.droppedFindingsByType),we=P.reduce((Fe,[,Bt])=>Fe+Bt,0),Ve=P.map(([Fe,Bt])=>`${Fe}:${Bt}`).join(", ");return a.jsxs("span",{className:"shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified",title:`Silently dropped <agent_finding> tags with invalid type=: ${Ve}. These never reach the dashboard, scores, or signals.`,children:[we," dropped"]})})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] shrink-0",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:We(E.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:Lt.map(P=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${P.textCls}`,children:[P.count," ",P.label]},P.label))}),E.topic&&a.jsxs("div",{className:"mt-1.5 flex items-start gap-2",children:[a.jsx("span",{className:"shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Topic"}),a.jsx("span",{className:"font-inter text-[11px] leading-relaxed",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:E.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] transition-transform duration-150 ${le?"rotate-90":""}`,style:{color:le?"color-mix(in oklch, var(--ink) 60%, transparent)":"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"▸"})]}),le&&a.jsxs("div",{className:"border-t border-border/20 px-4 pb-4 pt-3",children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Type:"}),Wm.map(P=>a.jsx("button",{onClick:()=>b(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${g===P.key?P.activeCls:P.cls}`,style:g===P.key?P.activeStyle:P.inactiveStyle,...P.tooltip?{"data-tooltip":P.tooltip}:{},children:P.label},P.key))]}),a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Severity:"}),bg.map(P=>a.jsx("button",{onClick:()=>O(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${S===P.key?P.activeCls:P.cls}`,style:S===P.key?P.activeStyle:P.inactiveStyle,children:P.label},P.key))]}),E.coverageDegraded&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Coverage degraded — ",E.coverageDegraded.received," of ",E.coverageDegraded.expected," agents responded"]}),E.coverageDegraded.droppedAgents.length>0&&a.jsxs("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["Dropped: ",E.coverageDegraded.droppedAgents.join(", ")]})]}),E.zeroTagAgents&&E.zeroTagAgents.length>0&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Zero-tag agents — ",E.zeroTagAgents.length+(E.zeroTagOverflow??0)," agent",E.zeroTagAgents.length+(E.zeroTagOverflow??0)===1?"":"s"," emitted no parseable <agent_finding> tags"]}),a.jsxs("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[E.zeroTagAgents.join(", "),E.zeroTagOverflow&&E.zeroTagOverflow>0?` (+${E.zeroTagOverflow} more)`:""]}),a.jsx("p",{className:"mt-1 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Likely a paraphrased relay or HTML-entity-encoded tags. See HANDBOOK invariant #12."})]}),E.relayCrossReviewSkipped&&E.relayCrossReviewSkipped.length>0&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Cross-review skipped: ",E.relayCrossReviewSkipped.length," relay agent",E.relayCrossReviewSkipped.length===1?"":"s"," failed Phase 2"]}),a.jsx("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:E.relayCrossReviewSkipped.map(P=>P.agentId).join(", ")})]}),(E.crossReviewAssignments||E.crossReviewCoverage)&&(()=>{const P=E.crossReviewAssignments||{},we=Object.entries(P),Ve=E.crossReviewCoverage||[],Fe=Ve.length,Bt=Ve.filter(Le=>Le.assigned<Le.targetK);return a.jsxs("details",{className:"mb-3 rounded-md border border-border/30",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 h-section select-none",children:["Cross-Review Assignments",E.partialReview&&a.jsx("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-unverified",children:"partial"}),a.jsxs("span",{className:"ml-auto font-mono text-[9px] font-normal normal-case tracking-normal",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[we.length," reviewers · ",Fe," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[we.map(([Le,Jn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:Le,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:gn(Le)},children:ho(Le)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:Le}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",Jn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:Jn.map(Fn=>a.jsx("span",{className:"rounded px-1.5 py-0.5 font-mono text-[9px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)",color:"var(--text-dim)"},children:Fn.length>12?Fn.slice(0,12)+"…":Fn},Fn))})]},Le)),Fe>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Bt.length>0?a.jsxs("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-2 py-1 font-mono text-[10px] font-semibold text-unverified",children:["⚠ ",Bt.length," of ",Fe," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",Fe," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:G.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):G.map((P,we)=>a.jsx(_g,{f:P,reviewInfo:P.id?y[P.id]:void 0,diagnostics:re(P)},we))})]})]})]},E.id)}),u&&de>1&&a.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4 font-mono text-[11px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>ne(E=>Math.max(0,E-1)),disabled:F===0,className:"rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:["Page ",F+1," of ",de]}),a.jsx("button",{onClick:()=>ne(E=>Math.min(de-1,E+1)),disabled:F>=de-1,className:"rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}):v.length===0?a.jsx(da,{title:"No consensus runs yet",hint:"Dispatch a consensus round with gossip_dispatch to populate this view."}):a.jsx("div",{className:"space-y-2",children:v.map((E,T)=>{const H=E.counts,W=(H.agreement||0)+(H.disagreement||0)+(H.hallucination||0)+(H.unverified||0)+(H.unique||0)+(H.new||0),ce=W||1,ue=p===E.taskId,y=[{key:"confirmed",count:H.agreement||0,color:"bg-confirmed",text:"text-confirmed",label:"confirmed"},{key:"disputed",count:(H.disagreement||0)+(H.hallucination||0),color:"bg-disputed",text:"text-disputed",label:"disputed"},{key:"unverified",count:H.unverified||0,color:"bg-unverified",text:"text-unverified",label:"unverified"},{key:"unique",count:(H.unique||0)+(H.new||0),color:"bg-unique",text:"text-unique",label:"unique"}],R=E.signals.filter(G=>{if(G.signal==="signal_retracted")return!1;if(g==="all")return!!uo[G.signal];const le=uo[G.signal];return le&&le.filter===g}),V=!!E.retracted;return a.jsxs("div",{className:`rounded-md border transition ${ue?"border-primary/25":"border-border"} ${V?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":V?"true":void 0,title:V&&E.retractionReason?`Retracted: ${E.retractionReason}`:void 0,children:[V&&a.jsxs("div",{className:"rounded-t-md border-b border-disputed/30 bg-disputed/10 px-3 py-1.5 font-mono text-[10px] text-disputed",style:{textDecoration:"none"},children:[a.jsx("span",{className:"font-bold uppercase tracking-wider",children:"⚠ Retracted"}),E.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",E.retractedAt.slice(0,10)]}),E.retractionReason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",E.retractionReason]})]}),a.jsxs("button",{"aria-expanded":ue,onClick:()=>{const G=!ue;x(G?E.taskId:null),G&&(b("all"),O("all"))},className:"flex w-full items-center p-3 text-left transition hover:bg-accent/10",children:[a.jsx("span",{className:"mr-3 font-mono text-xs transition",style:{color:ue?"var(--ink)":"var(--text-dim)",fontWeight:ue?600:400},children:ue?"▾":"▸"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:E.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold ${V?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[W," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[E.agents.slice(0,4).map(G=>a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:G.split("-").map(le=>le[0]).join("").toUpperCase().slice(0,2)},G)),E.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["+",E.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:We(E.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:y.map(G=>G.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${G.text} ${V?"line-through decoration-disputed/40":""}`,children:[G.count," ",G.label]},G.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:y.map(G=>G.count>0&&a.jsx("div",{className:`${G.color} transition-all`,style:{width:`${G.count/ce*100}%`}},G.key))})]})]}),ue&&a.jsxs("div",{className:"border-t border-border px-4 pb-3 pt-3",children:[a.jsx("div",{className:"mb-3 flex gap-1.5",children:Wm.map(G=>a.jsx("button",{onClick:()=>b(G.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${g===G.key?G.activeCls:G.cls} hover:opacity-80`,style:g===G.key?G.activeStyle:G.inactiveStyle,...G.tooltip?{"data-tooltip":G.tooltip}:{},children:G.label},G.key))}),R.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):a.jsx("div",{className:"space-y-2",children:R.map((G,le)=>{const re=uo[G.signal];return re?a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${re.cls}`,children:re.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:Oi(G.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[G.agentId,G.counterpartId?` + ${G.counterpartId}`:""]})]})]},le):null})})]})]},E.taskId+T)})})]})}const Ci=25;function Tg({commits:i}){const[r,u]=k.useState(!1);if(i.length===0)return a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"—"});const o=i[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,m=i.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text)"},children:d}),m>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":r,onClick:()=>u(v=>!v),className:"font-mono text-[10px] underline",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:r?"(collapse)":`(+${m} more)`}),r&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:i.slice(1).map((v,p)=>{const x=v.includes(" ")?v.slice(v.indexOf(" ")+1):v;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:x},p)})})]})]})}function Mg({row:i}){const r=i.preSha.slice(0,8),u=i.postSha.slice(0,8);return a.jsxs("tr",{className:"border-t border-border/20 align-top transition-colors hover:bg-accent/20",children:[a.jsx("td",{className:"whitespace-nowrap py-3 pl-4 pr-4 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:We(i.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"font-mono text-[11px] hover:underline",style:{color:"var(--text)"},onMouseEnter:o=>o.currentTarget.style.color="var(--accent)",onMouseLeave:o=>o.currentTarget.style.color="var(--text)",children:i.agentId})}),a.jsxs("td",{className:"whitespace-nowrap py-3 pr-4 font-mono text-[10px]",children:[a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:r}),a.jsx("span",{className:"mx-1",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"→"}),a.jsx("span",{style:{color:"var(--text)"},children:u})]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(Tg,{commits:i.commits})})]})}function Ag(){const[i,r]=k.useState([]),[u,o]=k.useState(0),[d,m]=k.useState(1),[v,p]=k.useState(!1),[x,g]=k.useState(null);k.useEffect(()=>{let S=!1;return p(!0),g(null),Ge(`violations?page=${d}&pageSize=${Ci}`).then(O=>{S||(r(O.items??[]),o(O.total??0))}).catch(O=>{S||g(String((O==null?void 0:O.message)??O))}).finally(()=>{S||p(!1)}),()=>{S=!0}},[d]);const b=Math.max(1,Math.ceil(u/Ci));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Process Violations"}),u>0&&a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:u})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"Direct master pushes detected by the ref-allowlist enforcer"})]}),a.jsxs("div",{className:"overflow-hidden rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[x&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:x}),!x&&a.jsxs("table",{className:"w-full table-fixed text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 font-mono text-[10px] uppercase tracking-wider",style:{background:"color-mix(in oklch, var(--surface-sunk) 20%, transparent)",color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:[a.jsx("th",{className:"py-2.5 pl-4 pr-4",children:"When"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Commit Range"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Commits"})]})}),a.jsxs("tbody",{children:[!v&&i.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"No violations recorded"})}),v&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Loading…"})}),!v&&i.map(S=>a.jsx(Mg,{row:S},`${S.taskId}-${S.detectedAt}`))]})]}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:v?"loading…":u===0?"no violations":`${(d-1)*Ci+1}–${Math.min(d*Ci,u)} of ${u}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] ${b<=1?"invisible":""}`,style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>m(S=>Math.max(1,S-1)),disabled:d===1||v,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",b]}),a.jsx("button",{type:"button",onClick:()=>m(S=>Math.min(b,S+1)),disabled:d>=b||v,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]})]})]})}function wg({categoryAccuracy:i,categoryCorrect:r,categoryHallucinated:u}){const o=Object.keys(i??{});if(o.length===0)return a.jsx(da,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(m=>{const v=Math.max(0,Math.min(1,i[m]??0)),p=(r==null?void 0:r[m])??0,x=(u==null?void 0:u[m])??0;return{key:m,acc:v,c:p,h:x,n:p+x}}).sort((m,v)=>v.acc-m.acc);return a.jsx("div",{className:"space-y-2",children:d.map(m=>{const v=m.acc>=.7?"bg-confirmed":m.acc>=.4?"bg-unverified":"bg-disputed",p=m.n>0?`${m.c} correct / ${m.h} hallucinated / ${m.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${m.n>0&&m.n<10?"opacity-50":""}`,title:m.n>0&&m.n<10?`${p} — low sample (n<10)`:p,children:[a.jsx("span",{className:"truncate font-mono text-[11px]",style:{color:"var(--text-dim)"},children:m.key.replace(/_/g," ")}),a.jsx("div",{className:"h-2 overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:a.jsx("div",{className:`h-full rounded-sm transition-all ${v}`,style:{width:`${m.acc*100}%`}})}),a.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums w-16",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:m.n>0?a.jsxs(a.Fragment,{children:[m.c,"/",m.n,m.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",m.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(m.acc*100),"%"]})]},m.key)})})}const Cg=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function zg(i,r,u){return(!i||!Cg.has(i))&&r!==void 0&&u!==void 0&&u>0}const Dg={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 120 post-bind signals — verdict pending more data",inconclusive:"Mixed signals — needs further evaluation",passed:"Skill verified effective",failed:"Skill verified ineffective",pending:"Awaiting evidence",flagged_for_manual_review:"Manual review required"},Rg={pending:"border-border/50",passed:"border-confirmed/40 bg-confirmed/10 text-confirmed",failed:"border-disputed/40 bg-disputed/10 text-disputed",silent_skill:"border-unverified/40 bg-unverified/10 text-unverified",insufficient_evidence:"border-unverified/40 bg-unverified/10 text-unverified",inconclusive:"border-[color:var(--warn)]/40 bg-[color:var(--warn)]/10 text-[color:var(--warn)]",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function Og(i){const r=Math.round(i*100),u=r>0?"+":"";return r>0?{text:`${u}${r}pp`,cls:"text-confirmed"}:r<0?{text:`${u}${r}pp`,cls:"text-disputed"}:{text:`${u}${r}pp`,cls:"",clsStyle:{color:"var(--text-dim)"}}}function Ug({slot:i}){const r=i.status,u=r?Rg[r]:"border-border/50",o=!r||r==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,d=r==="inconclusive"&&(i.inconclusiveStrikes??0)>0,m=i.forcedDevelops??[],v=m.length>0?m[m.length-1]:null,p=typeof i.effectiveness=="number"?Og(i.effectiveness):null,x=zg(r,i.postBindSignals,i.minEvidence);return a.jsxs("div",{className:`rounded-md border p-3 ${i.enabled?"border-border/50":"border-border/30 opacity-60"}`,style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsxs("span",{className:`font-mono text-xs font-semibold ${i.enabled?"":"line-through"}`,style:{color:i.enabled?"var(--text)":"var(--text-dim)"},children:[i.mode==="contextual"&&"⚡ ",i.name]}),a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[9px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:i.source}),i.mode==="contextual"&&a.jsx("span",{className:"warn-badge rounded-sm px-1.5 py-0.5 font-mono text-[9px]",children:"contextual"})]}),a.jsxs("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:["bound ",We(i.boundAt)]}),x&&(()=>{const g=i.postBindSignals,b=i.minEvidence,S=Math.round(g/b*100),O=Math.min(g/b,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${b} post-bind signals (${S}%)`,children:[a.jsxs("div",{className:"mb-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["post-bind: ",g," / ",b]}),a.jsx("div",{className:"relative h-1 w-full overflow-hidden rounded-full border border-border/40",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full border-r border-confirmed/40 bg-confirmed/20",style:{width:`${O}%`}})})]})})()]}),r&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${u}`,style:o,title:Dg[r],children:r.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[p&&a.jsx("span",{className:p.cls,style:p.clsStyle,title:"Effectiveness: change in hallucination rate pre/post",children:p.text}),d&&a.jsxs("span",{className:"text-unique",title:i.inconclusiveAt?`last strike ${We(i.inconclusiveAt)}`:void 0,children:[i.inconclusiveStrikes," strike",i.inconclusiveStrikes===1?"":"s"]})]}),m.length>0&&a.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},title:v!=null&&v.reason?`latest: ${v.reason}`:void 0,children:["forced ",m.length," time",m.length===1?"":"s",v&&` · last ${We(v.timestamp)}`]})]})}function qg({open:i,onOpenChange:r,children:u}){return k.useEffect(()=>{if(!i)return;const o=m=>{m.key==="Escape"&&r(!1)};document.addEventListener("keydown",o);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=d}},[i,r]),i?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 70%, transparent)"},onClick:()=>r(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:u})})]}):null}function Lg({side:i="right",className:r="",children:u,style:o,...d}){return a.jsx("div",{className:`h-full p-6 ${r}`,style:{background:"var(--surface-elev)",...o},...d,children:u})}function Bg({className:i="",...r}){return a.jsx("div",{className:`mb-2 ${i}`,...r})}function Hg({className:i="",...r}){return a.jsx("h2",{className:`font-semibold ${i}`,...r})}function $g({citation:i}){const r=i.snippet.split(`
|
|
77
|
+
`);return a.jsxs("div",{className:"rounded-md border border-border/40 overflow-hidden",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:[a.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[i.file,":",i.line]})}),a.jsx("pre",{className:"overflow-x-auto",style:{background:"var(--surface-sunk)",borderLeft:"3px solid var(--border-strong)",padding:"12px 16px",borderRadius:"6px",fontFamily:"var(--font-mono)",fontSize:"12px",color:"var(--text)"},children:r.map((u,o)=>a.jsx("div",{className:"whitespace-pre",children:u||" "},o))})]})}const Pm={critical:"text-red-400 bg-red-500/10",high:"text-severity-high bg-severity-high/10",medium:"text-yellow-400 bg-yellow-500/10",low:""},Gg={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},eh={confirmed:"text-confirmed bg-confirmed/10 border border-confirmed/20",disputed:"text-disputed bg-disputed/10 border border-disputed/20",unverified:"text-unverified bg-unverified/10 border border-unverified/20",unique:"text-unique bg-unique/10 border border-unique/20",insight:"text-insight bg-insight/10 border border-insight/20",newFinding:"text-unique bg-unique/10 border border-unique/20"},Yg={background:"var(--surface-elev)",borderRadius:"16px 0 0 16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function qi({open:i,onOpenChange:r,consensusId:u,findingId:o}){const[d,m]=k.useState(null),[v,p]=k.useState(null);return k.useEffect(()=>{if(!i||!u||!o){m(null),p(null);return}m(null),p(null),Ge(`finding/${encodeURIComponent(u)}/${encodeURIComponent(o)}`).then(m).catch(x=>p(x.message||"failed to load finding"))},[i,u,o]),a.jsx(qg,{open:i,onOpenChange:r,children:a.jsxs(Lg,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:Yg,children:[a.jsx(Bg,{children:a.jsx(Hg,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),v&&a.jsx("div",{className:"mt-4",children:a.jsx(Eo,{message:v})}),!v&&!d&&a.jsx("div",{className:"mt-4 text-[11px]",style:{color:"var(--text-dim)"},children:"Loading…"}),d&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${eh[d.finding.tag]||""}`,style:eh[d.finding.tag]?void 0:{background:"var(--surface-sunk)"},children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${Pm[d.finding.severity]||""}`,style:d.finding.severity==="low"?Gg:Pm[d.finding.severity]?void 0:{background:"var(--surface-sunk)"},children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"var(--text-dim)"},children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"font-mono text-[12px] leading-relaxed whitespace-pre-wrap",children:d.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),d.citations.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Citations"}),d.citations.map((x,g)=>a.jsx($g,{citation:x},g))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Coverage"}),d.finding.confirmedBy.length>0&&a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",d.finding.confirmedBy.join(", ")]}),d.finding.disputedBy.map((x,g)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",x.agentId,": ",a.jsx("span",{style:{color:"var(--text-dim)"},children:x.reason})]},g)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-dim)"},children:"No peer review"})]}),d.signals.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((x,g)=>a.jsxs("div",{className:"text-[11px] border-l-2 border-border/40 pl-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono font-semibold",children:x.signal}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"·"}),a.jsx("span",{children:x.agentId}),x.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--text-dim)"},children:"→"}),a.jsx("span",{children:x.counterpartId})]}),a.jsx("span",{className:"ml-auto",style:{color:"var(--text-dim)"},children:We(x.timestamp)})]}),x.evidence&&a.jsx("div",{className:"mt-0.5",style:{color:"var(--text-dim)"},children:x.evidence.slice(0,200)})]},g))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:vn(`/consensus/${d.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",d.consensusId]})})]})]})})}const Xg={agreement:"text-confirmed bg-confirmed/10",consensus_verified:"text-confirmed bg-confirmed/10",unique_confirmed:"text-unique bg-unique/10",unique_unconfirmed:"text-unique bg-unique/10",new_finding:"text-unique bg-unique/10",disagreement:"text-disputed bg-disputed/10",hallucination_caught:"text-disputed bg-disputed/10",unverified:"text-unverified bg-unverified/10"};function Vg({agentId:i}){const[r,u]=k.useState([]),[o,d]=k.useState(!0),[m,v]=k.useState("all"),[p,x]=k.useState(null);k.useEffect(()=>{let O=!1;return d(!0),Ge(`signals?agent=${encodeURIComponent(i)}&limit=100`).then(Q=>{O||(u(Q.items||[]),d(!1))}).catch(()=>{O||(u([]),d(!1))}),()=>{O=!0}},[i]);const g=[...r].sort((O,Q)=>(Q.timestamp||"").localeCompare(O.timestamp||"")),b=m==="all"||m==="signals"?g:[],S=({k:O,label:Q,enabled:L})=>a.jsx("button",{type:"button",onClick:()=>L&&v(O),disabled:!L,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${L?"":"opacity-40 cursor-not-allowed"}`,style:m===O?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:Q});return a.jsxs("div",{className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("span",{className:"h-section",children:"Activity"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(S,{k:"all",label:"All",enabled:!0}),a.jsx(S,{k:"signals",label:"Signals",enabled:!0}),a.jsx(S,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(S,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?a.jsx("div",{className:"py-6 text-center text-xs",style:{color:"var(--text-dim)"},children:"Loading…"}):b.length===0?a.jsx(da,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:b.map((O,Q)=>{const L=Xg[O.signal]||"text-text-dim",X=!!(O.consensusId&&O.findingId),M=a.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[a.jsx("span",{className:"shrink-0 font-mono text-[9px] tabular-nums w-16",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:We(O.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${L}`,children:O.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px]",style:{color:"var(--text-dim)"},children:[O.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["→ ",O.counterpartId," · "]}),O.evidence&&a.jsx("span",{children:O.evidence.length>160?O.evidence.slice(0,160)+"…":O.evidence})]})]});return X?a.jsx("button",{type:"button",onClick:()=>x({consensusId:O.consensusId,findingId:O.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/10",children:M},Q):a.jsx("div",{children:M},Q)})}),a.jsx(qi,{open:!!p,onOpenChange:O=>{O||x(null)},consensusId:(p==null?void 0:p.consensusId)??null,findingId:(p==null?void 0:p.findingId)??null})]})}function Qg(){const i=k.useRef(null),[r,u]=k.useState(0);return k.useEffect(()=>{const o=i.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(m=>{for(const v of m)u(v.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[i,r]}const th={agreement:"bg-confirmed",consensus_verified:"bg-confirmed",unique_confirmed:"bg-unique",unique_unconfirmed:"bg-unique/50",disagreement:"bg-disputed/70",hallucination_caught:"bg-disputed",new_finding:"bg-unique",unverified:"bg-unverified",citation_fabricated:"bg-amber-500",boundary_escape:"bg-destructive"},Zg={agreement:"Confirmed",consensus_verified:"Confirmed",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique (unconfirmed)",disagreement:"Disputed",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified",citation_fabricated:"Fabricated citation",boundary_escape:"Process violation"},Kg=6,Jg=500,jh=100,Fg=150;function Ig(i){if(i<=0)return jh;const r=Math.floor(i/Kg);return Math.max(1,Math.min(r,Jg))}function Wg({agentId:i}){const[r,u]=k.useState([]),[o,d]=k.useState(0),[m,v]=k.useState(!1),[p,x]=k.useState(null),[g,b]=Qg(),[S,O]=k.useState(jh),Q=k.useRef(null);k.useEffect(()=>{if(b<=0)return;const K=Ig(b);return Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{O(ee=>ee===K?ee:K)},Fg),()=>{Q.current&&clearTimeout(Q.current)}},[b]),k.useEffect(()=>{Ge(`signals?agent=${encodeURIComponent(i)}&limit=${S}`).then(K=>{u(K.items||[]),d(K.total||0)}).catch(()=>{})},[i,S]);const L=k.useMemo(()=>[...r].reverse(),[r]),X={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const K of r)K.signal==="agreement"||K.signal==="consensus_verified"?X.confirmed++:K.signal==="disagreement"||K.signal==="hallucination_caught"?X.disputed++:K.signal==="unique_confirmed"||K.signal==="unique_unconfirmed"||K.signal==="new_finding"?X.unique++:K.signal==="unverified"?X.unverified++:K.signal==="citation_fabricated"&&X.fabricated++;const M=r.length,I=o>M;return r.length===0?a.jsx("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsx(da,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:"h-section",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:I?`last ${M} of ${o}`:`${o} total`})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[a.jsxs("span",{className:"text-confirmed",children:[X.confirmed," confirmed"]}),X.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[X.disputed," disputed"]}),X.unique>0&&a.jsxs("span",{className:"text-unique",children:[X.unique," unique"]}),X.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[X.unverified," unverified"]}),X.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[X.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:L.map((K,ee)=>{const J=!!(K.consensusId&&K.findingId);return a.jsx("button",{type:"button",disabled:!J,onClick:()=>{K.consensusId&&K.findingId&&(x({consensusId:K.consensusId,findingId:K.findingId}),v(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${th[K.signal]||""} ${J?"cursor-pointer":"cursor-default"}`,style:th[K.signal]?void 0:{background:"var(--surface-sunk)"},title:`${Zg[K.signal]||K.signal} — ${We(K.timestamp)}${J?" (click for detail)":""}`},ee)})}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-3",children:[{color:"bg-confirmed",label:"Confirmed"},{color:"bg-disputed",label:"Disputed"},{color:"bg-unique",label:"Unique (confirmed)"},{color:"bg-unique/50",label:"Unique (unconfirmed)"},{color:"bg-unverified",label:"Unverified"},{color:"bg-amber-500",label:"Fabricated citation"}].map(K=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${K.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:K.label})]},K.label))}),a.jsx(qi,{open:m,onOpenChange:v,consensusId:(p==null?void 0:p.consensusId)??null,findingId:(p==null?void 0:p.findingId)??null})]})}function Pg(i){const r=i.toLowerCase();return r==="completed"||r==="done"||r==="success"||r==="succeeded"?"completed":r==="running"||r==="active"||r==="in_progress"||r==="pending"?"running":r==="failed"||r==="error"||r==="errored"||r==="timeout"||r==="timed_out"?"failed":r==="cancelled"||r==="canceled"||r==="queued"||r==="waiting"?"cancelled":"unknown"}const ey={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1},unknown:{label:"Unknown",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1}},ty={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function ny(i){if(!i)return"—";if(i<1e3)return"< 1s";if(i<6e4)return Math.floor(i/1e3)+"s";if(i<36e5){const o=Math.floor(i/6e4),d=Math.floor(i%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const r=Math.floor(i/36e5),u=Math.floor(i%36e5/6e4);return u>0?`${r}h ${u}m`:`${r}h`}function Nh({task:i,onClick:r}){const u=Pg(i.status),o=ey[u];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/10 transition-colors ${r?"cursor-pointer":""}`,onClick:r?d=>{d.target.closest("a")||r(i)}:void 0,children:[a.jsx("td",{className:"py-2.5 pl-4 pr-2",children:a.jsxs("span",{className:"inline-flex items-center gap-2","aria-label":`Status: ${o.label}`,children:[a.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${o.iconBox} ${o.text} ${o.pulse?"animate-pulse":""}`,style:o.textStyle,"aria-hidden":!0,children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:ty[u]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,style:o.textStyle,children:o.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"warn-badge rounded px-2 py-1 font-mono text-[10px] font-semibold",title:i.taskId,children:i.taskId.slice(0,8)})}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"inline-flex items-center gap-1.5 transition",children:[a.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:gn(i.agentId)}}),i.agentId]})}),a.jsx("td",{className:"py-2.5 pr-3 text-xs leading-snug",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:(()=>{const d=i.task.replace(/\n.*/s,"");return d.length>100?d.slice(0,100)+"…":d})()}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:u==="running"?"running":ny(i.duration)}),a.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:We(i.timestamp)})]})}const ly=3,ay=720*60*60*1e3;function sy({agentId:i,agents:r,tasks:u,consensus:o}){const d=r.find(y=>y.id===i),[m,v]=k.useState([]),[p,x]=k.useState([]),[g,b]=k.useState(null),[S,O]=k.useState(null),[Q,L]=k.useState(null),[X,M]=k.useState(0),[I,K]=k.useState(0),[ee,J]=k.useState(null);k.useEffect(()=>{Ge(`memory/${i}`).then(y=>{v(y.knowledge||[])}).catch(()=>v([]))},[i]),k.useEffect(()=>{let y=!1;return Ge("consensus-reports?page=1&pageSize=200").then(R=>{y||x(R.reports||[])}).catch(()=>{y||x([])}),()=>{y=!0}},[]);const A=k.useMemo(()=>{var G;const y=Date.now(),R=new Map;for(const le of p){const re=Date.parse(le.timestamp);if(Number.isNaN(re)||y-re>ay)continue;const ve=(G=le.authorDiagnostics)==null?void 0:G[i];if(ve)for(const Re of ve)R.set(Re.code,(R.get(Re.code)??0)+1)}const V=[];for(const[le,re]of R)re>=ly&&V.push({code:le,count:re});return V},[p,i]);if(!d)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",i]});const q=d.scores,w=(u==null?void 0:u.items.filter(y=>y.agentId===i))||[],Z=(o==null?void 0:o.runs.filter(y=>y.agents.includes(i)))||[],te=[{label:"accuracy",value:q.accuracy,fill:q.accuracy>=.7?"bg-confirmed":q.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"unique",value:q.uniqueness,fill:"bg-unique"},{label:"impact",value:q.impactScore,fill:"bg-[var(--c8)]"}],ne=q.unverifiedsEmitted??0,de=q.unverifiedsReceived??0,F=ne+de,ae=[{label:"Signals",value:String(q.signals),color:"",colorStyle:{color:"var(--text)"}},{label:"Agreements",value:String(q.agreements),color:"text-confirmed",colorStyle:void 0},{label:"Disagreements",value:String(q.disagreements),color:"text-disputed",colorStyle:void 0},{label:"Hallucinations",value:String(q.hallucinations),color:q.hallucinations>0?"text-disputed":"",colorStyle:q.hallucinations>0?void 0:{color:"var(--text-dim)"}},{label:"Unverified",value:F>0?`${ne}↑ ${de}↓`:"0",color:F>0?"text-unverified":"",colorStyle:F>0?void 0:{color:"var(--text-dim)"},title:F>0?`${ne} emitted (as reviewer) · ${de} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],me=10,E=Math.max(1,Math.ceil(w.length/me)),T=Math.min(X,E-1),H=w.slice(T*me,(T+1)*me),W=k.useMemo(()=>{const y=new Map;for(const R of m){const V=R.filename.match(/^(\d{4}-\d{2}-\d{2})/),G=V?V[1]:"undated",le=y.get(G)||[];le.push(R),y.set(G,le)}return Array.from(y.entries()).sort(([R],[V])=>R==="undated"?1:V==="undated"?-1:V.localeCompare(R)).map(([R,V])=>({day:R,items:V}))},[m]),ce=Math.min(I,Math.max(0,W.length-1)),ue=W[ce];return a.jsxs(a.Fragment,{children:[(()=>{const y=_o(q);return y==="benched"?a.jsx("div",{className:"mb-6 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-destructive",children:"BENCHED"}),a.jsxs("span",{className:"text-xs text-destructive/70",children:["Auto-bench rule fired (",q.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):y==="struggling"?a.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"STRUGGLING"}),a.jsxs("span",{className:"text-xs text-unverified/70",children:[q.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):y==="kept-for-coverage"?a.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"KEPT FOR COVERAGE"}),a.jsxs("span",{className:"text-xs text-unverified/70",children:["Would be benched (",q.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),A.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:A.map(({code:y,count:R})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":y,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"PARSE DIAGNOSTIC"}),a.jsx("span",{className:"font-mono text-[11px] text-unverified/80",dangerouslySetInnerHTML:{__html:No(y)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",R," fires in 30d"]})]}),a.jsxs("div",{className:"mt-1 text-xs",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["This agent's raw output has repeatedly tripped ",a.jsx("span",{className:"font-mono",children:y}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},y))}),a.jsx("div",{"data-theme":"dark",className:"relative mb-6 rounded-xl border border-border p-5",style:{background:"var(--surface-elev)",color:"var(--text)"},children:a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("div",{className:"relative shrink-0","data-tooltip":`Accuracy ${Math.round(q.accuracy*100)}% · Uniqueness ${Math.round(q.uniqueness*100)}% · Impact ${Math.round(q.impactScore*100)}%`,children:a.jsx(us,{agentId:d.id,size:120,signals:q.signals,accuracy:q.accuracy,uniqueness:q.uniqueness,impact:q.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold",style:{color:"var(--text)"},children:d.id}),a.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--text-dim)"},children:[d.provider,"/",d.model]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${d.native?"":"text-confirmed bg-confirmed/10"}`,style:d.native?{color:"var(--idle)",background:"color-mix(in oklch, var(--idle) 10%, transparent)"}:void 0,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm px-2 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[q.signals," signals",d.lastTask?` · ${We(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border px-3 py-2",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},"data-tooltip":`Dispatch weight ${q.dispatchWeight.toFixed(2)}
|
|
78
|
+
Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[a.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none",style:{color:"var(--text)"},children:q.dispatchWeight.toFixed(2)}),a.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"weight"})]})]})}),a.jsx("section",{className:"mb-6",children:a.jsx(Wg,{agentId:i})}),a.jsxs("section",{className:"mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"mb-3 h-section",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 p-4",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsx("div",{className:"space-y-2.5",children:te.map(y=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",children:[a.jsx("span",{className:"h-section",style:{color:"var(--text-dim)",fontSize:"10px"},children:y.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full transition-all ${y.fill}`,style:{width:`${Math.max(0,Math.min(100,y.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(y.value*100),"%"]})]},y.label))}),a.jsx("div",{className:"mt-4 grid grid-cols-6 gap-px overflow-hidden rounded-md border border-border/30 bg-border/30",children:ae.map(y=>a.jsxs("div",{className:"px-2 py-2 text-center",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},title:y.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${y.color}`,style:y.colorStyle,children:y.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:y.label})]},y.label))})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"mb-1 h-section",children:"Category Competency"}),a.jsx("p",{className:"mb-3 mt-0.5 font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:"◆ Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty."}),a.jsx(wg,{categoryAccuracy:q.categoryAccuracy,categoryCorrect:q.categoryCorrect,categoryHallucinated:q.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:d.skillSlots.length||d.skills.length})]}),d.skillSlots.length>0?a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:d.skillSlots.map(y=>a.jsx(Ug,{slot:y},y.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(y=>a.jsx("span",{className:"rounded-sm border border-border px-2.5 py-1 font-mono text-xs",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:y},y))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:w.length})]}),E>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>M(y=>Math.max(0,y-1)),disabled:T===0,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:[T+1," / ",E]}),a.jsx("button",{onClick:()=>M(y=>Math.min(E-1,y+1)),disabled:T>=E-1,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}),w.length>0?a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40",children:a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",style:{background:"var(--surface-elev)"},children:[a.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium",style:{width:32,color:"var(--text-dim)"}}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"ID"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"Agent"}),a.jsx("th",{className:"py-2 pr-3 text-xs font-medium",style:{color:"var(--text-dim)"},children:"Description"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"Duration"}),a.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"When"})]})}),a.jsx("tbody",{children:H.map(y=>a.jsx(Nh,{task:y,onClick:J},y.taskId))})]})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No tasks recorded."})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Consensus Runs ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:Z.length})]}),Z.length>0?a.jsx("div",{className:"space-y-2",children:Z.slice(0,20).map((y,R)=>{const V=y.counts,G=(V.agreement||0)+(V.disagreement||0)+(V.hallucination||0)+(V.unverified||0)+(V.unique||0)+(V.new||0),le=G||1,re=[{key:"confirmed",count:V.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(V.disagreement||0)+(V.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:V.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(V.unique||0)+(V.new||0),color:"bg-unique",text:"text-unique"}],ve={agreement:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},new_finding:{label:"NEW",cls:"text-unique bg-unique/10"}},Re=y.signals.filter(Ae=>Ae.signal!=="signal_retracted"&&ve[Ae.signal]),Me=y.taskId+":"+R,qt=S===Me;return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"var(--surface-elev)"},children:[a.jsx("button",{type:"button",onClick:()=>O(qt?null:Me),disabled:Re.length===0,className:`flex w-full items-center p-3 text-left transition ${Re.length>0?"hover:bg-accent/20":"cursor-default"}`,children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"font-mono text-sm font-semibold",style:{color:"var(--text)"},children:[Re.length>0&&a.jsx("span",{className:"mr-1.5 inline-block",style:{color:"var(--text-dim)"},children:qt?"▾":"▸"}),G," findings"]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:We(y.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:re.map(Ae=>Ae.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Ae.text}`,children:[Ae.count," ",Ae.key]},Ae.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:re.map(Ae=>Ae.count>0&&a.jsx("div",{className:Ae.color,style:{width:`${Ae.count/le*100}%`}},Ae.key))})]})}),qt&&Re.length>0&&a.jsx("div",{className:"border-t border-border/30 px-3 pb-2 pt-2",children:a.jsx("div",{className:"space-y-1",children:Re.map((Ae,yn)=>{const Zn=ve[Ae.signal],Lt=!!(Ae.findingId&&y.taskId),Yt=a.jsxs("div",{className:"flex items-start gap-2 py-1",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${Zn.cls}`,children:Zn.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"finding-md text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:Oi(Ae.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Ae.agentId,Ae.counterpartId?` + ${Ae.counterpartId}`:""]})]})]});return Lt?a.jsx("button",{type:"button",onClick:()=>L({consensusId:y.taskId,findingId:Ae.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/10",children:Yt},yn):a.jsx("div",{children:Yt},yn)})})})]},Me)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No consensus participation recorded."})]}),a.jsx("section",{className:"mb-8",children:a.jsx(Vg,{agentId:i})}),a.jsx(qi,{open:!!Q,onOpenChange:y=>{y||L(null)},consensusId:(Q==null?void 0:Q.consensusId)??null,findingId:(Q==null?void 0:Q.findingId)??null}),a.jsx(bh,{task:ee,onClose:()=>J(null)}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Memory ",a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[m.length," files"]}),ue&&a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["· ",ue.day," (",ue.items.length,")"]})]}),W.length>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>K(y=>Math.max(0,y-1)),disabled:ce===0,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Newer"}),a.jsxs("span",{children:[ce+1," / ",W.length]}),a.jsx("button",{onClick:()=>K(y=>Math.min(W.length-1,y+1)),disabled:ce>=W.length-1,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Older ▸"})]})]}),ue&&ue.items.length>0?a.jsx("div",{className:"space-y-1.5",children:ue.items.map(y=>{var le,re;const R=g===y.filename,V=((le=y.frontmatter)==null?void 0:le.type)||"memory",G=((re=y.frontmatter)==null?void 0:re.name)||y.filename.replace(/\.md$/,"");return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("button",{onClick:()=>b(R?null:y.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/10",children:[a.jsx("span",{className:"font-mono text-xs",style:{color:R?"var(--text)":"var(--text-dim)"},children:R?"▾":"▸"}),a.jsx("span",{className:"shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:V}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:G}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:y.filename})]}),R&&a.jsx("div",{className:"border-t border-border px-4 py-3",children:a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed",style:{color:"var(--text-dim)"},children:y.content})})]},y.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No memory files."})]})]})}const nh={dispatch:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},consensus:{color:"color-mix(in oklch, var(--info) 80%, transparent)"},error:{},timeout:{},worker:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},gemini:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},skill:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},boot:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},relay:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},gossip:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},utility:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},memory:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},persist:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},toolserver:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},other:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"}},iy={error:"text-disputed",timeout:"text-unverified"},cy=[[/^\[gossipcat\]\s*\[worker:/,"worker"],[/^\[gossipcat\]\s*\[Gemini\]/,"gemini"],[/^\[gossipcat\]\s*\[ToolServer\]/,"toolserver"],[/^\[gossipcat\]\s*dispatch\b/,"dispatch"],[/^\[gossipcat\]\s*relay\b/,"relay"],[/^\[gossipcat\]\s*Cross-review\b/,"consensus"],[/^\[gossipcat\]\s*Consensus\b/,"consensus"],[/^\[gossipcat\]\s*Skill\b/,"skill"],[/^\[gossipcat\]\s*Bootstrap\b/,"boot"],[/^\[gossipcat\]\s*Booted:/,"boot"],[/^\[gossipcat\]\s*Dashboard:/,"boot"],[/^\[gossipcat\]\s*Adaptive\b/,"boot"],[/^\[gossipcat\]\s*Gossip\b/,"gossip"],[/^\[gossipcat\]\s*utility\b/,"utility"],[/^\[gossipcat\]\s*Compacted\b/,"memory"],[/native agent/,"boot"],[/persist|Persist/,"persist"],[/timeout|Timeout|timed.out/,"timeout"],[/^\[gossipcat\].*(?:Error|error|failed|Failed)/,"error"]];function ry(i){for(const[r,u]of cy)if(r.test(i))return u;return"other"}const oy=[{key:"all",label:"All"},{key:"dispatch",label:"Dispatch"},{key:"consensus",label:"Consensus"},{key:"error",label:"Errors"},{key:"timeout",label:"Timeouts"},{key:"worker",label:"Workers"},{key:"skill",label:"Skills"},{key:"relay",label:"Relay"},{key:"boot",label:"Boot"}],lh=1e3;function uy(){const[i,r]=k.useState([]),[u,o]=k.useState(0),[d,m]=k.useState(0),[v,p]=k.useState("all"),[x,g]=k.useState(!0),[b,S]=k.useState(!0),O=k.useRef(null),Q=k.useRef(0);k.useEffect(()=>{let M=!1;return(async()=>{try{const K=await Ge("logs?tail=500");if(M)return;r(K.entries),o(K.totalLines),m(K.fileSize),Q.current=K.totalLines+1}catch{}})(),()=>{M=!0}},[]),k.useEffect(()=>{if(b)return hh(M=>{var K;if(M.type!=="log_lines")return;const I=(K=M.data)==null?void 0:K.lines;I!=null&&I.length&&r(ee=>{const J=I.map((q,w)=>({line:Q.current+w,text:q,category:ry(q)}));Q.current+=I.length,o(q=>q+I.length);const A=[...ee,...J];return A.length>lh?A.slice(-lh):A})})},[b]),k.useEffect(()=>{x&&O.current&&O.current.scrollIntoView({behavior:"smooth"})},[i,x]);const L=v==="all"?i:i.filter(M=>M.category===v),X=k.useCallback(M=>M<1024?`${M} B`:M<1048576?`${(M/1024).toFixed(1)} KB`:`${(M/1048576).toFixed(1)} MB`,[]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"MCP Log"}),a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:[u," lines"]}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:X(d)}),b&&a.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),"live"]})]}),a.jsxs("div",{className:"mb-3 flex items-center gap-1.5",children:[oy.map(M=>a.jsx("button",{onClick:()=>p(M.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:v===M.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:M.label},M.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>S(!b),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${b?"bg-confirmed/10 text-confirmed":""}`,style:b?void 0:{color:"var(--text-dim)"},children:b?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>g(!x),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:x?{color:"var(--ok)",background:"color-mix(in oklch, var(--ok) 10%, transparent)"}:{color:"var(--text-dim)"},children:x?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border",style:{background:"var(--surface-elev)"},children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[L.map(M=>a.jsxs("div",{className:"flex gap-2 hover:bg-accent/10",children:[a.jsx("span",{className:"w-10 shrink-0 select-none text-right",style:{color:"color-mix(in oklch, var(--text-dim) 30%, transparent)"},children:M.line}),a.jsx("span",{className:iy[M.category]??"",style:nh[M.category]??nh.other,children:M.text})]},M.line)),L.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs",style:{color:"var(--text-dim)"},children:i.length===0?"Loading...":v==="all"?"No log entries in current tail.":`No ${v} entries in current tail.`}),a.jsx("div",{ref:O})]})})]})}const dy=["critical","high","medium","low"],fy=["manual","impl","meta","auto-provisional"];function ah(i,r){return i.includes(r)?i.filter(u=>u!==r):[...i,r]}const Kt="mb-1 block h-section",Jt={},Vn="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",Qn={background:"var(--surface)",color:"var(--text)"};function my({filters:i,onChange:r,agents:u,signalTypes:o}){const d=m=>v=>{const p=v.target.value;r({[m]:p===""?void 0:p})};return a.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 p-3",style:{background:"color-mix(in oklch, var(--surface-elev) 70%, transparent)"},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"h-section",children:"Filters"}),a.jsx("button",{type:"button",className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},onClick:()=>r({agents:[],counterpart:void 0,signals:[],category:void 0,severity:void 0,since:void 0,until:void 0,consensusId:void 0,findingId:void 0,source:void 0}),children:"clear"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Kt,style:Jt,children:["Agents (",i.agents.length," selected)"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[u.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no agents"}),u.map(m=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20",style:{color:"var(--text)"},children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:i.agents.includes(m),onChange:()=>r({agents:ah(i.agents,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Counterpart"}),a.jsxs("select",{className:Vn,style:Qn,value:i.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),u.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Kt,style:Jt,children:["Signal types (",i.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[o.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals"}),o.map(m=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20",style:{color:"var(--text)"},children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:i.signals.includes(m),onChange:()=>r({signals:ah(i.signals,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Severity"}),a.jsxs("select",{className:Vn,style:Qn,value:i.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),dy.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Vn,style:Qn,value:i.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),fy.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Category"}),a.jsx("input",{type:"text",className:Vn,style:Qn,value:i.category??"",onChange:d("category"),placeholder:"e.g. trust_boundaries"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Vn,style:Qn,value:i.since?i.since.slice(0,16):"",onChange:m=>r({since:m.target.value?new Date(m.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Vn,style:Qn,value:i.until?i.until.slice(0,16):"",onChange:m=>r({until:m.target.value?new Date(m.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Vn,style:Qn,value:i.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Kt,style:Jt,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Vn,style:Qn,value:i.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const sh={agents:[],signals:[]},hy=["agreement","consensus_verified","unique_confirmed","unique_unconfirmed","disagreement","hallucination_caught","new_finding","unverified","impl_test_pass","impl_test_fail","impl_typecheck_pass","impl_typecheck_fail","task_completed","tool_turns","format_compliance"],xy={agreement:"Agreement",consensus_verified:"Consensus verified",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique (unconfirmed)",disagreement:"Disagreement",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified",impl_test_pass:"Test pass",impl_test_fail:"Test fail",impl_typecheck_pass:"Typecheck pass",impl_typecheck_fail:"Typecheck fail",impl_peer_approved:"Peer approved",impl_peer_rejected:"Peer rejected",boundary_escape:"Boundary escape"},py={agreement:"var(--ok)",consensus_verified:"var(--ok)",impl_test_pass:"var(--ok)",impl_typecheck_pass:"var(--ok)",impl_peer_approved:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",impl_test_fail:"var(--bad)",impl_typecheck_fail:"var(--bad)",impl_peer_rejected:"var(--bad)",boundary_escape:"var(--bad)",unique_confirmed:"var(--info)",unique_unconfirmed:"var(--info)",new_finding:"var(--info)",unverified:"var(--info)"},vy={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"},is=100;function gy(){if(typeof window>"u")return{filters:sh,hadAny:!1};const i=new URLSearchParams(window.location.search),r=i.getAll("signal").filter(Boolean),u=i.get("agent"),o=i.get("counterpart")??void 0,d=i.get("category")??void 0,m=i.get("severity"),v=m==="critical"||m==="high"||m==="medium"||m==="low"?m:void 0,p=i.get("since")??void 0,x=i.get("until")??void 0,g=i.get("consensus_id")??void 0,b=i.get("finding_id")??void 0,S=i.get("source"),O=S==="manual"||S==="impl"||S==="meta"||S==="auto-provisional"?S:void 0;return r.length>0||u||o||d||v||p||x||g||b||O?{filters:{agents:u?[u]:[],signals:r,counterpart:o,category:d,severity:v,since:p,until:x,consensusId:g,findingId:b,source:O},hadAny:!0}:{filters:sh,hadAny:!1}}function yy(i,r,u=is){const o=new URLSearchParams;o.set("limit",String(u)),o.set("offset",String(r)),i.agents.length===1&&o.set("agent",i.agents[0]),i.counterpart&&o.set("counterpart",i.counterpart);for(const d of i.signals)o.append("signal",d);return i.category&&o.set("category",i.category),i.severity&&o.set("severity",i.severity),i.since&&o.set("since",i.since),i.until&&o.set("until",i.until),i.consensusId&&o.set("consensus_id",i.consensusId),i.findingId&&o.set("finding_id",i.findingId),i.source&&o.set("source",i.source),o}function fo(i,r){return i?i.length>r?i.slice(0,r)+"…":i:""}function by(){const[{filters:i,hadAny:r}]=k.useState(gy),[u,o]=k.useState(i),[d,m]=k.useState([]),[v,p]=k.useState(0),[x,g]=k.useState(0),[b,S]=k.useState(!1),[O,Q]=k.useState(null),[L,X]=k.useState([]),[M,I]=k.useState(!1),[K,ee]=k.useState(null),[J,A]=k.useState(null),q=k.useRef(null),w=k.useRef(0),Z=k.useCallback(async(E,T)=>{const H=++w.current;S(!0),Q(null);try{const W=yy(E,T*is),ce=await Ge(`signals?${W.toString()}`);if(H!==w.current)return;m(ce.items??[]),g(ce.total??0)}catch(W){if(H!==w.current)return;Q(W instanceof Error?W.message:"fetch failed")}finally{H===w.current&&S(!1)}},[]);k.useEffect(()=>{Ge("agents").then(E=>{const T=(E??[]).map(H=>H.id).filter(Boolean).sort();T.length>0&&X(T)}).catch(()=>{})},[]),k.useEffect(()=>{p(0)},[u]),k.useEffect(()=>(q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{Z(u,v)},250),()=>{q.current&&clearTimeout(q.current)}),[u,v,Z]);const te=k.useCallback(E=>{o(T=>({...T,...E}))},[]),ne=Math.max(1,Math.ceil(x/is)),de=Math.min(v,ne-1),F=x>0||r||b,ae=(E,T)=>{!E||!T||(ee(E),A(T),I(!0))},me=k.useMemo(()=>{const E=[];return u.agents.length&&E.push(`${u.agents.length} agents`),u.signals.length&&E.push(`${u.signals.length} signals`),u.severity&&E.push(u.severity),u.source&&E.push(u.source),(u.since||u.until)&&E.push("time window"),E.length?E.join(" · "):"all signals"},[u]);return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-baseline justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"h-route",children:"Signals"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"Scored events emitted by agents during consensus review."}),a.jsxs("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[me," — showing ",d.length," of ",x]})]})}),r&&a.jsxs("div",{className:"rounded-md border border-border/40 px-3 py-2 font-mono text-[10px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"},children:["Filtered view — ",u.signals.length," signal type",u.signals.length!==1?"s":"",u.agents.length>0?` · ${u.agents.length} agent${u.agents.length!==1?"s":""}`:"",u.severity?` · severity: ${u.severity}`:"",u.source?` · source: ${u.source}`:"",". ",a.jsx("a",{href:vn("/signals"),style:{color:"var(--accent)"},children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${F?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[F&&a.jsx("div",{className:r?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(my,{filters:u,onChange:te,agents:L,signalTypes:hy})}),a.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60",style:{background:"color-mix(in oklch, var(--surface-elev) 70%, transparent)"},children:[O&&a.jsx("div",{className:"border-b border-border/60 px-3 py-2 font-mono text-[10px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)"},children:O}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"h-section border-b border-border/60 text-left",style:{color:"color-mix(in oklch, var(--ink-2) 80%, transparent)"},children:[a.jsx("th",{className:"w-[6px] p-0","aria-label":"severity"}),a.jsx("th",{className:"px-2 py-1.5",children:"time"}),a.jsx("th",{className:"px-2 py-1.5",children:"agent"}),a.jsx("th",{className:"px-2 py-1.5",children:"verdict"}),a.jsx("th",{className:"px-2 py-1.5",children:"finding"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"The other agent in this signal — e.g. the peer who agreed or disputed",children:"counterpart"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"Finding ID — click row to open finding detail",children:"id"}),a.jsx("th",{className:"px-2 py-1.5",children:"consensus"})]})}),a.jsxs("tbody",{children:[d.length===0&&!b&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals match these filters"})}),d.map((E,T)=>{const H=!!(E.consensusId&&E.findingId),W=E.severity?vy[E.severity]:"transparent",ce=py[E.signal]??"var(--ink-2)",ue=xy[E.signal]??E.signal;return a.jsxs("tr",{className:`border-b border-border/30 ${H?"cursor-pointer transition-colors":""}`,style:H?{"--row-hover-bg":"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"}:void 0,role:H?"button":void 0,tabIndex:H?0:void 0,"aria-label":H?`View finding ${E.findingId??""}`:void 0,onMouseEnter:y=>{H&&(y.currentTarget.style.background="color-mix(in oklch, var(--surface-sunk) 40%, transparent)")},onMouseLeave:y=>{H&&(y.currentTarget.style.background="")},onClick:()=>H&&ae(E.consensusId,E.findingId),onKeyDown:y=>{H&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),ae(E.consensusId,E.findingId))},children:[a.jsx("td",{className:"p-0",style:{background:W,width:6},title:E.severity??"no severity"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono tabular-nums",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},title:E.timestamp,children:We(E.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"var(--text)"},children:E.agentId}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:a.jsx("span",{className:"h-section",style:{color:ce,fontSize:11},children:ue})}),a.jsx("td",{className:"max-w-[320px] truncate px-2 py-1",style:{fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.45,color:"var(--text)"},title:E.evidence,children:fo(E.evidence,80)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:E.counterpartId??"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},title:E.findingId,children:E.findingId?fo(E.findingId,24):"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},title:E.consensusId,children:E.consensusId?fo(E.consensusId,16):"—"})]},`${E.timestamp}-${E.agentId}-${T}`)})]})]})}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:b?"loading…":`${de*is+1}–${de*is+d.length} of ${x}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>p(E=>Math.max(0,E-1)),disabled:de===0||b,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[de+1," / ",ne]}),a.jsx("button",{type:"button",onClick:()=>p(E=>Math.min(ne-1,E+1)),disabled:de>=ne-1||b,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]})]})]}),a.jsx(qi,{open:M,onOpenChange:I,consensusId:K,findingId:J})]})}function jy(){const[i,r]=k.useState(null),[u,o]=k.useState(null);k.useEffect(()=>{m0().then(r)},[]);const d=k.useCallback(async m=>{o(null);const v=await f0(m);v.ok?r(!0):o(v.kind)},[]);return{authed:i,login:d,error:u}}const Ny=5e3;function Sy(){const[i,r]=k.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,fleetTrend:null,signalActivity:null,skills:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),u=k.useRef(!1),o=k.useCallback(async()=>{if(!u.current){u.current=!0;try{const[d,m,v,p,x,g,b,S,O,Q]=await Promise.all([Ge("overview"),Ge("agents"),Ge("tasks?limit=2000"),Ge("consensus?pageSize=500"),Ge("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),Ge("fleet-trend?days=7").catch(()=>({days:7,points:[]})),Ge("signal-activity").catch(()=>({agents:[],total:0,generatedAt:""})),Ge("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),Ge("native-memory").catch(()=>({knowledge:[]})),Ge("gossip-memory").catch(()=>({knowledge:[]}))]),L=[...O.knowledge||[]].map(M=>({...M,origin:"native"})).sort((M,I)=>I.filename>M.filename?1:-1),X=[...Q.knowledge||[]].map(M=>({...M,origin:"gossip"})).sort((M,I)=>I.filename>M.filename?1:-1);r({overview:d,agents:m,tasks:v,consensus:p,consensusReports:x,fleetTrend:g,signalActivity:b,skills:S,nativeMemories:L,gossipMemories:X,memories:L,loading:!1,error:null})}catch(d){r(m=>({...m,loading:!1,error:d.message}))}finally{u.current=!1}}},[]);return k.useEffect(()=>{o()},[o]),k.useEffect(()=>{const d=setInterval(()=>{o()},Ny);return()=>clearInterval(d)},[o]),{...i,refresh:o}}const Sh="dashboard:lastEventId";function ky(){if(typeof window>"u")return 0;const i=window.localStorage.getItem(Sh);if(!i)return 0;const r=parseInt(i,10);return Number.isFinite(r)?r:0}function _y(i){typeof window>"u"||window.localStorage.setItem(Sh,String(i))}const ih=1e3,Ey=5e3;function Ty(i){k.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let r=null,u=null,o=ih,d=!1;function m(){if(d)return;const v=ky();r=new window.EventSource(`/dashboard/api/events?last_id=${v}`),r.onmessage=p=>{try{const x=JSON.parse(p.data);i(x),_y(x.id),o=ih}catch{}},r.onerror=()=>{r&&(r.close(),r=null),!d&&(u=setTimeout(()=>{m()},o),o=Math.min(o*2,Ey))}}return m(),()=>{d=!0,u!==null&&clearTimeout(u),r&&(r.close(),r=null)}},[])}const ch=5,My=6e3;function Ay({toast:i,onDismiss:r}){const u=k.useRef(null),o=k.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),d=k.useCallback(()=>{o(),u.current=setTimeout(()=>r(i.id),My)},[i.id,r,o]);k.useEffect(()=>(d(),o),[d,o]);const{type:m,payload:v}=i.event,p=m==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):v.confirmed>v.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let x;if(m==="task.completed"){const b=String(v.agentId??"agent"),S=typeof v.durationMs=="number"?v.durationMs:null,O=S!==null?`${(S/1e3).toFixed(1)}s`:"—";x=`${b} finished in ${O}`}else{const b=Number(v.confirmed??0),S=Number(v.disputed??0);x=`Consensus done — ${b} confirmed · ${S} disputed`}const g=()=>{o(),m==="task.completed"&&v.taskId?rs("/tasks"):m==="consensus.completed"&&v.consensusId&&rs("/debates"),r(i.id)};return a.jsx("div",{className:["pointer-events-auto border rounded px-4 py-3 max-w-sm cursor-pointer","transition-all duration-200","motion-reduce:transition-none motion-reduce:transform-none","hover:border-border",i.exiting?"opacity-0 scale-95 opacity-0 translate-y-2":"opacity-100 scale-100 translate-x-0"].join(" "),style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-card)"},onClick:g,onMouseEnter:o,onMouseLeave:d,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"shrink-0 text-sm font-bold",children:p}),a.jsx("span",{title:x,className:"font-mono text-[11px] min-w-0 truncate",style:{color:"var(--text)"},children:x}),a.jsx("button",{className:"ml-auto shrink-0 hover:[color:var(--text-dim)] text-xs leading-none",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},onClick:b=>{b.stopPropagation(),o(),r(i.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function wy(){const[i,r]=k.useState([]),u=k.useCallback(d=>{r(m=>m.map(v=>v.id===d?{...v,exiting:!0}:v)),setTimeout(()=>{r(m=>m.filter(v=>v.id!==d))},250)},[]),o=k.useCallback(d=>{r(m=>{const v={id:d.id,event:d,exiting:!1},p=[...m,v];if(p.length>ch){const x=p.length-ch;return p.slice(x)}return p})},[]);return Ty(o),a.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none",role:"region","aria-label":"Notifications","aria-live":"polite","aria-atomic":"false",children:i.map(d=>a.jsx(Ay,{toast:d,onDismiss:u},d.id))})}function Cy({agents:i,tasks:r,consensusReports:u,fleetTrend:o}){const[d,m]=k.useState("weight"),[v,p]=k.useState("desc"),[x,g]=k.useState(""),b=k.useMemo(()=>{const A=new Map;if(r)for(const q of r.items){const w=A.get(q.agentId);(!w||q.timestamp>w.timestamp)&&A.set(q.agentId,q)}return A},[r]);vh(u==null?void 0:u.reports),k.useMemo(()=>{const A=new Map;if(o){for(const q of o.points){const w=A.get(q.agentId)??[];w.push(q),A.set(q.agentId,w)}for(const q of A.values())q.sort((w,Z)=>w.day.localeCompare(Z.day))}return A},[o]);const S=i.filter(E0).length,O=i.filter(A=>A.scores.accuracy>=.5).length,Q=i.reduce((A,q)=>A+q.scores.signals,0),L=i.reduce((A,q)=>A+q.totalTokens,0),X=x.trim().toLowerCase(),M=X?i.filter(A=>A.id.toLowerCase().includes(X)||A.provider.toLowerCase().includes(X)||A.model.toLowerCase().includes(X)):i,I=A=>{const q=A.scores;switch(d){case"weight":return q.dispatchWeight;case"accuracy":return q.accuracy;case"uniqueness":return q.uniqueness;case"impact":return q.impactScore;case"signals":return q.signals;case"agreements":return q.agreements;case"hallucinations":return q.hallucinations;case"lastTask":{const w=b.get(A.id);return w?new Date(w.timestamp).getTime():0}}},K=[...M].sort((A,q)=>{const w=I(A),Z=I(q);return v==="desc"?Z-w:w-Z}),ee=A=>{d===A?p(q=>q==="desc"?"asc":"desc"):(m(A),p("desc"))},J=A=>d===A?v==="desc"?"▾":"▴":"";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Team"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:i.length})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Per-agent accuracy, signal counts, and dispatch weights."}),a.jsx("div",{className:"mt-2 grid grid-cols-2 gap-px overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border [background:color-mix(in_oklch,var(--border)_30%,transparent)] sm:grid-cols-4",children:[{label:"Healthy",value:O,varColor:"var(--ok)"},{label:"Benched",value:S,varColor:S>0?"var(--bad)":"var(--ink-3)"},{label:"Total Signals",value:Q.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:L.toLocaleString(),varColor:"var(--ink)"}].map(A=>a.jsxs("div",{style:{background:"var(--surface-elev)"},className:"px-4 py-3",children:[a.jsx("div",{className:"font-mono text-lg font-bold tabular-nums",style:{color:A.varColor},children:A.value}),a.jsx("div",{className:"h-section mt-0.5",children:A.label})]},A.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:x,onChange:A=>g(A.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:var(--ink-3)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}})}),a.jsx("div",{className:"overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsxs("table",{className:"w-full text-left",children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:44}}),a.jsx("col",{}),a.jsx("col",{style:{width:80}}),a.jsx("col",{style:{width:260}}),a.jsx("col",{style:{width:80}}),a.jsx("col",{style:{width:60}}),a.jsx("col",{})]}),a.jsx("thead",{children:a.jsxs("tr",{className:"border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]",style:{background:"color-mix(in oklch, var(--surface-sunk) 20%, transparent)"},children:[a.jsx("th",{className:"h-section py-2.5 pl-5 pr-2 text-center",children:"#"}),a.jsx("th",{className:"h-section py-2.5 pr-3 text-left",children:"Agent"}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ee("weight"),children:["Weight ",J("weight")]}),a.jsx("th",{className:"h-section py-2.5 pr-4 text-left align-top",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>ee("accuracy"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Accuracy — fraction of findings confirmed by cross-review (with hallucination penalty)",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-confirmed"}),"Acc",J("accuracy")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>ee("uniqueness"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Uniqueness — findings this agent surfaced that no peer found",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-unique"}),"Unq",J("uniqueness")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>ee("impact"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Impact — severity-weighted finding score",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--c8)]"}),"Imp",J("impact")]})]})}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ee("signals"),children:["Signals ",J("signals")]}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ee("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",J("hallucinations")]}),a.jsxs("th",{className:"h-section py-2.5 pr-5 text-left cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ee("lastTask"),children:["Last Task ",J("lastTask")]})]})}),a.jsx("tbody",{children:K.map((A,q)=>{const w=A.scores,Z=b.get(A.id),te=w.dispatchWeight>=1.2?"var(--ok)":w.dispatchWeight>=.8?"var(--ink)":"var(--bad)",ne=q+1;return a.jsxs("tr",{className:"group border-t [border-color:color-mix(in_oklch,var(--border)_20%,transparent)] align-top transition-colors hover:bg-accent/20",children:[a.jsx("td",{className:"py-3 pl-5 pr-2 text-center align-top",children:a.jsx("span",{className:"font-mono text-[11px] tabular-nums",style:{color:ne===1?"var(--ink)":ne===2||ne===3?"color-mix(in oklch, var(--ink-2) 80%, transparent)":"var(--ink-3)",fontWeight:ne===1?"bold":ne<=3?600:void 0},children:ne})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(A.id)}`,className:"flex items-center gap-3",children:[a.jsx(us,{agentId:A.id,size:32,signals:w.signals,accuracy:w.accuracy,uniqueness:w.uniqueness,impact:w.impactScore}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"truncate font-mono text-xs font-semibold group-hover:[color:var(--accent)]",style:{color:"var(--ink)"},children:A.id}),(()=>{const de=_o(w);return de==="benched"?a.jsx("span",{className:"shrink-0 rounded px-1 text-[8px] font-bold",style:{background:"color-mix(in oklch, var(--bad) 15%, transparent)",color:"var(--bad)",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":`Benched (${w.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):de==="struggling"?a.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 text-[8px] font-bold text-unverified",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":"Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.",children:"struggling"}):de==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded border border-unverified/40 px-1 text-[8px] font-bold text-unverified",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":`Would bench (${w.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"kept for coverage"}):null})()]}),a.jsxs("div",{className:"truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[A.provider,"/",A.model]})]})]})}),a.jsx("td",{className:"py-3 pr-4 text-right align-top",children:a.jsx("span",{className:"font-mono text-sm font-bold tabular-nums",style:{color:te},children:w.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(mo,{label:"A",value:w.accuracy,fillClass:w.accuracy>=.7?"bg-confirmed":w.accuracy>=.4?"bg-unverified":"bg-disputed",tooltip:"Adjusted accuracy = raw signal ratio × 1/(1 + weighted hallucinations × 0.3). The penalty is recoverable via skill-gated multiplier in the same category."}),a.jsx(mo,{label:"U",value:w.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(mo,{label:"I",value:w.impactScore,fillClass:"bg-[var(--c8)]",tooltip:"Impact — severity-weighted finding score; critical and high findings count more"})]})}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",style:{color:"var(--ink)"},children:w.signals.toLocaleString()}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:a.jsx("span",{style:{color:w.hallucinations>0?"var(--bad)":"var(--ink-3)",fontWeight:w.hallucinations>10?"bold":void 0},"data-tooltip":`Agreements ${w.agreements} · Disagreements ${w.disagreements} · Hallucinations ${w.hallucinations}`,children:w.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:Z?a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] font-semibold",children:Z.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:Z.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:We(Z.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},A.id)})})]})})]})}function mo({label:i,value:r,fillClass:u,tooltip:o}){return a.jsxs("div",{className:"flex items-center gap-2","data-tooltip":o,"data-tooltip-pos":"top",children:[a.jsx("span",{className:"w-6 text-[10px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:i}),a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full ${u}`,style:{width:`${Math.max(0,Math.min(100,r*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums",style:{color:"var(--ink-2)"},children:[Math.round(r*100),"%"]})]})}function zy({tasks:i}){const[r,u]=k.useState(""),[o,d]=k.useState(0),[m,v]=k.useState(null),p=100,x=i.items.filter(M=>M.status==="completed").length,g=i.items.filter(M=>M.status==="failed").length,b=i.items.filter(M=>M.status==="running").length,S=r.trim().toLowerCase(),O=S?i.items.filter(M=>{var I,K,ee,J;return((I=M.task)==null?void 0:I.toLowerCase().includes(S))||((K=M.agentId)==null?void 0:K.toLowerCase().includes(S))||((ee=M.taskId)==null?void 0:ee.toLowerCase().includes(S))||((J=M.status)==null?void 0:J.toLowerCase().includes(S))}):i.items,Q=Math.max(1,Math.ceil(O.length/p)),L=Math.min(o,Q-1),X=O.slice(L*p,(L+1)*p);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Tasks"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:i.total})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:x})," completed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:g})," failed"]}),b>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:b})," running"]}),a.jsxs("span",{children:["showing ",X.length," of ",O.length,S&&` (filtered from ${i.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:r,onChange:M=>{u(M.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:color-mix(in_oklch,var(--accent)_40%,transparent)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] ${Q<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>d(M=>Math.max(0,M-1)),disabled:L===0,className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:[L+1," / ",Q]}),a.jsx("button",{onClick:()=>d(M=>Math.min(Q-1,M+1)),disabled:L>=Q-1,className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:X.length===0?a.jsx("div",{className:"py-12 text-center text-sm",style:{color:"var(--ink-3)"},children:S?"No tasks match your search.":"No tasks yet."}):a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("th",{className:"py-2.5 pl-4 pr-2 h-section",style:{width:32}}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"ID"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Description"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Duration"}),a.jsx("th",{className:"py-2.5 pr-4 text-right h-section",children:"When"})]})}),a.jsx("tbody",{children:X.map(M=>a.jsx(Nh,{task:M,onClick:v},M.taskId))})]})}),a.jsx(bh,{task:m,onClose:()=>v(null)})]})}function Dy({consensus:i,consensusReports:r}){const[u,o]=k.useState(!1),d=u?i.runs:i.runs.filter(g=>!g.retracted),m=i.runs.filter(g=>g.retracted).length,v=d.reduce((g,b)=>g+(b.counts.agreement||0),0),p=d.reduce((g,b)=>g+((b.counts.disagreement||0)+(b.counts.hallucination||0)),0),x=d.reduce((g,b)=>g+(b.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Consensus Rounds"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:d.length}),!u&&m>0&&a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:["/ ",i.totalRuns??i.runs.length," total"]})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Multi-agent review rounds — findings confirmed when ≥2 agents agree."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:v})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:p})," disputed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:x})," unverified"]}),a.jsxs("span",{children:[i.totalSignals," total signals"]})]}),m>0&&a.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:u?`${m} retracted run${m===1?"":"s"} shown`:`${m} retracted run${m===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>o(g=>!g),className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 text-[10px] transition hover:bg-accent/10 hover:[color:var(--ink)]",style:{background:"var(--surface-elev)"},children:u?"hide":"show"})]})]}),a.jsx(Eg,{consensus:i,filteredRuns:d,reports:r,showAll:!0,hideHeader:!0})]})}function Ry(){const i=rh(),{overview:r,agents:u,tasks:o,consensus:d,consensusReports:m,fleetTrend:v,signalActivity:p,skills:x,loading:g,refresh:b}=Sy(),[S,O]=k.useState(0),Q=k.useCallback(ee=>{ee.type!=="log_lines"&&b()},[b]);if(xh(Q),g||!r||!d)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(Im,{}),a.jsx("div",{className:"flex items-center justify-center py-20",style:{color:"var(--ink-3)"},children:"Loading dashboard..."})]});let L;const X=i.match(/^\/agent\/(.+)$/),M=i.match(/^\/consensus\/(.+)$/);if(X&&u){const ee=decodeURIComponent(X[1]);L=a.jsx(sy,{agentId:ee,agents:u,tasks:o,consensus:d})}else if(M){const ee=decodeURIComponent(M[1]);L=a.jsx(cg,{consensusId:ee})}else i==="/team"&&u?L=a.jsx(Cy,{agents:u,tasks:o,consensusReports:m,fleetTrend:v}):i==="/tasks"&&o?L=a.jsx(zy,{tasks:o}):i==="/debates"&&d?L=a.jsx(Dy,{consensus:d,consensusReports:m}):i==="/logs"?L=a.jsx(uy,{}):i==="/signals"?L=a.jsx(by,{}):i==="/violations"?L=a.jsx(Ag,{}):L=a.jsx(Jv,{overview:r,agents:u,tasks:o,consensus:d,consensusReports:m,fleetTrend:v,signalActivity:p,skills:x,activeTaskCount:S,setActiveTaskCount:O});const K=i==="/"||i==="/overview"||!/^\/(agent\/|consensus\/|team|tasks|debates|logs|signals|violations)/.test(i)?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6";return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(Im,{}),a.jsx("main",{className:K,children:L})]})}function Oy(){const{authed:i,login:r,error:u}=jy();return i===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center",style:{color:"var(--ink-3)"},children:"Loading..."}):i?a.jsxs(a.Fragment,{children:[a.jsx(Ry,{}),a.jsx(wy,{})]}):a.jsx(rg,{onLogin:r,error:u})}e0.createRoot(document.getElementById("root")).render(a.jsx(k.StrictMode,{children:a.jsx(Oy,{})}));
|