gossipcat 0.4.31 → 0.5.2
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 +28 -0
- package/dist-dashboard/assets/Geist-Variable-jflMhO5d.woff2 +0 -0
- package/dist-dashboard/assets/dashboard-overview.png +0 -0
- package/dist-dashboard/assets/dashboard-skills.png +0 -0
- package/dist-dashboard/assets/dashboard-team.png +0 -0
- package/dist-dashboard/assets/index-BggwL1Da.css +1 -0
- package/dist-dashboard/assets/index-BxhrNkau.js +78 -0
- package/dist-dashboard/index.html +16 -8
- package/dist-mcp/mcp-server.js +778 -403
- package/package.json +1 -1
- package/dist-dashboard/assets/index-CC9eddQj.css +0 -1
- package/dist-dashboard/assets/index-CLlV_738.js +0 -71
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var Xp=Object.defineProperty;var Vp=(i,r,u)=>r in i?Xp(i,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[r]=u;var tt=(i,r,u)=>Vp(i,typeof r!="symbol"?r+"":r,u);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function u(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=u(f);fetch(f.href,m)}})();var Jr={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 Em;function Qp(){if(Em)return as;Em=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(o,f,m){var g=null;if(m!==void 0&&(g=""+m),f.key!==void 0&&(g=""+f.key),"key"in f){m={};for(var p in f)p!=="key"&&(m[p]=f[p])}else m=f;return f=m.ref,{$$typeof:i,type:o,key:g,ref:f!==void 0?f:null,props:m}}return as.Fragment=r,as.jsx=u,as.jsxs=u,as}var Tm;function Zp(){return Tm||(Tm=1,Jr.exports=Qp()),Jr.exports}var a=Zp(),Fr={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 Mm;function Kp(){if(Mm)return he;Mm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),O=Symbol.iterator;function X(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(){}},V=Object.assign,A={};function W(y,R,Q){this.props=y,this.context=R,this.refs=A,this.updater=Q||L}W.prototype.isReactComponent={},W.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")},W.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Z(){}Z.prototype=W.prototype;function ee(y,R,Q){this.props=y,this.context=R,this.refs=A,this.updater=Q||L}var J=ee.prototype=new Z;J.constructor=ee,V(J,W.prototype),J.isPureReactComponent=!0;var M=Array.isArray;function q(){}var w={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function le(y,R,Q){var Y=Q.ref;return{$$typeof:i,type:y,key:R,ref:Y!==void 0?Y:null,props:Q}}function ne(y,R){return le(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(Q){return R[Q]})}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,Q,Y,te){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,Q,Y,te)}}if(ve)return te=te(y),ve=Y===""?"."+me(y,0):Y,M(te)?(Q="",ve!=null&&(Q=ve.replace(ae,"$&/")+"/"),T(te,R,Q,"",function(qt){return qt})):te!=null&&(de(te)&&(te=ne(te,Q+(te.key==null||y&&y.key===te.key?"":(""+te.key).replace(ae,"$&/")+"/")+ve)),R.push(te)),1;ve=0;var Re=Y===""?".":Y+":";if(M(y))for(var Me=0;Me<y.length;Me++)Y=y[Me],re=Re+me(Y,Me),ve+=T(Y,R,Q,re,te);else if(Me=X(y),typeof Me=="function")for(y=Me.call(y),Me=0;!(Y=y.next()).done;)Y=Y.value,re=Re+me(Y,Me++),ve+=T(Y,R,Q,re,te);else if(re==="object"){if(typeof y.then=="function")return T(E(y),R,Q,Y,te);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,Q){if(y==null)return y;var Y=[],te=0;return T(y,Y,"","",function(re){return R.call(Q,re,te++)}),Y}function I(y){if(y._status===-1){var R=y._result;R=R(),R.then(function(Q){(y._status===0||y._status===-1)&&(y._status=1,y._result=Q)},function(Q){(y._status===0||y._status===-1)&&(y._status=2,y._result=Q)}),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,Q){H(y,function(){R.apply(this,arguments)},Q)},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=W,he.Fragment=u,he.Profiler=f,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,Q){if(y==null)throw Error("The argument must be a React element, but you passed "+y+".");var Y=V({},y.props),te=y.key;if(R!=null)for(re in R.key!==void 0&&(te=""+R.key),R)!K.call(R,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&R.ref===void 0||(Y[re]=R[re]);var re=arguments.length-2;if(re===1)Y.children=Q;else if(1<re){for(var ve=Array(re),Re=0;Re<re;Re++)ve[Re]=arguments[Re+2];Y.children=ve}return le(y.type,te,Y)},he.createContext=function(y){return y={$$typeof:g,_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,Q){var Y,te={},re=null;if(R!=null)for(Y in R.key!==void 0&&(re=""+R.key),R)K.call(R,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(te[Y]=R[Y]);var ve=arguments.length-2;if(ve===1)te.children=Q;else if(1<ve){for(var Re=Array(ve),Me=0;Me<ve;Me++)Re[Me]=arguments[Me+2];te.children=Re}if(y&&y.defaultProps)for(Y in ve=y.defaultProps,ve)te[Y]===void 0&&(te[Y]=ve[Y]);return le(y,re,te)},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:I}},he.memo=function(y,R){return{$$typeof:v,type:y,compare:R===void 0?null:R}},he.startTransition=function(y){var R=w.T,Q={};w.T=Q;try{var Y=y(),te=w.S;te!==null&&te(Q,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(q,ce)}catch(re){ce(re)}finally{R!==null&&Q.types!==null&&(R.types=Q.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,Q){return w.H.useActionState(y,R,Q)},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,Q){return w.H.useImperativeHandle(y,R,Q)},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,Q){return w.H.useReducer(y,R,Q)},he.useRef=function(y){return w.H.useRef(y)},he.useState=function(y){return w.H.useState(y)},he.useSyncExternalStore=function(y,R,Q){return w.H.useSyncExternalStore(y,R,Q)},he.useTransition=function(){return w.H.useTransition()},he.version="19.2.4",he}var Am;function No(){return Am||(Am=1,Fr.exports=Kp()),Fr.exports}var k=No(),Ir={exports:{}},ss={},Wr={exports:{}},Pr={};/**
|
|
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 wm;function Jp(){return wm||(wm=1,(function(i){function r(T,H){var I=T.length;T.push(H);e:for(;0<I;){var ce=I-1>>>1,ue=T[ce];if(0<f(ue,H))T[ce]=H,T[I]=ue,I=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],I=T.pop();if(I!==H){T[0]=I;e:for(var ce=0,ue=T.length,y=ue>>>1;ce<y;){var R=2*(ce+1)-1,Q=T[R],Y=R+1,te=T[Y];if(0>f(Q,I))Y<ue&&0>f(te,Q)?(T[ce]=te,T[Y]=I,ce=Y):(T[ce]=Q,T[R]=I,ce=R);else if(Y<ue&&0>f(te,I))T[ce]=te,T[Y]=I,ce=Y;else break e}}return H}function f(T,H){var I=T.sortIndex-H.sortIndex;return I!==0?I: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 g=Date,p=g.now();i.unstable_now=function(){return g.now()-p}}var x=[],v=[],b=1,S=null,O=3,X=!1,L=!1,V=!1,A=!1,W=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,ee=typeof setImmediate<"u"?setImmediate:null;function J(T){for(var H=u(v);H!==null;){if(H.callback===null)o(v);else if(H.startTime<=T)o(v),H.sortIndex=H.expirationTime,r(x,H);else break;H=u(v)}}function M(T){if(V=!1,J(T),!L)if(u(x)!==null)L=!0,q||(q=!0,F());else{var H=u(v);H!==null&&E(M,H.startTime-T)}}var q=!1,w=-1,K=5,le=-1;function ne(){return A?!0:!(i.unstable_now()-le<K)}function de(){if(A=!1,q){var T=i.unstable_now();le=T;var H=!0;try{e:{L=!1,V&&(V=!1,Z(w),w=-1),X=!0;var I=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(v);y!==null&&E(M,y.startTime-T),H=!1}}break e}finally{S=null,O=I,X=!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(){W(de,0)};function E(T,H){w=W(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"):K=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 I=O;O=H;try{return T()}finally{O=I}},i.unstable_requestPaint=function(){A=!0},i.unstable_runWithPriority=function(T,H){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var I=O;O=T;try{return H()}finally{O=I}},i.unstable_scheduleCallback=function(T,H,I){var ce=i.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?ce+I:ce):I=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=I+ue,T={id:b++,callback:H,priorityLevel:T,startTime:I,expirationTime:ue,sortIndex:-1},I>ce?(T.sortIndex=I,r(v,T),u(x)===null&&T===u(v)&&(V?(Z(w),w=-1):V=!0,E(M,I-ce))):(T.sortIndex=ue,r(x,T),L||X||(L=!0,q||(q=!0,F()))),T},i.unstable_shouldYield=ne,i.unstable_wrapCallback=function(T){var H=O;return function(){var I=O;O=H;try{return T.apply(this,arguments)}finally{O=I}}}})(Pr)),Pr}var Cm;function Fp(){return Cm||(Cm=1,Wr.exports=Jp()),Wr.exports}var eo={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 zm;function Ip(){if(zm)return ct;zm=1;var i=No();function r(x){var v="https://react.dev/errors/"+x;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)v+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+x+"; visit "+v+" 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},f=Symbol.for("react.portal");function m(x,v,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:S==null?null:""+S,children:x,containerInfo:v,implementation:b}}var g=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(x,v){if(x==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ct.createPortal=function(x,v){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(r(299));return m(x,v,null,b)},ct.flushSync=function(x){var v=g.T,b=o.p;try{if(g.T=null,o.p=2,x)return x()}finally{g.T=v,o.p=b,o.d.f()}},ct.preconnect=function(x,v){typeof x=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(x,v))},ct.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},ct.preinit=function(x,v){if(typeof x=="string"&&v&&typeof v.as=="string"){var b=v.as,S=p(b,v.crossOrigin),O=typeof v.integrity=="string"?v.integrity:void 0,X=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;b==="style"?o.d.S(x,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:S,integrity:O,fetchPriority:X}):b==="script"&&o.d.X(x,{crossOrigin:S,integrity:O,fetchPriority:X,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},ct.preinitModule=function(x,v){if(typeof x=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var b=p(v.as,v.crossOrigin);o.d.M(x,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(x)},ct.preload=function(x,v){if(typeof x=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var b=v.as,S=p(b,v.crossOrigin);o.d.L(x,b,{crossOrigin:S,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},ct.preloadModule=function(x,v){if(typeof x=="string")if(v){var b=p(v.as,v.crossOrigin);o.d.m(x,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(x)},ct.requestFormReset=function(x){o.d.r(x)},ct.unstable_batchedUpdates=function(x,v){return x(v)},ct.useFormState=function(x,v,b){return g.H.useFormState(x,v,b)},ct.useFormStatus=function(){return g.H.useHostTransitionStatus()},ct.version="19.2.4",ct}var Dm;function Wp(){if(Dm)return eo.exports;Dm=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(),eo.exports=Ip(),eo.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 Rm;function Pp(){if(Rm)return ss;Rm=1;var i=Fp(),r=No(),u=Wp();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 f(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 g(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 v(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 d=!1,h=s.child;h;){if(h===n){d=!0,n=s,l=c;break}if(h===l){d=!0,l=s,n=c;break}h=h.sibling}if(!d){for(h=c.child;h;){if(h===n){d=!0,n=c,l=s;break}if(h===l){d=!0,l=c,n=s;break}h=h.sibling}if(!d)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"),X=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),le=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 V:return"Fragment";case W:return"Profiler";case A:return"StrictMode";case M:return"Suspense";case q:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case L:return"Portal";case ee:return e.displayName||"Context";case Z: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 K: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,I={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 Q(e,t){ue++,ce[ue]=e.current,e.current=t}var Y=y(null),te=y(null),re=y(null),ve=y(null);function Re(e,t){switch(Q(re,t),Q(te,e),Q(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jf(t),e=Ff(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}R(Y),Q(Y,e)}function Me(){R(Y),R(te),R(re)}function qt(e){e.memoizedState!==null&&Q(ve,e);var t=Y.current,n=Ff(t,e.type);t!==n&&(Q(te,e),Q(Y,n))}function Ae(e){te.current===e&&(R(Y),R(te)),ve.current===e&&(R(ve),es._currentValue=I)}var gn,Qn;function Bt(e){if(gn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);gn=t&&t[1]||"",Qn=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+gn+e+Qn}var Xt=!1;function jl(e,t){if(!e||Xt)return"";Xt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(U){var D=U}Reflect.construct(e,[],$)}else{try{$.call()}catch(U){D=U}e.call($.prototype)}}else{try{throw Error()}catch(U){D=U}($=e())&&typeof $.catch=="function"&&$.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(),d=c[0],h=c[1];if(d&&h){var j=d.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{Xt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Bt(n):""}function Zn(e,t){switch(e.tag){case 26:case 27:case 5:return Bt(e.type);case 16:return Bt("Lazy");case 13:return e.child!==t&&t!==null?Bt("Suspense Fallback"):Bt("Suspense");case 19:return Bt("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 Bt("Activity");default:return""}}function Nl(e){try{var t="",n=null;do t+=Zn(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,Lt=i.unstable_requestPaint,Be=i.unstable_now,Kn=i.unstable_getCurrentPriorityLevel,Jn=i.unstable_ImmediatePriority,To=i.unstable_UserBlockingPriority,us=i.unstable_NormalPriority,_h=i.unstable_LowPriority,Mo=i.unstable_IdlePriority,Eh=i.log,Th=i.unstable_setDisableYieldValue,fa=null,vt=null;function yn(e){if(typeof Eh=="function"&&Th(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(fa,e)}catch{}}var gt=Math.clz32?Math.clz32:wh,Mh=Math.log,Ah=Math.LN2;function wh(e){return e>>>=0,e===0?32:31-(Mh(e)/Ah|0)|0}var ds=256,fs=262144,ms=4194304;function Fn(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 hs(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var s=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var h=l&134217727;return h!==0?(l=h&~c,l!==0?s=Fn(l):(d&=h,d!==0?s=Fn(d):n||(n=h&~e,n!==0&&(s=Fn(n))))):(h=l&~c,h!==0?s=Fn(h):d!==0?s=Fn(d):n||(n=l&~e,n!==0&&(s=Fn(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 Ch(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 Ao(){var e=ms;return ms<<=1,(ms&62914560)===0&&(ms=4194304),e}function qi(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 zh(e,t,n,l,s,c){var d=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=d&~n;0<n;){var B=31-gt(n),$=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&=~$}l!==0&&wo(e,l,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(d&~t))}function wo(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 Co(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 zo(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 Li(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Do(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:ym(e.type))}function Ro(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var bn=Math.random().toString(36).slice(2),nt="__reactFiber$"+bn,ut="__reactProps$"+bn,Sl="__reactContainer$"+bn,Hi="__reactEvents$"+bn,Dh="__reactListeners$"+bn,Rh="__reactHandles$"+bn,Oo="__reactResources$"+bn,xa="__reactMarker$"+bn;function Gi(e){delete e[nt],delete e[ut],delete e[Hi],delete e[Dh],delete e[Rh]}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=lm(e);e!==null;){if(n=e[nt])return n;e=lm(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[Oo];return t||(t=e[Oo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[xa]=!0}var Uo=new Set,qo={};function In(e,t){Tl(e,t),Tl(e+"Capture",t)}function Tl(e,t){for(qo[e]=t,e=0;e<t.length;e++)Uo.add(t[e])}var Oh=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]*$"),Bo={},Lo={};function Uh(e){return P.call(Lo,e)?!0:P.call(Bo,e)?!1:Oh.test(e)?Lo[e]=!0:(Bo[e]=!0,!1)}function xs(e,t,n){if(Uh(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 ps(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 Ho(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qh(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(d){n=""+d,c.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yi(e){if(!e._valueTracker){var t=Ho(e)?"checked":"value";e._valueTracker=qh(e,t,""+e[t])}}function Go(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Ho(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function vs(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 Bh=/[\n"\\]/g;function Tt(e){return e.replace(Bh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function $i(e,t,n,l,s,c,d,h){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Xi(e,d,Et(t)):n!=null?Xi(e,d,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 Yo(e,t,n,l,s,c,d,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,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Yi(e)}function Xi(e,t,n){t==="number"&&vs(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 $o(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 Xo(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 Vo(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 Qo(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&&Vo(e,s,l)}else for(var c in t)t.hasOwnProperty(c)&&Vo(e,c,t[c])}function Vi(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 Hh=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"]]),Gh=/^[\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 gs(e){return Gh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Qi=null;function Zi(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 Zo(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($i(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));$i(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&&Go(l)}break e;case"textarea":$o(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ml(e,!!n.multiple,t,!1)}}}var Ki=!1;function Ko(e,t,n){if(Ki)return e(t,n);Ki=!0;try{var l=e(t);return l}finally{if(Ki=!1,(wl!==null||Cl!==null)&&(si(),wl&&(t=wl,e=Cl,Cl=wl=null,Zo(t),e)))for(t=0;t<e.length;t++)Zo(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"),Ji=!1;if(Pt)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){Ji=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{Ji=!1}var jn=null,Fi=null,ys=null;function Jo(){if(ys)return ys;var e,t=Fi,n=t.length,l,s="value"in jn?jn.value:jn.textContent,c=s.length;for(e=0;e<n&&t[e]===s[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===s[c-l];l++);return ys=s.slice(e,1<l?1-l:void 0)}function bs(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 js(){return!0}function Fo(){return!1}function dt(e){function t(n,l,s,c,d){this._reactName=n,this._targetInst=s,this.type=l,this.nativeEvent=c,this.target=d,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)?js:Fo,this.isPropagationStopped=Fo,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=js)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=js)},persist:function(){},isPersistent:js}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ns=dt(Wn),ya=S({},Wn,{view:0,detail:0}),Yh=dt(ya),Ii,Wi,ba,Ss=S({},ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ec,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"?(Ii=e.screenX-ba.screenX,Wi=e.screenY-ba.screenY):Wi=Ii=0,ba=e),Ii)},movementY:function(e){return"movementY"in e?e.movementY:Wi}}),Io=dt(Ss),$h=S({},Ss,{dataTransfer:0}),Xh=dt($h),Vh=S({},ya,{relatedTarget:0}),Pi=dt(Vh),Qh=S({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),Zh=dt(Qh),Kh=S({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jh=dt(Kh),Fh=S({},Wn,{data:0}),Wo=dt(Fh),Ih={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wh={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"},Ph={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ex(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ph[e])?!!t[e]:!1}function ec(){return ex}var tx=S({},ya,{key:function(e){if(e.key){var t=Ih[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ec,charCode:function(e){return e.type==="keypress"?bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nx=dt(tx),lx=S({},Ss,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Po=dt(lx),ax=S({},ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ec}),sx=dt(ax),ix=S({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),cx=dt(ix),rx=S({},Ss,{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}),ox=dt(rx),ux=S({},Wn,{newState:0,oldState:0}),dx=dt(ux),fx=[9,13,27,32],tc=Pt&&"CompositionEvent"in window,ja=null;Pt&&"documentMode"in document&&(ja=document.documentMode);var mx=Pt&&"TextEvent"in window&&!ja,eu=Pt&&(!tc||ja&&8<ja&&11>=ja),tu=" ",nu=!1;function lu(e,t){switch(e){case"keyup":return fx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function au(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zl=!1;function hx(e,t){switch(e){case"compositionend":return au(t);case"keypress":return t.which!==32?null:(nu=!0,tu);case"textInput":return e=t.data,e===tu&&nu?null:e;default:return null}}function xx(e,t){if(zl)return e==="compositionend"||!tc&&lu(e,t)?(e=Jo(),ys=Fi=jn=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 eu&&t.locale!=="ko"?null:t.data;default:return null}}var px={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 su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!px[e.type]:t==="textarea"}function iu(e,t,n,l){wl?Cl?Cl.push(l):Cl=[l]:wl=l,t=fi(t,"onChange"),0<t.length&&(n=new Ns("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Na=null,Sa=null;function vx(e){$f(e,0)}function ks(e){var t=pa(e);if(Go(t))return e}function cu(e,t){if(e==="change")return t}var ru=!1;if(Pt){var nc;if(Pt){var lc="oninput"in document;if(!lc){var ou=document.createElement("div");ou.setAttribute("oninput","return;"),lc=typeof ou.oninput=="function"}nc=lc}else nc=!1;ru=nc&&(!document.documentMode||9<document.documentMode)}function uu(){Na&&(Na.detachEvent("onpropertychange",du),Sa=Na=null)}function du(e){if(e.propertyName==="value"&&ks(Sa)){var t=[];iu(t,Sa,e,Zi(e)),Ko(vx,t)}}function gx(e,t,n){e==="focusin"?(uu(),Na=t,Sa=n,Na.attachEvent("onpropertychange",du)):e==="focusout"&&uu()}function yx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ks(Sa)}function bx(e,t){if(e==="click")return ks(t)}function jx(e,t){if(e==="input"||e==="change")return ks(t)}function Nx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:Nx;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 fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mu(e,t){var n=fu(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=fu(n)}}function hu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vs(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=vs(e.document)}return t}function ac(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 Sx=Pt&&"documentMode"in document&&11>=document.documentMode,Dl=null,sc=null,_a=null,ic=!1;function pu(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ic||Dl==null||Dl!==vs(l)||(l=Dl,"selectionStart"in l&&ac(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=fi(sc,"onSelect"),0<l.length&&(t=new Ns("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Dl)))}function Pn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rl={animationend:Pn("Animation","AnimationEnd"),animationiteration:Pn("Animation","AnimationIteration"),animationstart:Pn("Animation","AnimationStart"),transitionrun:Pn("Transition","TransitionRun"),transitionstart:Pn("Transition","TransitionStart"),transitioncancel:Pn("Transition","TransitionCancel"),transitionend:Pn("Transition","TransitionEnd")},cc={},vu={};Pt&&(vu=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 el(e){if(cc[e])return cc[e];if(!Rl[e])return e;var t=Rl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in vu)return cc[e]=t[n];return e}var gu=el("animationend"),yu=el("animationiteration"),bu=el("animationstart"),kx=el("transitionrun"),_x=el("transitionstart"),Ex=el("transitioncancel"),ju=el("transitionend"),Nu=new Map,rc="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(" ");rc.push("scrollEnd");function Ht(e,t){Nu.set(e,t),In(t,[e])}var _s=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,oc=0;function Es(){for(var e=Ol,t=oc=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 d=l.pending;d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s}c!==0&&Su(n,s,c)}}function Ts(e,t,n,l){Mt[Ol++]=e,Mt[Ol++]=t,Mt[Ol++]=n,Mt[Ol++]=l,oc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function uc(e,t,n,l){return Ts(e,t,n,l),Ms(e)}function tl(e,t){return Ts(e,null,null,t),Ms(e)}function Su(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 Ms(e){if(50<Za)throw Za=0,yr=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 Tx(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 Tx(e,t,n,l)}function dc(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 ku(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 As(e,t,n,l,s,c){var d=0;if(l=e,typeof e=="function")dc(e)&&(d=1);else if(typeof e=="string")d=zp(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=bt(31,n,t,s),e.elementType=le,e.lanes=c,e;case V:return nl(n.children,s,c,t);case A:d=8,s|=24;break;case W:return e=bt(12,n,t,s|2),e.elementType=W,e.lanes=c,e;case M:return e=bt(13,n,t,s),e.elementType=M,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:d=10;break e;case Z:d=9;break e;case J:d=11;break e;case w:d=14;break e;case K:d=16,l=null;break e}d=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=bt(d,n,t,s),t.elementType=e,t.type=l,t.lanes=c,t}function nl(e,t,n,l){return e=bt(7,e,l,t),e.lanes=n,e}function fc(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function _u(e){var t=bt(18,null,null,0);return t.stateNode=e,t}function mc(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 Eu=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var n=Eu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Nl(t)},Eu.set(e,t),t)}return{value:e,source:t,stack:Nl(t)}}var ql=[],Bl=0,ws=null,Ea=0,wt=[],Ct=0,Nn=null,Vt=1,Qt="";function tn(e,t){ql[Bl++]=Ea,ql[Bl++]=ws,ws=e,Ea=t}function Tu(e,t,n){wt[Ct++]=Vt,wt[Ct++]=Qt,wt[Ct++]=Nn,Nn=e;var l=Vt;e=Qt;var s=32-gt(l)-1;l&=~(1<<s),n+=1;var c=32-gt(t)+s;if(30<c){var d=s-s%5;c=(l&(1<<d)-1).toString(32),l>>=d,s-=d,Vt=1<<32-gt(t)+s|n<<s|l,Qt=c+e}else Vt=1<<c|n<<s|l,Qt=e}function hc(e){e.return!==null&&(tn(e,1),Tu(e,1,0))}function xc(e){for(;e===ws;)ws=ql[--Bl],ql[Bl]=null,Ea=ql[--Bl],ql[Bl]=null;for(;e===Nn;)Nn=wt[--Ct],wt[Ct]=null,Qt=wt[--Ct],wt[Ct]=null,Vt=wt[--Ct],wt[Ct]=null}function Mu(e,t){wt[Ct++]=Vt,wt[Ct++]=Qt,wt[Ct++]=Nn,Vt=t.id,Qt=t.overflow,Nn=e}var lt=null,Ue=null,Ne=!1,Sn=null,zt=!1,pc=Error(o(519));function kn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ta(At(t,e)),pc}function Au(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),Yo(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),Xo(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||Zf(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||kn(e,!0)}function wu(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 Ll(e){if(e!==lt)return!1;if(!Ne)return wu(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")||Rr(e.type,e.memoizedProps)),n=!n),n&&Ue&&kn(e),wu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ue=nm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ue=nm(e)}else t===27?(t=Ue,Bn(e.type)?(e=Lr,Lr=null,Ue=e):Ue=t):Ue=lt?Rt(e.stateNode.nextSibling):null;return!0}function ll(){Ue=lt=null,Ne=!1}function vc(){var e=Sn;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),Sn=null),e}function Ta(e){Sn===null?Sn=[e]:Sn.push(e)}var gc=y(null),al=null,nn=null;function _n(e,t,n){Q(gc,t._currentValue),t._currentValue=n}function ln(e){e._currentValue=gc.current,R(gc)}function yc(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 bc(e,t,n,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var d=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),yc(c.return,n,e),l||(d=null);break e}c=h.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(o(341));d.lanes|=n,c=d.alternate,c!==null&&(c.lanes|=n),yc(d,n,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}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 d=s.alternate;if(d===null)throw Error(o(387));if(d=d.memoizedProps,d!==null){var h=s.type;yt(s.pendingProps.value,d.value)||(e!==null?e.push(h):e=[h])}}else if(s===ve.current){if(d=s.alternate,d===null)throw Error(o(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(es):e=[es])}s=s.return}e!==null&&bc(t,e,n,l),t.flags|=262144}function Cs(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sl(e){al=e,nn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return Cu(al,e)}function zs(e,t){return al===null&&sl(e),Cu(e,t)}function Cu(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 Mx=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()})}},Ax=i.unstable_scheduleCallback,wx=i.unstable_NormalPriority,Qe={$$typeof:ee,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jc(){return{controller:new Mx,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Ax(wx,function(){e.controller.abort()})}var Aa=null,Nc=0,Gl=0,Yl=null;function Cx(e,t){if(Aa===null){var n=Aa=[];Nc=0,Gl=_r(),Yl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Nc++,t.then(zu,zu),t}function zu(){if(--Nc===0&&Aa!==null){Yl!==null&&(Yl.status="fulfilled");var e=Aa;Aa=null,Gl=0,Yl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function zx(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 Du=T.S;T.S=function(e,t){vf=Be(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Cx(e,t),Du!==null&&Du(e,t)};var il=y(null);function Sc(){var e=il.current;return e!==null?e:Oe.pooledCache}function Ds(e,t){t===null?Q(il,il.current):Q(il,t.pool)}function Ru(){var e=Sc();return e===null?null:{parent:Qe._currentValue,pool:e}}var $l=Error(o(460)),kc=Error(o(474)),Rs=Error(o(542)),Os={then:function(){}};function Ou(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Uu(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,Bu(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,Bu(e),e}throw rl=t,$l}}function cl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(rl=n,$l):n}}var rl=null;function qu(){if(rl===null)throw Error(o(459));var e=rl;return rl=null,e}function Bu(e){if(e===$l||e===Rs)throw Error(o(483))}var Xl=null,wa=0;function Us(e){var t=wa;return wa+=1,Xl===null&&(Xl=[]),Uu(Xl,e,t)}function Ca(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qs(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 Lu(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 d(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function h(_,N,C,G){return N===null||N.tag!==6?(N=fc(C,_.mode,G),N.return=_,N):(N=s(N,C),N.return=_,N)}function j(_,N,C,G){var oe=C.type;return oe===V?B(_,N,C.props.children,G,C.key):N!==null&&(N.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===K&&cl(oe)===N.type)?(N=s(N,C.props),Ca(N,C),N.return=_,N):(N=As(C.type,C.key,C.props,null,_.mode,G),Ca(N,C),N.return=_,N)}function z(_,N,C,G){return N===null||N.tag!==4||N.stateNode.containerInfo!==C.containerInfo||N.stateNode.implementation!==C.implementation?(N=mc(C,_.mode,G),N.return=_,N):(N=s(N,C.children||[]),N.return=_,N)}function B(_,N,C,G,oe){return N===null||N.tag!==7?(N=nl(C,_.mode,G,oe),N.return=_,N):(N=s(N,C),N.return=_,N)}function $(_,N,C){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=fc(""+N,_.mode,C),N.return=_,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case X:return C=As(N.type,N.key,N.props,null,_.mode,C),Ca(C,N),C.return=_,C;case L:return N=mc(N,_.mode,C),N.return=_,N;case K:return N=cl(N),$(_,N,C)}if(E(N)||F(N))return N=nl(N,_.mode,C,null),N.return=_,N;if(typeof N.then=="function")return $(_,Us(N),C);if(N.$$typeof===ee)return $(_,zs(_,N),C);qs(_,N)}return null}function D(_,N,C,G){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,G);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case X:return C.key===oe?j(_,N,C,G):null;case L:return C.key===oe?z(_,N,C,G):null;case K:return C=cl(C),D(_,N,C,G)}if(E(C)||F(C))return oe!==null?null:B(_,N,C,G,null);if(typeof C.then=="function")return D(_,N,Us(C),G);if(C.$$typeof===ee)return D(_,N,zs(_,C),G);qs(_,C)}return null}function U(_,N,C,G,oe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return _=_.get(C)||null,h(N,_,""+G,oe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case X:return _=_.get(G.key===null?C:G.key)||null,j(N,_,G,oe);case L:return _=_.get(G.key===null?C:G.key)||null,z(N,_,G,oe);case K:return G=cl(G),U(_,N,C,G,oe)}if(E(G)||F(G))return _=_.get(C)||null,B(N,_,G,oe,null);if(typeof G.then=="function")return U(_,N,C,Us(G),oe);if(G.$$typeof===ee)return U(_,N,C,zs(N,G),oe);qs(N,G)}return null}function se(_,N,C,G){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],G);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=$(_,C[pe],G),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],G),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($n){return t(_,$n)}),Ne&&tn(_,pe),oe}function fe(_,N,C,G){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 $n=D(_,ie,ke.value,G);if($n===null){ie===null&&(ie=je);break}e&&ie&&$n.alternate===null&&t(_,ie),N=c($n,N,pe),Se===null?oe=$n:Se.sibling=$n,Se=$n,ie=je}if(ke.done)return n(_,ie),Ne&&tn(_,pe),oe;if(ie===null){for(;!ke.done;pe++,ke=C.next())ke=$(_,ke.value,G),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,G),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($p){return t(_,$p)}),Ne&&tn(_,pe),oe}function De(_,N,C,G){if(typeof C=="object"&&C!==null&&C.type===V&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case X:e:{for(var oe=C.key;N!==null;){if(N.key===oe){if(oe=C.type,oe===V){if(N.tag===7){n(_,N.sibling),G=s(N,C.props.children),G.return=_,_=G;break e}}else if(N.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===K&&cl(oe)===N.type){n(_,N.sibling),G=s(N,C.props),Ca(G,C),G.return=_,_=G;break e}n(_,N);break}else t(_,N);N=N.sibling}C.type===V?(G=nl(C.props.children,_.mode,G,C.key),G.return=_,_=G):(G=As(C.type,C.key,C.props,null,_.mode,G),Ca(G,C),G.return=_,_=G)}return d(_);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),G=s(N,C.children||[]),G.return=_,_=G;break e}else{n(_,N);break}else t(_,N);N=N.sibling}G=mc(C,_.mode,G),G.return=_,_=G}return d(_);case K:return C=cl(C),De(_,N,C,G)}if(E(C))return se(_,N,C,G);if(F(C)){if(oe=F(C),typeof oe!="function")throw Error(o(150));return C=oe.call(C),fe(_,N,C,G)}if(typeof C.then=="function")return De(_,N,Us(C),G);if(C.$$typeof===ee)return De(_,N,zs(_,C),G);qs(_,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,N!==null&&N.tag===6?(n(_,N.sibling),G=s(N,C),G.return=_,_=G):(n(_,N),G=fc(C,_.mode,G),G.return=_,_=G),d(_)):n(_,N)}return function(_,N,C,G){try{wa=0;var oe=De(_,N,C,G);return Xl=null,oe}catch(ie){if(ie===$l||ie===Rs)throw ie;var Se=bt(29,ie,null,_.mode);return Se.lanes=G,Se.return=_,Se}finally{}}}var ol=Lu(!0),Hu=Lu(!1),En=!1;function _c(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ec(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 Tn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Mn(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=Ms(e),Su(e,null,n),t}return Ts(e,l,t,n),Ms(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,Co(e,n)}}function Tc(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 d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=d:c=c.next=d,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 Mc=!1;function Da(){if(Mc){var e=Yl;if(e!==null)throw e}}function Ra(e,t,n,l){Mc=!1;var s=e.updateQueue;En=!1;var c=s.firstBaseUpdate,d=s.lastBaseUpdate,h=s.shared.pending;if(h!==null){s.shared.pending=null;var j=h,z=j.next;j.next=null,d===null?c=z:d.next=z,d=j;var B=e.alternate;B!==null&&(B=B.updateQueue,h=B.lastBaseUpdate,h!==d&&(h===null?B.firstBaseUpdate=z:h.next=z,B.lastBaseUpdate=j))}if(c!==null){var $=s.baseState;d=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===Gl&&(Mc=!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"){$=se.call(De,$,D);break e}$=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=fe.payload,D=typeof se=="function"?se.call(De,$,D):se,D==null)break e;$=S({},$,D);break e;case 2:En=!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=$):B=B.next=U,d|=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=$),s.baseState=j,s.firstBaseUpdate=z,s.lastBaseUpdate=B,c===null&&(s.shared.lanes=0),Dn|=d,e.lanes=d,e.memoizedState=$}}function Gu(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Yu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Gu(n[e],t)}var Vl=y(null),Bs=y(0);function $u(e,t){e=mn,Q(Bs,e),Q(Vl,t),mn=e|t.baseLanes}function Ac(){Q(Bs,mn),Q(Vl,Vl.current)}function wc(){mn=Bs.current,R(Vl),R(Bs)}var jt=y(null),Dt=null;function An(e){var t=e.alternate;Q(Ye,Ye.current&1),Q(jt,e),Dt===null&&(t===null||Vl.current!==null||t.memoizedState!==null)&&(Dt=e)}function Cc(e){Q(Ye,Ye.current),Q(jt,e),Dt===null&&(Dt=e)}function Xu(e){e.tag===22?(Q(Ye,Ye.current),Q(jt,e),Dt===null&&(Dt=e)):wn()}function wn(){Q(Ye,Ye.current),Q(jt,jt.current)}function Nt(e){R(jt),Dt===e&&(Dt=null),R(Ye)}var Ye=y(0);function Ls(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||qr(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,Hs=!1,Ql=!1,ul=!1,Gs=0,Oa=0,Zl=null,Dx=0;function He(){throw Error(o(321))}function zc(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 Dc(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?Td:Kc,ul=!1,c=n(l,s),ul=!1,Ql&&(c=Qu(t,n,l,s)),Vu(e),c}function Vu(e){T.H=Ba;var t=Ce!==null&&Ce.next!==null;if(an=0,Ze=Ce=xe=null,Hs=!1,Oa=0,Zl=null,t)throw Error(o(300));e===null||Ke||(e=e.dependencies,e!==null&&Cs(e)&&(Ke=!0))}function Qu(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=Md,c=t(n,l)}while(Ql);return c}function Rx(){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 Rc(){var e=Gs!==0;return Gs=0,e}function Oc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Uc(e){if(Hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Hs=!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 $e(){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=Uu(Zl,e,t),t=xe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?Td:Kc),e}function $s(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 qc(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 Xs(e){var t=$e();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 d=s.next;s.next=c.next,c.next=d}t.baseQueue=s=c,l.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var h=d=null,j=null,z=t,B=!1;do{var $=z.lane&-536870913;if($!==z.lane?(be&$)===$:(an&$)===$){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}),$===Gl&&(B=!0);else if((an&D)===D){z=z.next,D===Gl&&(B=!0);continue}else $={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},j===null?(h=j=$,d=c):j=j.next=$,xe.lanes|=D,Dn|=D;$=z.action,ul&&n(c,$),c=z.hasEagerState?z.eagerState:n(c,$)}else D={lane:$,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},j===null?(h=j=D,d=c):j=j.next=D,xe.lanes|=$,Dn|=$;z=z.next}while(z!==null&&z!==t);if(j===null?d=c:j.next=h,!yt(c,e.memoizedState)&&(Ke=!0,B&&(n=Yl,n!==null)))throw n;e.memoizedState=c,e.baseState=d,e.baseQueue=j,l.lastRenderedState=c}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Lc(e){var t=$e(),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 d=s=s.next;do c=e(c,d.action),d=d.next;while(d!==s);yt(c,t.memoizedState)||(Ke=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function Zu(e,t,n){var l=xe,s=$e(),c=Ne;if(c){if(n===void 0)throw Error(o(407));n=n()}else n=t();var d=!yt((Ce||s).memoizedState,n);if(d&&(s.memoizedState=n,Ke=!0),s=s.queue,Yc(Fu.bind(null,l,s,e),[e]),s.getSnapshot!==t||d||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Kl(9,{destroy:void 0},Ju.bind(null,l,s,n,t),null),Oe===null)throw Error(o(349));c||(an&127)!==0||Ku(l,t,n)}return n}function Ku(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 Ju(e,t,n,l){t.value=n,t.getSnapshot=l,Iu(t)&&Wu(e)}function Fu(e,t,n){return n(function(){Iu(t)&&Wu(e)})}function Iu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function Wu(e){var t=tl(e,2);t!==null&&pt(t,e,2)}function Hc(e){var t=rt();if(typeof e=="function"){var n=e;if(e=n(),ul){yn(!0);try{n()}finally{yn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:e},t}function Pu(e,t,n,l){return e.baseState=n,Bc(e,Ce,typeof l=="function"?l:sn)}function Ox(e,t,n,l,s){if(Zs(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(d){c.listeners.push(d)}};T.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,ed(t,c)):(c.next=n.next,t.pending=n.next=c)}}function ed(e,t){var n=t.action,l=t.payload,s=e.state;if(t.isTransition){var c=T.T,d={};T.T=d;try{var h=n(s,l),j=T.S;j!==null&&j(d,h),td(e,t,h)}catch(z){Gc(e,t,z)}finally{c!==null&&d.types!==null&&(c.types=d.types),T.T=c}}else try{c=n(s,l),td(e,t,c)}catch(z){Gc(e,t,z)}}function td(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){nd(e,t,l)},function(l){return Gc(e,t,l)}):nd(e,t,n)}function nd(e,t,n){t.status="fulfilled",t.value=n,ld(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ed(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,ld(t),t=t.next;while(t!==l)}e.action=null}function ld(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ad(e,t){return t}function sd(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}}kn(l)}l=!1}l&&(t=n[0])}}return n=rt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ad,lastRenderedState:t},n.queue=l,n=kd.bind(null,xe,l),l.dispatch=n,l=Hc(!1),c=Zc.bind(null,xe,!1,l.queue),l=rt(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,n=Ox.bind(null,xe,s,c,n),s.dispatch=n,l.memoizedState=e,[t,n,!1]}function id(e){var t=$e();return cd(t,Ce,e)}function cd(e,t,n){if(t=Bc(e,t,ad)[0],e=Xs(sn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ua(t)}catch(d){throw d===$l?Rs:d}else l=t;t=$e();var s=t.queue,c=s.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Kl(9,{destroy:void 0},Ux.bind(null,s,n),null)),[l,c,e]}function Ux(e,t){e.action=t}function rd(e){var t=$e(),n=Ce;if(n!==null)return cd(t,n,e);$e(),t=t.memoizedState,n=$e();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 od(){return $e().memoizedState}function Vs(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 Qs(e,t,n,l){var s=$e();l=l===void 0?null:l;var c=s.memoizedState.inst;Ce!==null&&l!==null&&zc(l,Ce.memoizedState.deps)?s.memoizedState=Kl(t,c,n,l):(xe.flags|=e,s.memoizedState=Kl(1|t,c,n,l))}function ud(e,t){Vs(8390656,8,e,t)}function Yc(e,t){Qs(2048,8,e,t)}function qx(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 dd(e){var t=$e().memoizedState;return qx({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function fd(e,t){return Qs(4,2,e,t)}function md(e,t){return Qs(4,4,e,t)}function hd(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 xd(e,t,n){n=n!=null?n.concat([e]):null,Qs(4,4,hd.bind(null,t,e),n)}function $c(){}function pd(e,t){var n=$e();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&zc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function vd(e,t){var n=$e();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&zc(t,l[1]))return l[0];if(l=e(),ul){yn(!0);try{e()}finally{yn(!1)}}return n.memoizedState=[l,t],l}function Xc(e,t,n){return n===void 0||(an&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=yf(),xe.lanes|=e,Dn|=e,n)}function gd(e,t,n,l){return yt(n,t)?n:Vl.current!==null?(e=Xc(e,n,l),yt(e,t)||(Ke=!0),e):(an&42)===0||(an&1073741824)!==0&&(be&261930)===0?(Ke=!0,e.memoizedState=n):(e=yf(),xe.lanes|=e,Dn|=e,t)}function yd(e,t,n,l,s){var c=H.p;H.p=c!==0&&8>c?c:8;var d=T.T,h={};T.T=h,Zc(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=zx(j,l);qa(e,t,B,_t(e))}else qa(e,t,l,_t(e))}catch($){qa(e,t,{then:function(){},status:"rejected",reason:$},_t())}finally{H.p=c,d!==null&&h.types!==null&&(d.types=h.types),T.T=d}}function Bx(){}function Vc(e,t,n,l){if(e.tag!==5)throw Error(o(476));var s=bd(e).queue;yd(e,s,t,I,n===null?Bx:function(){return jd(e),n(l)})}function bd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:I},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 jd(e){var t=bd(e);t.next===null&&(t=e.alternate.memoizedState),qa(e,t.next.queue,{},_t())}function Qc(){return at(es)}function Nd(){return $e().memoizedState}function Sd(){return $e().memoizedState}function Lx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_t();e=Tn(n);var l=Mn(t,e,n);l!==null&&(pt(l,t,n),za(l,t,n)),t={cache:jc()},e.payload=t;return}t=t.return}}function Hx(e,t,n){var l=_t();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zs(e)?_d(t,n):(n=uc(e,t,n,l),n!==null&&(pt(n,e,l),Ed(n,t,l)))}function kd(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(Zs(e))_d(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var d=t.lastRenderedState,h=c(d,n);if(s.hasEagerState=!0,s.eagerState=h,yt(h,d))return Ts(e,t,s,0),Oe===null&&Es(),!1}catch{}finally{}if(n=uc(e,t,s,l),n!==null)return pt(n,e,l),Ed(n,t,l),!0}return!1}function Zc(e,t,n,l){if(l={lane:2,revertLane:_r(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Zs(e)){if(t)throw Error(o(479))}else t=uc(e,n,l,2),t!==null&&pt(t,e,2)}function Zs(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function _d(e,t){Ql=Hs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ed(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Co(e,n)}}var Ba={readContext:at,use:$s,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};Ba.useEffectEvent=He;var Td={readContext:at,use:$s,useCallback:function(e,t){return rt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:ud,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Vs(4194308,4,hd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var n=rt();t=t===void 0?null:t;var l=e();if(ul){yn(!0);try{e()}finally{yn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=rt();if(n!==void 0){var s=n(t);if(ul){yn(!0);try{n(t)}finally{yn(!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=Hx.bind(null,xe,e),[l.memoizedState,e]},useRef:function(e){var t=rt();return e={current:e},t.memoizedState=e},useState:function(e){e=Hc(e);var t=e.queue,n=kd.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$c,useDeferredValue:function(e,t){var n=rt();return Xc(n,e,t)},useTransition:function(){var e=Hc(!1);return e=yd.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||Ku(l,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,ud(Fu.bind(null,l,c,e),[e]),l.flags|=2048,Kl(9,{destroy:void 0},Ju.bind(null,l,c,n,t),null),n},useId:function(){var e=rt(),t=Oe.identifierPrefix;if(Ne){var n=Qt,l=Vt;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=Dx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Qc,useFormState:sd,useActionState:sd,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=Zc.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:qc,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)}}},Kc={readContext:at,use:$s,useCallback:pd,useContext:at,useEffect:Yc,useImperativeHandle:xd,useInsertionEffect:fd,useLayoutEffect:md,useMemo:vd,useReducer:Xs,useRef:od,useState:function(){return Xs(sn)},useDebugValue:$c,useDeferredValue:function(e,t){var n=$e();return gd(n,Ce.memoizedState,e,t)},useTransition:function(){var e=Xs(sn)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:Ua(e),t]},useSyncExternalStore:Zu,useId:Nd,useHostTransitionStatus:Qc,useFormState:id,useActionState:id,useOptimistic:function(e,t){var n=$e();return Pu(n,Ce,e,t)},useMemoCache:qc,useCacheRefresh:Sd};Kc.useEffectEvent=dd;var Md={readContext:at,use:$s,useCallback:pd,useContext:at,useEffect:Yc,useImperativeHandle:xd,useInsertionEffect:fd,useLayoutEffect:md,useMemo:vd,useReducer:Lc,useRef:od,useState:function(){return Lc(sn)},useDebugValue:$c,useDeferredValue:function(e,t){var n=$e();return Ce===null?Xc(n,e,t):gd(n,Ce.memoizedState,e,t)},useTransition:function(){var e=Lc(sn)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:Ua(e),t]},useSyncExternalStore:Zu,useId:Nd,useHostTransitionStatus:Qc,useFormState:rd,useActionState:rd,useOptimistic:function(e,t){var n=$e();return Ce!==null?Pu(n,Ce,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:qc,useCacheRefresh:Sd};Md.useEffectEvent=dd;function Jc(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 Fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=_t(),s=Tn(l);s.payload=t,n!=null&&(s.callback=n),t=Mn(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=Tn(l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Mn(e,s,l),t!==null&&(pt(t,e,l),za(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_t(),l=Tn(n);l.tag=2,t!=null&&(l.callback=t),t=Mn(e,l,n),t!==null&&(pt(t,e,n),za(t,e,n))}};function Ad(e,t,n,l,s,c,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,d):t.prototype&&t.prototype.isPureReactComponent?!ka(n,l)||!ka(s,c):!0}function wd(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&&Fc.enqueueReplaceState(t,t.state,null)}function dl(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 Cd(e){_s(e)}function zd(e){console.error(e)}function Dd(e){_s(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Rd(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 Ic(e,t,n){return n=Tn(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Od(e){return e=Tn(e),e.tag=3,e}function Ud(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(){Rd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Rd(t,n,l),typeof s!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var h=l.stack;this.componentDidCatch(l.value,{componentStack:h!==null?h:""})})}function Gx(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?ii():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=s,l===Os?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Nr(e,l,s)),!1;case 22:return n.flags|=65536,l===Os?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)),Nr(e,l,s)),!1}throw Error(o(435,n.tag))}return Nr(e,l,s),ii(),!1}if(Ne)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==pc&&(e=Error(o(422),{cause:l}),Ta(At(e,n)))):(l!==pc&&(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=Ic(e.stateNode,l,s),Tc(e,s),Ge!==4&&(Ge=2)),!1;var c=Error(o(520),{cause:l});if(c=At(c,n),Qa===null?Qa=[c]:Qa.push(c),Ge!==4&&(Ge=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=Ic(n.stateNode,l,e),Tc(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"&&(Rn===null||!Rn.has(c))))return n.flags|=65536,s&=-s,n.lanes|=s,s=Od(s),Ud(s,e,n,l),Tc(n,s),!1}n=n.return}while(n!==null);return!1}var Wc=Error(o(461)),Ke=!1;function st(e,t,n,l){t.child=e===null?Hu(t,null,n,l):ol(t,e.child,n,l)}function qd(e,t,n,l,s){n=n.render;var c=t.ref;if("ref"in l){var d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}else d=l;return sl(t),l=Dc(e,t,n,d,c,s),h=Rc(),e!==null&&!Ke?(Oc(e,t,s),cn(e,t,s)):(Ne&&h&&hc(t),t.flags|=1,st(e,t,l,s),t.child)}function Bd(e,t,n,l,s){if(e===null){var c=n.type;return typeof c=="function"&&!dc(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,Ld(e,t,c,l,s)):(e=As(n.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!ir(e,s)){var d=c.memoizedProps;if(n=n.compare,n=n!==null?n:ka,n(d,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 Ld(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,ir(e,s))(e.flags&131072)!==0&&(Ke=!0);else return t.lanes=e.lanes,cn(e,t,s)}return Pc(e,t,n,l,s)}function Hd(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 Gd(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ds(t,c!==null?c.cachePool:null),c!==null?$u(t,c):Ac(),Xu(t);else return l=t.lanes=536870912,Gd(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(Ds(t,c.cachePool),$u(t,c),wn(),t.memoizedState=null):(e!==null&&Ds(t,null),Ac(),wn());return st(e,t,s,n),t.child}function La(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gd(e,t,n,l,s){var c=Sc();return c=c===null?null:{parent:Qe._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Ds(t,null),Ac(),Xu(t),e!==null&&Hl(e,t,l,!0),t.childLanes=s,null}function Js(e,t){return t=Is({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yd(e,t,n){return ol(t,e.child,null,n),e=Js(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function Yx(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=Js(t,l),t.lanes=536870912,La(null,e);if(Cc(t),(e=Ue)?(e=tm(e,zt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nn!==null?{id:Vt,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},n=_u(e),n.return=t,t.child=n,lt=t,Ue=null)):e=null,e===null)throw kn(t);return t.lanes=536870912,null}return Js(t,l)}var c=e.memoizedState;if(c!==null){var d=c.dehydrated;if(Cc(t),s)if(t.flags&256)t.flags&=-257,t=Yd(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&&(d=zo(l,n),d!==0&&d!==c.retryLane))throw c.retryLane=d,tl(e,d),pt(l,e,d),Wc;ii(),t=Yd(e,t,n)}else e=c.treeContext,Ue=Rt(d.nextSibling),lt=t,Ne=!0,Sn=null,zt=!1,e!==null&&Mu(t,e),t=Js(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 Fs(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 Pc(e,t,n,l,s){return sl(t),n=Dc(e,t,n,l,void 0,s),l=Rc(),e!==null&&!Ke?(Oc(e,t,s),cn(e,t,s)):(Ne&&l&&hc(t),t.flags|=1,st(e,t,n,s),t.child)}function $d(e,t,n,l,s,c){return sl(t),t.updateQueue=null,n=Qu(t,l,n,s),Vu(e),l=Rc(),e!==null&&!Ke?(Oc(e,t,c),cn(e,t,c)):(Ne&&l&&hc(t),t.flags|=1,st(e,t,n,c),t.child)}function Xd(e,t,n,l,s){if(sl(t),t.stateNode===null){var c=Ul,d=n.contextType;typeof d=="object"&&d!==null&&(c=at(d)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Fc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},_c(t),d=n.contextType,c.context=typeof d=="object"&&d!==null?at(d):Ul,c.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Jc(t,n,d,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(d=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),d!==c.state&&Fc.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=dl(n,h);c.props=j;var z=c.context,B=n.contextType;d=Ul,typeof B=="object"&&B!==null&&(d=at(B));var $=n.getDerivedStateFromProps;B=typeof $=="function"||typeof c.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,B||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h||z!==d)&&wd(t,c,l,d),En=!1;var D=t.memoizedState;c.state=D,Ra(t,l,c,s),Da(),z=t.memoizedState,h||D!==z||En?(typeof $=="function"&&(Jc(t,n,$,l),z=t.memoizedState),(j=En||Ad(t,n,j,l,D,z,d))?(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=d,l=j):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,Ec(e,t),d=t.memoizedProps,B=dl(n,d),c.props=B,$=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"||(d!==$||D!==j)&&wd(t,c,l,j),En=!1,D=t.memoizedState,c.state=D,Ra(t,l,c,s),Da();var U=t.memoizedState;d!==$||D!==U||En||e!==null&&e.dependencies!==null&&Cs(e.dependencies)?(typeof h=="function"&&(Jc(t,n,h,l),U=t.memoizedState),(B=En||Ad(t,n,B,l,D,U,j)||e!==null&&e.dependencies!==null&&Cs(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"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===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"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Fs(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=ol(t,e.child,null,s),t.child=ol(t,null,n,s)):st(e,t,n,s),t.memoizedState=c.state,e=t.child):e=cn(e,t,s),e}function Vd(e,t,n,l){return ll(),t.flags|=256,st(e,t,n,l),t.child}var er={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tr(e){return{baseLanes:e,cachePool:Ru()}}function nr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=kt),e}function Qd(e,t,n){var l=t.pendingProps,s=!1,c=(t.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(s?An(t):wn(),(e=Ue)?(e=tm(e,zt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nn!==null?{id:Vt,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},n=_u(e),n.return=t,t.child=n,lt=t,Ue=null)):e=null,e===null)throw kn(t);return Br(e)?t.lanes=32:t.lanes=536870912,null}var h=l.children;return l=l.fallback,s?(wn(),s=t.mode,h=Is({mode:"hidden",children:h},s),l=nl(l,s,n,null),h.return=t,l.return=t,h.sibling=l,t.child=h,l=t.child,l.memoizedState=tr(n),l.childLanes=nr(e,d,n),t.memoizedState=er,La(null,l)):(An(t),lr(t,h))}var j=e.memoizedState;if(j!==null&&(h=j.dehydrated,h!==null)){if(c)t.flags&256?(An(t),t.flags&=-257,t=ar(e,t,n)):t.memoizedState!==null?(wn(),t.child=e.child,t.flags|=128,t=null):(wn(),h=l.fallback,s=t.mode,l=Is({mode:"visible",children:l.children},s),h=nl(h,s,n,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,ol(t,e.child,null,n),l=t.child,l.memoizedState=tr(n),l.childLanes=nr(e,d,n),t.memoizedState=er,t=La(null,l));else if(An(t),Br(h)){if(d=h.nextSibling&&h.nextSibling.dataset,d)var z=d.dgst;d=z,l=Error(o(419)),l.stack="",l.digest=d,Ta({value:l,source:null,stack:null}),t=ar(e,t,n)}else if(Ke||Hl(e,t,n,!1),d=(n&e.childLanes)!==0,Ke||d){if(d=Oe,d!==null&&(l=zo(d,n),l!==0&&l!==j.retryLane))throw j.retryLane=l,tl(e,l),pt(d,e,l),Wc;qr(h)||ii(),t=ar(e,t,n)}else qr(h)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ue=Rt(h.nextSibling),lt=t,Ne=!0,Sn=null,zt=!1,e!==null&&Mu(t,e),t=lr(t,l.children),t.flags|=4096);return t}return s?(wn(),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=nl(h,s,n,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,La(null,l),l=t.child,h=e.child.memoizedState,h===null?h=tr(n):(s=h.cachePool,s!==null?(j=Qe._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=Ru(),h={baseLanes:h.baseLanes|n,cachePool:s}),l.memoizedState=h,l.childLanes=nr(e,d,n),t.memoizedState=er,La(e.child,l)):(An(t),n=e.child,e=n.sibling,n=en(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function lr(e,t){return t=Is({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Is(e,t){return e=bt(22,e,null,t),e.lanes=0,e}function ar(e,t,n){return ol(t,e.child,null,n),e=lr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),yc(e.return,t,n)}function sr(e,t,n,l,s,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:s,treeForkCount:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=s,d.treeForkCount=c)}function Kd(e,t,n){var l=t.pendingProps,s=l.revealOrder,c=l.tail;l=l.children;var d=Ye.current,h=(d&2)!==0;if(h?(d=d&1|2,t.flags|=128):d&=1,Q(Ye,d),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&&Zd(e,n,t);else if(e.tag===19)Zd(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&&Ls(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),sr(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&&Ls(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}sr(t,!0,n,null,c,l);break;case"together":sr(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),Dn|=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 ir(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Cs(e)))}function $x(e,t,n){switch(t.tag){case 3:Re(t,t.stateNode.containerInfo),_n(t,Qe,e.memoizedState.cache),ll();break;case 27:case 5:qt(t);break;case 4:Re(t,t.stateNode.containerInfo);break;case 10:_n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(An(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Qd(e,t,n):(An(t),e=cn(e,t,n),e!==null?e.sibling:null);An(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 Kd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Q(Ye,Ye.current),l)break;return null;case 22:return t.lanes=0,Hd(e,t,n,t.pendingProps);case 24:_n(t,Qe,e.memoizedState.cache)}return cn(e,t,n)}function Jd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ke=!0;else{if(!ir(e,n)&&(t.flags&128)===0)return Ke=!1,$x(e,t,n);Ke=(e.flags&131072)!==0}else Ke=!1,Ne&&(t.flags&1048576)!==0&&Tu(t,Ea,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=cl(t.elementType),t.type=e,typeof e=="function")dc(e)?(l=dl(e,l),t.tag=1,t=Xd(null,t,e,l,n)):(t.tag=0,t=Pc(null,t,e,l,n));else{if(e!=null){var s=e.$$typeof;if(s===J){t.tag=11,t=qd(null,t,e,l,n);break e}else if(s===w){t.tag=14,t=Bd(null,t,e,l,n);break e}}throw t=me(e)||e,Error(o(306,t,""))}}return t;case 0:return Pc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,s=dl(l,t.pendingProps),Xd(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,Ec(e,t),Ra(t,l,null,n);var d=t.memoizedState;if(l=d.cache,_n(t,Qe,l),l!==c.cache&&bc(t,[Qe],n,!0),Da(),l=d.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Vd(e,t,l,n);break e}else if(l!==s){s=At(Error(o(424)),t),Ta(s),t=Vd(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,Sn=null,zt=!0,n=Hu(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ll(),l===s){t=cn(e,t,n);break e}st(e,t,l,n)}t=t.child}return t;case 26:return Fs(e,t),e===null?(n=cm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,l=mi(re.current).createElement(n),l[nt]=t,l[ut]=e,it(l,n,e),Pe(l),t.stateNode=l):t.memoizedState=cm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qt(t),e===null&&Ne&&(l=t.stateNode=am(t.type,t.pendingProps,re.current),lt=t,zt=!0,s=Ue,Bn(t.type)?(Lr=s,Ue=Rt(l.firstChild)):Ue=s),st(e,t,t.pendingProps.children,n),Fs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((s=l=Ue)&&(l=yp(l,t.type,t.pendingProps,zt),l!==null?(t.stateNode=l,lt=t,Ue=Rt(l.firstChild),zt=!1,s=!0):s=!1),s||kn(t)),qt(t),s=t.type,c=t.pendingProps,d=e!==null?e.memoizedProps:null,l=c.children,Rr(s,c)?l=null:d!==null&&Rr(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Dc(e,t,Rx,null,null,n),es._currentValue=s),Fs(e,t),st(e,t,l,n),t.child;case 6:return e===null&&Ne&&((e=n=Ue)&&(n=bp(n,t.pendingProps,zt),n!==null?(t.stateNode=n,lt=t,Ue=null,e=!0):e=!1),e||kn(t)),null;case 13:return Qd(e,t,n);case 4:return Re(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ol(t,null,l,n):st(e,t,l,n),t.child;case 11:return qd(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,_n(t,t.type,l.value),st(e,t,l.children,n),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,sl(t),s=at(s),l=l(s),t.flags|=1,st(e,t,l,n),t.child;case 14:return Bd(e,t,t.type,t.pendingProps,n);case 15:return Ld(e,t,t.type,t.pendingProps,n);case 19:return Kd(e,t,n);case 31:return Yx(e,t,n);case 22:return Hd(e,t,n,t.pendingProps);case 24:return sl(t),l=at(Qe),e===null?(s=Sc(),s===null&&(s=Oe,c=jc(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=n),s=c),t.memoizedState={parent:l,cache:s},_c(t),_n(t,Qe,s)):((e.lanes&n)!==0&&(Ec(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),_n(t,Qe,l)):(l=c.cache,_n(t,Qe,l),l!==s.cache&&bc(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 cr(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(Sf())e.flags|=8192;else throw rl=Os,kc}else e.flags&=-16777217}function Fd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fm(t))if(Sf())e.flags|=8192;else throw rl=Os,kc}function Ws(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ao():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 Xx(e,t,n){var l=t.pendingProps;switch(xc(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)&&(Ll(t)?rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vc())),qe(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(rn(t),c!==null?(qe(t),Fd(t,c)):(qe(t),cr(t,s,null,l,n))):c?c!==e.memoizedState?(rn(t),qe(t),Fd(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&rn(t),qe(t),cr(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=Y.current,Ll(t)?Au(t):(e=am(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=Y.current,Ll(t))Au(t);else{var d=mi(re.current);switch(c){case 1:c=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=d.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?d.createElement(s,{is:l.is}):d.createElement(s)}}c[nt]=t,c[ut]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.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),cr(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,Ll(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||Zf(e.nodeValue,n)),e||kn(t,!0)}else e=mi(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=Ll(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 ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else n=vc(),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=Ll(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 ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),s=!1}else s=vc(),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),Ws(t,t.updateQueue),qe(t),null);case 4:return Me(),e===null&&Ar(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(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Ls(e),c!==null){for(t.flags|=128,Ha(l,!1),e=c.updateQueue,t.updateQueue=e,Ws(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ku(n,e),n=n.sibling;return Q(Ye,Ye.current&1|2),Ne&&tn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Be()>li&&(t.flags|=128,s=!0,Ha(l,!1),t.lanes=4194304)}else{if(!s)if(e=Ls(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ws(t,e),Ha(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ne)return qe(t),null}else 2*Be()-l.renderingStartTime>li&&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=Be(),e.sibling=null,n=Ye.current,Q(Ye,s?n&1|2:n&1),Ne&&tn(t,l.treeForkCount),e):(qe(t),null);case 22:case 23:return Nt(t),wc(),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&&Ws(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(il),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 Vx(e,t){switch(xc(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));ll()}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));ll()}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),wc(),e!==null&&R(il),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 Id(e,t){switch(xc(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),wc(),e!==null&&R(il);break;case 24:ln(Qe)}}function Ga(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,d=n.inst;l=c(),d.destroy=l}n=n.next}while(n!==s)}}catch(h){Te(t,t.return,h)}}function Cn(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 d=l.inst,h=d.destroy;if(h!==void 0){d.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 Wd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Yu(t,n)}catch(l){Te(e,e.return,l)}}}function Pd(e,t,n){n.props=dl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Te(e,t,l)}}function Ya(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 Zt(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 ef(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 rr(e,t,n){try{var l=e.stateNode;mp(l,e.type,n,t),l[ut]=t}catch(s){Te(e,e.return,s)}}function tf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bn(e.type)||e.tag===4}function or(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tf(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 ur(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(ur(e,t,n),e=e.sibling;e!==null;)ur(e,t,n),e=e.sibling}function Ps(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(Ps(e,t,n),e=e.sibling;e!==null;)Ps(e,t,n),e=e.sibling}function nf(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,dr=!1,lf=typeof WeakSet=="function"?WeakSet:Set,et=null;function Qx(e,t){if(e=e.containerInfo,zr=bi,e=xu(e),ac(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 d=0,h=-1,j=-1,z=0,B=0,$=e,D=null;t:for(;;){for(var U;$!==n||s!==0&&$.nodeType!==3||(h=d+s),$!==c||l!==0&&$.nodeType!==3||(j=d+l),$.nodeType===3&&(d+=$.nodeValue.length),(U=$.firstChild)!==null;)D=$,$=U;for(;;){if($===e)break t;if(D===n&&++z===s&&(h=d),D===c&&++B===l&&(j=d),(U=$.nextSibling)!==null)break;$=D,D=$.parentNode}$=U}n=h===-1||j===-1?null:{start:h,end:j}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dr={focusedElem:e,selectionRange:n},bi=!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=dl(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)Ur(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ur(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 af(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:dn(e,n),l&4&&Ga(5,n);break;case 1:if(dn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Te(n,n.return,d)}else{var s=dl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Te(n,n.return,d)}}l&64&&Wd(n),l&512&&Ya(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{Yu(e,t)}catch(d){Te(n,n.return,d)}}break;case 27:t===null&&l&4&&nf(n);case 26:case 5:dn(e,n),t===null&&l&4&&ef(n),l&512&&Ya(n,n.return);break;case 12:dn(e,n);break;case 31:dn(e,n),l&4&&rf(e,n);break;case 13:dn(e,n),l&4&&of(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=tp.bind(null,n),jp(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 sf(e){var t=e.alternate;t!==null&&(e.alternate=null,sf(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 Le=null,ft=!1;function un(e,t,n){for(n=n.child;n!==null;)cf(e,t,n),n=n.sibling}function cf(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(fa,n)}catch{}switch(n.tag){case 26:Je||Zt(n,t),un(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Je||Zt(n,t);var l=Le,s=ft;Bn(n.type)&&(Le=n.stateNode,ft=!1),un(e,t,n),Ia(n.stateNode),Le=l,ft=s;break;case 5:Je||Zt(n,t);case 6:if(l=Le,s=ft,Le=null,un(e,t,n),Le=l,ft=s,Le!==null)if(ft)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(c){Te(n,t,c)}else try{Le.removeChild(n.stateNode)}catch(c){Te(n,t,c)}break;case 18:Le!==null&&(ft?(e=Le,Pf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ia(e)):Pf(Le,n.stateNode));break;case 4:l=Le,s=ft,Le=n.stateNode.containerInfo,ft=!0,un(e,t,n),Le=l,ft=s;break;case 0:case 11:case 14:case 15:Cn(2,n,t),Je||Cn(4,n,t),un(e,t,n);break;case 1:Je||(Zt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Pd(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 rf(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 of(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 Zx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lf),t;default:throw Error(o(435,e.tag))}}function ei(e,t){var n=Zx(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var s=np.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,d=t,h=d;e:for(;h!==null;){switch(h.tag){case 27:if(Bn(h.type)){Le=h.stateNode,ft=!1;break e}break;case 5:Le=h.stateNode,ft=!1;break e;case 3:case 4:Le=h.stateNode.containerInfo,ft=!0;break e}h=h.return}if(Le===null)throw Error(o(160));cf(c,d,s),Le=null,ft=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)uf(t,e),t=t.sibling}var Gt=null;function uf(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&&(Cn(3,e,e.return),Ga(3,e),Cn(5,e,e.return));break;case 1:mt(t,e),ht(e),l&512&&(Je||n===null||Zt(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=Gt;if(mt(t,e),ht(e),l&512&&(Je||n===null||Zt(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 d=um("link","href",s).get(l+(n.href||""));if(d){for(var h=0;h<d.length;h++)if(c=d[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)){d.splice(h,1);break t}}c=s.createElement(l),it(c,l,n),s.head.appendChild(c);break;case"meta":if(d=um("meta","content",s).get(l+(n.content||""))){for(h=0;h<d.length;h++)if(c=d[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)){d.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 dm(s,e.type,e.stateNode);else e.stateNode=om(s,l,e.memoizedProps);else c!==l?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,l===null?dm(s,e.type,e.stateNode):om(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&rr(e,e.memoizedProps,n.memoizedProps)}break;case 27:mt(t,e),ht(e),l&512&&(Je||n===null||Zt(n,n.return)),n!==null&&l&4&&rr(e,e.memoizedProps,n.memoizedProps);break;case 5:if(mt(t,e),ht(e),l&512&&(Je||n===null||Zt(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,rr(e,s,n!==null?n.memoizedProps:s)),l&1024&&(dr=!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(pi=null,s=Gt,Gt=hi(t.containerInfo),mt(t,e),Gt=s,ht(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ia(t.containerInfo)}catch(se){Te(e,e.return,se)}dr&&(dr=!1,df(e));break;case 4:l=Gt,Gt=hi(e.stateNode.containerInfo),mt(t,e),ht(e),Gt=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,ei(e,l)));break;case 13:mt(t,e),ht(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ni=Be()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ei(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||fl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){j=n=t;try{if(c=j.stateNode,s)d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{h=j.stateNode;var $=j.memoizedProps.style,D=$!=null&&$.hasOwnProperty("display")?$.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?em(U,!0):em(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,ei(e,n))));break;case 19:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ei(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(tf(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var s=n.stateNode,c=or(e);Ps(e,c,s);break;case 5:var d=n.stateNode;n.flags&32&&(Al(d,""),n.flags&=-33);var h=or(e);Ps(e,h,d);break;case 3:case 4:var j=n.stateNode.containerInfo,z=or(e);ur(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 df(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;df(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;)af(e,t.alternate,t),t=t.sibling}function fl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Cn(4,t,t.return),fl(t);break;case 1:Zt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Pd(t,t.return,n),fl(t);break;case 27:Ia(t.stateNode);case 26:case 5:Zt(t,t.return),fl(t);break;case 22:t.memoizedState===null&&fl(t);break;case 30:fl(t);break;default:fl(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,d=c.flags;switch(c.tag){case 0:case 11:case 15:fn(s,c,n),Ga(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++)Gu(j[s],h)}catch(z){Te(l,l.return,z)}}n&&d&64&&Wd(c),Ya(c,c.return);break;case 27:nf(c);case 26:case 5:fn(s,c,n),n&&l===null&&d&4&&ef(c),Ya(c,c.return);break;case 12:fn(s,c,n);break;case 31:fn(s,c,n),n&&d&4&&rf(s,c);break;case 13:fn(s,c,n),n&&d&4&&of(s,c);break;case 22:c.memoizedState===null&&fn(s,c,n),Ya(c,c.return);break;case 30:break;default:fn(s,c,n)}t=t.sibling}}function fr(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 mr(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 Yt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ff(e,t,n,l),t=t.sibling}function ff(e,t,n,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Yt(e,t,n,l),s&2048&&Ga(9,t);break;case 1:Yt(e,t,n,l);break;case 3:Yt(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){Yt(e,t,n,l),e=t.stateNode;try{var c=t.memoizedProps,d=c.id,h=c.onPostCommit;typeof h=="function"&&h(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Te(t,t.return,j)}}else Yt(e,t,n,l);break;case 31:Yt(e,t,n,l);break;case 13:Yt(e,t,n,l);break;case 23:break;case 22:c=t.stateNode,d=t.alternate,t.memoizedState!==null?c._visibility&2?Yt(e,t,n,l):$a(e,t):c._visibility&2?Yt(e,t,n,l):(c._visibility|=2,Jl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&fr(d,t);break;case 24:Yt(e,t,n,l),s&2048&&mr(t.alternate,t);break;default:Yt(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,d=t,h=n,j=l,z=d.flags;switch(d.tag){case 0:case 11:case 15:Jl(c,d,h,j,s),Ga(8,d);break;case 23:break;case 22:var B=d.stateNode;d.memoizedState!==null?B._visibility&2?Jl(c,d,h,j,s):$a(c,d):(B._visibility|=2,Jl(c,d,h,j,s)),s&&z&2048&&fr(d.alternate,d);break;case 24:Jl(c,d,h,j,s),s&&z&2048&&mr(d.alternate,d);break;default:Jl(c,d,h,j,s)}t=t.sibling}}function $a(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:$a(n,l),s&2048&&fr(l.alternate,l);break;case 24:$a(n,l),s&2048&&mr(l.alternate,l);break;default:$a(n,l)}t=t.sibling}}var Xa=8192;function Fl(e,t,n){if(e.subtreeFlags&Xa)for(e=e.child;e!==null;)mf(e,t,n),e=e.sibling}function mf(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Xa&&e.memoizedState!==null&&Dp(n,Gt,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var l=Gt;Gt=hi(e.stateNode.containerInfo),Fl(e,t,n),Gt=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 hf(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,pf(l,e)}hf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xf(e),e=e.sibling}function xf(e){switch(e.tag){case 0:case 11:case 15:Va(e),e.flags&2048&&Cn(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,ti(e)):Va(e);break;default:Va(e)}}function ti(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,pf(l,e)}hf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cn(8,t,t.return),ti(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ti(t));break;default:ti(t)}e=e.sibling}}function pf(e,t){for(;et!==null;){var n=et;switch(n.tag){case 0:case 11:case 15:Cn(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(sf(l),l===n){et=null;break e}if(s!==null){s.return=c,et=s;break e}et=c}}}var Kx={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}},Jx=typeof WeakMap=="function"?WeakMap:Map,_e=0,Oe=null,ge=null,be=0,Ee=0,St=null,zn=!1,Il=!1,hr=!1,mn=0,Ge=0,Dn=0,ml=0,xr=0,kt=0,Wl=0,Qa=null,xt=null,pr=!1,ni=0,vf=0,li=1/0,ai=null,Rn=null,Ie=0,On=null,Pl=null,hn=0,vr=0,gr=null,gf=null,Za=0,yr=null;function _t(){return(_e&2)!==0&&be!==0?be&-be:T.T!==null?_r():Do()}function yf(){if(kt===0)if((be&536870912)===0||Ne){var e=fs;fs<<=1,(fs&3932160)===0&&(fs=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),Un(e,be,kt,!1)),ha(e,n),((_e&2)===0||e!==Oe)&&(e===Oe&&((_e&2)===0&&(ml|=n),Ge===4&&Un(e,be,kt,!1)),Kt(e))}function bf(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?Wx(e,t):jr(e,t,!0),c=l;do{if(s===0){Il&&!l&&Un(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Fx(n)){s=jr(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var h=e;s=Qa;var j=h.current.memoizedState.isDehydrated;if(j&&(ea(h,d).flags|=256),d=jr(h,d,!1),d!==2){if(hr&&!j){h.errorRecoveryDisabledLanes|=c,ml|=c,s=4;break e}c=xt,xt=s,c!==null&&(xt===null?xt=c:xt.push.apply(xt,c))}s=d}if(c=!1,s!==2)continue}}if(s===1){ea(e,0),Un(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:Un(l,t,kt,!zn);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=ni+300-Be(),10<s)){if(Un(l,t,kt,!zn),hs(l,0,!0)!==0)break e;hn=t,l.timeoutHandle=If(jf.bind(null,l,n,xt,ai,pr,t,kt,ml,Wl,zn,c,"Throttled",-0,0),s);break e}jf(l,n,xt,ai,pr,t,kt,ml,Wl,zn,c,null,-0,0)}}break}while(!0);Kt(e)}function jf(e,t,n,l,s,c,d,h,j,z,B,$,D,U){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},mf(t,c,$);var se=(c&62914560)===c?ni-Be():(c&4194048)===c?vf-Be():0;if(se=Rp($,se),se!==null){hn=c,e.cancelPendingCommit=se(Af.bind(null,e,t,c,n,l,s,d,h,j,B,$,null,D,U)),Un(e,c,d,!z);return}}Af(e,t,c,n,l,s,d,h,j)}function Fx(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 Un(e,t,n,l){t&=~xr,t&=~ml,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var c=31-gt(s),d=1<<c;l[c]=-1,s&=~d}n!==0&&wo(e,n,t)}function si(){return(_e&6)===0?(Ka(0),!1):!0}function br(){if(ge!==null){if(Ee===0)var e=ge.return;else e=ge,nn=al=null,Uc(e),Xl=null,wa=0,e=ge;for(;e!==null;)Id(e.alternate,e),e=e.return;ge=null}}function ea(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,pp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hn=0,br(),Oe=e,ge=n=en(e.current,null),be=t,Ee=0,St=null,zn=!1,Il=ma(e,t),hr=!1,Wl=kt=xr=ml=Dn=Ge=0,xt=Qa=null,pr=!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,Es(),n}function Nf(e,t){xe=null,T.H=Ba,t===$l||t===Rs?(t=qu(),Ee=3):t===kc?(t=qu(),Ee=4):Ee=t===Wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,St=t,ge===null&&(Ge=1,Ks(e,At(t,e.current)))}function Sf(){var e=jt.current;return e===null?!0:(be&4194048)===be?Dt===null:(be&62914560)===be||(be&536870912)!==0?e===Dt:!1}function kf(){var e=T.H;return T.H=Ba,e===null?Ba:e}function _f(){var e=T.A;return T.A=Kx,e}function ii(){Ge=4,zn||(be&4194048)!==be&&jt.current!==null||(Il=!0),(Dn&134217727)===0&&(ml&134217727)===0||Oe===null||Un(Oe,be,kt,!1)}function jr(e,t,n){var l=_e;_e|=2;var s=kf(),c=_f();(Oe!==e||be!==t)&&(ai=null,ea(e,t)),t=!1;var d=Ge;e:do try{if(Ee!==0&&ge!==null){var h=ge,j=St;switch(Ee){case 8:br(),d=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){d=0;break e}break;default:z=Ee,Ee=0,St=null,ta(e,h,j,z)}}Ix(),d=Ge;break}catch(B){Nf(e,B)}while(!0);return t&&e.shellSuspendCounter++,nn=al=null,_e=l,T.H=s,T.A=c,ge===null&&(Oe=null,be=0,Es()),d}function Ix(){for(;ge!==null;)Ef(ge)}function Wx(e,t){var n=_e;_e|=2;var l=kf(),s=_f();Oe!==e||be!==t?(ai=null,li=Be()+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(Ou(c)){Ee=0,St=null,Tf(t);break}t=function(){Ee!==2&&Ee!==9||Oe!==e||(Ee=7),Kt(e)},c.then(t,t);break e;case 3:Ee=7;break e;case 4:Ee=5;break e;case 7:Ou(c)?(Ee=0,St=null,Tf(t)):(Ee=0,St=null,ta(e,t,c,7));break;case 5:var d=null;switch(ge.tag){case 26:d=ge.memoizedState;case 5:case 27:var h=ge;if(d?fm(d):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,ci(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:br(),Ge=6;break e;default:throw Error(o(462))}}Px();break}catch(B){Nf(e,B)}while(!0);return nn=al=null,T.H=l,T.A=s,_e=n,ge!==null?0:(Oe=null,be=0,Es(),Ge)}function Px(){for(;ge!==null&&!Fe();)Ef(ge)}function Ef(e){var t=Jd(e.alternate,e,mn);e.memoizedProps=e.pendingProps,t===null?ci(e):ge=t}function Tf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$d(n,t,t.pendingProps,t.type,void 0,be);break;case 11:t=$d(n,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:Uc(t);default:Id(n,t),t=ge=ku(t,mn),t=Jd(n,t,mn)}e.memoizedProps=e.pendingProps,t===null?ci(e):ge=t}function ta(e,t,n,l){nn=al=null,Uc(t),Xl=null,wa=0;var s=t.return;try{if(Gx(e,s,t,n,be)){Ge=1,Ks(e,At(n,e.current)),ge=null;return}}catch(c){if(s!==null)throw ge=s,c;Ge=1,Ks(e,At(n,e.current)),ge=null;return}t.flags&32768?(Ne||l===1?e=!0:Il||(be&536870912)!==0?e=!1:(zn=e=!0,(l===2||l===9||l===3||l===6)&&(l=jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Mf(t,e)):ci(t)}function ci(e){var t=e;do{if((t.flags&32768)!==0){Mf(t,zn);return}e=t.return;var n=Xx(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);Ge===0&&(Ge=5)}function Mf(e,t){do{var n=Vx(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);Ge=6,ge=null}function Af(e,t,n,l,s,c,d,h,j){e.cancelPendingCommit=null;do ri();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|=oc,zh(e,n,c,d,h,j),e===Oe&&(ge=Oe=null,be=0),Pl=t,On=e,hn=n,vr=c,gr=s,gf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,lp(us,function(){return Rf(),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,d=_e,_e|=4;try{Qx(e,t,n)}finally{_e=d,H.p=s,T.T=l}}Ie=1,wf(),Cf(),zf()}}function wf(){if(Ie===1){Ie=0;var e=On,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{uf(t,e);var c=Dr,d=xu(e.containerInfo),h=c.focusedElem,j=c.selectionRange;if(d!==h&&h&&h.ownerDocument&&hu(h.ownerDocument.documentElement,h)){if(j!==null&&ac(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 $=h.ownerDocument||document,D=$&&$.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&&(d=De,De=fe,fe=d);var _=mu(h,fe),N=mu(h,De);if(_&&N&&(U.rangeCount!==1||U.anchorNode!==_.node||U.anchorOffset!==_.offset||U.focusNode!==N.node||U.focusOffset!==N.offset)){var C=$.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($=[],U=h;U=U.parentNode;)U.nodeType===1&&$.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<$.length;h++){var G=$[h];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}bi=!!zr,Dr=zr=null}finally{_e=s,H.p=l,T.T=n}}e.current=t,Ie=2}}function Cf(){if(Ie===2){Ie=0;var e=On,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{af(e,t.alternate,t)}finally{_e=s,H.p=l,T.T=n}}Ie=3}}function zf(){if(Ie===4||Ie===3){Ie=0,Lt();var e=On,t=Pl,n=hn,l=gf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,Pl=On=null,Df(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Rn=null),Li(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,d=0;d<l.length;d++){var h=l[d];c(h.value,{componentStack:h.stack})}}finally{T.T=t,H.p=s}}(hn&3)!==0&&ri(),Kt(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===yr?Za++:(Za=0,yr=e):Za=0,Ka(0)}}function Df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function ri(){return wf(),Cf(),zf(),Rf()}function Rf(){if(Ie!==5)return!1;var e=On,t=vr;vr=0;var n=Li(hn),l=T.T,s=H.p;try{H.p=32>n?32:n,T.T=null,n=gr,gr=null;var c=On,d=hn;if(Ie=0,Pl=On=null,hn=0,(_e&6)!==0)throw Error(o(331));var h=_e;if(_e|=4,xf(c.current),ff(c,c.current,d,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,Df(e,t)}}function Of(e,t,n){t=At(n,t),t=Ic(e.stateNode,t,2),e=Mn(e,t,2),e!==null&&(ha(e,2),Kt(e))}function Te(e,t,n){if(e.tag===3)Of(e,e,n);else for(;t!==null;){if(t.tag===3){Of(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Rn===null||!Rn.has(l))){e=At(n,e),n=Od(2),l=Mn(t,n,2),l!==null&&(Ud(n,l,t,e),ha(l,2),Kt(l));break}}t=t.return}}function Nr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Jx;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)||(hr=!0,s.add(n),e=ep.bind(null,e,t,n),t.then(e,e))}function ep(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&&(Ge===4||Ge===3&&(be&62914560)===be&&300>Be()-ni?(_e&2)===0&&ea(e,0):xr|=n,Wl===be&&(Wl=0)),Kt(e)}function Uf(e,t){t===0&&(t=Ao()),e=tl(e,t),e!==null&&(ha(e,t),Kt(e))}function tp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Uf(e,n)}function np(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),Uf(e,n)}function lp(e,t){return we(e,t)}var oi=null,na=null,Sr=!1,ui=!1,kr=!1,qn=0;function Kt(e){e!==na&&e.next===null&&(na===null?oi=na=e:na=na.next=e),ui=!0,Sr||(Sr=!0,sp())}function Ka(e,t){if(!kr&&ui){kr=!0;do for(var n=!1,l=oi;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var c=0;else{var d=l.suspendedLanes,h=l.pingedLanes;c=(1<<31-gt(42|e)+1)-1,c&=s&~(d&~h),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Hf(l,c))}else c=be,c=hs(l,l===Oe?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||ma(l,c)||(n=!0,Hf(l,c));l=l.next}while(n);kr=!1}}function ap(){qf()}function qf(){ui=Sr=!1;var e=0;qn!==0&&xp()&&(e=qn);for(var t=Be(),n=null,l=oi;l!==null;){var s=l.next,c=Bf(l,t);c===0?(l.next=null,n===null?oi=s:n.next=s,s===null&&(na=n)):(n=l,(e!==0||(c&3)!==0)&&(ui=!0)),l=s}Ie!==0&&Ie!==5||Ka(e),qn!==0&&(qn=0)}function Bf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var d=31-gt(c),h=1<<d,j=s[d];j===-1?((h&n)===0||(h&l)!==0)&&(s[d]=Ch(h,t)):j<=t&&(e.expiredLanes|=h),c&=~h}if(t=Oe,n=be,n=hs(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),Li(n)){case 2:case 8:n=To;break;case 32:n=us;break;case 268435456:n=Mo;break;default:n=us}return l=Lf.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 Lf(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ri()&&e.callbackNode!==n)return null;var l=be;return l=hs(e,e===Oe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(bf(e,l,t),Bf(e,Be()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Hf(e,t){if(ri())return null;bf(e,t,!0)}function sp(){vp(function(){(_e&6)!==0?we(Jn,ap):qf()})}function _r(){if(qn===0){var e=Gl;e===0&&(e=ds,ds<<=1,(ds&261888)===0&&(ds=256)),qn=e}return qn}function Gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gs(""+e)}function Yf(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 ip(e,t,n,l,s){if(t==="submit"&&n&&n.stateNode===s){var c=Gf((s[ut]||null).action),d=l.submitter;d&&(t=(t=d[ut]||null)?Gf(t.formAction):d.getAttribute("formAction"),t!==null&&(c=t,d=null));var h=new Ns("action","action",null,l,s);e.push({event:h,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(qn!==0){var j=d?Yf(s,d):new FormData(s);Vc(n,{pending:!0,data:j,method:s.method,action:c},null,j)}}else typeof c=="function"&&(h.preventDefault(),j=d?Yf(s,d):new FormData(s),Vc(n,{pending:!0,data:j,method:s.method,action:c},c,j))},currentTarget:s}]})}}for(var Er=0;Er<rc.length;Er++){var Tr=rc[Er],cp=Tr.toLowerCase(),rp=Tr[0].toUpperCase()+Tr.slice(1);Ht(cp,"on"+rp)}Ht(gu,"onAnimationEnd"),Ht(yu,"onAnimationIteration"),Ht(bu,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(kx,"onTransitionRun"),Ht(_x,"onTransitionStart"),Ht(Ex,"onTransitionCancel"),Ht(ju,"onTransitionEnd"),Tl("onMouseEnter",["mouseout","mouseover"]),Tl("onMouseLeave",["mouseout","mouseover"]),Tl("onPointerEnter",["pointerout","pointerover"]),Tl("onPointerLeave",["pointerout","pointerover"]),In("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),In("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),In("onBeforeInput",["compositionend","keypress","textInput","paste"]),In("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),In("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),In("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(" "),op=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ja));function $f(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 d=l.length-1;0<=d;d--){var h=l[d],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){_s(B)}s.currentTarget=null,c=j}else for(d=0;d<l.length;d++){if(h=l[d],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){_s(B)}s.currentTarget=null,c=j}}}}function ye(e,t){var n=t[Hi];n===void 0&&(n=t[Hi]=new Set);var l=e+"__bubble";n.has(l)||(Xf(t,e,2,!1),n.add(l))}function Mr(e,t,n){var l=0;t&&(l|=4),Xf(n,e,l,t)}var di="_reactListening"+Math.random().toString(36).slice(2);function Ar(e){if(!e[di]){e[di]=!0,Uo.forEach(function(n){n!=="selectionchange"&&(op.has(n)||Mr(n,!1,e),Mr(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[di]||(t[di]=!0,Mr("selectionchange",!1,t))}}function Xf(e,t,n,l){switch(ym(t)){case 2:var s=qp;break;case 8:s=Bp;break;default:s=Xr}n=s.bind(null,t,n,e),s=void 0,!Ji||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 wr(e,t,n,l,s){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var h=l.stateNode.containerInfo;if(h===s)break;if(d===4)for(d=l.return;d!==null;){var j=d.tag;if((j===3||j===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;h!==null;){if(d=kl(h),d===null)return;if(j=d.tag,j===5||j===6||j===26||j===27){l=c=d;continue e}h=h.parentNode}}l=l.return}Ko(function(){var z=c,B=Zi(n),$=[];e:{var D=Nu.get(e);if(D!==void 0){var U=Ns,se=e;switch(e){case"keypress":if(bs(n)===0)break e;case"keydown":case"keyup":U=nx;break;case"focusin":se="focus",U=Pi;break;case"focusout":se="blur",U=Pi;break;case"beforeblur":case"afterblur":U=Pi;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=Io;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=Xh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=sx;break;case gu:case yu:case bu:U=Zh;break;case ju:U=cx;break;case"scroll":case"scrollend":U=Yh;break;case"wheel":U=ox;break;case"copy":case"cut":case"paste":U=Jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=Po;break;case"toggle":case"beforetoggle":U=dx}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 G=N;if(C=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||C===null||_===null||(G=va(N,_),G!=null&&fe.push(Fa(N,G,C))),De)break;N=N.return}0<fe.length&&(D=new U(D,se,null,n,B),$.push({event:D,listeners:fe}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",D&&n!==Qi&&(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=Io,G="onMouseLeave",_="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(fe=Po,G="onPointerLeave",_="onPointerEnter",N="pointer"),De=U==null?D:pa(U),C=se==null?D:pa(se),D=new fe(G,N+"leave",U,n,B),D.target=De,D.relatedTarget=C,G=null,kl(B)===z&&(fe=new fe(_,N+"enter",se,n,B),fe.target=C,fe.relatedTarget=De,G=fe),De=G,U&&se)t:{for(fe=up,_=U,N=se,C=0,G=_;G;G=fe(G))C++;G=0;for(var oe=N;oe;oe=fe(oe))G++;for(;0<C-G;)_=fe(_),C--;for(;0<G-C;)N=fe(N),G--;for(;C--;){if(_===N||N!==null&&_===N.alternate){fe=_;break t}_=fe(_),N=fe(N)}fe=null}else fe=null;U!==null&&Vf($,D,U,fe,!1),se!==null&&De!==null&&Vf($,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=cu;else if(su(D))if(ru)Se=jx;else{Se=yx;var ie=gx}else U=D.nodeName,!U||U.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?z&&Vi(z.elementType)&&(Se=cu):Se=bx;if(Se&&(Se=Se(e,z))){iu($,Se,n,B);break e}ie&&ie(e,D,z),e==="focusout"&&z&&D.type==="number"&&z.memoizedProps.value!=null&&Xi(D,"number",D.value)}switch(ie=z?pa(z):window,e){case"focusin":(su(ie)||ie.contentEditable==="true")&&(Dl=ie,sc=z,_a=null);break;case"focusout":_a=sc=Dl=null;break;case"mousedown":ic=!0;break;case"contextmenu":case"mouseup":case"dragend":ic=!1,pu($,n,B);break;case"selectionchange":if(Sx)break;case"keydown":case"keyup":pu($,n,B)}var pe;if(tc)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?lu(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(eu&&n.locale!=="ko"&&(zl||je!=="onCompositionStart"?je==="onCompositionEnd"&&zl&&(pe=Jo()):(jn=B,Fi="value"in jn?jn.value:jn.textContent,zl=!0)),ie=fi(z,je),0<ie.length&&(je=new Wo(je,e,null,n,B),$.push({event:je,listeners:ie}),pe?je.data=pe:(pe=au(n),pe!==null&&(je.data=pe)))),(pe=mx?hx(e,n):xx(e,n))&&(je=fi(z,"onBeforeInput"),0<je.length&&(ie=new Wo("onBeforeInput","beforeinput",null,n,B),$.push({event:ie,listeners:je}),ie.data=pe)),ip($,e,z,n,B)}$f($,t)})}function Fa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fi(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 up(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vf(e,t,n,l,s){for(var c=t._reactName,d=[];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&&d.unshift(Fa(n,z,j))):s||(z=va(n,c),z!=null&&d.push(Fa(n,z,j)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var dp=/\r\n?/g,fp=/\u0000|\uFFFD/g;function Qf(e){return(typeof e=="string"?e:""+e).replace(dp,`
|
|
49
|
+
`).replace(fp,"")}function Zf(e,t){return t=Qf(t),Qf(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":ps(e,"class",l);break;case"tabIndex":ps(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ps(e,n,l);break;case"style":Qo(e,l,c);break;case"data":if(t!=="object"){ps(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=gs(""+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=gs(""+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=gs(""+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),xs(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":xs(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=Hh.get(n)||n,xs(e,n,l))}}function Cr(e,t,n,l,s,c){switch(n){case"style":Qo(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(!qo.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,""):xs(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 d=n[c];if(d!=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,d,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=d=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":d=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)}}Yo(e,c,h,j,z,d,s,!1);return;case"select":ye("invalid",e),l=d=c=null;for(s in n)if(n.hasOwnProperty(s)&&(h=n[s],h!=null))switch(s){case"value":c=h;break;case"defaultValue":d=h;break;case"multiple":l=h;default:ze(e,t,s,h,n,null)}t=c,n=d,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(d in n)if(n.hasOwnProperty(d)&&(h=n[d],h!=null))switch(d){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,d,h,n,null)}Xo(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(Vi(t)){for(B in n)n.hasOwnProperty(B)&&(l=n[B],l!==void 0&&Cr(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 mp(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,d=null,h=null,j=null,z=null,B=null;for(U in n){var $=n[U];if(n.hasOwnProperty(U)&&$!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":j=$;default:l.hasOwnProperty(U)||ze(e,t,U,null,l,$)}}for(var D in l){var U=l[D];if($=n[D],l.hasOwnProperty(D)&&(U!=null||$!=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":d=U;break;case"defaultValue":h=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:U!==$&&ze(e,t,D,U,l,$)}}$i(e,d,h,j,z,B,c,s);return;case"select":U=d=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":d=c;default:c!==j&&ze(e,t,s,c,l,j)}t=h,n=d,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(d in l)if(s=l[d],c=n[d],l.hasOwnProperty(d)&&(s!=null||c!=null))switch(d){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,d,s,l,c)}$o(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(Vi(t)){for(var De in n)D=n[De],n.hasOwnProperty(De)&&D!==void 0&&!l.hasOwnProperty(De)&&Cr(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||Cr(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($ in l)D=l[$],U=n[$],!l.hasOwnProperty($)||D===U||D==null&&U==null||ze(e,t,$,D,l,U)}function Kf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hp(){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,d=s.initiatorType,h=s.duration;if(c&&h&&Kf(d)){for(d=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,$=j.initiatorType;B&&Kf($)&&(j=j.responseEnd,d+=B*(j<h?1:(h-z)/(j-z)))}if(--l,t+=8*(c+d)/(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 zr=null,Dr=null;function mi(e){return e.nodeType===9?e:e.ownerDocument}function Jf(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 Ff(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 Rr(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 Or=null;function xp(){var e=window.event;return e&&e.type==="popstate"?e===Or?!1:(Or=e,!0):(Or=null,!1)}var If=typeof setTimeout=="function"?setTimeout:void 0,pp=typeof clearTimeout=="function"?clearTimeout:void 0,Wf=typeof Promise=="function"?Promise:void 0,vp=typeof queueMicrotask=="function"?queueMicrotask:typeof Wf<"u"?function(e){return Wf.resolve(null).then(e).catch(gp)}:If;function gp(e){setTimeout(function(){throw e})}function Bn(e){return e==="head"}function Pf(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 d=c.nextSibling,h=c.nodeName;c[xa]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=d}}else n==="body"&&Ia(e.ownerDocument.body);n=s}while(n);ia(t)}function em(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 Ur(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":Ur(n),Gi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function yp(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 bp(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 tm(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 qr(e){return e.data==="$?"||e.data==="$~"}function Br(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function jp(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 Lr=null;function nm(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 lm(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 am(e,t,n){switch(t=mi(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,sm=new Set;function hi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xn=H.d;H.d={f:Np,r:Sp,D:kp,C:_p,L:Ep,m:Tp,X:Ap,S:Mp,M:wp};function Np(){var e=xn.f(),t=si();return e||t}function Sp(e){var t=_l(e);t!==null&&t.tag===5&&t.type==="form"?jd(t):xn.r(e)}var la=typeof document>"u"?null:document;function im(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+'"]'),sm.has(s)||(sm.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 kp(e){xn.D(e),im("dns-prefetch",e,null)}function _p(e,t){xn.C(e,t),im("preconnect",e,t)}function Ep(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 Tp(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 Mp(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 d=s.get(c);if(!d){var h={loading:0,preload:null};if(d=l.querySelector(Wa(c)))h.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ot.get(c))&&Hr(e,n);var j=d=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,xi(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:h},s.set(c,d)}}}function Ap(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 wp(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 cm(e,t,n,l){var s=(s=re.current)?hi(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,d=c.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=s.querySelector(Wa(e)))&&!c._p&&(d.instance=c,d.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||Cp(s,e,n,d.state))),t&&l===null)throw Error(o(528,""));return d}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 rm(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function Cp(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 om(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),xi(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=rm(n),(s=Ot.get(s))&&Hr(l,s),c=(e.ownerDocument||e).createElement("link"),Pe(c);var d=c;return d._p=new Promise(function(h,j){d.onload=h,d.onerror=j}),it(c,"link",l),t.state.loading|=4,xi(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,xi(l,n.precedence,e));return t.instance}function xi(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,d=0;d<l.length;d++){var h=l[d];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 Hr(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 pi=null;function um(e,t,n){if(pi===null){var l=new Map,s=pi=new Map;s.set(n,l)}else s=pi,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 d=c.getAttribute(t)||"";d=e+d;var h=l.get(d);h?h.push(c):l.set(d,[c])}}return l}function dm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function zp(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 fm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dp(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=vi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Pe(c);return}c=t.ownerDocument||t,l=rm(l),(s=Ot.get(s))&&Hr(l,s),c=c.createElement("link"),Pe(c);var d=c;d._p=new Promise(function(h,j){d.onload=h,d.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=vi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Yr=0;function Rp(e,t){return e.stylesheets&&e.count===0&&yi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&yi(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Yr===0&&(Yr=62500*hp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yi(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 vi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gi=null;function yi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gi=new Map,t.forEach(Op,e),gi=null,vi.call(e))}function Op(e,t){if(!(t.state.loading&4)){var n=gi.get(e);if(n)var l=n.get(null);else{n=new Map,gi.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var d=s[c];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}s=t.instance,d=s.getAttribute("data-precedence"),c=n.get(d)||l,c===l&&n.set(null,s),n.set(d,s),this.count++,l=vi.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:I,_currentValue2:I,_threadCount:0};function Up(e,t,n,l,s,c,d,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=qi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qi(0),this.hiddenUpdates=qi(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function mm(e,t,n,l,s,c,d,h,j,z,B,$){return e=new Up(e,t,n,d,j,z,B,$,h),t=1,c===!0&&(t|=24),c=bt(3,null,null,t),e.current=c,c.stateNode=e,t=jc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},_c(c),e}function hm(e){return e?(e=Ul,e):Ul}function xm(e,t,n,l,s,c){s=hm(s),l.context===null?l.context=s:l.pendingContext=s,l=Tn(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=Mn(e,l,t),n!==null&&(pt(n,e,t),za(n,e,t))}function pm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $r(e,t){pm(e,t),(e=e.alternate)&&pm(e,t)}function vm(e){if(e.tag===13||e.tag===31){var t=tl(e,67108864);t!==null&&pt(t,e,67108864),$r(e,67108864)}}function gm(e){if(e.tag===13||e.tag===31){var t=_t();t=Bi(t);var n=tl(e,t);n!==null&&pt(n,e,t),$r(e,t)}}var bi=!0;function qp(e,t,n,l){var s=T.T;T.T=null;var c=H.p;try{H.p=2,Xr(e,t,n,l)}finally{H.p=c,T.T=s}}function Bp(e,t,n,l){var s=T.T;T.T=null;var c=H.p;try{H.p=8,Xr(e,t,n,l)}finally{H.p=c,T.T=s}}function Xr(e,t,n,l){if(bi){var s=Vr(l);if(s===null)wr(e,t,l,ji,n),bm(e,l);else if(Hp(s,e,t,n,l))l.stopPropagation();else if(bm(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 d=Fn(c.pendingLanes);if(d!==0){var h=c;for(h.pendingLanes|=2,h.entangledLanes|=2;d;){var j=1<<31-gt(d);h.entanglements[1]|=j,d&=~j}Kt(c),(_e&6)===0&&(li=Be()+500,Ka(0))}}break;case 31:case 13:h=tl(c,2),h!==null&&pt(h,c,2),si(),$r(c,2)}if(c=Vr(l),c===null&&wr(e,t,l,ji,n),c===s)break;s=c}s!==null&&l.stopPropagation()}else wr(e,t,l,null,n)}}function Vr(e){return e=Zi(e),Qr(e)}var ji=null;function Qr(e){if(ji=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=g(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 ji=e,null}function ym(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(Kn()){case Jn:return 2;case To:return 8;case us:case _h:return 32;case Mo:return 268435456;default:return 32}default:return 32}}var Zr=!1,Ln=null,Hn=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 bm(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":Hn=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&&vm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Hp(e,t,n,l,s){switch(t){case"focusin":return Ln=ls(Ln,e,t,n,l,s),!0;case"dragenter":return Hn=ls(Hn,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 jm(e){var t=kl(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,Ro(e.priority,function(){gm(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Ro(e.priority,function(){gm(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 Ni(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vr(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Qi=l,n.target.dispatchEvent(l),Qi=null}else return t=_l(n),t!==null&&vm(t),e.blockedOn=n,!1;t.shift()}return!0}function Nm(e,t,n){Ni(e)&&n.delete(t)}function Gp(){Zr=!1,Ln!==null&&Ni(Ln)&&(Ln=null),Hn!==null&&Ni(Hn)&&(Hn=null),Gn!==null&&Ni(Gn)&&(Gn=null),ts.forEach(Nm),ns.forEach(Nm)}function Si(e,t){e.blockedOn===t&&(e.blockedOn=null,Zr||(Zr=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Gp)))}var ki=null;function Sm(e){ki!==e&&(ki=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ki===e&&(ki=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(Qr(l||n)===null)continue;break}var c=_l(n);c!==null&&(e.splice(t,3),t-=3,Vc(c,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function ia(e){function t(j){return Si(j,e)}Ln!==null&&Si(Ln,e),Hn!==null&&Si(Hn,e),Gn!==null&&Si(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);)jm(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],d=s[ut]||null;if(typeof c=="function")d||Sm(n);else if(d){var h=null;if(c&&c.hasAttribute("formAction")){if(s=c,d=c[ut]||null)h=d.formAction;else if(Qr(s)!==null)continue}else h=d.action;typeof h=="function"?n[l+1]=h:(n.splice(l,3),l-=3),Sm(n)}}}function km(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(d){return s=d})},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 Kr(e){this._internalRoot=e}_i.prototype.render=Kr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=_t();xm(n,l,e,t,null,null)},_i.prototype.unmount=Kr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xm(e.current,2,null,e,null,null),si(),t[Sl]=null}};function _i(e){this._internalRoot=e}_i.prototype.unstable_scheduleHydration=function(e){if(e){var t=Do();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&&jm(e)}};var _m=r.version;if(_m!=="19.2.4")throw Error(o(527,_m,"19.2.4"));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=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Yp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ei=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ei.isDisabled&&Ei.supportsFiber)try{fa=Ei.inject(Yp),vt=Ei}catch{}}return ss.createRoot=function(e,t){if(!f(e))throw Error(o(299));var n=!1,l="",s=Cd,c=zd,d=Dd;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&&(d=t.onRecoverableError)),t=mm(e,1,!1,null,null,n,l,null,s,c,d,km),e[Sl]=t.current,Ar(e),new Kr(t)},ss.hydrateRoot=function(e,t,n){if(!f(e))throw Error(o(299));var l=!1,s="",c=Cd,d=zd,h=Dd,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&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(h=n.onRecoverableError),n.formState!==void 0&&(j=n.formState)),t=mm(e,1,!0,t,n??null,l,s,j,c,d,h,km),t.context=hm(null),n=t.current,l=_t(),l=Bi(l),s=Tn(l),s.callback=null,Mn(n,s,l),n=l,t.current.lanes=n,ha(t,n),Kt(t),e[Sl]=t.current,Ar(e),new _i(t)},ss.version="19.2.4",ss}var Om;function e0(){if(Om)return Ir.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(),Ir.exports=Pp(),Ir.exports}var t0=e0();const pl="/dashboard";function Um(){const i=window.location.pathname;return i===pl||i===pl+"/"?"/":i.startsWith(pl+"/")?i.slice(pl.length):i||"/"}function vn(i){return i==="/"||i===""?pl+"/":pl+(i.startsWith("/")?i:"/"+i)}function cs(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,f;if(i.defaultPrevented||i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;const r=(f=(o=i.target)==null?void 0:o.closest)==null?void 0:f.call(o,"a");if(!r)return;const u=r.getAttribute("href");u&&(r.hasAttribute("target")||r.hasAttribute("download")||u.startsWith(pl)&&(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 ch(){const[i,r]=k.useState(Um());return k.useEffect(()=>{const u=()=>r(Um());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),i}function n0(i){let r=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");r=r.replace(/```(\w*)\n?([\s\S]*?)```/g,(m,g,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 f=!1;for(let m=0;m<u.length;m++){const g=u[m],p=g.match(/^###\s+(.+)$/),x=g.match(/^##\s+(.+)$/),v=g.match(/^#\s+(.+)$/);if(p){f&&(o.push("</ul>"),f=!1),o.push(`<h3 class="md-h3">${p[1]}</h3>`);continue}if(x){f&&(o.push("</ul>"),f=!1),o.push(`<h2 class="md-h2">${x[1]}</h2>`);continue}if(v){f&&(o.push("</ul>"),f=!1),o.push(`<h1 class="md-h1">${v[1]}</h1>`);continue}const b=g.match(/^(\s*)[*-]\s+(.+)$/);if(b){f||(o.push('<ul class="md-list">'),f=!0),o.push(`<li>${b[2]}</li>`);continue}if(g.trim()===""){f&&(o.push("</ul>"),f=!1),o.push("");continue}f&&(o.push("</ul>"),f=!1),o.push(g)}return f&&o.push("</ul>"),o.join(`
|
|
51
|
+
`)}function Ri(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 f=!1;for(const m of u){const g=m.match(/^###\s+(.+)$/),p=m.match(/^##\s+(.+)$/),x=m.match(/^#\s+(.+)$/);if(g){f&&(o.push("</ul>"),f=!1),o.push(`<h3 class="md-h3">${g[1]}</h3>`);continue}if(p){f&&(o.push("</ul>"),f=!1),o.push(`<h2 class="md-h2">${p[1]}</h2>`);continue}if(x){f&&(o.push("</ul>"),f=!1),o.push(`<h1 class="md-h1">${x[1]}</h1>`);continue}const v=m.match(/^(\s*)[*-]\s+(.+)$/);if(v){f||(o.push('<ul class="md-list">'),f=!0),o.push(`<li>${v[2]}</li>`);continue}if(m.trim()===""){f&&(o.push("</ul>"),f=!1),o.push("");continue}f&&(o.push("</ul>"),f=!1),o.push(m)}return f&&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 l0(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 qm=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],Bm={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function yl(i){if(Bm[i])return Bm[i];let r=0;for(let u=0;u<i.length;u++)r=r*31+i.charCodeAt(u)>>>0;return qm[r%qm.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 a0(i){return i==null||i<=0?"—":i<1e3?`${i}ms`:i<6e4?`${(i/1e3).toFixed(1)}s`:`${(i/6e4).toFixed(1)}m`}function hl({value:i,unit:r,label:u,valueClass:o="",valueColor:f,pulse:m,tooltip:g}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":g,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:f?{color:f}:void 0,children:i}),r&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:r})]}),a.jsx("div",{className:"mt-1.5 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--text-dim)"},children:u})]})}function s0({overview:i,activeTasks:r,mode:u="dense",showActivity:o}){const f=i.relayCount+i.nativeCount,m=i.tasksCompleted+i.tasksFailed>0?Math.round(i.tasksCompleted/(i.tasksCompleted+i.tasksFailed)*100):null,g=i.totalFindings>0?Math.round(i.confirmedFindings/i.totalFindings*100):0,p=u==="calm",x=o??!p,v=p&&f===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"]})]}),v?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(hl,{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(hl,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--text-dim)",pulse:r>0})}),a.jsx(hl,{value:`${g}%`,label:"Confirmed",valueClass:g>=50?"text-confirmed":g>0?"text-unverified":"",valueColor:g===0?"var(--text-dim)":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:"font-mono text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--text-dim)"},"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:"font-mono text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--text-dim)"},"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(--text-dim)"},children:i.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--text-dim)"},"data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:"var(--text-dim)"},children:f})]})]}),a.jsx(hl,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--text-dim)",pulse:r>0}),a.jsx(hl,{value:i.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(hl,{value:`${g}%`,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/30","aria-label":"View actionable findings on Signals page",children:a.jsx(hl,{value:i.actionableFindings,label:"Actionable",valueClass:i.actionableFindings>0?"text-orange-400":"",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(--text-dim)"},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(--text-dim)"},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(--text-dim)"},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(--text-dim)"},children:"avg duration"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:a0(i.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text-dim)"},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(--text-dim)"}:void 0,children:m===null?"—":`${m}%`})]})]}),x&&a.jsx(i0,{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(--text-dim) 60%, transparent)"},children:["last consensus ",We(i.lastConsensusTimestamp)]})]})}function i0({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:"mb-2 font-mono text-[9px] font-bold uppercase tracking-wider",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:r.map((o,f)=>{const m=11-f,g=o/u*100,p=f===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,g)}%`},"data-tooltip":`${x}
|
|
54
|
+
${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},f)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const $t=24,rh=3600*1e3,c0=$t*rh;function r0(i,r,u){const o=new Map;for(const m of r)o.set(m.id,new Array($t).fill(0));const f=u-c0;for(const m of i){if(m.retracted)continue;const g=Date.parse(m.timestamp);if(isNaN(g)||g<f||g>u)continue;const p=Math.min($t-1,Math.floor((g-f)/rh));for(const x of m.signals??[]){const v=o.get(x.agentId);v&&(v[p]+=1)}}return o}function o0(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 u0={0:.18,1:.35,2:.55,3:.78,4:1};function oh(i){switch(i){case"sonnet-reviewer":return"#8C5E97";case"sonnet-designer":return"#C8A45A";case"sonnet-implementer":return"#A53A4A";case"opus-implementer":return"#C97056";case"gemini-reviewer":return"#3F8B86";case"gemini-tester":return"#2F7D5B";case"haiku-researcher":return"#6B7A85";default:return"#6B6862"}}function d0({agents:i,runs:r,loading:u=!1,error:o=null}){const f=Date.now(),m=k.useMemo(()=>r0(r??[],i,f),[r,i]),g=k.useMemo(()=>{const x=new Map;for(const[v,b]of m)x.set(v,b.reduce((S,O)=>S+O,0));return x},[m]),p=k.useMemo(()=>{let x=0;for(const v of g.values())x+=v;return x},[g]);return u&&i.length===0?a.jsx(Ti,{error:null,fleetTotal:null,children:Array.from({length:4}).map((x,v)=>a.jsx(f0,{},v))}):i.length===0?a.jsx(Ti,{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."]})}):p===0?a.jsxs(Ti,{error:o,fleetTotal:0,children:[i.map(x=>a.jsx(m0,{agent:x},x.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:"No active dispatches — fleet idle."})]}):a.jsx(Ti,{error:o,fleetTotal:p,children:i.map(x=>{const v=m.get(x.id)??new Array($t).fill(0),b=Math.max(0,...v),S=g.get(x.id)??0,O=p>0?Math.round(S/p*100):0,X=oh(x.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:X,boxShadow:`0 0 4px ${X}80`}}),a.jsx("span",{className:"truncate",children:x.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${$t}, 1fr)`},role:"img","aria-label":`${x.id} 24h activity — ${S} signals`,children:v.map((L,V)=>{const A=o0(L,b);return a.jsx("div",{className:"rounded-sm",title:`hour ${V}: ${L} signal${L===1?"":"s"}`,style:{background:A===0?"var(--surface-sunk)":X,opacity:u0[A]}},V)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[S,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[O,"%"]})]})]},x.id)})})}function Ti({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(${$t}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:$t}).map((o,f)=>a.jsx("span",{className:"text-center",children:f%2===0?String(f).padStart(2,"0"):""},f))}),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 f0(){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(${$t}, 1fr)`},children:Array.from({length:$t}).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 m0({agent:i}){const r=oh(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(${$t}, 1fr)`},children:Array.from({length:$t}).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 So="/dashboard/api";async function Xe(i,r){const u=await fetch(`${So}/${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 h0(i){try{const r=await fetch(`${So}/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 x0(){try{return(await fetch(`${So}/overview`,{credentials:"include"})).ok}catch{return!1}}const p0=7200*1e3;function v0(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 g0({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 Xe("active-tasks");p||(u(S.tasks||[]),i==null||i(((b=S.tasks)==null?void 0:b.length)||0))}catch{}};x();const v=setInterval(x,5e3);return()=>{p=!0,clearInterval(v)}},[i]),k.useEffect(()=>{if(r.length===0)return;const p=setInterval(()=>o(x=>x+1),1e3);return()=>clearInterval(p)},[r.length]);const f=Date.now(),m=r.filter(p=>f-new Date(p.startedAt).getTime()<p0),g=r.length-m.length;return m.length===0?g===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:[g," stale task",g===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"]}),g>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",g," 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:v0(p.startedAt)})]},p.taskId))})]})}function y0(i,r,u,o){const f=Math.max(0,Math.min(.9999,o)),m=-Math.PI/2,g=m+f*2*Math.PI,p=i+u*Math.cos(m),x=r+u*Math.sin(m),v=i+u*Math.cos(g),b=r+u*Math.sin(g),S=f>.5?1:0;return`M ${p.toFixed(2)} ${x.toFixed(2)} A ${u} ${u} 0 ${S} 1 ${v.toFixed(2)} ${b.toFixed(2)}`}function b0(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 j0({accuracy:i,size:r=90,color:u="var(--ink)"}){const o=Number.isFinite(i)?Math.max(0,Math.min(1,i)):0,f=r/2,m=r/2,g=r*.089,p=(r-g)/2-2,x=Math.round(o*100),v=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:b0(f,m,p),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:g,strokeLinecap:"round"}),o>0&&a.jsx("path",{d:y0(f,m,p,o),fill:"none",stroke:u,strokeWidth:g,strokeLinecap:"round"}),a.jsxs("text",{x:f,y:m,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:v,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 Lm={critical:"var(--bad)",high:"var(--warn)",medium:"var(--info)",low:"var(--idle)"},Hm=["critical","high","medium","low"];function N0({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,f=`critical: ${u.critical}, high: ${u.high}, medium: ${u.medium}, low: ${u.low}`;return o===0?a.jsx("div",{title:`${f} (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:Hm.map(m=>a.jsx("div",{style:{flex:1,background:Lm[m],opacity:.4}},m))}):a.jsx("div",{title:f,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",width:"100%"},children:Hm.map(m=>{const g=u[m];if(g===0)return null;const p=g/o*100;return a.jsx("div",{style:{width:`${p.toFixed(2)}%`,background:Lm[m],flexShrink:0}},m)})})}function S0(i){return i.map(r=>r.signals)}function k0(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),f=r/(i.length-1),m=i.map((x,v)=>{const b=(v*f).toFixed(2),S=(u-x/o*u).toFixed(2);return`${b},${S}`}),g=`M ${m.join(" L ")}`,p=`M 0,${u} L ${m.join(" L ")} L ${((i.length-1)*f).toFixed(2)},${u} Z`;return{line:g,area:p}}const _0=5,xo=999;function E0(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),f=b=>b.reduce((S,O)=>S+O.signals,0),m=f(u),g=f(o);if(m<_0)return null;const p=m/u.length,x=g/o.length,v=Math.round((x-p)/p*100);return Math.max(-xo,Math.min(xo,v))}function T0({points:i,width:r=80,height:u=20,reducedMotion:o=!1,color:f="var(--c1)"}){const m=k.useMemo(()=>S0(i),[i]),{line:g,area:p}=k.useMemo(()=>k0(m,r,u),[m,r,u]),x=k.useMemo(()=>E0(i),[i]),v=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&&!v&&p&&a.jsx("path",{d:p,fill:f,fillOpacity:.3}),a.jsx("path",{d:g,fill:"none",stroke:v?"var(--idle)":f,strokeOpacity:v?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),x!==null&&!v&&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 ko(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 M0(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 A0(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 Gm({label:i,value:r,color:u,tooltip:o}){const f=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(f*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(f)})]})}function w0({agent:i,severityCounts:r,trendPoints:u}){var p;const o=i.scores,f=(p=i.lastTask)!=null&&p.timestamp?We(i.lastTask.timestamp):"",m=yl(i.id),g=A0(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":g.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:g.dotColor,flexShrink:0}}),g.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(j0,{accuracy:o.accuracy,size:90,color:m}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(N0,{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=ko(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","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","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","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(Gm,{label:"unique",value:o.uniqueness,color:m,tooltip:`Uniqueness ${po(o.uniqueness)}
|
|
55
|
+
Findings others missed.`}),a.jsx(Gm,{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(T0,{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"]}),f&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{children:f})]})]})]})]})]})]})}function C0({agents:i,highlightedAgentId:r,severityMap:u,trendByAgent:o}){const f=[...i].sort((p,x)=>{var X,L,V,A;const v=((X=p.lastTask)==null?void 0:X.timestamp)??"",b=((L=x.lastTask)==null?void 0:L.timestamp)??"";if(v!==b)return b.localeCompare(v);const S=((V=p.scores)==null?void 0:V.signals)||0,O=((A=x.scores)==null?void 0:A.signals)||0;return S!==O?O-S:p.id.localeCompare(x.id)}),m=f.slice(0,4),g=f.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})]}),g&&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(w0,{agent:p,severityCounts:u==null?void 0:u.get(p.id),trendPoints:o==null?void 0:o.get(p.id)})},p.id)})})]})}const z0=8;function D0(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 R0={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}},O0={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 U0(i){return i.length>8?i.slice(0,8):i}function q0(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 B0({tasks:i,limit:r=z0}){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((f,m)=>{const g=D0(f.status),p=R0[g],x=q0(f.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:O0[g]})}),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":f.taskId,children:U0(f.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":f.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:f.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:f.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(f.timestamp)})]},f.taskId)})})]})}const L0={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},H0={agreement:"var(--ok)",consensus_verified:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",unique_confirmed:"var(--info)",unique_unconfirmed:"var(--info)",new_finding:"var(--info)",unverified:"var(--info)"},G0={critical:"var(--bad)",high:"var(--warn)",medium:"var(--info)",low:"var(--ink-3)"},Y0={critical:5,high:4,medium:3,low:2};function $0(i,r){return i?i.length>r?i.slice(0,r-1)+"…":i:""}function X0(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 V0(){const[i,r]=k.useState(null),[u,o]=k.useState(null);k.useEffect(()=>{Xe("signals?limit=7").then(m=>r(m.items??[])).catch(m=>o(String((m==null?void 0:m.message)??m)))},[]);const f=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"}),f>0&&a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--info)"},children:["+",f," in last hour"]})]}),a.jsx("button",{type:"button",onClick:()=>cs("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[u&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"unavailable"}),!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.jsxs("table",{className:"w-full",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-3 text-left",style:{fontSize:10},children:"finding"}),a.jsx("th",{className:"h-section py-2 pl-3 pr-4 text-right",style:{fontSize:10,width:60},children:"conf"})]})}),a.jsx("tbody",{children:i.map((m,g)=>{const p=m.severity?G0[m.severity]:"transparent",x=H0[m.signal]??"var(--ink-2)",v=L0[m.signal]??m.signal,b=m.severity?Y0[m.severity]:1;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:v,children:v})]})}),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-3 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:X0($0(m.evidence??"",120))}),a.jsxs("td",{className:"py-2.5 pl-3 pr-4 align-middle text-right font-mono text-[12px] tabular-nums",style:{color:"var(--text-dim)"},children:[b,"/5"]})]},`${m.timestamp}-${g}`)})})]})]})]})}const to=[{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 Q0({overview:i}){const r=i==null?void 0:i.skillVerdictSummary,u=r?to.reduce((o,f)=>o+(r[f.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:to.map(o=>{const f=r[o.key]??0;if(f===0)return null;const m=f/u*100;return a.jsx("div",{style:{width:`${m}%`,background:o.color},title:`${o.label}: ${f}`},o.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:to.map(o=>{const f=r[o.key]??0,m=f===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:f})]},o.key)})})]})]})}const xl=1,no=2,Z0=5;function K0({curve:i,threshold:r,stroke:u,width:o=140,height:f=30}){const m=k.useMemo(()=>F0(i),[i]),g=m.reduce((O,X)=>O+X.length,0);if(i.length===0||g<Z0)return a.jsx(J0,{width:o,height:f});const p=o-xl*2,x=f-no*2,v=no+(1-Ym(r))*x,b=O=>i.length<=1?xl+p/2:xl+O/(i.length-1)*p,S=O=>no+(1-Ym(O))*x;return a.jsxs("svg",{width:o,height:f,viewBox:`0 0 ${o} ${f}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:xl,x2:o-xl,y1:v,y2:v,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),m.map((O,X)=>{if(O.length===1){const{idx:V,value:A}=O[0];return a.jsx("circle",{cx:b(V),cy:S(A),r:1.4,fill:u},X)}const L=O.map((V,A)=>`${A===0?"M":"L"} ${b(V.idx).toFixed(2)} ${S(V.value).toFixed(2)}`).join(" ");return a.jsx("path",{d:L,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},X)})]})}function J0({width:i,height:r}){const u=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:xl,x2:i-xl,y1:u,y2:u,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.5})})}function F0(i){const r=[];let u=[];for(let o=0;o<i.length;o++){const f=i[o].value;if(f==null||!Number.isFinite(f)){u.length>0&&(r.push(u),u=[]);continue}u.push({idx:o,value:f})}return u.length>0&&r.push(u),r}function Ym(i){return!Number.isFinite(i)||i<0?0:i>1?1:i}const uh={passed:"var(--ok)",pending:"var(--info)",insufficient_evidence:"var(--idle)",inconclusive:"var(--warn)",silent_skill:"var(--ink-3)",failed:"var(--bad)"},I0={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed"},W0="var(--ink-4)";function Ci(i){return i!=null&&i in uh}function P0({skills:i,loading:r,error:u}){const{known:o,unknown:f,total:m,transitions:g}=k.useMemo(()=>ev(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 · ",g," transitions /24h"]})]}),a.jsx("a",{href:vn("/"),className:"font-mono text-[11px] transition hover:underline",style:{color:"var(--ink-3)"},children:"skill detail →"})]}),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."}),u&&a.jsx(av,{message:u}),r&&!i&&a.jsx(sv,{}),!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",children:o.map(x=>a.jsx(Xm,{entry:x},$m(x)))}),f.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:[f.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:f.map(x=>a.jsx(Xm,{entry:x},$m(x)))}),a.jsx("style",{children:`
|
|
57
|
+
details[open] > summary > .chevron { transform: rotate(90deg); }
|
|
58
|
+
`})]})]})]})}function $m(i){return`${i.agentId}::${i.skill}`}function ev(i){if(!i)return{known:[],unknown:[],total:0,transitions:0};const r=[],u=[];let o=0;for(const m of i)if(Ci(m.status)?r.push(m):u.push(m),m.curve.length>=2){const g=m.curve.slice(-2),p=g.filter(v=>v.value!=null&&v.value>=m.threshold).length,x=g.filter(v=>v.value!=null&&v.value<m.threshold).length;p>=1&&x>=1&&o++}const f={failed:0,inconclusive:1,silent_skill:2,insufficient_evidence:3,pending:4,passed:5};return r.sort((m,g)=>{const p=Ci(m.status)?f[m.status]:99,x=Ci(g.status)?f[g.status]:99;return p!==x?p-x:m.skill.localeCompare(g.skill)}),u.sort((m,g)=>m.skill.localeCompare(g.skill)),{known:r,unknown:u,total:r.length+u.length,transitions:o}}function Xm({entry:i}){const r=Ci(i.status)?i.status:null,u=r?uh[r]:W0,o=r?I0[r]:i.status??"unknown",f=r==="passed"?nv(i.curve):null,m=lv(i.curve),g=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:yl(i.agentId)}}),a.jsx("span",{className:"truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:i.agentId})]})]}),a.jsx(K0,{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:[f!==null&&a.jsxs("span",{className:"font-mono text-[10px] tabular-nums",style:{color:f>0?"var(--ok)":f<0?"var(--bad)":"var(--ink-3)"},title:`Trend ${f>0?"up":f<0?"down":"flat"} ${Math.abs(f)} percentage points across the 7d window`,"aria-label":`Trend ${f>0?"up":f<0?"down":"flat"} ${Math.abs(f)} percentage points`,children:[f>0?"+":"",f,"pp"]}),a.jsxs("span",{className:"font-mono text-[10px] tabular-nums",style:{color:"var(--ink)"},title:`current ${g} · threshold ${p}`,children:[g,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 tv=4;function nv(i){const r=i.filter(u=>u.value!=null&&Number.isFinite(u.value));return r.length<tv?null:Math.round((r[r.length-1].value-r[0].value)*100)}function lv(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 av({message:i}){return a.jsxs("div",{className:"mb-3 rounded-sm px-2 py-1 font-mono text-[10px]",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:["error · ",i]})}function sv(){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 iv(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 cv{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),f=parseInt(i.slice(5,7),16);return`rgba(${u},${o},${f},${Math.max(0,Math.min(1,r))})`}function rv(i){const r=Math.max(0,i);return Math.min(1.4,Math.pow(r/2e3,.55))}class ov{constructor(r,u,o,f,m,g,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,f)),this.uniqueness=Math.max(0,Math.min(1,m)),this.impact=Math.max(0,Math.min(1,p)),this.colorHex=g;const v=iv(u);this.variant=v%12;const b=new cv(v),S=rv(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 g=m%2,p=r.next(),x=this.armSeeds[g]+p*Math.PI*2.4,v=r.range(-.04,.04)*Math.PI*2,b=x+v,S=(.08+p*.38)*this.size*this.scale;this.particles.push(this._mkParticle(r,S,b,1,1))}}else if(o===1)for(let f=0;f<u;f++){const m=r.range(.34,.42)*this.size*this.scale,g=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,m,g,1,1))}else if(o===2){const f=[.16,.28,.42];for(let m=0;m<u;m++){const g=m%3,p=(f[g]+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 f=.18*this.size*this.scale;this.binaryCenters=[{x:-f,y:0},{x:f,y:0}];for(let m=0;m<u;m++){const g=m%2,p=r.range(.04,.22)*this.size*this.scale,x=r.next()*Math.PI*2,v=this._mkParticle(r,p,x,1,1);v.binaryCore=g,v.angularVelocity*=g===0?1:-1,this.particles.push(v)}}else if(o===4)for(let f=0;f<u;f++){const m=r.range(.05,.32)*this.size*this.scale,g=r.next()*Math.PI*2,p=r.range(.7,1.3),x=r.range(.7,1.3),v=this._mkParticle(r,m,g,p,x);v.orbitTilt=r.range(0,Math.PI),this.particles.push(v)}else if(o===5){this.jetAxis=r.next()*Math.PI*2;const f=Math.floor(u*.7),m=u-f;for(let g=0;g<f;g++){const p=g%2===0?1:-1,x=r.next(),v=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=v,b.jetSpeed=r.range(.15,.35)*.001,b.size=r.range(.6,1.4),this.particles.push(b)}for(let g=0;g<m;g++){const p=r.range(.35,.42)*this.size*this.scale,x=r.next()*Math.PI*2,v=this._mkParticle(r,p,x,1,1);v.isDisk=!0,v.brightness*=.35,this.particles.push(v)}}else if(o===6)for(let f=0;f<u;f++){const m=r.next()*Math.PI*2,g=r.range(.05,.45)*this.size*this.scale,p=this._mkParticle(r,g,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 f=.1*this.size*this.scale,m=Math.floor(u*.3);for(let p=0;p<m;p++){const x=r.range(0,f),v=r.next()*Math.PI*2,b=this._mkParticle(r,x,v,1,1);b.size=r.range(.8,1.8),this.particles.push(b)}const g=u-m;for(let p=0;p<g;p++){const x=r.next(),v=f+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=v,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 f=0;f<u;f++){const m=f%3,g=r.range(.3,.42)*this.size*this.scale,p=r.next()*Math.PI*2,x=this._mkParticle(r,g,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 f=0;f<u;f++){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 f=0;f<u;f++){const m=f/u,g=r.range(.35,.4)*this.size*this.scale,p=m*Math.PI*2+r.range(-.03,.03),x=this._mkParticle(r,g,p,1,1);x.ouroT=m,this.particles.push(x)}else for(let f=0;f<u;f++){const m=f%2,g=r.next(),p=this._mkParticle(r,0,0,1,1);p.isHelix=!0,p.helixStrand=m,p.helixT=g,p.helixSpeed=r.range(.3,.6)*.001,this.particles.push(p)}}_mkParticle(r,u,o,f,m){const g=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:g*(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:f,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:f,uniqueness:m,impact:g,colorHex:p,variant:x}=this,v=u/2,b=u/2;r.clearRect(0,0,u,u);const S=.4+this.exp*.6,O=f*S,X=m*S,L=g*S,V=.2+O*.8,A=.3+L*1.9,W=X,Z=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),ee=1-Z,J=r.createRadialGradient(v,b,0,v,b,u*.45);if(J.addColorStop(0,ot(p,.05*V)),J.addColorStop(.4,ot(p,.015)),J.addColorStop(1,"transparent"),r.fillStyle=J,r.fillRect(0,0,u,u),x===0&&this.armSeeds){const M=o*5e-4*A;for(const q of this.armSeeds){const w=q+M;r.beginPath();for(let K=0;K<1;K+=.02){const le=w+K*Math.PI*2.4,ne=(.08+K*.38)*u*this.scale,de=v+Math.cos(le)*ne,F=b+Math.sin(le)*ne;K===0?r.moveTo(de,F):r.lineTo(de,F)}r.strokeStyle=ot(p,.12*V),r.lineWidth=1,r.stroke()}}for(const M of this.particles){const q=Math.sin(o*M.wobbleSpeed*.001+M.wobblePhase)*1.2,w=M.baseRadius+q,K=M.angle+o*M.angularVelocity*A;let le,ne;if(x===3&&this.binaryCenters){const F=this.binaryCenters[M.binaryCore];le=v+F.x+Math.cos(K)*w,ne=b+F.y+Math.sin(K)*w}else if(x===4){const F=Math.cos(M.orbitTilt),ae=Math.sin(M.orbitTilt),me=Math.cos(K)*w*M.ellipX,E=Math.sin(K)*w*M.ellipY;le=v+me*F-E*ae,ne=b+me*ae+E*F}else if(x===5&&M.jetSide!==void 0&&!M.isDisk&&this.jetAxis!==void 0){const F=(M.jetProgress+o*M.jetSpeed*A)%1,ae=F*.44*u*this.scale,me=this.jetAxis+Math.PI/2;le=v+Math.cos(this.jetAxis)*ae*M.jetSide+Math.cos(me)*M.jetSpread*ae,ne=b+Math.sin(this.jetAxis)*ae*M.jetSide+Math.sin(me)*M.jetSpread*ae,M._fadeMul=Math.sin(F*Math.PI)*.9+.1}else if(x===6&&M.isNebula){const F=o*M.driftSpeed*A,ae=Math.sin(F+M.driftPhase)*2;le=v+Math.cos(M.angle+F*.3)*w+Math.cos(M.driftAngle)*ae,ne=b+Math.sin(M.angle+F*.3)*w+Math.sin(M.driftAngle)*ae}else if(x===7&&M.isComet&&this.tailAngle!==void 0){const F=(M.cometT+o*3e-4*A)%1,ae=M.cometTailDist+F*.06*u*this.scale,me=this.tailAngle+Math.PI/2;le=v+Math.cos(this.tailAngle)*ae+Math.cos(me)*M.cometPerp,ne=b+Math.sin(this.tailAngle)*ae+Math.sin(me)*M.cometPerp}else if(x===8&&M.gyroAxis){const F=o*1e-4*A;M.gyroAxis==="z"?(le=v+Math.cos(K)*w,ne=b+Math.sin(K)*w*.3):M.gyroAxis==="x"?(le=v+Math.cos(K)*w*.3+Math.sin(F)*w*.1,ne=b+Math.sin(K)*w):(le=v+Math.sin(K+F)*w*.6,ne=b+Math.cos(K+F)*w*.8)}else if(x===9){const F=(o*5e-4*A+M.wobblePhase)%1,ae=w*(1-F*.85);le=v+Math.cos(K)*ae,ne=b+Math.sin(K)*ae,M._fadeMul=1-F}else if(x===10&&M.ouroT!==void 0){const F=(M.ouroT+o*3e-4*A)%1,ae=F*Math.PI*2;le=v+Math.cos(ae)*w,ne=b+Math.sin(ae)*w;const me=Math.cos(F*Math.PI*2)*.5+.5;M._fadeMul=.3+me*.9}else if(x===11&&M.helixT!==void 0){const F=(M.helixT+o*M.helixSpeed*A)%1,ae=(F-.5)*.65*u*this.scale,me=M.helixStrand===0?0:Math.PI,E=.15*u*this.scale,T=Math.sin(F*Math.PI*3+me)*E;le=v+T,ne=b+ae,M._fadeMul=.4+(Math.cos(F*Math.PI*3+me)+1)/2*.6}else le=v+Math.cos(K)*w*M.ellipX,ne=b+Math.sin(K)*w*M.ellipY;if(ee>.01){const F=o*M.chaosDriftSpeed,ae=Math.cos(F+M.chaosDriftPhase)*2,me=Math.sin(F*1.13+M.chaosDriftPhase)*2,E=v+M.chaosX+ae,T=b+M.chaosY+me;le=E*ee+le*Z,ne=T*ee+ne*Z}const de=M._fadeMul!==void 0?M._fadeMul:1;if(x<=4&&Z>.5){const F=2+Math.floor(g*3);for(let ae=0;ae<F;ae++){const me=M.angularVelocity*A*(ae+1)*80,E=K-me;let T,H;if(x===3&&this.binaryCenters){const ce=this.binaryCenters[M.binaryCore];T=v+ce.x+Math.cos(E)*w,H=b+ce.y+Math.sin(E)*w}else if(x===4){const ce=Math.cos(M.orbitTilt),ue=Math.sin(M.orbitTilt),y=Math.cos(E)*w*M.ellipX,R=Math.sin(E)*w*M.ellipY;T=v+y*ce-R*ue,H=b+y*ue+R*ce}else T=v+Math.cos(E)*w*M.ellipX,H=b+Math.sin(E)*w*M.ellipY;const I=(1-ae/F)*.3*M.brightness*V*Z;r.beginPath(),r.arc(T,H,M.size*(1-ae*.25),0,Math.PI*2),r.fillStyle=ot(p,I),r.fill()}}else if(x===6&&M.isNebula){const F=M.size*3,ae=r.createRadialGradient(le,ne,0,le,ne,F);ae.addColorStop(0,ot(p,M.brightness*V*.4)),ae.addColorStop(1,"transparent"),r.fillStyle=ae,r.beginPath(),r.arc(le,ne,F,0,Math.PI*2),r.fill()}r.beginPath(),r.arc(le,ne,M.size,0,Math.PI*2),r.fillStyle=ot(p,M.brightness*V*de),r.fill()}if(W>.05)for(let q=0;q<3;q++){const w=(o*7e-4*W+q*.33)%1;if(w>.5)continue;const K=(q*1.618*Math.PI+o*1e-4)%(Math.PI*2),le=u*.5*(1-w*1.6);if(le<3)continue;const ne=v+Math.cos(K)*le,de=b+Math.sin(K)*le,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 M=.9+.1*Math.sin(o*.003),q=(1+this.exp*9+f*2)*this.scale,w=Math.min(q*(3+g*2),u*.4),K=r.createRadialGradient(v,b,0,v,b,w);K.addColorStop(0,ot("#ffffff",.95*M*V)),K.addColorStop(.2,ot(p,.75*M*V)),K.addColorStop(.5,ot(p,.2*V)),K.addColorStop(1,"transparent"),r.fillStyle=K,r.beginPath(),r.arc(v,b,w,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(v,b,q*M,0,Math.PI*2),r.fillStyle=ot("#ffffff",.95),r.fill()}else if(this.binaryCenters)for(const M of this.binaryCenters){const q=v+M.x,w=b+M.y,K=(.8+this.exp*5+f*1.5)*this.scale,le=Math.min(K*3.5,u*.22),ne=r.createRadialGradient(q,w,0,q,w,le);ne.addColorStop(0,ot("#ffffff",.9*V)),ne.addColorStop(.3,ot(p,.6*V)),ne.addColorStop(1,"transparent"),r.fillStyle=ne,r.beginPath(),r.arc(q,w,le,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(q,w,K,0,Math.PI*2),r.fillStyle=ot("#ffffff",.9),r.fill()}}}const bl=globalThis,ca=new Set;let gl=0,ra=0;const uv=100;function dh(i){const r=ra===0?16:Math.min(uv,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?gl=bl.requestAnimationFrame(dh):(gl=0,ra=0)}function dv(){gl===0&&(ra=0,gl=bl.requestAnimationFrame(dh))}function fv(){gl!==0&&(bl.cancelAnimationFrame&&bl.cancelAnimationFrame(gl),gl=0,ra=0)}function mv(){return bl.matchMedia?bl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function fh(i){if(!bl.requestAnimationFrame)return()=>{};if(mv())return()=>{};ca.add(i),ca.size===1&&dv();let r=!1;return function(){r||(r=!0,ca.delete(i),ca.size===0&&fv())}}function os({agentId:i,size:r=64,animate:u=!0,signals:o=0,accuracy:f=.5,uniqueness:m=.5,impact:g=.5}){const p=k.useRef(null),x=k.useRef(null),v=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 X=yl(i),L=new ov(S,i,o,f,m,X,g);x.current=L,L.draw();const V=fh(A=>{v.current&&b.current&&(L.update(A),L.draw())});return()=>{V(),x.current=null}},[i,r,o,f,m,g]),k.useEffect(()=>{const S=p.current;if(!S)return;const O=new IntersectionObserver(([X])=>{v.current=X.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 hv(i){return i.hallucinationsCaught>0?"catch":i.disputed>0?"mixed":i.confirmed>0?"trust":null}function xv(i){return Math.max(1,Math.min(2.5,1+i*.15))}function rs(i,r){return i<=r?`${i}::${r}`:`${r}::${i}`}const pv=new Set(["agreement","unique_confirmed","impl_peer_approved"]),vv=new Set(["disagreement","impl_peer_rejected"]),gv=new Set(["hallucination_caught"]);function yv(i){const r=new Map,u=new Map;for(const o of i)if(!o.retracted)for(const f of o.signals){if(!f.counterpartId||!f.agentId)continue;const m=pv.has(f.signal),g=vv.has(f.signal),p=gv.has(f.signal);if(!m&&!g&&!p)continue;const x=rs(f.agentId,f.counterpartId);let v=r.get(x);v||(v={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:o.timestamp},r.set(x,v)),m&&(v.confirmed+=1),g&&(v.disputed+=1),p&&(v.hallucinationsCaught+=1);let b=u.get(x);b||(b=new Set,u.set(x,b)),b.has(o.taskId)||(b.add(o.taskId),v.rounds+=1),o.timestamp>v.lastInteraction&&(v.lastInteraction=o.timestamp)}return r}function zi(i){return i>=2e3?84:i>=800?72:i>=200?60:48}function bv(i,r,u){var b;const o={x:r/2,y:u/2},m=Math.max(80,Math.min(r,u)/2-24),g=new Map;if(i.length===0)return g;const p=[...i].sort((S,O)=>{var V,A;const X=((V=O.scores)==null?void 0:V.accuracy)??0,L=((A=S.scores)==null?void 0:A.accuracy)??0;return X!==L?L-X:S.id.localeCompare(O.id)}),x=p.length,v=Math.PI*(3-Math.sqrt(5));for(let S=0;S<x;S++){const O=p[S],X=jv(((b=O.scores)==null?void 0:b.accuracy)??0,0,1),L=Math.max(m*.22,(1-X)*m),V=-Math.PI/2+S*v;g.set(O.id,{x:o.x+L*Math.cos(V),y:o.y+L*Math.sin(V),role:"fleet",angle:V})}return g}function jv(i,r,u){return Math.min(Math.max(i,r),u)}function Vm(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 Nv({width:i,height:r,agentPositions:u}){const o=k.useRef(null),f=k.useRef([]),m=k.useRef([]);k.useEffect(()=>{if(i<=0||r<=0)return;const p=Vm(7311),x=170;f.current=Array.from({length:x},()=>{const v=p();let b,S;return v<.07?(b=2+p()*.6,S=.75+p()*.25):v<.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=Vm(919),x=60,v=90,b=1.5,S=1.8;let O=0;const L=fh(V=>{const A=V/1e3;O+=A;const W=f.current,Z=m.current;for(let ee=0;ee<W.length;ee++){const J=W[ee];if(J.consumed===null)for(let q=0;q<u.length;q++){const w=u[q].x-J.x,K=u[q].y-J.y;if(w*w+K*K<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,K=q.y-J.y,le=Math.sqrt(w*w+K*K)||1,ne=Math.min(le,v*A);J.x+=w/le*ne,J.y+=K/le*ne,J.o=Math.max(0,J.o-b*A),J.r=Math.max(0,J.r-S*A)}if(J.o<=.01||J.r<=.1){let w=0,K=0,le=!1;for(let ne=0;ne<8;ne++){w=p()*i,K=p()*r,le=!0;for(const de of u){const F=de.x-w,ae=de.y-K;if(F*F+ae*ae<x*x*1.5){le=!1;break}}if(le)break}J.x=w,J.y=K,J.r=J.baseR,J.o=J.baseO,J.consumed=null}}const M=Z[ee];M&&(M.setAttribute("cx",String(J.x)),M.setAttribute("cy",String(J.y)),M.setAttribute("r",String(J.r)),M.setAttribute("opacity",String(J.o)))}});return()=>L()},[i,r,u]);const g=f.current;return a.jsx("svg",{ref:o,width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:g.map((p,x)=>a.jsx("circle",{ref:v=>{m.current[x]=v},cx:p.x,cy:p.y,r:p.r,fill:"#F2EDE3",opacity:p.o},x))})}function Sv({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 kv(){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 _v({width:i,height:r,hideLabels:u=!1}){const o=i/2,f=r/2,g=Math.max(80,Math.min(i,r)/2-40),p=[{r:g,accLabel:"0%"},{r:g*.75,accLabel:"25%"},{r:g*.5,accLabel:"50%"},{r:g*.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:v})=>a.jsxs("g",{children:[a.jsx("circle",{cx:o,cy:f,r:x,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:o+6,y:f-x-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:v})]},v))})}function Ev(i,r,u,o,f){const m={x:o/2,y:f/2},g=new Map;g.set(i,{x:m.x,y:m.y,role:"center"});const p=[];for(const X of r){if(X===i)continue;const L=u.get(rs(i,X));L&&p.push({id:X,rel:L})}const x=Math.max(1,...p.map(X=>X.rel.rounds)),v=Math.max(120,Math.min(o,f)*.2),b=Math.min(o,f)*.42,S=p.slice().sort((X,L)=>X.id.localeCompare(L.id)),O=S.length;for(let X=0;X<O;X++){const{id:L,rel:V}=S[X],A=X/Math.max(1,O)*Math.PI*2-Math.PI/2,W=V.rounds/x,Z=b-W*(b-v);g.set(L,{x:m.x+Z*Math.cos(A),y:m.y+Z*Math.sin(A),role:"peer"})}for(const X of r)g.has(X)||g.set(X,{x:m.x,y:m.y,role:"hidden"});return g}function Tv({agents:i,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:f=420}){if(i.length===0)return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:f,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:f,background:"var(--stage-bg)",borderColor:"var(--border)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-block",children:a.jsx(os,{agentId:m.id,signals:m.scores.signals,accuracy:m.scores.accuracy,uniqueness:m.scores.uniqueness,impact:m.scores.impactScore,size:zi(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(Mv,{agents:i,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:f})}function Mv({agents:i,peerRelationships:r,selectedAgentId:u,onSelectAgent:o,height:f=420}){const m=k.useRef(null),[g,p]=k.useState(800),[x,v]=k.useState(f),[b,S]=k.useState(0);k.useEffect(()=>{const A=m.current;if(!A)return;const W=new ResizeObserver(([Z])=>{const ee=Z.contentRect.width,J=Z.contentRect.height;ee>0&&p(ee),J>0&&v(J)});return W.observe(A),()=>W.disconnect()},[]);const O=k.useMemo(()=>{const A=i.map(W=>W.id);return u&&A.includes(u)?Ev(u,A,r,g,x):bv(i,g,x)},[i,r,u,g,x]),X=k.useMemo(()=>{if(!u)return[];const A=O.get(u);if(!A)return[];const W=[];for(const ee of i){if(ee.id===u)continue;const J=O.get(ee.id);if(!J||J.role!=="peer")continue;const M=r.get(rs(u,ee.id));if(!M)continue;const q=hv(M);q&&W.push({peerId:ee.id,x1:A.x,y1:A.y,x2:J.x,y2:J.y,cls:q,width:xv(M.rounds),rounds:M.rounds})}const Z={mixed:0,trust:1,catch:2};return W.sort((ee,J)=>Z[ee.cls]-Z[J.cls]),W},[i,r,u,O]),L=u?X.length:0,V=k.useMemo(()=>{const A=[];for(const W of i){const Z=O.get(W.id);Z&&A.push({x:Z.x,y:Z.y})}return A},[i,O]);return a.jsxs("div",{ref:m,className:"relative overflow-hidden rounded-lg border",style:{minHeight:f,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(Nv,{width:g,height:x,agentPositions:V}),a.jsx(_v,{width:g,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:X.map(A=>{const W=i.find(T=>T.id===u),Z=i.find(T=>T.id===A.peerId);if(!W||!Z)return null;const ee=zi(W.scores.signals)/2,J=zi(Z.scores.signals)/2,M=A.x2-A.x1,q=A.y2-A.y1,w=Math.max(1,Math.hypot(M,q)),K=M/w,le=q/w,ne=A.x1+K*ee,de=A.y1+le*ee,F=A.x2-K*J,ae=A.y2-le*J,me=A.cls==="trust"?"var(--success)":A.cls==="mixed"?"var(--warn)":"var(--danger)",E=A.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:ne,y1:de,x2:F,y2:ae,stroke:me,strokeWidth:A.width,strokeDasharray:E,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},A.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:g/2,top:x/2,cursor:"pointer"},onClick:A=>{A.stopPropagation(),S(W=>W+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(Sv,{variant:(b-1)%4},b),b>0&&a.jsx(kv,{},`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(A=>{const W=O.get(A.id);if(!W)return null;const Z=zi(A.scores.signals),ee=W.role==="center",J=W.role==="hidden",M=W.role==="peer",q=J?0:1,w=ee?"#F2EDE3":"var(--stage-text-dim)",K=W.angle??Math.PI/2,le=Z/2+14,ne=Math.cos(K)*le,de=Math.sin(K)*le,F=Math.abs(Math.cos(K))>.7?Math.cos(K)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:ae=>{ae.stopPropagation(),o(A.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:W.x,top:W.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 ${A.id}`,title:A.id,children:[a.jsx("div",{className:"rounded-full",style:{width:Z,height:Z,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(os,{agentId:A.id,signals:A.scores.signals,accuracy:A.scores.accuracy,uniqueness:A.scores.uniqueness,impact:A.scores.impactScore,size:Z})}),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:A.id}),M&&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(rs(u??"",A.id));return ae?`${ae.rounds} round${ae.rounds===1?"":"s"}`:""})()})]},A.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 Qm(i){const r=new URLSearchParams(i).get("agent");return r&&r.length>0?r:null}function Av(i,r,u){const o=new URLSearchParams(r);u===null?o.delete("agent"):o.set("agent",u);const f=o.toString();return f.length>0?`${i}?${f}`:i}function mh(i){const r=globalThis;if(typeof r.window>"u")return;const u=r.window,o=Av(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 wv({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(Dv,{agent:i,peerRelationships:u,agents:r}):a.jsx(Cv,{agents:r,peerRelationships:u})})}function Cv({agents:i,peerRelationships:r}){const u=[...i].filter(m=>m.scores.signals>0).sort((m,g)=>g.scores.accuracy-m.scores.accuracy).slice(0,3),o=[];for(const[m,g]of r.entries())if(g.hallucinationsCaught>0){const[p,x]=m.split("::");o.push({pair:[p,x],catches:g.hallucinationsCaught,ts:g.lastInteraction})}o.sort((m,g)=>new Date(g.ts).getTime()-new Date(m.ts).getTime());const f=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(--text-faint)"},children:"Click a node to see detail."}),a.jsx(Zm,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(vo,{text:"No agent has logged a signal yet."}):u.map(m=>a.jsxs("button",{type:"button",onClick:()=>mh(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(--text-dim)"},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(Zm,{label:"Recent hallucination catches",tone:"danger",children:f.length===0?a.jsx(vo,{text:"No catches in the active window."}):f.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(--text-dim)"},children:[m.catches," caught · ",zv(m.ts)]})]},`${m.pair[0]}::${m.pair[1]}`))})]})}function Zm({label:i,tone:r,children:u}){const o=r==="success"?"var(--success)":r==="danger"?"var(--danger)":"var(--text-faint)";return a.jsxs("section",{className:"mb-4",children:[a.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[11px] font-bold uppercase tracking-wider",style:{color:o},children:[a.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:o,display:"inline-block"}}),i]}),a.jsx("div",{className:"space-y-1",children:u})]})}function vo({text:i}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--text-faint)"},children:i})}function zv(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 Dv({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)"},f=[];for(const g of u){if(g.id===i.id)continue;const p=r.get(rs(i.id,g.id));if(!p)continue;const x=p.confirmed+p.disputed+p.hallucinationsCaught;f.push({other:g.id,rel:p,total:x})}f.sort((g,p)=>p.total-g.total);const m=f.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(os,{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(Mi,{label:"Accuracy",value:`${Math.round(i.scores.accuracy*100)}%`}),a.jsx(Mi,{label:"Reliability",value:i.scores.taskCompletionRate==null?"—":`${Math.round(i.scores.taskCompletionRate*100)}%`}),a.jsx(Mi,{label:"Signals",value:i.scores.signals.toLocaleString()}),a.jsx(Mi,{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(vo,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:m.map(({other:g,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:g}),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"]})]})]},g))})]}),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(g=>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:g},g))})]}),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 Mi({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:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-faint)"},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(--text-faint)":"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(--text-dim)"},children:r})]})}let Ut=null,Ai=3e3,so=null;const go=new Set;function hh(){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=()=>{Ai=3e3},Ut.onmessage=r=>{try{const u=JSON.parse(r.data);go.forEach(o=>o(u))}catch{}},Ut.onclose=()=>{Ut=null,so&&clearTimeout(so),so=setTimeout(()=>{Ai=Math.min(Ai*1.5,3e4),hh()},Ai)},Ut.onerror=()=>{}}function xh(i){return go.add(i),()=>go.delete(i)}function ph(i){const r=k.useRef(i);r.current=i,k.useEffect(()=>(hh(),xh(u=>r.current(u))),[])}const Rv=6e4;function Ov(){const[i,r]=k.useState(null),[u,o]=k.useState(null),f=k.useRef(null),m=()=>{r(null),o(null),f.current!=null&&(window.clearTimeout(f.current),f.current=null)};if(ph(p=>{if(p.type==="task_dispatched"){r(p.taskId),o(p.agentId),f.current!=null&&window.clearTimeout(f.current),f.current=window.setTimeout(m,Rv);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 g=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:g}),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 vl=24,Uv={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function vh(i){return Uv[i]}function qv(i,r,u){const o=vh(r),f=o/vl,m=u-o,g=new Array(vl).fill(0);for(const p of i){const x=new Date(p).getTime();if(!Number.isFinite(x)||x<m||x>u)continue;const v=x-m;let b=Math.floor(v/f);b>=vl&&(b=vl-1),g[b]+=1}return g}const Bv=["1h","24h","7d","30d"],Lv={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function Hv({runs:i,range:r,onRangeChange:u,height:o=52}){const[f,m]=k.useState(()=>Date.now());k.useEffect(()=>{const x=vh(r)/vl,v=window.setInterval(()=>m(Date.now()),x);return()=>window.clearInterval(v)},[r]);const g=k.useMemo(()=>{var v;const x=[];for(const b of i){const S=((v=b.signals)==null?void 0:v.length)??0;for(let O=0;O<S;O++)x.push(b.timestamp)}return qv(x,r,f)},[i,r,f]),p=Math.max(1,...g);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:Bv.map(x=>{const v=x===r;return a.jsx("button",{type:"button",onClick:()=>u(x),"aria-pressed":v,className:"rounded px-2 py-0.5 font-mono text-[10px] transition",style:{background:v?"color-mix(in oklch, var(--accent) 10%, transparent)":"transparent",color:v?"var(--accent)":"var(--text-dim)",border:"1px solid",borderColor:v?"color-mix(in oklch, var(--accent) 30%, transparent)":"transparent"},children:x},x)})})]}),a.jsxs("svg",{viewBox:`0 0 ${vl} 1`,preserveAspectRatio:"none",style:{width:"100%",height:o,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:vl,height:.015,fill:"var(--ink)",opacity:.08}),g.map((x,v)=>{const b=x===0?0:x/p,S=1-b;return a.jsx("rect",{x:v+.15,y:S,width:.7,height:Math.max(b,x>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:x===0?0:.9},v)})]}),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:Lv[r]}),a.jsx("span",{children:"now"})]})]})}function Gv(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 Yv(i){const r=k.useRef(""),u=k.useRef(new Map);return k.useMemo(()=>{const o=yv(i??[]),f=Gv(o);return f===r.current?u.current:(r.current=f,u.current=o,o)},[i])}function $v(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 gh(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 g=[...m.confirmed??[],...m.disputed??[],...m.unique??[],...m.unverified??[]];for(const p of g){const x=p.originalAgentId;if(!x)continue;const v=o.get(x)??{critical:0,high:0,medium:0,low:0},b=p.severity??"low";b==="critical"?v.critical+=1:b==="high"?v.high+=1:b==="medium"?v.medium+=1:v.low+=1,o.set(x,v)}}const f=$v(o);return f===r.current?u.current:(r.current=f,u.current=o,o)},[i])}function Xv(){const[i,r]=k.useState(()=>typeof window>"u"?null:Qm(window.location.search));return k.useEffect(()=>{const u=()=>{const o=typeof window>"u"?null:Qm(window.location.search);r(f=>f===o?f:o)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[i,mh]}const Vv=["1h","24h","7d","30d"];function Qv(i){return typeof i=="string"&&Vv.includes(i)}function io(i){const r=new URLSearchParams(i).get("range");return Qv(r)?r:null}function Zv(i,r,u){const o=new URLSearchParams(r);u===null?o.delete("range"):o.set("range",u);const f=o.toString();return f.length>0?`${i}?${f}`:i}function Km(i){const r=globalThis;if(!r.window)return;const u=r.window,o=Zv(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 Kv(){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&&Km(i);const u=()=>{const o=typeof window>"u"?"7d":io(window.location.search)??"7d";r(f=>f===o?f:o)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[i,Km]}const Jv=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function Fv(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&&Jv.has(u)}function Iv(i){k.useEffect(()=>{if(!i)return;function r(u){Fv(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),cs("/agent/"+encodeURIComponent(i))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),cs("/agent/"+encodeURIComponent(i)+"#skills")))}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[i])}function Wv(i){const r=globalThis.window,u=r!=null?r.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function Pv({overview:i,agents:r,tasks:u,consensus:o,consensusReports:f,fleetTrend:m,skills:g,activeTaskCount:p,setActiveTaskCount:x}){const v=i.actionableFindings,b=Wv(),S=Yv(o==null?void 0:o.runs),O=gh(f==null?void 0:f.reports),X=k.useMemo(()=>{const q=new Map;if(m){for(const w of m.points){const K=q.get(w.agentId)??[];K.push(w),q.set(w.agentId,K)}for(const w of q.values())w.sort((K,le)=>K.day.localeCompare(le.day))}return q},[m]),[L,V]=Xv(),[A,W]=Kv();Iv(L);const Z=r&&L?r.find(q=>q.id===L)??null:null,[ee,J]=k.useState(!b);function M(){const q=!ee;J(q);const w=new URL(window.location.href);q?w.searchParams.delete("graph"):w.searchParams.set("graph","0"),window.history.replaceState(null,"",w.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:[v>0&&a.jsxs("a",{href:vn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] text-orange-400 transition hover:underline","data-tooltip":"Findings open for operator review",children:[v," actionable →"]}),r&&a.jsx("button",{type:"button",onClick:M,className:"font-mono text-[10px] transition hover:underline",style:{color:"var(--text-dim)"},children:ee?"[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."})]}),ee&&r&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(Ov,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(Tv,{agents:r,peerRelationships:S,selectedAgentId:L,onSelectAgent:V})}),a.jsx(wv,{selectedAgent:Z,agents:r,peerRelationships:S})]}),o&&a.jsx(Hv,{runs:o.runs,range:A,onRangeChange:W})]}),a.jsx(s0,{overview:i,activeTasks:p,mode:"calm"}),a.jsx(g0,{onCountChange:x}),r&&a.jsx(d0,{agents:r,runs:o==null?void 0:o.runs}),a.jsx(V0,{}),u&&a.jsx(B0,{tasks:u,limit:3}),r&&a.jsx(C0,{agents:r,highlightedAgentId:ee?L:null,severityMap:O,trendByAgent:X}),a.jsx(Q0,{overview:i}),a.jsx(P0,{skills:g??null})]})}const ua={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},Oi={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},_o={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},oa=["confirmed","disputed","unverified","unique"],eg=.01;function tg({consensusId:i,data:r,onError:u}){const[o,f]=k.useState(r?{kind:"full",data:r}:i?{kind:"loading"}:{kind:"empty"});return k.useEffect(()=>{if(r)return;let m=!1;return f(g=>g.kind==="error"?g:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(i)}`).then(async g=>{const p=await g.json().catch(()=>({}));if(!g.ok){const x=typeof(p==null?void 0:p.error)=="string"?p.error:`HTTP ${g.status}`;throw new Error(x)}return p}).then(g=>{m||f({kind:"full",data:g})}).catch(g=>{m||(f(p=>({kind:"error",error:g.message,stale:p.kind==="full"?p.data:void 0})),u==null||u(g))}),()=>{m=!0}},[i,r,u]),o.kind==="loading"?a.jsx(cg,{}):o.kind==="empty"?a.jsx(rg,{}):o.kind==="error"?a.jsx(og,{error:o.error,stale:o.stale}):a.jsx(yh,{data:o.data})}function yh({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:"font-mono text-[13px] font-semibold",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(ng,{degraded:i.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(lg,{data:i})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(sg,{data:i})}),a.jsx(ig,{data:i})]})}function ng({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 Eo=720,Di=320,pn=120,yo=0,bo=(Eo-pn)/2,Jm=Eo-pn,co=8;function lg({data:i}){const r=k.useMemo(()=>ag(i),[i]),u=k.useMemo(()=>r.edges,[r.edges]),o=ug();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Eo} ${Di}`,width:"100%",height:Di,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((f,m)=>a.jsx("path",{d:f.path,fill:f.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:f.tooltip})},m))}),a.jsx("g",{children:r.left.map(f=>a.jsxs("g",{children:[a.jsx("rect",{x:yo,y:f.y,width:pn,height:f.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:yo+pn-6,y:f.y+f.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fontFamily:"var(--font-mono)",fill:"var(--ink)",children:[_o[f.family]," · ",f.agentCount]})]},f.family))}),a.jsx("g",{children:r.right.map(f=>a.jsxs("g",{children:[a.jsx("rect",{x:bo,y:f.y,width:pn,height:f.h,fill:ua[f.verdict],fillOpacity:.16}),a.jsxs("text",{x:bo+pn/2,y:f.y+f.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fontFamily:"var(--font-mono)",fill:"var(--ink)",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},children:[Oi[f.verdict]," · ",f.count]})]},f.verdict))}),a.jsx("g",{children:r.right.map(f=>{const m=i.summary.totalFindings>0?Math.round(f.count/i.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:Jm,y:f.y,width:pn,height:f.h,fill:ua[f.verdict],fillOpacity:.32}),a.jsxs("text",{x:Jm+pn-6,y:f.y+f.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fontFamily:"var(--font-mono)",fill:"var(--ink)",children:[f.count," · ",m,"%"]})]},f.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 ag(i){const r=i.summary.totalFindings,u=Di-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 f=i.modelFamilyToFindings.reduce((L,V)=>L+(o.get(V.family)??0),0)||1;let m=co;const g=i.modelFamilyToFindings.map(L=>{const V=o.get(L.family)??0,A=Math.max(20,V/f*u),W={family:L.family,y:m,h:A,agentCount:L.agentCount};return m+=A,W}),p=24;let x=co;const v=oa.map(L=>{const V=i.summary[L],A=r>0?V/r:0,W=Math.max(p,A*u),Z={verdict:L,y:x,h:W,count:V};return x+=W,Z}),b=new Map,S=new Map,O=[],X=[...i.familyToOutcome].sort((L,V)=>L.from.family!==V.from.family?L.from.family.localeCompare(V.from.family):oa.indexOf(L.to.verdict)-oa.indexOf(V.to.verdict));for(const L of X){const V=g.find(I=>I.family===L.from.family),A=v.find(I=>I.verdict===L.to.verdict);if(!V||!A)continue;const W=o.get(L.from.family)??0,Z=W>0?L.to.count/W*V.h:0,ee=A.count||1,J=L.to.count/ee*A.h,M=b.get(L.from.family)??0,q=S.get(L.to.verdict)??0;if(b.set(L.from.family,M+Z),S.set(L.to.verdict,q+J),L.weight<eg)continue;const w=V.y+M,K=w+Z,le=A.y+q,ne=le+J,de=yo+pn,F=bo,ae=de+(F-de)*.5,me=F-(F-de)*.5,E=`M ${de} ${w} C ${ae} ${w}, ${me} ${le}, ${F} ${le} L ${F} ${ne} C ${me} ${ne}, ${ae} ${K}, ${de} ${K} Z`,T=i.modelFamilyToFindings.find(I=>I.family===L.from.family),H=(T==null?void 0:T.agentCount)??0;O.push({path:E,color:ua[L.to.verdict],tooltip:`${H} ${_o[L.from.family]} agent${H===1?"":"s"} → ${L.to.count} ${Oi[L.to.verdict]} finding${L.to.count===1?"":"s"} (${Math.round(L.weight*100)}%)`})}return{left:g,right:v,edges:O}}function sg({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:`${_o[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(ro,{label:"Findings reviewed",items:oa.map(u=>({key:u,label:`${Oi[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,f)=>o+f.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 f=o.value/u*100;return f<.5?null:a.jsx("div",{title:o.label,style:{width:`${f}%`,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:f>12?o.label:""},o.key)})})]})}function ig({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]}}),Oi[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 cg(){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:Di},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 rg(){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 og({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(yh,{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 ug(){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=f=>r(f.matches);return u.addEventListener("change",o),()=>u.removeEventListener("change",o)},[]),i}function dg({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(tg,{consensusId:i})]})}function fg({onLogin:i,error:r}){const[u,o]=k.useState(""),[f,m]=k.useState(!1),g=async x=>{if(x.preventDefault(),!(!u.trim()||f)){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:g,children:[a.jsx("input",{type:"password",value:u,onChange:x=>o(x.target.value),placeholder:"Dashboard key",autoFocus:!0,disabled:f,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:f,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:f?"Unlocking…":"Unlock"})]}),p&&a.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--bad)"},children:p})]})})}const bh="dashboard:theme",mg=["light","dark"];function hg(i){return i==="light"||i==="dark"?i:i==="editorial"?"light":i==="default"?"dark":null}function xg(i,r){const u=hg(i);return u!==null?u:r?"dark":"light"}function pg(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function vg(){if(typeof window>"u")return"light";let i=null;try{i=window.localStorage.getItem(bh)}catch{}return xg(i,pg())}function gg(){const[i,r]=k.useState(vg);k.useEffect(()=>{typeof document>"u"||(i==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=i)},[i]);function u(f){if(mg.includes(f)&&(r(f),typeof window<"u"))try{window.localStorage.setItem(bh,f)}catch{}}return{theme:i,setTheme:u,toggle:()=>{u(i==="light"?"dark":"light")}}}const yg=[{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."}],bg={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function jg({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()}),f=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",f),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:bg,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:yg.map(({term:o,definition:f,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:f}),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 Ng=[{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 Fm(){const[i,r]=k.useState(!1),u=ch(),{theme:o,toggle:f}=gg();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:Ng.map(m=>{const g=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 ${g?"font-semibold":"hover:bg-accent/10"}`,style:g?{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:f,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(jg,{open:i,onClose:()=>r(!1)})]})}const Sg={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 jh({task:i,onClose:r}){if(k.useEffect(()=>{if(!i)return;const f=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}},[i,r]),!i)return null;const u=Sg[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 shadow-2xl",style:{background:"var(--surface-elev)"},onClick:f=>f.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:["· ",l0(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:n0(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:Ri(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 jo(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"}},Im=[{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."}],kg=[{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-red-400/50 border-red-400/20 hover:border-red-400/40",activeCls:"text-red-400 bg-red-400/10 border-red-400/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-yellow-400/50 border-yellow-400/20 hover:border-yellow-400/40",activeCls:"text-yellow-400 bg-yellow-400/10 border-yellow-400/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)"}}],_g={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:""},Eg={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Tg="[&_.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",Mg={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 Ag({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",f=i.severity&&_g[i.severity]||"",m=i.severity==="low"?Eg:void 0,g=i.findingType==="suggestion"?"SUGGESTION":i.findingType==="insight"?"INSIGHT":null,p=i.findingType==="suggestion"?"text-blue-400 bg-blue-500/10":i.findingType==="insight"?"text-zinc-400 bg-zinc-500/10":"",x=i.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),v=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 ${f}`,style:m,children:i.severity.toUpperCase()}),g&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${p}`,children:g}),v&&a.jsx("span",{className:"bg-blue-500/10 px-2 py-1 font-mono text-[10px] text-blue-400 border border-blue-500/15 rounded",children:v}),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:jo(Mg[b.code])+" — "+jo(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 ${Tg}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:Ri(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:yl(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 wg({consensus:i,reports:r,showAll:u=!1,hideHeader:o=!1,filteredRuns:f}){const m=f??i.runs,g=u?m:m.slice(0,oo);!u&&m.length>oo;const[p,x]=k.useState(null),[v,b]=k.useState("all"),[S,O]=k.useState("all"),[X,L]=k.useState(1),[V,A]=k.useState([]),[W,Z]=k.useState(0),[ee,J]=k.useState(!1),[M,q]=k.useState({});k.useEffect(()=>{if(!u&&(r!=null&&r.reports)&&(A(r.reports),Z(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 Xe("consensus-reports?page=1&pageSize=200");if(E)return;if(A(H.reports||[]),Z(H.totalReports??(((T=H.reports)==null?void 0:T.length)||0)),L(1),H.roundRetractions){const I={};for(const ce of H.roundRetractions)I[ce.consensus_id]={reason:ce.reason,retracted_at:ce.retracted_at};q(I)}}catch{}})(),()=>{E=!0}},[u]);const w=V.slice().sort((E,T)=>T.timestamp.localeCompare(E.timestamp)),K=10,[le,ne]=k.useState(0),de=Math.max(1,Math.ceil(w.length/K)),F=Math.min(le,de-1),ae=u?w.slice(F*K,(F+1)*K):w.slice(0,oo),me=E=>{const T=new Date,H=new Date(E),I=ue=>new Date(ue.getFullYear(),ue.getMonth(),ue.getDate()).getTime(),ce=Math.round((I(T)-I(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,I=u?me(E.timestamp):null,ce=u&&H?me(H.timestamp):null,ue=u&&I!==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||[]],Q=v==="all"?R:v==="insight"?R.filter(P=>P.findingType==="insight"||P.findingType==="suggestion"):R.filter(P=>P.tag===v),Y=S==="all"?Q:Q.filter(P=>P.severity===S),te=p===E.id,re=(()=>{const P=new Set;return we=>{var Lt;const Ve=(Lt=E.authorDiagnostics)==null?void 0:Lt[we.originalAgentId];if(!Ve||Ve.length===0)return;const Fe=Ve.filter(Be=>{const Kn=`${we.originalAgentId}:${Be.code}`;return P.has(Kn)?!1:(P.add(Kn),!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,gn=(E.insights||[]).length,Qn=(()=>{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"})(),Bt=[{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:gn,textCls:"text-zinc-400",label:"insights"}].filter(P=>P.count>0),Xt=[...new Set(R.map(P=>P.originalAgentId).filter(Boolean))],jl=Xt.slice(0,5),Zn=M[E.id],Nl=!!Zn;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:I}),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
|
+
${Qn}
|
|
75
|
+
${Nl?"opacity-60 line-through decoration-disputed/40":""}
|
|
76
|
+
${te?"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:shadow-sm hover:shadow-black/20 hover:-translate-y-px"}`,style:{background:te?"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"}),Zn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Zn.retracted_at.slice(0,10)]}),Zn.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",Zn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":te,onClick:()=>{const P=!te;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:yl(P)},children:ho(P)},P)),Xt.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",Xt.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,[,Lt])=>Fe+Lt,0),Ve=P.map(([Fe,Lt])=>`${Fe}:${Lt}`).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:Bt.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 ${te?"rotate-90":""}`,style:{color:te?"color-mix(in oklch, var(--ink) 60%, transparent)":"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"▸"})]}),te&&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:"}),Im.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 ${v===P.key?P.activeCls:P.cls}`,style:v===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:"}),kg.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,Lt=Ve.filter(Be=>Be.assigned<Be.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(([Be,Kn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:Be,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:yl(Be)},children:ho(Be)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:Be}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",Kn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:Kn.map(Jn=>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:Jn.length>12?Jn.slice(0,12)+"…":Jn},Jn))})]},Be)),Fe>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Lt.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:["⚠ ",Lt.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:Y.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):Y.map((P,we)=>a.jsx(Ag,{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 ▸"})]})]}):g.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:g.map((E,T)=>{const H=E.counts,I=(H.agreement||0)+(H.disagreement||0)+(H.hallucination||0)+(H.unverified||0)+(H.unique||0)+(H.new||0),ce=I||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(Y=>{if(Y.signal==="signal_retracted")return!1;if(v==="all")return!!uo[Y.signal];const te=uo[Y.signal];return te&&te.filter===v}),Q=!!E.retracted;return a.jsxs("div",{className:`rounded-md border transition ${ue?"border-primary/25":"border-border"} ${Q?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":Q?"true":void 0,title:Q&&E.retractionReason?`Retracted: ${E.retractionReason}`:void 0,children:[Q&&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 Y=!ue;x(Y?E.taskId:null),Y&&(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 ${Q?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[I," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[E.agents.slice(0,4).map(Y=>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:Y.split("-").map(te=>te[0]).join("").toUpperCase().slice(0,2)},Y)),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(Y=>Y.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Y.text} ${Q?"line-through decoration-disputed/40":""}`,children:[Y.count," ",Y.label]},Y.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:y.map(Y=>Y.count>0&&a.jsx("div",{className:`${Y.color} transition-all`,style:{width:`${Y.count/ce*100}%`}},Y.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:Im.map(Y=>a.jsx("button",{onClick:()=>b(Y.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${v===Y.key?Y.activeCls:Y.cls} hover:opacity-80`,style:v===Y.key?Y.activeStyle:Y.inactiveStyle,...Y.tooltip?{"data-tooltip":Y.tooltip}:{},children:Y.label},Y.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((Y,te)=>{const re=uo[Y.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:Ri(Y.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Y.agentId,Y.counterpartId?` + ${Y.counterpartId}`:""]})]})]},te):null})})]})]},E.taskId+T)})})]})}const wi=25;function Cg({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],f=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:f}),m>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":r,onClick:()=>u(g=>!g),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((g,p)=>{const x=g.includes(" ")?g.slice(g.indexOf(" ")+1):g;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:x},p)})})]})]})}function zg({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(Cg,{commits:i.commits})})]})}function Dg(){const[i,r]=k.useState([]),[u,o]=k.useState(0),[f,m]=k.useState(1),[g,p]=k.useState(!1),[x,v]=k.useState(null);k.useEffect(()=>{let S=!1;return p(!0),v(null),Xe(`violations?page=${f}&pageSize=${wi}`).then(O=>{S||(r(O.items??[]),o(O.total??0))}).catch(O=>{S||v(String((O==null?void 0:O.message)??O))}).finally(()=>{S||p(!1)}),()=>{S=!0}},[f]);const b=Math.max(1,Math.ceil(u/wi));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:[!g&&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"})}),g&&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…"})}),!g&&i.map(S=>a.jsx(zg,{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:g?"loading…":u===0?"no violations":`${(f-1)*wi+1}–${Math.min(f*wi,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:f===1||g,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:[f," / ",b]}),a.jsx("button",{type:"button",onClick:()=>m(S=>Math.min(b,S+1)),disabled:f>=b||g,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 Rg({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 f=o.map(m=>{const g=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:g,c:p,h:x,n:p+x}}).sort((m,g)=>g.acc-m.acc);return a.jsx("div",{className:"space-y-2",children:f.map(m=>{const g=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 ${g}`,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 Og=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function Ug(i,r,u){return(!i||!Og.has(i))&&r!==void 0&&u!==void 0&&u>0}const qg={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"},Bg={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-orange-400/40 bg-orange-500/10 text-orange-400",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function Lg(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 Hg({slot:i}){const r=i.status,u=r?Bg[r]:"border-border/50",o=!r||r==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,f=r==="inconclusive"&&(i.inconclusiveStrikes??0)>0,m=i.forcedDevelops??[],g=m.length>0?m[m.length-1]:null,p=typeof i.effectiveness=="number"?Lg(i.effectiveness):null,x=Ug(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 v=i.postBindSignals,b=i.minEvidence,S=Math.round(v/b*100),O=Math.min(v/b,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${v} 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: ",v," / ",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:qg[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}),f&&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:g!=null&&g.reason?`latest: ${g.reason}`:void 0,children:["forced ",m.length," time",m.length===1?"":"s",g&&` · last ${We(g.timestamp)}`]})]})}function Gg({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 f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=f}},[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 Yg({side:i="right",className:r="",children:u,style:o,...f}){return a.jsx("div",{className:`h-full p-6 ${r}`,style:{background:"var(--surface-elev)",...o},...f,children:u})}function $g({className:i="",...r}){return a.jsx("div",{className:`mb-2 ${i}`,...r})}function Xg({className:i="",...r}){return a.jsx("h2",{className:`font-semibold ${i}`,...r})}function Vg({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(--accent)",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 Wm={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:""},Qg={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Pm={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"},Zg={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 Ui({open:i,onOpenChange:r,consensusId:u,findingId:o}){const[f,m]=k.useState(null),[g,p]=k.useState(null);return k.useEffect(()=>{if(!i||!u||!o){m(null),p(null);return}m(null),p(null),Xe(`finding/${encodeURIComponent(u)}/${encodeURIComponent(o)}`).then(m).catch(x=>p(x.message||"failed to load finding"))},[i,u,o]),a.jsx(Gg,{open:i,onOpenChange:r,children:a.jsxs(Yg,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:Zg,children:[a.jsx($g,{children:a.jsx(Xg,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),g&&a.jsx("div",{className:"mt-4 text-[11px] text-disputed",children:g}),!g&&!f&&a.jsx("div",{className:"mt-4 text-[11px]",style:{color:"var(--text-dim)"},children:"Loading…"}),f&&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 ${Pm[f.finding.tag]||""}`,style:Pm[f.finding.tag]?void 0:{background:"var(--surface-sunk)"},children:f.finding.tag}),f.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${Wm[f.finding.severity]||""}`,style:f.finding.severity==="low"?Qg:Wm[f.finding.severity]?void 0:{background:"var(--surface-sunk)"},children:f.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"var(--text-dim)"},children:["by ",f.finding.originalAgentId]}),f.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:f.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),f.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"}),f.citations.map((x,v)=>a.jsx(Vg,{citation:x},v))]}),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"}),f.finding.confirmedBy.length>0&&a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",f.finding.confirmedBy.join(", ")]}),f.finding.disputedBy.map((x,v)=>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})]},v)),f.finding.confirmedBy.length===0&&f.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-dim)"},children:"No peer review"})]}),f.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 (",f.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:f.signals.map((x,v)=>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)})]},v))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:vn(`/consensus/${f.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",f.consensusId]})})]})]})})}const Kg={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 Jg({agentId:i}){const[r,u]=k.useState([]),[o,f]=k.useState(!0),[m,g]=k.useState("all"),[p,x]=k.useState(null);k.useEffect(()=>{let O=!1;return f(!0),Xe(`signals?agent=${encodeURIComponent(i)}&limit=100`).then(X=>{O||(u(X.items||[]),f(!1))}).catch(()=>{O||(u([]),f(!1))}),()=>{O=!0}},[i]);const v=[...r].sort((O,X)=>(X.timestamp||"").localeCompare(O.timestamp||"")),b=m==="all"||m==="signals"?v:[],S=({k:O,label:X,enabled:L})=>a.jsx("button",{type:"button",onClick:()=>L&&g(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:X});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,X)=>{const L=Kg[O.signal]||"text-text-dim",V=!!(O.consensusId&&O.findingId),A=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 V?a.jsx("button",{type:"button",onClick:()=>x({consensusId:O.consensusId,findingId:O.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/40",children:A},X):a.jsx("div",{children:A},X)})}),a.jsx(Ui,{open:!!p,onOpenChange:O=>{O||x(null)},consensusId:(p==null?void 0:p.consensusId)??null,findingId:(p==null?void 0:p.findingId)??null})]})}function Fg(){const i=k.useRef(null),[r,u]=k.useState(0);return k.useEffect(()=>{const o=i.current;if(!o||typeof ResizeObserver>"u")return;const f=new ResizeObserver(m=>{for(const g of m)u(g.contentRect.width)});return f.observe(o),()=>f.disconnect()},[]),[i,r]}const eh={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"},Ig={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"},Wg=6,Pg=500,Nh=100,ey=150;function ty(i){if(i<=0)return Nh;const r=Math.floor(i/Wg);return Math.max(1,Math.min(r,Pg))}function ny({agentId:i}){const[r,u]=k.useState([]),[o,f]=k.useState(0),[m,g]=k.useState(!1),[p,x]=k.useState(null),[v,b]=Fg(),[S,O]=k.useState(Nh),X=k.useRef(null);k.useEffect(()=>{if(b<=0)return;const Z=ty(b);return X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{O(ee=>ee===Z?ee:Z)},ey),()=>{X.current&&clearTimeout(X.current)}},[b]),k.useEffect(()=>{Xe(`signals?agent=${encodeURIComponent(i)}&limit=${S}`).then(Z=>{u(Z.items||[]),f(Z.total||0)}).catch(()=>{})},[i,S]);const L=k.useMemo(()=>[...r].reverse(),[r]),V={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const Z of r)Z.signal==="agreement"||Z.signal==="consensus_verified"?V.confirmed++:Z.signal==="disagreement"||Z.signal==="hallucination_caught"?V.disputed++:Z.signal==="unique_confirmed"||Z.signal==="unique_unconfirmed"||Z.signal==="new_finding"?V.unique++:Z.signal==="unverified"?V.unverified++:Z.signal==="citation_fabricated"&&V.fabricated++;const A=r.length,W=o>A;return r.length===0?a.jsx("div",{ref:v,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:v,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:W?`last ${A} 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:[V.confirmed," confirmed"]}),V.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[V.disputed," disputed"]}),V.unique>0&&a.jsxs("span",{className:"text-unique",children:[V.unique," unique"]}),V.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[V.unverified," unverified"]}),V.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[V.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:L.map((Z,ee)=>{const J=!!(Z.consensusId&&Z.findingId);return a.jsx("button",{type:"button",disabled:!J,onClick:()=>{Z.consensusId&&Z.findingId&&(x({consensusId:Z.consensusId,findingId:Z.findingId}),g(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${eh[Z.signal]||""} ${J?"cursor-pointer":"cursor-default"}`,style:eh[Z.signal]?void 0:{background:"var(--surface-sunk)"},title:`${Ig[Z.signal]||Z.signal} — ${We(Z.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(Z=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${Z.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:Z.label})]},Z.label))}),a.jsx(Ui,{open:m,onOpenChange:g,consensusId:(p==null?void 0:p.consensusId)??null,findingId:(p==null?void 0:p.findingId)??null})]})}function ly(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 ay={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}},sy={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 iy(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),f=Math.floor(i%6e4/1e3);return f>0?`${o}m ${f}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 Sh({task:i,onClick:r}){const u=ly(i.status),o=ay[u];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/30 transition-colors ${r?"cursor-pointer":""}`,onClick:r?f=>{f.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:sy[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:yl(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 f=i.task.replace(/\n.*/s,"");return f.length>100?f.slice(0,100)+"…":f})()}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:u==="running"?"running":iy(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 cy=3,ry=720*60*60*1e3;function oy({agentId:i,agents:r,tasks:u,consensus:o}){const f=r.find(y=>y.id===i),[m,g]=k.useState([]),[p,x]=k.useState([]),[v,b]=k.useState(null),[S,O]=k.useState(null),[X,L]=k.useState(null),[V,A]=k.useState(0),[W,Z]=k.useState(0),[ee,J]=k.useState(null);k.useEffect(()=>{Xe(`memory/${i}`).then(y=>{g(y.knowledge||[])}).catch(()=>g([]))},[i]),k.useEffect(()=>{let y=!1;return Xe("consensus-reports?page=1&pageSize=200").then(R=>{y||x(R.reports||[])}).catch(()=>{y||x([])}),()=>{y=!0}},[]);const M=k.useMemo(()=>{var Y;const y=Date.now(),R=new Map;for(const te of p){const re=Date.parse(te.timestamp);if(Number.isNaN(re)||y-re>ry)continue;const ve=(Y=te.authorDiagnostics)==null?void 0:Y[i];if(ve)for(const Re of ve)R.set(Re.code,(R.get(Re.code)??0)+1)}const Q=[];for(const[te,re]of R)re>=cy&&Q.push({code:te,count:re});return Q},[p,i]);if(!f)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",i]});const q=f.scores,w=(u==null?void 0:u.items.filter(y=>y.agentId===i))||[],K=(o==null?void 0:o.runs.filter(y=>y.agents.includes(i)))||[],le=[{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:f.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],me=10,E=Math.max(1,Math.ceil(w.length/me)),T=Math.min(V,E-1),H=w.slice(T*me,(T+1)*me),I=k.useMemo(()=>{const y=new Map;for(const R of m){const Q=R.filename.match(/^(\d{4}-\d{2}-\d{2})/),Y=Q?Q[1]:"undated",te=y.get(Y)||[];te.push(R),y.set(Y,te)}return Array.from(y.entries()).sort(([R],[Q])=>R==="undated"?1:Q==="undated"?-1:Q.localeCompare(R)).map(([R,Q])=>({day:R,items:Q}))},[m]),ce=Math.min(W,Math.max(0,I.length-1)),ue=I[ce];return a.jsxs(a.Fragment,{children:[(()=>{const y=ko(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})(),M.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:M.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:jo(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(os,{agentId:f.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:f.id}),a.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--text-dim)"},children:[f.provider,"/",f.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 ${f.native?"":"text-confirmed bg-confirmed/10"}`,style:f.native?{color:"var(--idle)",background:"color-mix(in oklch, var(--idle) 10%, transparent)"}:void 0,children:f.native?"NATIVE":"RELAY"}),f.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:f.preset}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[q.signals," signals",f.lastTask?` · ${We(f.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(ny,{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 shadow-[inset_0_1px_3px_rgba(0,0,0,0.35)]",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsx("div",{className:"space-y-2.5",children:le.map(y=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},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(Rg,{categoryAccuracy:q.categoryAccuracy,categoryCorrect:q.categoryCorrect,categoryHallucinated:q.categoryHallucinated})]})]}),(f.skillSlots.length>0||f.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:f.skillSlots.length||f.skills.length})]}),f.skillSlots.length>0?a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:f.skillSlots.map(y=>a.jsx(Hg,{slot:y},y.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.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:()=>A(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:()=>A(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(Sh,{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:K.length})]}),K.length>0?a.jsx("div",{className:"space-y-2",children:K.slice(0,20).map((y,R)=>{const Q=y.counts,Y=(Q.agreement||0)+(Q.disagreement||0)+(Q.hallucination||0)+(Q.unverified||0)+(Q.unique||0)+(Q.new||0),te=Y||1,re=[{key:"confirmed",count:Q.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(Q.disagreement||0)+(Q.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:Q.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(Q.unique||0)+(Q.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?"▾":"▸"}),Y," 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/te*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,gn)=>{const Qn=ve[Ae.signal],Bt=!!(Ae.findingId&&y.taskId),Xt=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 ${Qn.cls}`,children:Qn.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:Ri(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 Bt?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/40",children:Xt},gn):a.jsx("div",{children:Xt},gn)})})})]},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(Jg,{agentId:i})}),a.jsx(Ui,{open:!!X,onOpenChange:y=>{y||L(null)},consensusId:(X==null?void 0:X.consensusId)??null,findingId:(X==null?void 0:X.findingId)??null}),a.jsx(jh,{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,")"]})]}),I.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:()=>Z(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," / ",I.length]}),a.jsx("button",{onClick:()=>Z(y=>Math.min(I.length-1,y+1)),disabled:ce>=I.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 te,re;const R=v===y.filename,Q=((te=y.frontmatter)==null?void 0:te.type)||"memory",Y=((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(--accent)":"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:Q}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:Y}),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 th={dispatch:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},consensus:{color:"color-mix(in oklch, var(--accent) 70%, 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)"}},uy={error:"text-disputed",timeout:"text-unverified"},dy=[[/^\[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 fy(i){for(const[r,u]of dy)if(r.test(i))return u;return"other"}const my=[{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"}],nh=1e3;function hy(){const[i,r]=k.useState([]),[u,o]=k.useState(0),[f,m]=k.useState(0),[g,p]=k.useState("all"),[x,v]=k.useState(!0),[b,S]=k.useState(!0),O=k.useRef(null),X=k.useRef(0);k.useEffect(()=>{let A=!1;return(async()=>{try{const Z=await Xe("logs?tail=500");if(A)return;r(Z.entries),o(Z.totalLines),m(Z.fileSize),X.current=Z.totalLines+1}catch{}})(),()=>{A=!0}},[]),k.useEffect(()=>{if(b)return xh(A=>{var Z;if(A.type!=="log_lines")return;const W=(Z=A.data)==null?void 0:Z.lines;W!=null&&W.length&&r(ee=>{const J=W.map((q,w)=>({line:X.current+w,text:q,category:fy(q)}));X.current+=W.length,o(q=>q+W.length);const M=[...ee,...J];return M.length>nh?M.slice(-nh):M})})},[b]),k.useEffect(()=>{x&&O.current&&O.current.scrollIntoView({behavior:"smooth"})},[i,x]);const L=g==="all"?i:i.filter(A=>A.category===g),V=k.useCallback(A=>A<1024?`${A} B`:A<1048576?`${(A/1024).toFixed(1)} KB`:`${(A/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:V(f)}),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:[my.map(A=>a.jsx("button",{onClick:()=>p(A.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:g===A.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:A.label},A.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:()=>v(!x),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:x?{color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 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(A=>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:A.line}),a.jsx("span",{className:uy[A.category]??"",style:th[A.category]??th.other,children:A.text})]},A.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...":g==="all"?"No log entries in current tail.":`No ${g} entries in current tail.`}),a.jsx("div",{ref:O})]})})]})}const xy=["critical","high","medium","low"],py=["manual","impl","meta","auto-provisional"];function lh(i,r){return i.includes(r)?i.filter(u=>u!==r):[...i,r]}const Jt="mb-1 block h-section",Ft={},Xn="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",Vn={background:"var(--surface)",color:"var(--text)"};function vy({filters:i,onChange:r,agents:u,signalTypes:o}){const f=m=>g=>{const p=g.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:Jt,style:Ft,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:lh(i.agents,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Jt,style:Ft,children:"Counterpart"}),a.jsxs("select",{className:Xn,style:Vn,value:i.counterpart??"",onChange:f("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:Jt,style:Ft,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:lh(i.signals,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Jt,style:Ft,children:"Severity"}),a.jsxs("select",{className:Xn,style:Vn,value:i.severity??"",onChange:f("severity"),children:[a.jsx("option",{value:"",children:"any"}),xy.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Jt,style:Ft,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Xn,style:Vn,value:i.source??"",onChange:f("source"),children:[a.jsx("option",{value:"",children:"any"}),py.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Jt,style:Ft,children:"Category"}),a.jsx("input",{type:"text",className:Xn,style:Vn,value:i.category??"",onChange:f("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:Jt,style:Ft,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Xn,style:Vn,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:Jt,style:Ft,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Xn,style:Vn,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:Jt,style:Ft,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Xn,style:Vn,value:i.consensusId??"",onChange:f("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Jt,style:Ft,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Xn,style:Vn,value:i.findingId??"",onChange:f("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const ah={agents:[],signals:[]},gy=["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"],yy={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"},by={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)"},jy={critical:"var(--bad)",high:"var(--warn)",medium:"var(--info)",low:"var(--ink-3)"},is=100;function Ny(){if(typeof window>"u")return{filters:ah,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,f=i.get("category")??void 0,m=i.get("severity"),g=m==="critical"||m==="high"||m==="medium"||m==="low"?m:void 0,p=i.get("since")??void 0,x=i.get("until")??void 0,v=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||f||g||p||x||v||b||O?{filters:{agents:u?[u]:[],signals:r,counterpart:o,category:f,severity:g,since:p,until:x,consensusId:v,findingId:b,source:O},hadAny:!0}:{filters:ah,hadAny:!1}}function Sy(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 f of i.signals)o.append("signal",f);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 ky(){const[{filters:i,hadAny:r}]=k.useState(Ny),[u,o]=k.useState(i),[f,m]=k.useState([]),[g,p]=k.useState(0),[x,v]=k.useState(0),[b,S]=k.useState(!1),[O,X]=k.useState(null),[L,V]=k.useState([]),[A,W]=k.useState(!1),[Z,ee]=k.useState(null),[J,M]=k.useState(null),q=k.useRef(null),w=k.useRef(0),K=k.useCallback(async(E,T)=>{const H=++w.current;S(!0),X(null);try{const I=Sy(E,T*is),ce=await Xe(`signals?${I.toString()}`);if(H!==w.current)return;m(ce.items??[]),v(ce.total??0)}catch(I){if(H!==w.current)return;X(I instanceof Error?I.message:"fetch failed")}finally{H===w.current&&S(!1)}},[]);k.useEffect(()=>{Xe("agents").then(E=>{const T=(E??[]).map(H=>H.id).filter(Boolean).sort();T.length>0&&V(T)}).catch(()=>{})},[]),k.useEffect(()=>{p(0)},[u]),k.useEffect(()=>(q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{K(u,g)},250),()=>{q.current&&clearTimeout(q.current)}),[u,g,K]);const le=k.useCallback(E=>{o(T=>({...T,...E}))},[]),ne=Math.max(1,Math.ceil(x/is)),de=Math.min(g,ne-1),F=x>0||r||b,ae=(E,T)=>{!E||!T||(ee(E),M(T),W(!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 ",f.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(vy,{filters:u,onChange:le,agents:L,signalTypes:gy})}),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:[f.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"})}),f.map((E,T)=>{const H=!!(E.consensusId&&E.findingId),I=E.severity?jy[E.severity]:"transparent",ce=by[E.signal]??"var(--ink-2)",ue=yy[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,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),children:[a.jsx("td",{className:"p-0",style:{background:I,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+f.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(Ui,{open:A,onOpenChange:W,consensusId:Z,findingId:J})]})}function _y(){const[i,r]=k.useState(null),[u,o]=k.useState(null);k.useEffect(()=>{x0().then(r)},[]);const f=k.useCallback(async m=>{o(null);const g=await h0(m);g.ok?r(!0):o(g.kind)},[]);return{authed:i,login:f,error:u}}const Ey=5e3;function Ty(){const[i,r]=k.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,fleetTrend: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[f,m,g,p,x,v,b,S,O]=await Promise.all([Xe("overview"),Xe("agents"),Xe("tasks?limit=2000"),Xe("consensus?pageSize=500"),Xe("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),Xe("fleet-trend?days=7").catch(()=>({days:7,points:[]})),Xe("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),Xe("native-memory").catch(()=>({knowledge:[]})),Xe("gossip-memory").catch(()=>({knowledge:[]}))]),X=[...S.knowledge||[]].map(V=>({...V,origin:"native"})).sort((V,A)=>A.filename>V.filename?1:-1),L=[...O.knowledge||[]].map(V=>({...V,origin:"gossip"})).sort((V,A)=>A.filename>V.filename?1:-1);r({overview:f,agents:m,tasks:g,consensus:p,consensusReports:x,fleetTrend:v,skills:b,nativeMemories:X,gossipMemories:L,memories:X,loading:!1,error:null})}catch(f){r(m=>({...m,loading:!1,error:f.message}))}finally{u.current=!1}}},[]);return k.useEffect(()=>{o()},[o]),k.useEffect(()=>{const f=setInterval(()=>{o()},Ey);return()=>clearInterval(f)},[o]),{...i,refresh:o}}const kh="dashboard:lastEventId";function My(){if(typeof window>"u")return 0;const i=window.localStorage.getItem(kh);if(!i)return 0;const r=parseInt(i,10);return Number.isFinite(r)?r:0}function Ay(i){typeof window>"u"||window.localStorage.setItem(kh,String(i))}const sh=1e3,wy=5e3;function Cy(i){k.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let r=null,u=null,o=sh,f=!1;function m(){if(f)return;const g=My();r=new window.EventSource(`/dashboard/api/events?last_id=${g}`),r.onmessage=p=>{try{const x=JSON.parse(p.data);i(x),Ay(x.id),o=sh}catch{}},r.onerror=()=>{r&&(r.close(),r=null),!f&&(u=setTimeout(()=>{m()},o),o=Math.min(o*2,wy))}}return m(),()=>{f=!0,u!==null&&clearTimeout(u),r&&(r.close(),r=null)}},[])}const ih=5,zy=6e3;function Dy({toast:i,onDismiss:r}){const u=k.useRef(null),o=k.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),f=k.useCallback(()=>{o(),u.current=setTimeout(()=>r(i.id),zy)},[i.id,r,o]);k.useEffect(()=>(f(),o),[f,o]);const{type:m,payload:g}=i.event,p=m==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):g.confirmed>g.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let x;if(m==="task.completed"){const b=String(g.agentId??"agent"),S=typeof g.durationMs=="number"?g.durationMs:null,O=S!==null?`${(S/1e3).toFixed(1)}s`:"—";x=`${b} finished in ${O}`}else{const b=Number(g.confirmed??0),S=Number(g.disputed??0);x=`Consensus done — ${b} confirmed · ${S} disputed`}const v=()=>{o(),m==="task.completed"&&g.taskId?cs("/tasks"):m==="consensus.completed"&&g.consensusId&&cs("/debates"),r(i.id)};return a.jsx("div",{className:["pointer-events-auto border rounded shadow-sm 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)"},onClick:v,onMouseEnter:o,onMouseLeave:f,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 Ry(){const[i,r]=k.useState([]),u=k.useCallback(f=>{r(m=>m.map(g=>g.id===f?{...g,exiting:!0}:g)),setTimeout(()=>{r(m=>m.filter(g=>g.id!==f))},250)},[]),o=k.useCallback(f=>{r(m=>{const g={id:f.id,event:f,exiting:!1},p=[...m,g];if(p.length>ih){const x=p.length-ih;return p.slice(x)}return p})},[]);return Cy(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(f=>a.jsx(Dy,{toast:f,onDismiss:u},f.id))})}function Oy({agents:i,tasks:r,consensusReports:u,fleetTrend:o}){const[f,m]=k.useState("weight"),[g,p]=k.useState("desc"),[x,v]=k.useState(""),b=k.useMemo(()=>{const M=new Map;if(r)for(const q of r.items){const w=M.get(q.agentId);(!w||q.timestamp>w.timestamp)&&M.set(q.agentId,q)}return M},[r]);gh(u==null?void 0:u.reports),k.useMemo(()=>{const M=new Map;if(o){for(const q of o.points){const w=M.get(q.agentId)??[];w.push(q),M.set(q.agentId,w)}for(const q of M.values())q.sort((w,K)=>w.day.localeCompare(K.day))}return M},[o]);const S=i.filter(M0).length,O=i.filter(M=>M.scores.accuracy>=.5).length,X=i.reduce((M,q)=>M+q.scores.signals,0),L=i.reduce((M,q)=>M+q.totalTokens,0),V=x.trim().toLowerCase(),A=V?i.filter(M=>M.id.toLowerCase().includes(V)||M.provider.toLowerCase().includes(V)||M.model.toLowerCase().includes(V)):i,W=M=>{const q=M.scores;switch(f){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(M.id);return w?new Date(w.timestamp).getTime():0}}},Z=[...A].sort((M,q)=>{const w=W(M),K=W(q);return g==="desc"?K-w:w-K}),ee=M=>{f===M?p(q=>q==="desc"?"asc":"desc"):(m(M),p("desc"))},J=M=>f===M?g==="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:X.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:L.toLocaleString(),varColor:"var(--ink)"}].map(M=>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:M.varColor},children:M.value}),a.jsx("div",{className:"h-section mt-0.5",children:M.label})]},M.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:x,onChange:M=>v(M.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:Z.map((M,q)=>{const w=M.scores,K=b.get(M.id),le=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(M.id)}`,className:"flex items-center gap-3",children:[a.jsx(os,{agentId:M.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:M.id}),(()=>{const de=ko(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:[M.provider,"/",M.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:le},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:K?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:K.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:K.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:We(K.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},M.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 Uy({tasks:i}){const[r,u]=k.useState(""),[o,f]=k.useState(0),[m,g]=k.useState(null),p=100,x=i.items.filter(A=>A.status==="completed").length,v=i.items.filter(A=>A.status==="failed").length,b=i.items.filter(A=>A.status==="running").length,S=r.trim().toLowerCase(),O=S?i.items.filter(A=>{var W,Z,ee,J;return((W=A.task)==null?void 0:W.toLowerCase().includes(S))||((Z=A.agentId)==null?void 0:Z.toLowerCase().includes(S))||((ee=A.taskId)==null?void 0:ee.toLowerCase().includes(S))||((J=A.status)==null?void 0:J.toLowerCase().includes(S))}):i.items,X=Math.max(1,Math.ceil(O.length/p)),L=Math.min(o,X-1),V=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"]}),v>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:v})," failed"]}),b>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:b})," running"]}),a.jsxs("span",{children:["showing ",V.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:A=>{u(A.target.value),f(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] ${X<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>f(A=>Math.max(0,A-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," / ",X]}),a.jsx("button",{onClick:()=>f(A=>Math.min(X-1,A+1)),disabled:L>=X-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:V.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:V.map(A=>a.jsx(Sh,{task:A,onClick:g},A.taskId))})]})}),a.jsx(jh,{task:m,onClose:()=>g(null)})]})}function qy({consensus:i,consensusReports:r}){const[u,o]=k.useState(!1),f=u?i.runs:i.runs.filter(v=>!v.retracted),m=i.runs.filter(v=>v.retracted).length,g=f.reduce((v,b)=>v+(b.counts.agreement||0),0),p=f.reduce((v,b)=>v+((b.counts.disagreement||0)+(b.counts.hallucination||0)),0),x=f.reduce((v,b)=>v+(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:f.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:g})," 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(v=>!v),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(wg,{consensus:i,filteredRuns:f,reports:r,showAll:!0,hideHeader:!0})]})}function By(){const i=ch(),{overview:r,agents:u,tasks:o,consensus:f,consensusReports:m,fleetTrend:g,skills:p,loading:x,refresh:v}=Ty(),[b,S]=k.useState(0),O=k.useCallback(Z=>{Z.type!=="log_lines"&&v()},[v]);if(ph(O),x||!r||!f)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(Fm,{}),a.jsx("div",{className:"flex items-center justify-center py-20",style:{color:"var(--ink-3)"},children:"Loading dashboard..."})]});let X;const L=i.match(/^\/agent\/(.+)$/),V=i.match(/^\/consensus\/(.+)$/);if(L&&u){const Z=decodeURIComponent(L[1]);X=a.jsx(oy,{agentId:Z,agents:u,tasks:o,consensus:f})}else if(V){const Z=decodeURIComponent(V[1]);X=a.jsx(dg,{consensusId:Z})}else i==="/team"&&u?X=a.jsx(Oy,{agents:u,tasks:o,consensusReports:m,fleetTrend:g}):i==="/tasks"&&o?X=a.jsx(Uy,{tasks:o}):i==="/debates"&&f?X=a.jsx(qy,{consensus:f,consensusReports:m}):i==="/logs"?X=a.jsx(hy,{}):i==="/signals"?X=a.jsx(ky,{}):i==="/violations"?X=a.jsx(Dg,{}):X=a.jsx(Pv,{overview:r,agents:u,tasks:o,consensus:f,consensusReports:m,fleetTrend:g,skills:p,activeTaskCount:b,setActiveTaskCount:S});const W=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(Fm,{}),a.jsx("main",{className:W,children:X})]})}function Ly(){const{authed:i,login:r,error:u}=_y();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(By,{}),a.jsx(Ry,{})]}):a.jsx(fg,{onLogin:r,error:u})}t0.createRoot(document.getElementById("root")).render(a.jsx(k.StrictMode,{children:a.jsx(Ly,{})}));
|