gossipcat 0.6.6 → 0.6.7
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 +8 -0
- package/dist-dashboard/assets/index-BrM1EvA1.css +1 -0
- package/dist-dashboard/assets/index-CqSX6axm.js +81 -0
- package/dist-dashboard/index.html +2 -2
- package/dist-mcp/mcp-server.js +1457 -664
- package/docs/HANDBOOK.md +11 -3
- package/package.json +1 -1
- package/dist-dashboard/assets/index-BEKs0u32.js +0 -81
- package/dist-dashboard/assets/index-CxBsFpD6.css +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var Xg=Object.defineProperty;var Kg=(s,r,u)=>r in s?Xg(s,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[r]=u;var Mt=(s,r,u)=>Kg(s,typeof r!="symbol"?r+"":r,u);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function u(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=u(d);fetch(d.href,f)}})();function Vg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Zc={exports:{}},ai={};/**
|
|
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 ph;function Qg(){if(ph)return ai;ph=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(c,d,f){var p=null;if(f!==void 0&&(p=""+f),d.key!==void 0&&(p=""+d.key),"key"in d){f={};for(var h in d)h!=="key"&&(f[h]=d[h])}else f=d;return d=f.ref,{$$typeof:s,type:c,key:p,ref:d!==void 0?d:null,props:f}}return ai.Fragment=r,ai.jsx=u,ai.jsxs=u,ai}var xh;function Zg(){return xh||(xh=1,Zc.exports=Qg()),Zc.exports}var a=Zg(),Fc={exports:{}},we={};/**
|
|
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 gh;function Fg(){if(gh)return we;gh=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),w=Symbol.iterator;function G(j){return j===null||typeof j!="object"?null:(j=w&&j[w]||j["@@iterator"],typeof j=="function"?j:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,S={};function D(j,B,le){this.props=j,this.context=B,this.refs=S,this.updater=le||R}D.prototype.isReactComponent={},D.prototype.setState=function(j,B){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,B,"setState")},D.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function L(){}L.prototype=D.prototype;function J(j,B,le){this.props=j,this.context=B,this.refs=S,this.updater=le||R}var K=J.prototype=new L;K.constructor=J,A(K,D.prototype),K.isPureReactComponent=!0;var C=Array.isArray;function O(){}var _={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function F(j,B,le){var fe=le.ref;return{$$typeof:s,type:j,key:B,ref:fe!==void 0?fe:null,props:le}}function I(j,B){return F(j.type,B,j.props)}function ue(j){return typeof j=="object"&&j!==null&&j.$$typeof===s}function te(j){var B={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(le){return B[le]})}var oe=/\/+/g;function xe(j,B){return typeof j=="object"&&j!==null&&j.key!=null?te(""+j.key):B.toString(36)}function se(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(O,O):(j.status="pending",j.then(function(B){j.status==="pending"&&(j.status="fulfilled",j.value=B)},function(B){j.status==="pending"&&(j.status="rejected",j.reason=B)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function y(j,B,le,fe,Y){var ae=typeof j;(ae==="undefined"||ae==="boolean")&&(j=null);var he=!1;if(j===null)he=!0;else switch(ae){case"bigint":case"string":case"number":he=!0;break;case"object":switch(j.$$typeof){case s:case r:he=!0;break;case v:return he=j._init,y(he(j._payload),B,le,fe,Y)}}if(he)return Y=Y(j),he=fe===""?"."+xe(j,0):fe,C(Y)?(le="",he!=null&&(le=he.replace(oe,"$&/")+"/"),y(Y,B,le,"",function(tt){return tt})):Y!=null&&(ue(Y)&&(Y=I(Y,le+(Y.key==null||j&&j.key===Y.key?"":(""+Y.key).replace(oe,"$&/")+"/")+he)),B.push(Y)),1;he=0;var Oe=fe===""?".":fe+":";if(C(j))for(var ze=0;ze<j.length;ze++)fe=j[ze],ae=Oe+xe(fe,ze),he+=y(fe,B,le,ae,Y);else if(ze=G(j),typeof ze=="function")for(j=ze.call(j),ze=0;!(fe=j.next()).done;)fe=fe.value,ae=Oe+xe(fe,ze++),he+=y(fe,B,le,ae,Y);else if(ae==="object"){if(typeof j.then=="function")return y(se(j),B,le,fe,Y);throw B=String(j),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return he}function H(j,B,le){if(j==null)return j;var fe=[],Y=0;return y(j,fe,"","",function(ae){return B.call(le,ae,Y++)}),fe}function Q(j){if(j._status===-1){var B=j._result;B=B(),B.then(function(le){(j._status===0||j._status===-1)&&(j._status=1,j._result=le)},function(le){(j._status===0||j._status===-1)&&(j._status=2,j._result=le)}),j._status===-1&&(j._status=0,j._result=B)}if(j._status===1)return j._result.default;throw j._result}var ne=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},re={map:H,forEach:function(j,B,le){H(j,function(){B.apply(this,arguments)},le)},count:function(j){var B=0;return H(j,function(){B++}),B},toArray:function(j){return H(j,function(B){return B})||[]},only:function(j){if(!ue(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return we.Activity=k,we.Children=re,we.Component=D,we.Fragment=u,we.Profiler=d,we.PureComponent=J,we.StrictMode=c,we.Suspense=x,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,we.__COMPILER_RUNTIME={__proto__:null,c:function(j){return _.H.useMemoCache(j)}},we.cache=function(j){return function(){return j.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(j,B,le){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var fe=A({},j.props),Y=j.key;if(B!=null)for(ae in B.key!==void 0&&(Y=""+B.key),B)!V.call(B,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&B.ref===void 0||(fe[ae]=B[ae]);var ae=arguments.length-2;if(ae===1)fe.children=le;else if(1<ae){for(var he=Array(ae),Oe=0;Oe<ae;Oe++)he[Oe]=arguments[Oe+2];fe.children=he}return F(j.type,Y,fe)},we.createContext=function(j){return j={$$typeof:p,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:f,_context:j},j},we.createElement=function(j,B,le){var fe,Y={},ae=null;if(B!=null)for(fe in B.key!==void 0&&(ae=""+B.key),B)V.call(B,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(Y[fe]=B[fe]);var he=arguments.length-2;if(he===1)Y.children=le;else if(1<he){for(var Oe=Array(he),ze=0;ze<he;ze++)Oe[ze]=arguments[ze+2];Y.children=Oe}if(j&&j.defaultProps)for(fe in he=j.defaultProps,he)Y[fe]===void 0&&(Y[fe]=he[fe]);return F(j,ae,Y)},we.createRef=function(){return{current:null}},we.forwardRef=function(j){return{$$typeof:h,render:j}},we.isValidElement=ue,we.lazy=function(j){return{$$typeof:v,_payload:{_status:-1,_result:j},_init:Q}},we.memo=function(j,B){return{$$typeof:g,type:j,compare:B===void 0?null:B}},we.startTransition=function(j){var B=_.T,le={};_.T=le;try{var fe=j(),Y=_.S;Y!==null&&Y(le,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(O,ne)}catch(ae){ne(ae)}finally{B!==null&&le.types!==null&&(B.types=le.types),_.T=B}},we.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},we.use=function(j){return _.H.use(j)},we.useActionState=function(j,B,le){return _.H.useActionState(j,B,le)},we.useCallback=function(j,B){return _.H.useCallback(j,B)},we.useContext=function(j){return _.H.useContext(j)},we.useDebugValue=function(){},we.useDeferredValue=function(j,B){return _.H.useDeferredValue(j,B)},we.useEffect=function(j,B){return _.H.useEffect(j,B)},we.useEffectEvent=function(j){return _.H.useEffectEvent(j)},we.useId=function(){return _.H.useId()},we.useImperativeHandle=function(j,B,le){return _.H.useImperativeHandle(j,B,le)},we.useInsertionEffect=function(j,B){return _.H.useInsertionEffect(j,B)},we.useLayoutEffect=function(j,B){return _.H.useLayoutEffect(j,B)},we.useMemo=function(j,B){return _.H.useMemo(j,B)},we.useOptimistic=function(j,B){return _.H.useOptimistic(j,B)},we.useReducer=function(j,B,le){return _.H.useReducer(j,B,le)},we.useRef=function(j){return _.H.useRef(j)},we.useState=function(j){return _.H.useState(j)},we.useSyncExternalStore=function(j,B,le){return _.H.useSyncExternalStore(j,B,le)},we.useTransition=function(){return _.H.useTransition()},we.version="19.2.6",we}var bh;function Tu(){return bh||(bh=1,Fc.exports=Fg()),Fc.exports}var N=Tu(),Jc={exports:{}},li={},Wc={exports:{}},Pc={};/**
|
|
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 vh;function Jg(){return vh||(vh=1,(function(s){function r(y,H){var Q=y.length;y.push(H);e:for(;0<Q;){var ne=Q-1>>>1,re=y[ne];if(0<d(re,H))y[ne]=H,y[Q]=re,Q=ne;else break e}}function u(y){return y.length===0?null:y[0]}function c(y){if(y.length===0)return null;var H=y[0],Q=y.pop();if(Q!==H){y[0]=Q;e:for(var ne=0,re=y.length,j=re>>>1;ne<j;){var B=2*(ne+1)-1,le=y[B],fe=B+1,Y=y[fe];if(0>d(le,Q))fe<re&&0>d(Y,le)?(y[ne]=Y,y[fe]=Q,ne=fe):(y[ne]=le,y[B]=Q,ne=B);else if(fe<re&&0>d(Y,Q))y[ne]=Y,y[fe]=Q,ne=fe;else break e}}return H}function d(y,H){var Q=y.sortIndex-H.sortIndex;return Q!==0?Q:y.id-H.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var p=Date,h=p.now();s.unstable_now=function(){return p.now()-h}}var x=[],g=[],v=1,k=null,w=3,G=!1,R=!1,A=!1,S=!1,D=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function K(y){for(var H=u(g);H!==null;){if(H.callback===null)c(g);else if(H.startTime<=y)c(g),H.sortIndex=H.expirationTime,r(x,H);else break;H=u(g)}}function C(y){if(A=!1,K(y),!R)if(u(x)!==null)R=!0,O||(O=!0,te());else{var H=u(g);H!==null&&se(C,H.startTime-y)}}var O=!1,_=-1,V=5,F=-1;function I(){return S?!0:!(s.unstable_now()-F<V)}function ue(){if(S=!1,O){var y=s.unstable_now();F=y;var H=!0;try{e:{R=!1,A&&(A=!1,L(_),_=-1),G=!0;var Q=w;try{t:{for(K(y),k=u(x);k!==null&&!(k.expirationTime>y&&I());){var ne=k.callback;if(typeof ne=="function"){k.callback=null,w=k.priorityLevel;var re=ne(k.expirationTime<=y);if(y=s.unstable_now(),typeof re=="function"){k.callback=re,K(y),H=!0;break t}k===u(x)&&c(x),K(y)}else c(x);k=u(x)}if(k!==null)H=!0;else{var j=u(g);j!==null&&se(C,j.startTime-y),H=!1}}break e}finally{k=null,w=Q,G=!1}H=void 0}}finally{H?te():O=!1}}}var te;if(typeof J=="function")te=function(){J(ue)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,xe=oe.port2;oe.port1.onmessage=ue,te=function(){xe.postMessage(null)}}else te=function(){D(ue,0)};function se(y,H){_=D(function(){y(s.unstable_now())},H)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(y){y.callback=null},s.unstable_forceFrameRate=function(y){0>y||125<y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<y?Math.floor(1e3/y):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_next=function(y){switch(w){case 1:case 2:case 3:var H=3;break;default:H=w}var Q=w;w=H;try{return y()}finally{w=Q}},s.unstable_requestPaint=function(){S=!0},s.unstable_runWithPriority=function(y,H){switch(y){case 1:case 2:case 3:case 4:case 5:break;default:y=3}var Q=w;w=y;try{return H()}finally{w=Q}},s.unstable_scheduleCallback=function(y,H,Q){var ne=s.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ne+Q:ne):Q=ne,y){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=Q+re,y={id:v++,callback:H,priorityLevel:y,startTime:Q,expirationTime:re,sortIndex:-1},Q>ne?(y.sortIndex=Q,r(g,y),u(x)===null&&y===u(g)&&(A?(L(_),_=-1):A=!0,se(C,Q-ne))):(y.sortIndex=re,r(x,y),R||G||(R=!0,O||(O=!0,te()))),y},s.unstable_shouldYield=I,s.unstable_wrapCallback=function(y){var H=w;return function(){var Q=w;w=H;try{return y.apply(this,arguments)}finally{w=Q}}}})(Pc)),Pc}var yh;function Wg(){return yh||(yh=1,Wc.exports=Jg()),Wc.exports}var eu={exports:{}},qt={};/**
|
|
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 Nh;function Pg(){if(Nh)return qt;Nh=1;var s=Tu();function r(x){var g="https://react.dev/errors/"+x;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+x+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(r(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(x,g,v){var k=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:k==null?null:""+k,children:x,containerInfo:g,implementation:v}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(x,g){if(x==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,qt.createPortal=function(x,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return f(x,g,null,v)},qt.flushSync=function(x){var g=p.T,v=c.p;try{if(p.T=null,c.p=2,x)return x()}finally{p.T=g,c.p=v,c.d.f()}},qt.preconnect=function(x,g){typeof x=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,c.d.C(x,g))},qt.prefetchDNS=function(x){typeof x=="string"&&c.d.D(x)},qt.preinit=function(x,g){if(typeof x=="string"&&g&&typeof g.as=="string"){var v=g.as,k=h(v,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,G=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?c.d.S(x,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:k,integrity:w,fetchPriority:G}):v==="script"&&c.d.X(x,{crossOrigin:k,integrity:w,fetchPriority:G,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},qt.preinitModule=function(x,g){if(typeof x=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=h(g.as,g.crossOrigin);c.d.M(x,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&c.d.M(x)},qt.preload=function(x,g){if(typeof x=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,k=h(v,g.crossOrigin);c.d.L(x,v,{crossOrigin:k,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},qt.preloadModule=function(x,g){if(typeof x=="string")if(g){var v=h(g.as,g.crossOrigin);c.d.m(x,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else c.d.m(x)},qt.requestFormReset=function(x){c.d.r(x)},qt.unstable_batchedUpdates=function(x,g){return x(g)},qt.useFormState=function(x,g,v){return p.H.useFormState(x,g,v)},qt.useFormStatus=function(){return p.H.useHostTransitionStatus()},qt.version="19.2.6",qt}var jh;function eb(){if(jh)return eu.exports;jh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),eu.exports=Pg(),eu.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 Sh;function tb(){if(Sh)return li;Sh=1;var s=Wg(),r=Tu(),u=eb();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(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 h(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(f(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return x(i),e;if(o===l)return x(i),t;o=o.sibling}throw Error(c(188))}if(n.return!==l.return)n=i,l=o;else{for(var m=!1,b=i.child;b;){if(b===n){m=!0,n=i,l=o;break}if(b===l){m=!0,l=i,n=o;break}b=b.sibling}if(!m){for(b=o.child;b;){if(b===n){m=!0,n=o,l=i;break}if(b===l){m=!0,l=o,n=i;break}b=b.sibling}if(!m)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var k=Object.assign,w=Symbol.for("react.element"),G=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),J=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case D:return"Profiler";case S:return"StrictMode";case C:return"Suspense";case O:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case J:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var se=Array.isArray,y=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,Q={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function j(e){return{current:e}}function B(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function le(e,t){re++,ne[re]=e.current,e.current=t}var fe=j(null),Y=j(null),ae=j(null),he=j(null);function Oe(e,t){switch(le(ae,t),le(Y,e),le(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Um(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Um(t),e=$m(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(fe),le(fe,e)}function ze(){B(fe),B(Y),B(ae)}function tt(e){e.memoizedState!==null&&le(he,e);var t=fe.current,n=$m(t,e.type);t!==n&&(le(Y,e),le(fe,n))}function Ht(e){Y.current===e&&(B(fe),B(Y)),he.current===e&&(B(he),Ps._currentValue=Q)}var Ct,Cn;function It(e){if(Ct===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ct=t&&t[1]||"",Cn=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ct+e+Cn}var Xe=!1;function Rn(e,t){if(!e||Xe)return"";Xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(X){var q=X}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(X){q=X}e.call(ee.prototype)}}else{try{throw Error()}catch(X){q=X}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(X){if(X&&q&&typeof X.stack=="string")return[X.stack,q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),m=o[0],b=o[1];if(m&&b){var E=m.split(`
|
|
44
|
+
`),$=b.split(`
|
|
45
|
+
`);for(i=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;i<$.length&&!$[i].includes("DetermineComponentFrameRoot");)i++;if(l===E.length||i===$.length)for(l=E.length-1,i=$.length-1;1<=l&&0<=i&&E[l]!==$[i];)i--;for(;1<=l&&0<=i;l--,i--)if(E[l]!==$[i]){if(l!==1||i!==1)do if(l--,i--,0>i||E[l]!==$[i]){var Z=`
|
|
46
|
+
`+E[l].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=l&&0<=i);break}}}finally{Xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?It(n):""}function ma(e,t){switch(e.tag){case 26:case 27:case 5:return It(e.type);case 16:return It("Lazy");case 13:return e.child!==t&&t!==null?It("Suspense Fallback"):It("Suspense");case 19:return It("SuspenseList");case 0:case 15:return Rn(e.type,!1);case 11:return Rn(e.type.render,!1);case 1:return Rn(e.type,!0);case 31:return It("Activity");default:return""}}function On(e){try{var t="",n=null;do t+=ma(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var En=Object.prototype.hasOwnProperty,hn=s.unstable_scheduleCallback,Yn=s.unstable_cancelCallback,de=s.unstable_shouldYield,Te=s.unstable_requestPaint,Ae=s.unstable_now,Tt=s.unstable_getCurrentPriorityLevel,Et=s.unstable_ImmediatePriority,wn=s.unstable_UserBlockingPriority,ft=s.unstable_NormalPriority,vl=s.unstable_LowPriority,Xn=s.unstable_IdlePriority,Yr=s.log,Xr=s.unstable_setDisableYieldValue,Ya=null,Bt=null;function Dn(e){if(typeof Yr=="function"&&Xr(e),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(Ya,e)}catch{}}var Gt=Math.clz32?Math.clz32:fi,Kr=Math.log,cs=Math.LN2;function fi(e){return e>>>=0,e===0?32:31-(Kr(e)/cs|0)|0}var Xa=256,yl=262144,Ka=4194304;function Vt(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 T(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,o=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var b=l&134217727;return b!==0?(l=b&~o,l!==0?i=Vt(l):(m&=b,m!==0?i=Vt(m):n||(n=b&~e,n!==0&&(i=Vt(n))))):(b=l&~o,b!==0?i=Vt(b):m!==0?i=Vt(m):n||(n=l&~e,n!==0&&(i=Vt(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function W(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function me(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 Ee(){var e=Ka;return Ka<<=1,(Ka&62914560)===0&&(Ka=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function be(e,t,n,l,i,o){var m=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 b=e.entanglements,E=e.expirationTimes,$=e.hiddenUpdates;for(n=m&~n;0<n;){var Z=31-Gt(n),ee=1<<Z;b[Z]=0,E[Z]=-1;var q=$[Z];if(q!==null)for($[Z]=null,Z=0;Z<q.length;Z++){var X=q[Z];X!==null&&(X.lane&=-536870913)}n&=~ee}l!==0&&pe(e,l,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(m&~t))}function pe(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 _e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Gt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function mt(e,t){var n=t&-t;return n=(n&42)!==0?1:it(n),(n&(e.suspendedLanes|t))!==0?0:n}function it(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 Kn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Nl(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function jl(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var zn=Math.random().toString(36).slice(2),ht="__reactFiber$"+zn,Ut="__reactProps$"+zn,ha="__reactContainer$"+zn,us="__reactEvents$"+zn,mi="__reactListeners$"+zn,Sl="__reactHandles$"+zn,hi="__reactResources$"+zn,Va="__reactMarker$"+zn;function ds(e){delete e[ht],delete e[Ut],delete e[us],delete e[mi],delete e[Sl]}function Yt(e){var t=e[ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ha]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Km(e);e!==null;){if(n=e[ht])return n;e=Km(e)}return t}e=n,n=e.parentNode}return null}function Vn(e){if(e=e[ht]||e[ha]){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(c(33))}function xa(e){var t=e[hi];return t||(t=e[hi]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[Va]=!0}var pi=new Set,Qa={};function Qn(e,t){ie(e,t),ie(e+"Capture",t)}function ie(e,t){for(Qa[e]=t,e=0;e<t.length;e++)pi.add(t[e])}var Ne=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]*$"),De={},Ke={};function pt(e){return En.call(Ke,e)?!0:En.call(De,e)?!1:Ne.test(e)?Ke[e]=!0:(De[e]=!0,!1)}function $t(e,t,n){if(pt(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 nn(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 Qt(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 nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function an(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xi(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 i=l.get,o=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(m){n=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kl(e){if(!e._valueTracker){var t=an(e)?"checked":"value";e._valueTracker=xi(e,t,""+e[t])}}function fs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=an(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function _l(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 Vr=/[\n"\\]/g;function Zt(e){return e.replace(Vr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ms(e,t,n,l,i,o,m,b){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nt(t)):e.value!==""+nt(t)&&(e.value=""+nt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?El(e,m,nt(t)):n!=null?El(e,m,nt(n)):l!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+nt(b):e.removeAttribute("name")}function Za(e,t,n,l,i,o,m,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){kl(e);return}n=n!=null?""+nt(n):"",t=t!=null?""+nt(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=b?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),kl(e)}function El(e,t,n){t==="number"&&_l(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Rt(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gi(e,t,n){if(t!=null&&(t=""+nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+nt(n):""}function wl(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(se(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=nt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),kl(e)}function ke(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bi=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 yt(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||bi.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ve(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(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 i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&yt(e,i,l)}else for(var o in t)t.hasOwnProperty(o)&&yt(e,o,t[o])}function ga(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 Zn=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"]]),hs=/^[\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 ba(e){return hs.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ce(){}var ve=null;function Me(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ue=null,ct=null;function pn(e){var t=Vn(e);if(t&&(e=t.stateNode)){var n=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(ms(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="'+Zt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Ut]||null;if(!i)throw Error(c(90));ms(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&fs(l)}break e;case"textarea":gi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var ps=!1;function vi(e,t,n){if(ps)return e(t,n);ps=!0;try{var l=e(t);return l}finally{if(ps=!1,(Ue!==null||ct!==null)&&(ir(),Ue&&(t=Ue,e=ct,ct=Ue=null,pn(t),e)))for(t=0;t<e.length;t++)pn(e[t])}}function xs(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(c(231,t,typeof n));return n}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qr=!1;if(Fn)try{var gs={};Object.defineProperty(gs,"passive",{get:function(){Qr=!0}}),window.addEventListener("test",gs,gs),window.removeEventListener("test",gs,gs)}catch{Qr=!1}var va=null,Zr=null,yi=null;function Uu(){if(yi)return yi;var e,t=Zr,n=t.length,l,i="value"in va?va.value:va.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var m=n-e;for(l=1;l<=m&&t[n-l]===i[o-l];l++);return yi=i.slice(e,1<l?1-l:void 0)}function Ni(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 ji(){return!0}function $u(){return!1}function Ft(e){function t(n,l,i,o,m){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(o):o[b]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ji:$u,this.isPropagationStopped=$u,this}return k(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=ji)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ji)},persist:function(){},isPersistent:ji}),t}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Si=Ft(Fa),bs=k({},Fa,{view:0,detail:0}),Gp=Ft(bs),Fr,Jr,vs,ki=k({},bs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pr,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!==vs&&(vs&&e.type==="mousemove"?(Fr=e.screenX-vs.screenX,Jr=e.screenY-vs.screenY):Jr=Fr=0,vs=e),Fr)},movementY:function(e){return"movementY"in e?e.movementY:Jr}}),qu=Ft(ki),Yp=k({},ki,{dataTransfer:0}),Xp=Ft(Yp),Kp=k({},bs,{relatedTarget:0}),Wr=Ft(Kp),Vp=k({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),Qp=Ft(Vp),Zp=k({},Fa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fp=Ft(Zp),Jp=k({},Fa,{data:0}),Hu=Ft(Jp),Wp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pp={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"},ex={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ex[e])?!!t[e]:!1}function Pr(){return tx}var nx=k({},bs,{key:function(e){if(e.key){var t=Wp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ni(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pr,charCode:function(e){return e.type==="keypress"?Ni(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ni(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ax=Ft(nx),lx=k({},ki,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Iu=Ft(lx),sx=k({},bs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pr}),ix=Ft(sx),rx=k({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),ox=Ft(rx),cx=k({},ki,{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}),ux=Ft(cx),dx=k({},Fa,{newState:0,oldState:0}),fx=Ft(dx),mx=[9,13,27,32],eo=Fn&&"CompositionEvent"in window,ys=null;Fn&&"documentMode"in document&&(ys=document.documentMode);var hx=Fn&&"TextEvent"in window&&!ys,Gu=Fn&&(!eo||ys&&8<ys&&11>=ys),Yu=" ",Xu=!1;function Ku(e,t){switch(e){case"keyup":return mx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tl=!1;function px(e,t){switch(e){case"compositionend":return Vu(t);case"keypress":return t.which!==32?null:(Xu=!0,Yu);case"textInput":return e=t.data,e===Yu&&Xu?null:e;default:return null}}function xx(e,t){if(Tl)return e==="compositionend"||!eo&&Ku(e,t)?(e=Uu(),yi=Zr=va=null,Tl=!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 Gu&&t.locale!=="ko"?null:t.data;default:return null}}var gx={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 Qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gx[e.type]:t==="textarea"}function Zu(e,t,n,l){Ue?ct?ct.push(l):ct=[l]:Ue=l,t=mr(t,"onChange"),0<t.length&&(n=new Si("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Ns=null,js=null;function bx(e){Rm(e,0)}function _i(e){var t=pa(e);if(fs(t))return e}function Fu(e,t){if(e==="change")return t}var Ju=!1;if(Fn){var to;if(Fn){var no="oninput"in document;if(!no){var Wu=document.createElement("div");Wu.setAttribute("oninput","return;"),no=typeof Wu.oninput=="function"}to=no}else to=!1;Ju=to&&(!document.documentMode||9<document.documentMode)}function Pu(){Ns&&(Ns.detachEvent("onpropertychange",ed),js=Ns=null)}function ed(e){if(e.propertyName==="value"&&_i(js)){var t=[];Zu(t,js,e,Me(e)),vi(bx,t)}}function vx(e,t,n){e==="focusin"?(Pu(),Ns=t,js=n,Ns.attachEvent("onpropertychange",ed)):e==="focusout"&&Pu()}function yx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _i(js)}function Nx(e,t){if(e==="click")return _i(t)}function jx(e,t){if(e==="input"||e==="change")return _i(t)}function Sx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:Sx;function Ss(e,t){if(ln(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 i=n[l];if(!En.call(t,i)||!ln(e[i],t[i]))return!1}return!0}function td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nd(e,t){var n=td(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=td(n)}}function ad(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ad(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ld(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_l(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=_l(e.document)}return t}function ao(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 kx=Fn&&"documentMode"in document&&11>=document.documentMode,Al=null,lo=null,ks=null,so=!1;function sd(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;so||Al==null||Al!==_l(l)||(l=Al,"selectionStart"in l&&ao(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}),ks&&Ss(ks,l)||(ks=l,l=mr(lo,"onSelect"),0<l.length&&(t=new Si("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Al)))}function Ja(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ml={animationend:Ja("Animation","AnimationEnd"),animationiteration:Ja("Animation","AnimationIteration"),animationstart:Ja("Animation","AnimationStart"),transitionrun:Ja("Transition","TransitionRun"),transitionstart:Ja("Transition","TransitionStart"),transitioncancel:Ja("Transition","TransitionCancel"),transitionend:Ja("Transition","TransitionEnd")},io={},id={};Fn&&(id=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Wa(e){if(io[e])return io[e];if(!Ml[e])return e;var t=Ml[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in id)return io[e]=t[n];return e}var rd=Wa("animationend"),od=Wa("animationiteration"),cd=Wa("animationstart"),_x=Wa("transitionrun"),Ex=Wa("transitionstart"),wx=Wa("transitioncancel"),ud=Wa("transitionend"),dd=new Map,ro="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(" ");ro.push("scrollEnd");function Tn(e,t){dd.set(e,t),Qn(t,[e])}var Ei=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)},xn=[],Cl=0,oo=0;function wi(){for(var e=Cl,t=oo=Cl=0;t<e;){var n=xn[t];xn[t++]=null;var l=xn[t];xn[t++]=null;var i=xn[t];xn[t++]=null;var o=xn[t];if(xn[t++]=null,l!==null&&i!==null){var m=l.pending;m===null?i.next=i:(i.next=m.next,m.next=i),l.pending=i}o!==0&&fd(n,i,o)}}function Ti(e,t,n,l){xn[Cl++]=e,xn[Cl++]=t,xn[Cl++]=n,xn[Cl++]=l,oo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function co(e,t,n,l){return Ti(e,t,n,l),Ai(e)}function Pa(e,t){return Ti(e,null,null,t),Ai(e)}function fd(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,l=o.alternate,l!==null&&(l.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-Gt(n),e=o.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),o):null}function Ai(e){if(50<Ks)throw Ks=0,vc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Rl={};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 sn(e,t,n,l){return new Tx(e,t,n,l)}function uo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var n=e.alternate;return n===null?(n=sn(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 md(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 Mi(e,t,n,l,i,o){var m=0;if(l=e,typeof e=="function")uo(e)&&(m=1);else if(typeof e=="string")m=Og(e,n,fe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=sn(31,n,t,i),e.elementType=F,e.lanes=o,e;case A:return el(n.children,i,o,t);case S:m=8,i|=24;break;case D:return e=sn(12,n,t,i|2),e.elementType=D,e.lanes=o,e;case C:return e=sn(13,n,t,i),e.elementType=C,e.lanes=o,e;case O:return e=sn(19,n,t,i),e.elementType=O,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:m=10;break e;case L:m=9;break e;case K:m=11;break e;case _:m=14;break e;case V:m=16,l=null;break e}m=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=sn(m,n,t,i),t.elementType=e,t.type=l,t.lanes=o,t}function el(e,t,n,l){return e=sn(7,e,l,t),e.lanes=n,e}function fo(e,t,n){return e=sn(6,e,null,t),e.lanes=n,e}function hd(e){var t=sn(18,null,null,0);return t.stateNode=e,t}function mo(e,t,n){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pd=new WeakMap;function gn(e,t){if(typeof e=="object"&&e!==null){var n=pd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:On(t)},pd.set(e,t),t)}return{value:e,source:t,stack:On(t)}}var Ol=[],Dl=0,Ci=null,_s=0,bn=[],vn=0,ya=null,Ln=1,Bn="";function Wn(e,t){Ol[Dl++]=_s,Ol[Dl++]=Ci,Ci=e,_s=t}function xd(e,t,n){bn[vn++]=Ln,bn[vn++]=Bn,bn[vn++]=ya,ya=e;var l=Ln;e=Bn;var i=32-Gt(l)-1;l&=~(1<<i),n+=1;var o=32-Gt(t)+i;if(30<o){var m=i-i%5;o=(l&(1<<m)-1).toString(32),l>>=m,i-=m,Ln=1<<32-Gt(t)+i|n<<i|l,Bn=o+e}else Ln=1<<o|n<<i|l,Bn=e}function ho(e){e.return!==null&&(Wn(e,1),xd(e,1,0))}function po(e){for(;e===Ci;)Ci=Ol[--Dl],Ol[Dl]=null,_s=Ol[--Dl],Ol[Dl]=null;for(;e===ya;)ya=bn[--vn],bn[vn]=null,Bn=bn[--vn],bn[vn]=null,Ln=bn[--vn],bn[vn]=null}function gd(e,t){bn[vn++]=Ln,bn[vn++]=Bn,bn[vn++]=ya,Ln=t.id,Bn=t.overflow,ya=e}var Ot=null,lt=null,He=!1,Na=null,yn=!1,xo=Error(c(519));function ja(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Es(gn(t,e)),xo}function bd(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[ht]=e,t[Ut]=l,n){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(n=0;n<Qs.length;n++)Be(Qs[n],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),Za(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),wl(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||Lm(t.textContent,n)?(l.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),l.onScroll!=null&&Be("scroll",t),l.onScrollEnd!=null&&Be("scrollend",t),l.onClick!=null&&(t.onclick=ce),t=!0):t=!1,t||ja(e,!0)}function vd(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:yn=!1;return;case 27:case 3:yn=!0;return;default:Ot=Ot.return}}function zl(e){if(e!==Ot)return!1;if(!He)return vd(e),He=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Dc(e.type,e.memoizedProps)),n=!n),n&<&&ja(e),vd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));lt=Xm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));lt=Xm(e)}else t===27?(t=lt,La(e.type)?(e=$c,$c=null,lt=e):lt=t):lt=Ot?jn(e.stateNode.nextSibling):null;return!0}function tl(){lt=Ot=null,He=!1}function go(){var e=Na;return e!==null&&(en===null?en=e:en.push.apply(en,e),Na=null),e}function Es(e){Na===null?Na=[e]:Na.push(e)}var bo=j(null),nl=null,Pn=null;function Sa(e,t,n){le(bo,t._currentValue),t._currentValue=n}function ea(e){e._currentValue=bo.current,B(bo)}function vo(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 yo(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var m=i.child;o=o.firstContext;e:for(;o!==null;){var b=o;o=i;for(var E=0;E<t.length;E++)if(b.context===t[E]){o.lanes|=n,b=o.alternate,b!==null&&(b.lanes|=n),vo(o.return,n,e),l||(m=null);break e}o=b.next}}else if(i.tag===18){if(m=i.return,m===null)throw Error(c(341));m.lanes|=n,o=m.alternate,o!==null&&(o.lanes|=n),vo(m,n,e),m=null}else m=i.child;if(m!==null)m.return=i;else for(m=i;m!==null;){if(m===e){m=null;break}if(i=m.sibling,i!==null){i.return=m.return,m=i;break}m=m.return}i=m}}function Ll(e,t,n,l){e=null;for(var i=t,o=!1;i!==null;){if(!o){if((i.flags&524288)!==0)o=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var m=i.alternate;if(m===null)throw Error(c(387));if(m=m.memoizedProps,m!==null){var b=i.type;ln(i.pendingProps.value,m.value)||(e!==null?e.push(b):e=[b])}}else if(i===he.current){if(m=i.alternate,m===null)throw Error(c(387));m.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ps):e=[Ps])}i=i.return}e!==null&&yo(t,e,n,l),t.flags|=262144}function Ri(e){for(e=e.firstContext;e!==null;){if(!ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function al(e){nl=e,Pn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return yd(nl,e)}function Oi(e,t){return nl===null&&al(e),yd(e,t)}function yd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pn===null){if(e===null)throw Error(c(308));Pn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pn=Pn.next=t;return n}var Ax=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Mx=s.unstable_scheduleCallback,Cx=s.unstable_NormalPriority,Nt={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function No(){return{controller:new Ax,data:new Map,refCount:0}}function ws(e){e.refCount--,e.refCount===0&&Mx(Cx,function(){e.controller.abort()})}var Ts=null,jo=0,Bl=0,Ul=null;function Rx(e,t){if(Ts===null){var n=Ts=[];jo=0,Bl=_c(),Ul={status:"pending",value:void 0,then:function(l){n.push(l)}}}return jo++,t.then(Nd,Nd),t}function Nd(){if(--jo===0&&Ts!==null){Ul!==null&&(Ul.status="fulfilled");var e=Ts;Ts=null,Bl=0,Ul=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ox(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var jd=y.S;y.S=function(e,t){im=Ae(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Rx(e,t),jd!==null&&jd(e,t)};var ll=j(null);function So(){var e=ll.current;return e!==null?e:et.pooledCache}function Di(e,t){t===null?le(ll,ll.current):le(ll,t.pool)}function Sd(){var e=So();return e===null?null:{parent:Nt._currentValue,pool:e}}var $l=Error(c(460)),ko=Error(c(474)),zi=Error(c(542)),Li={then:function(){}};function kd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function _d(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ce,ce),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wd(e),e;default:if(typeof t.status=="string")t.then(ce,ce);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wd(e),e}throw il=t,$l}}function sl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(il=n,$l):n}}var il=null;function Ed(){if(il===null)throw Error(c(459));var e=il;return il=null,e}function wd(e){if(e===$l||e===zi)throw Error(c(483))}var ql=null,As=0;function Bi(e){var t=As;return As+=1,ql===null&&(ql=[]),_d(ql,e,t)}function Ms(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ui(e,t){throw t.$$typeof===w?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Td(e){function t(z,M){if(e){var U=z.deletions;U===null?(z.deletions=[M],z.flags|=16):U.push(M)}}function n(z,M){if(!e)return null;for(;M!==null;)t(z,M),M=M.sibling;return null}function l(z){for(var M=new Map;z!==null;)z.key!==null?M.set(z.key,z):M.set(z.index,z),z=z.sibling;return M}function i(z,M){return z=Jn(z,M),z.index=0,z.sibling=null,z}function o(z,M,U){return z.index=U,e?(U=z.alternate,U!==null?(U=U.index,U<M?(z.flags|=67108866,M):U):(z.flags|=67108866,M)):(z.flags|=1048576,M)}function m(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function b(z,M,U,P){return M===null||M.tag!==6?(M=fo(U,z.mode,P),M.return=z,M):(M=i(M,U),M.return=z,M)}function E(z,M,U,P){var je=U.type;return je===A?Z(z,M,U.props.children,P,U.key):M!==null&&(M.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===V&&sl(je)===M.type)?(M=i(M,U.props),Ms(M,U),M.return=z,M):(M=Mi(U.type,U.key,U.props,null,z.mode,P),Ms(M,U),M.return=z,M)}function $(z,M,U,P){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=mo(U,z.mode,P),M.return=z,M):(M=i(M,U.children||[]),M.return=z,M)}function Z(z,M,U,P,je){return M===null||M.tag!==7?(M=el(U,z.mode,P,je),M.return=z,M):(M=i(M,U),M.return=z,M)}function ee(z,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=fo(""+M,z.mode,U),M.return=z,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case G:return U=Mi(M.type,M.key,M.props,null,z.mode,U),Ms(U,M),U.return=z,U;case R:return M=mo(M,z.mode,U),M.return=z,M;case V:return M=sl(M),ee(z,M,U)}if(se(M)||te(M))return M=el(M,z.mode,U,null),M.return=z,M;if(typeof M.then=="function")return ee(z,Bi(M),U);if(M.$$typeof===J)return ee(z,Oi(z,M),U);Ui(z,M)}return null}function q(z,M,U,P){var je=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return je!==null?null:b(z,M,""+U,P);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case G:return U.key===je?E(z,M,U,P):null;case R:return U.key===je?$(z,M,U,P):null;case V:return U=sl(U),q(z,M,U,P)}if(se(U)||te(U))return je!==null?null:Z(z,M,U,P,null);if(typeof U.then=="function")return q(z,M,Bi(U),P);if(U.$$typeof===J)return q(z,M,Oi(z,U),P);Ui(z,U)}return null}function X(z,M,U,P,je){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return z=z.get(U)||null,b(M,z,""+P,je);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case G:return z=z.get(P.key===null?U:P.key)||null,E(M,z,P,je);case R:return z=z.get(P.key===null?U:P.key)||null,$(M,z,P,je);case V:return P=sl(P),X(z,M,U,P,je)}if(se(P)||te(P))return z=z.get(U)||null,Z(M,z,P,je,null);if(typeof P.then=="function")return X(z,M,U,Bi(P),je);if(P.$$typeof===J)return X(z,M,U,Oi(M,P),je);Ui(M,P)}return null}function ge(z,M,U,P){for(var je=null,Ie=null,ye=M,Re=M=0,qe=null;ye!==null&&Re<U.length;Re++){ye.index>Re?(qe=ye,ye=null):qe=ye.sibling;var Ge=q(z,ye,U[Re],P);if(Ge===null){ye===null&&(ye=qe);break}e&&ye&&Ge.alternate===null&&t(z,ye),M=o(Ge,M,Re),Ie===null?je=Ge:Ie.sibling=Ge,Ie=Ge,ye=qe}if(Re===U.length)return n(z,ye),He&&Wn(z,Re),je;if(ye===null){for(;Re<U.length;Re++)ye=ee(z,U[Re],P),ye!==null&&(M=o(ye,M,Re),Ie===null?je=ye:Ie.sibling=ye,Ie=ye);return He&&Wn(z,Re),je}for(ye=l(ye);Re<U.length;Re++)qe=X(ye,z,Re,U[Re],P),qe!==null&&(e&&qe.alternate!==null&&ye.delete(qe.key===null?Re:qe.key),M=o(qe,M,Re),Ie===null?je=qe:Ie.sibling=qe,Ie=qe);return e&&ye.forEach(function(Ha){return t(z,Ha)}),He&&Wn(z,Re),je}function Se(z,M,U,P){if(U==null)throw Error(c(151));for(var je=null,Ie=null,ye=M,Re=M=0,qe=null,Ge=U.next();ye!==null&&!Ge.done;Re++,Ge=U.next()){ye.index>Re?(qe=ye,ye=null):qe=ye.sibling;var Ha=q(z,ye,Ge.value,P);if(Ha===null){ye===null&&(ye=qe);break}e&&ye&&Ha.alternate===null&&t(z,ye),M=o(Ha,M,Re),Ie===null?je=Ha:Ie.sibling=Ha,Ie=Ha,ye=qe}if(Ge.done)return n(z,ye),He&&Wn(z,Re),je;if(ye===null){for(;!Ge.done;Re++,Ge=U.next())Ge=ee(z,Ge.value,P),Ge!==null&&(M=o(Ge,M,Re),Ie===null?je=Ge:Ie.sibling=Ge,Ie=Ge);return He&&Wn(z,Re),je}for(ye=l(ye);!Ge.done;Re++,Ge=U.next())Ge=X(ye,z,Re,Ge.value,P),Ge!==null&&(e&&Ge.alternate!==null&&ye.delete(Ge.key===null?Re:Ge.key),M=o(Ge,M,Re),Ie===null?je=Ge:Ie.sibling=Ge,Ie=Ge);return e&&ye.forEach(function(Yg){return t(z,Yg)}),He&&Wn(z,Re),je}function We(z,M,U,P){if(typeof U=="object"&&U!==null&&U.type===A&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case G:e:{for(var je=U.key;M!==null;){if(M.key===je){if(je=U.type,je===A){if(M.tag===7){n(z,M.sibling),P=i(M,U.props.children),P.return=z,z=P;break e}}else if(M.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===V&&sl(je)===M.type){n(z,M.sibling),P=i(M,U.props),Ms(P,U),P.return=z,z=P;break e}n(z,M);break}else t(z,M);M=M.sibling}U.type===A?(P=el(U.props.children,z.mode,P,U.key),P.return=z,z=P):(P=Mi(U.type,U.key,U.props,null,z.mode,P),Ms(P,U),P.return=z,z=P)}return m(z);case R:e:{for(je=U.key;M!==null;){if(M.key===je)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){n(z,M.sibling),P=i(M,U.children||[]),P.return=z,z=P;break e}else{n(z,M);break}else t(z,M);M=M.sibling}P=mo(U,z.mode,P),P.return=z,z=P}return m(z);case V:return U=sl(U),We(z,M,U,P)}if(se(U))return ge(z,M,U,P);if(te(U)){if(je=te(U),typeof je!="function")throw Error(c(150));return U=je.call(U),Se(z,M,U,P)}if(typeof U.then=="function")return We(z,M,Bi(U),P);if(U.$$typeof===J)return We(z,M,Oi(z,U),P);Ui(z,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(n(z,M.sibling),P=i(M,U),P.return=z,z=P):(n(z,M),P=fo(U,z.mode,P),P.return=z,z=P),m(z)):n(z,M)}return function(z,M,U,P){try{As=0;var je=We(z,M,U,P);return ql=null,je}catch(ye){if(ye===$l||ye===zi)throw ye;var Ie=sn(29,ye,null,z.mode);return Ie.lanes=P,Ie.return=z,Ie}finally{}}}var rl=Td(!0),Ad=Td(!1),ka=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eo(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 _a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ea(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Ai(e),fd(e,null,n),t}return Ti(e,l,t,n),Ai(e)}function Cs(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,_e(e,n)}}function wo(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=m:o=o.next=m,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,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 To=!1;function Rs(){if(To){var e=Ul;if(e!==null)throw e}}function Os(e,t,n,l){To=!1;var i=e.updateQueue;ka=!1;var o=i.firstBaseUpdate,m=i.lastBaseUpdate,b=i.shared.pending;if(b!==null){i.shared.pending=null;var E=b,$=E.next;E.next=null,m===null?o=$:m.next=$,m=E;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,b=Z.lastBaseUpdate,b!==m&&(b===null?Z.firstBaseUpdate=$:b.next=$,Z.lastBaseUpdate=E))}if(o!==null){var ee=i.baseState;m=0,Z=$=E=null,b=o;do{var q=b.lane&-536870913,X=q!==b.lane;if(X?($e&q)===q:(l&q)===q){q!==0&&q===Bl&&(To=!0),Z!==null&&(Z=Z.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ge=e,Se=b;q=t;var We=n;switch(Se.tag){case 1:if(ge=Se.payload,typeof ge=="function"){ee=ge.call(We,ee,q);break e}ee=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Se.payload,q=typeof ge=="function"?ge.call(We,ee,q):ge,q==null)break e;ee=k({},ee,q);break e;case 2:ka=!0}}q=b.callback,q!==null&&(e.flags|=64,X&&(e.flags|=8192),X=i.callbacks,X===null?i.callbacks=[q]:X.push(q))}else X={lane:q,tag:b.tag,payload:b.payload,callback:b.callback,next:null},Z===null?($=Z=X,E=ee):Z=Z.next=X,m|=q;if(b=b.next,b===null){if(b=i.shared.pending,b===null)break;X=b,b=X.next,X.next=null,i.lastBaseUpdate=X,i.shared.pending=null}}while(!0);Z===null&&(E=ee),i.baseState=E,i.firstBaseUpdate=$,i.lastBaseUpdate=Z,o===null&&(i.shared.lanes=0),Ca|=m,e.lanes=m,e.memoizedState=ee}}function Md(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Cd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Md(n[e],t)}var Hl=j(null),$i=j(0);function Rd(e,t){e=ca,le($i,e),le(Hl,t),ca=e|t.baseLanes}function Ao(){le($i,ca),le(Hl,Hl.current)}function Mo(){ca=$i.current,B(Hl),B($i)}var rn=j(null),Nn=null;function wa(e){var t=e.alternate;le(xt,xt.current&1),le(rn,e),Nn===null&&(t===null||Hl.current!==null||t.memoizedState!==null)&&(Nn=e)}function Co(e){le(xt,xt.current),le(rn,e),Nn===null&&(Nn=e)}function Od(e){e.tag===22?(le(xt,xt.current),le(rn,e),Nn===null&&(Nn=e)):Ta()}function Ta(){le(xt,xt.current),le(rn,rn.current)}function on(e){B(rn),Nn===e&&(Nn=null),B(xt)}var xt=j(0);function qi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Bc(n)||Uc(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 ta=0,Ce=null,Fe=null,jt=null,Hi=!1,Il=!1,ol=!1,Ii=0,Ds=0,Gl=null,Dx=0;function ut(){throw Error(c(321))}function Ro(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ln(e[n],t[n]))return!1;return!0}function Oo(e,t,n,l,i,o){return ta=o,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,y.H=e===null||e.memoizedState===null?gf:Qo,ol=!1,o=n(l,i),ol=!1,Il&&(o=zd(t,n,l,i)),Dd(e),o}function Dd(e){y.H=Bs;var t=Fe!==null&&Fe.next!==null;if(ta=0,jt=Fe=Ce=null,Hi=!1,Ds=0,Gl=null,t)throw Error(c(300));e===null||St||(e=e.dependencies,e!==null&&Ri(e)&&(St=!0))}function zd(e,t,n,l){Ce=e;var i=0;do{if(Il&&(Gl=null),Ds=0,Il=!1,25<=i)throw Error(c(301));if(i+=1,jt=Fe=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}y.H=bf,o=t(n,l)}while(Il);return o}function zx(){var e=y.H,t=e.useState()[0];return t=typeof t.then=="function"?zs(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Do(){var e=Ii!==0;return Ii=0,e}function zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Lo(e){if(Hi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Hi=!1}ta=0,jt=Fe=Ce=null,Il=!1,Ds=Ii=0,Gl=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Ce.memoizedState=jt=e:jt=jt.next=e,jt}function gt(){if(Fe===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=jt===null?Ce.memoizedState:jt.next;if(t!==null)jt=t,Fe=e;else{if(e===null)throw Ce.alternate===null?Error(c(467)):Error(c(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},jt===null?Ce.memoizedState=jt=e:jt=jt.next=e}return jt}function Gi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zs(e){var t=Ds;return Ds+=1,Gl===null&&(Gl=[]),e=_d(Gl,e,t),t=Ce,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,y.H=t===null||t.memoizedState===null?gf:Qo),e}function Yi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zs(e);if(e.$$typeof===J)return Dt(e)}throw Error(c(438,String(e)))}function Bo(e){var t=null,n=Ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ce.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Gi(),Ce.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]=I;return t.index++,n}function na(e,t){return typeof t=="function"?t(e):t}function Xi(e){var t=gt();return Uo(t,Fe,e)}function Uo(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var i=e.baseQueue,o=l.pending;if(o!==null){if(i!==null){var m=i.next;i.next=o.next,o.next=m}t.baseQueue=i=o,l.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var b=m=null,E=null,$=t,Z=!1;do{var ee=$.lane&-536870913;if(ee!==$.lane?($e&ee)===ee:(ta&ee)===ee){var q=$.revertLane;if(q===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),ee===Bl&&(Z=!0);else if((ta&q)===q){$=$.next,q===Bl&&(Z=!0);continue}else ee={lane:0,revertLane:$.revertLane,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},E===null?(b=E=ee,m=o):E=E.next=ee,Ce.lanes|=q,Ca|=q;ee=$.action,ol&&n(o,ee),o=$.hasEagerState?$.eagerState:n(o,ee)}else q={lane:ee,revertLane:$.revertLane,gesture:$.gesture,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},E===null?(b=E=q,m=o):E=E.next=q,Ce.lanes|=ee,Ca|=ee;$=$.next}while($!==null&&$!==t);if(E===null?m=o:E.next=b,!ln(o,e.memoizedState)&&(St=!0,Z&&(n=Ul,n!==null)))throw n;e.memoizedState=o,e.baseState=m,e.baseQueue=E,l.lastRenderedState=o}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function $o(e){var t=gt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var m=i=i.next;do o=e(o,m.action),m=m.next;while(m!==i);ln(o,t.memoizedState)||(St=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,l]}function Ld(e,t,n){var l=Ce,i=gt(),o=He;if(o){if(n===void 0)throw Error(c(407));n=n()}else n=t();var m=!ln((Fe||i).memoizedState,n);if(m&&(i.memoizedState=n,St=!0),i=i.queue,Io($d.bind(null,l,i,e),[e]),i.getSnapshot!==t||m||jt!==null&&jt.memoizedState.tag&1){if(l.flags|=2048,Yl(9,{destroy:void 0},Ud.bind(null,l,i,n,t),null),et===null)throw Error(c(349));o||(ta&127)!==0||Bd(l,t,n)}return n}function Bd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t=Gi(),Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ud(e,t,n,l){t.value=n,t.getSnapshot=l,qd(t)&&Hd(e)}function $d(e,t,n){return n(function(){qd(t)&&Hd(e)})}function qd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ln(e,n)}catch{return!0}}function Hd(e){var t=Pa(e,2);t!==null&&tn(t,e,2)}function qo(e){var t=Xt();if(typeof e=="function"){var n=e;if(e=n(),ol){Dn(!0);try{n()}finally{Dn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:e},t}function Id(e,t,n,l){return e.baseState=n,Uo(e,Fe,typeof l=="function"?l:na)}function Lx(e,t,n,l,i){if(Qi(e))throw Error(c(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){o.listeners.push(m)}};y.T!==null?n(!0):o.isTransition=!1,l(o),n=t.pending,n===null?(o.next=t.pending=o,Gd(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Gd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var o=y.T,m={};y.T=m;try{var b=n(i,l),E=y.S;E!==null&&E(m,b),Yd(e,t,b)}catch($){Ho(e,t,$)}finally{o!==null&&m.types!==null&&(o.types=m.types),y.T=o}}else try{o=n(i,l),Yd(e,t,o)}catch($){Ho(e,t,$)}}function Yd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Xd(e,t,l)},function(l){return Ho(e,t,l)}):Xd(e,t,n)}function Xd(e,t,n){t.status="fulfilled",t.value=n,Kd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Gd(e,n)))}function Ho(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Kd(t),t=t.next;while(t!==l)}e.action=null}function Kd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vd(e,t){return t}function Qd(e,t){if(He){var n=et.formState;if(n!==null){e:{var l=Ce;if(He){if(lt){t:{for(var i=lt,o=yn;i.nodeType!==8;){if(!o){i=null;break t}if(i=jn(i.nextSibling),i===null){i=null;break t}}o=i.data,i=o==="F!"||o==="F"?i:null}if(i){lt=jn(i.nextSibling),l=i.data==="F!";break e}}ja(l)}l=!1}l&&(t=n[0])}}return n=Xt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vd,lastRenderedState:t},n.queue=l,n=hf.bind(null,Ce,l),l.dispatch=n,l=qo(!1),o=Vo.bind(null,Ce,!1,l.queue),l=Xt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Lx.bind(null,Ce,i,o,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Zd(e){var t=gt();return Fd(t,Fe,e)}function Fd(e,t,n){if(t=Uo(e,t,Vd)[0],e=Xi(na)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=zs(t)}catch(m){throw m===$l?zi:m}else l=t;t=gt();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&(Ce.flags|=2048,Yl(9,{destroy:void 0},Bx.bind(null,i,n),null)),[l,o,e]}function Bx(e,t){e.action=t}function Jd(e){var t=gt(),n=Fe;if(n!==null)return Fd(t,n,e);gt(),t=t.memoizedState,n=gt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Yl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Gi(),Ce.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 Wd(){return gt().memoizedState}function Ki(e,t,n,l){var i=Xt();Ce.flags|=e,i.memoizedState=Yl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Vi(e,t,n,l){var i=gt();l=l===void 0?null:l;var o=i.memoizedState.inst;Fe!==null&&l!==null&&Ro(l,Fe.memoizedState.deps)?i.memoizedState=Yl(t,o,n,l):(Ce.flags|=e,i.memoizedState=Yl(1|t,o,n,l))}function Pd(e,t){Ki(8390656,8,e,t)}function Io(e,t){Vi(2048,8,e,t)}function Ux(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=Gi(),Ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ef(e){var t=gt().memoizedState;return Ux({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function tf(e,t){return Vi(4,2,e,t)}function nf(e,t){return Vi(4,4,e,t)}function af(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 lf(e,t,n){n=n!=null?n.concat([e]):null,Vi(4,4,af.bind(null,t,e),n)}function Go(){}function sf(e,t){var n=gt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Ro(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function rf(e,t){var n=gt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Ro(t,l[1]))return l[0];if(l=e(),ol){Dn(!0);try{e()}finally{Dn(!1)}}return n.memoizedState=[l,t],l}function Yo(e,t,n){return n===void 0||(ta&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=om(),Ce.lanes|=e,Ca|=e,n)}function of(e,t,n,l){return ln(n,t)?n:Hl.current!==null?(e=Yo(e,n,l),ln(e,t)||(St=!0),e):(ta&42)===0||(ta&1073741824)!==0&&($e&261930)===0?(St=!0,e.memoizedState=n):(e=om(),Ce.lanes|=e,Ca|=e,t)}function cf(e,t,n,l,i){var o=H.p;H.p=o!==0&&8>o?o:8;var m=y.T,b={};y.T=b,Vo(e,!1,t,n);try{var E=i(),$=y.S;if($!==null&&$(b,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var Z=Ox(E,l);Ls(e,t,Z,dn(e))}else Ls(e,t,l,dn(e))}catch(ee){Ls(e,t,{then:function(){},status:"rejected",reason:ee},dn())}finally{H.p=o,m!==null&&b.types!==null&&(m.types=b.types),y.T=m}}function $x(){}function Xo(e,t,n,l){if(e.tag!==5)throw Error(c(476));var i=uf(e).queue;cf(e,i,t,Q,n===null?$x:function(){return df(e),n(l)})}function uf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:Q},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function df(e){var t=uf(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},dn())}function Ko(){return Dt(Ps)}function ff(){return gt().memoizedState}function mf(){return gt().memoizedState}function qx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=dn();e=_a(n);var l=Ea(t,e,n);l!==null&&(tn(l,t,n),Cs(l,t,n)),t={cache:No()},e.payload=t;return}t=t.return}}function Hx(e,t,n){var l=dn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Qi(e)?pf(t,n):(n=co(e,t,n,l),n!==null&&(tn(n,e,l),xf(n,t,l)))}function hf(e,t,n){var l=dn();Ls(e,t,n,l)}function Ls(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qi(e))pf(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,b=o(m,n);if(i.hasEagerState=!0,i.eagerState=b,ln(b,m))return Ti(e,t,i,0),et===null&&wi(),!1}catch{}finally{}if(n=co(e,t,i,l),n!==null)return tn(n,e,l),xf(n,t,l),!0}return!1}function Vo(e,t,n,l){if(l={lane:2,revertLane:_c(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Qi(e)){if(t)throw Error(c(479))}else t=co(e,n,l,2),t!==null&&tn(t,e,2)}function Qi(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function pf(e,t){Il=Hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xf(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_e(e,n)}}var Bs={readContext:Dt,use:Yi,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Bs.useEffectEvent=ut;var gf={readContext:Dt,use:Yi,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Pd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ki(4194308,4,af.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){Ki(4,2,e,t)},useMemo:function(e,t){var n=Xt();t=t===void 0?null:t;var l=e();if(ol){Dn(!0);try{e()}finally{Dn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Xt();if(n!==void 0){var i=n(t);if(ol){Dn(!0);try{n(t)}finally{Dn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Hx.bind(null,Ce,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=hf.bind(null,Ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Go,useDeferredValue:function(e,t){var n=Xt();return Yo(n,e,t)},useTransition:function(){var e=qo(!1);return e=cf.bind(null,Ce,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ce,i=Xt();if(He){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),et===null)throw Error(c(349));($e&127)!==0||Bd(l,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Pd($d.bind(null,l,o,e),[e]),l.flags|=2048,Yl(9,{destroy:void 0},Ud.bind(null,l,o,n,t),null),n},useId:function(){var e=Xt(),t=et.identifierPrefix;if(He){var n=Bn,l=Ln;n=(l&~(1<<32-Gt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ii++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Dx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ko,useFormState:Qd,useActionState:Qd,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vo.bind(null,Ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bo,useCacheRefresh:function(){return Xt().memoizedState=qx.bind(null,Ce)},useEffectEvent:function(e){var t=Xt(),n={impl:e};return t.memoizedState=n,function(){if((Ye&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Qo={readContext:Dt,use:Yi,useCallback:sf,useContext:Dt,useEffect:Io,useImperativeHandle:lf,useInsertionEffect:tf,useLayoutEffect:nf,useMemo:rf,useReducer:Xi,useRef:Wd,useState:function(){return Xi(na)},useDebugValue:Go,useDeferredValue:function(e,t){var n=gt();return of(n,Fe.memoizedState,e,t)},useTransition:function(){var e=Xi(na)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:zs(e),t]},useSyncExternalStore:Ld,useId:ff,useHostTransitionStatus:Ko,useFormState:Zd,useActionState:Zd,useOptimistic:function(e,t){var n=gt();return Id(n,Fe,e,t)},useMemoCache:Bo,useCacheRefresh:mf};Qo.useEffectEvent=ef;var bf={readContext:Dt,use:Yi,useCallback:sf,useContext:Dt,useEffect:Io,useImperativeHandle:lf,useInsertionEffect:tf,useLayoutEffect:nf,useMemo:rf,useReducer:$o,useRef:Wd,useState:function(){return $o(na)},useDebugValue:Go,useDeferredValue:function(e,t){var n=gt();return Fe===null?Yo(n,e,t):of(n,Fe.memoizedState,e,t)},useTransition:function(){var e=$o(na)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:zs(e),t]},useSyncExternalStore:Ld,useId:ff,useHostTransitionStatus:Ko,useFormState:Jd,useActionState:Jd,useOptimistic:function(e,t){var n=gt();return Fe!==null?Id(n,Fe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Bo,useCacheRefresh:mf};bf.useEffectEvent=ef;function Zo(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:k({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fo={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=dn(),i=_a(l);i.payload=t,n!=null&&(i.callback=n),t=Ea(e,i,l),t!==null&&(tn(t,e,l),Cs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=dn(),i=_a(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ea(e,i,l),t!==null&&(tn(t,e,l),Cs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=dn(),l=_a(n);l.tag=2,t!=null&&(l.callback=t),t=Ea(e,l,n),t!==null&&(tn(t,e,n),Cs(t,e,n))}};function vf(e,t,n,l,i,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,m):t.prototype&&t.prototype.isPureReactComponent?!Ss(n,l)||!Ss(i,o):!0}function yf(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&&Fo.enqueueReplaceState(t,t.state,null)}function cl(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=k({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Nf(e){Ei(e)}function jf(e){console.error(e)}function Sf(e){Ei(e)}function Zi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function kf(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Jo(e,t,n){return n=_a(n),n.tag=3,n.payload={element:null},n.callback=function(){Zi(e,t)},n}function _f(e){return e=_a(e),e.tag=3,e}function Ef(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var o=l.value;e.payload=function(){return i(o)},e.callback=function(){kf(t,n,l)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){kf(t,n,l),typeof i!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var b=l.stack;this.componentDidCatch(l.value,{componentStack:b!==null?b:""})})}function Ix(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Ll(t,n,i,!0),n=rn.current,n!==null){switch(n.tag){case 31:case 13:return Nn===null?rr():n.alternate===null&&dt===0&&(dt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===Li?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),jc(e,l,i)),!1;case 22:return n.flags|=65536,l===Li?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)),jc(e,l,i)),!1}throw Error(c(435,n.tag))}return jc(e,l,i),rr(),!1}if(He)return t=rn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==xo&&(e=Error(c(422),{cause:l}),Es(gn(e,n)))):(l!==xo&&(t=Error(c(423),{cause:l}),Es(gn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=gn(l,n),i=Jo(e.stateNode,l,i),wo(e,i),dt!==4&&(dt=2)),!1;var o=Error(c(520),{cause:l});if(o=gn(o,n),Xs===null?Xs=[o]:Xs.push(o),dt!==4&&(dt=2),t===null)return!0;l=gn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Jo(n.stateNode,l,e),wo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Ra===null||!Ra.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=_f(i),Ef(i,e,n,l),wo(n,i),!1}n=n.return}while(n!==null);return!1}var Wo=Error(c(461)),St=!1;function zt(e,t,n,l){t.child=e===null?Ad(t,null,n,l):rl(t,e.child,n,l)}function wf(e,t,n,l,i){n=n.render;var o=t.ref;if("ref"in l){var m={};for(var b in l)b!=="ref"&&(m[b]=l[b])}else m=l;return al(t),l=Oo(e,t,n,m,o,i),b=Do(),e!==null&&!St?(zo(e,t,i),aa(e,t,i)):(He&&b&&ho(t),t.flags|=1,zt(e,t,l,i),t.child)}function Tf(e,t,n,l,i){if(e===null){var o=n.type;return typeof o=="function"&&!uo(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,Af(e,t,o,l,i)):(e=Mi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!ic(e,i)){var m=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ss,n(m,l)&&e.ref===t.ref)return aa(e,t,i)}return t.flags|=1,e=Jn(o,l),e.ref=t.ref,e.return=t,t.child=e}function Af(e,t,n,l,i){if(e!==null){var o=e.memoizedProps;if(Ss(o,l)&&e.ref===t.ref)if(St=!1,t.pendingProps=l=o,ic(e,i))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,aa(e,t,i)}return Po(e,t,n,l,i)}function Mf(e,t,n,l){var i=l.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~o}else l=0,t.child=null;return Cf(e,t,o,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Di(t,o!==null?o.cachePool:null),o!==null?Rd(t,o):Ao(),Od(t);else return l=t.lanes=536870912,Cf(e,t,o!==null?o.baseLanes|n:n,n,l)}else o!==null?(Di(t,o.cachePool),Rd(t,o),Ta(),t.memoizedState=null):(e!==null&&Di(t,null),Ao(),Ta());return zt(e,t,i,n),t.child}function Us(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cf(e,t,n,l,i){var o=So();return o=o===null?null:{parent:Nt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Di(t,null),Ao(),Od(t),e!==null&&Ll(e,t,l,!0),t.childLanes=i,null}function Fi(e,t){return t=Wi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rf(e,t,n){return rl(t,e.child,null,n),e=Fi(t,t.pendingProps),e.flags|=2,on(t),t.memoizedState=null,e}function Gx(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(l.mode==="hidden")return e=Fi(t,l),t.lanes=536870912,Us(null,e);if(Co(t),(e=lt)?(e=Ym(e,yn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Ln,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},n=hd(e),n.return=t,t.child=n,Ot=t,lt=null)):e=null,e===null)throw ja(t);return t.lanes=536870912,null}return Fi(t,l)}var o=e.memoizedState;if(o!==null){var m=o.dehydrated;if(Co(t),i)if(t.flags&256)t.flags&=-257,t=Rf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(St||Ll(e,t,n,!1),i=(n&e.childLanes)!==0,St||i){if(l=et,l!==null&&(m=mt(l,n),m!==0&&m!==o.retryLane))throw o.retryLane=m,Pa(e,m),tn(l,e,m),Wo;rr(),t=Rf(e,t,n)}else e=o.treeContext,lt=jn(m.nextSibling),Ot=t,He=!0,Na=null,yn=!1,e!==null&&gd(t,e),t=Fi(t,l),t.flags|=4096;return t}return e=Jn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ji(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(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Po(e,t,n,l,i){return al(t),n=Oo(e,t,n,l,void 0,i),l=Do(),e!==null&&!St?(zo(e,t,i),aa(e,t,i)):(He&&l&&ho(t),t.flags|=1,zt(e,t,n,i),t.child)}function Of(e,t,n,l,i,o){return al(t),t.updateQueue=null,n=zd(t,l,n,i),Dd(e),l=Do(),e!==null&&!St?(zo(e,t,o),aa(e,t,o)):(He&&l&&ho(t),t.flags|=1,zt(e,t,n,o),t.child)}function Df(e,t,n,l,i){if(al(t),t.stateNode===null){var o=Rl,m=n.contextType;typeof m=="object"&&m!==null&&(o=Dt(m)),o=new n(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Fo,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},_o(t),m=n.contextType,o.context=typeof m=="object"&&m!==null?Dt(m):Rl,o.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Zo(t,n,m,l),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(m=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),m!==o.state&&Fo.enqueueReplaceState(o,o.state,null),Os(t,l,o,i),Rs(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var b=t.memoizedProps,E=cl(n,b);o.props=E;var $=o.context,Z=n.contextType;m=Rl,typeof Z=="object"&&Z!==null&&(m=Dt(Z));var ee=n.getDerivedStateFromProps;Z=typeof ee=="function"||typeof o.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,Z||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(b||$!==m)&&yf(t,o,l,m),ka=!1;var q=t.memoizedState;o.state=q,Os(t,l,o,i),Rs(),$=t.memoizedState,b||q!==$||ka?(typeof ee=="function"&&(Zo(t,n,ee,l),$=t.memoizedState),(E=ka||vf(t,n,E,l,q,$,m))?(Z||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=$),o.props=l,o.state=$,o.context=m,l=E):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,Eo(e,t),m=t.memoizedProps,Z=cl(n,m),o.props=Z,ee=t.pendingProps,q=o.context,$=n.contextType,E=Rl,typeof $=="object"&&$!==null&&(E=Dt($)),b=n.getDerivedStateFromProps,($=typeof b=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m!==ee||q!==E)&&yf(t,o,l,E),ka=!1,q=t.memoizedState,o.state=q,Os(t,l,o,i),Rs();var X=t.memoizedState;m!==ee||q!==X||ka||e!==null&&e.dependencies!==null&&Ri(e.dependencies)?(typeof b=="function"&&(Zo(t,n,b,l),X=t.memoizedState),(Z=ka||vf(t,n,Z,l,q,X,E)||e!==null&&e.dependencies!==null&&Ri(e.dependencies))?($||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,X,E),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,X,E)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=X),o.props=l,o.state=X,o.context=E,l=Z):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,Ji(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=rl(t,e.child,null,i),t.child=rl(t,null,n,i)):zt(e,t,n,i),t.memoizedState=o.state,e=t.child):e=aa(e,t,i),e}function zf(e,t,n,l){return tl(),t.flags|=256,zt(e,t,n,l),t.child}var ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tc(e){return{baseLanes:e,cachePool:Sd()}}function nc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=un),e}function Lf(e,t,n){var l=t.pendingProps,i=!1,o=(t.flags&128)!==0,m;if((m=o)||(m=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),m&&(i=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(i?wa(t):Ta(),(e=lt)?(e=Ym(e,yn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Ln,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},n=hd(e),n.return=t,t.child=n,Ot=t,lt=null)):e=null,e===null)throw ja(t);return Uc(e)?t.lanes=32:t.lanes=536870912,null}var b=l.children;return l=l.fallback,i?(Ta(),i=t.mode,b=Wi({mode:"hidden",children:b},i),l=el(l,i,n,null),b.return=t,l.return=t,b.sibling=l,t.child=b,l=t.child,l.memoizedState=tc(n),l.childLanes=nc(e,m,n),t.memoizedState=ec,Us(null,l)):(wa(t),ac(t,b))}var E=e.memoizedState;if(E!==null&&(b=E.dehydrated,b!==null)){if(o)t.flags&256?(wa(t),t.flags&=-257,t=lc(e,t,n)):t.memoizedState!==null?(Ta(),t.child=e.child,t.flags|=128,t=null):(Ta(),b=l.fallback,i=t.mode,l=Wi({mode:"visible",children:l.children},i),b=el(b,i,n,null),b.flags|=2,l.return=t,b.return=t,l.sibling=b,t.child=l,rl(t,e.child,null,n),l=t.child,l.memoizedState=tc(n),l.childLanes=nc(e,m,n),t.memoizedState=ec,t=Us(null,l));else if(wa(t),Uc(b)){if(m=b.nextSibling&&b.nextSibling.dataset,m)var $=m.dgst;m=$,l=Error(c(419)),l.stack="",l.digest=m,Es({value:l,source:null,stack:null}),t=lc(e,t,n)}else if(St||Ll(e,t,n,!1),m=(n&e.childLanes)!==0,St||m){if(m=et,m!==null&&(l=mt(m,n),l!==0&&l!==E.retryLane))throw E.retryLane=l,Pa(e,l),tn(m,e,l),Wo;Bc(b)||rr(),t=lc(e,t,n)}else Bc(b)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,lt=jn(b.nextSibling),Ot=t,He=!0,Na=null,yn=!1,e!==null&&gd(t,e),t=ac(t,l.children),t.flags|=4096);return t}return i?(Ta(),b=l.fallback,i=t.mode,E=e.child,$=E.sibling,l=Jn(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,$!==null?b=Jn($,b):(b=el(b,i,n,null),b.flags|=2),b.return=t,l.return=t,l.sibling=b,t.child=l,Us(null,l),l=t.child,b=e.child.memoizedState,b===null?b=tc(n):(i=b.cachePool,i!==null?(E=Nt._currentValue,i=i.parent!==E?{parent:E,pool:E}:i):i=Sd(),b={baseLanes:b.baseLanes|n,cachePool:i}),l.memoizedState=b,l.childLanes=nc(e,m,n),t.memoizedState=ec,Us(e.child,l)):(wa(t),n=e.child,e=n.sibling,n=Jn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function ac(e,t){return t=Wi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Wi(e,t){return e=sn(22,e,null,t),e.lanes=0,e}function lc(e,t,n){return rl(t,e.child,null,n),e=ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bf(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vo(e.return,t,n)}function sc(e,t,n,l,i,o){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:o}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=n,m.tailMode=i,m.treeForkCount=o)}function Uf(e,t,n){var l=t.pendingProps,i=l.revealOrder,o=l.tail;l=l.children;var m=xt.current,b=(m&2)!==0;if(b?(m=m&1|2,t.flags|=128):m&=1,le(xt,m),zt(e,t,l,n),l=He?_s:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bf(e,n,t);else if(e.tag===19)Bf(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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&qi(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sc(t,!1,i,n,o,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&qi(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sc(t,!0,n,null,o,l);break;case"together":sc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function aa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ll(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Jn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Jn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ic(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ri(e)))}function Yx(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),Sa(t,Nt,e.memoizedState.cache),tl();break;case 27:case 5:tt(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:Sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Co(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(wa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Lf(e,t,n):(wa(t),e=aa(e,t,n),e!==null?e.sibling:null);wa(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Ll(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return Uf(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(xt,xt.current),l)break;return null;case 22:return t.lanes=0,Mf(e,t,n,t.pendingProps);case 24:Sa(t,Nt,e.memoizedState.cache)}return aa(e,t,n)}function $f(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!ic(e,n)&&(t.flags&128)===0)return St=!1,Yx(e,t,n);St=(e.flags&131072)!==0}else St=!1,He&&(t.flags&1048576)!==0&&xd(t,_s,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=sl(t.elementType),t.type=e,typeof e=="function")uo(e)?(l=cl(e,l),t.tag=1,t=Df(null,t,e,l,n)):(t.tag=0,t=Po(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===K){t.tag=11,t=wf(null,t,e,l,n);break e}else if(i===_){t.tag=14,t=Tf(null,t,e,l,n);break e}}throw t=xe(e)||e,Error(c(306,t,""))}}return t;case 0:return Po(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=cl(l,t.pendingProps),Df(e,t,l,i,n);case 3:e:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var o=t.memoizedState;i=o.element,Eo(e,t),Os(t,l,null,n);var m=t.memoizedState;if(l=m.cache,Sa(t,Nt,l),l!==o.cache&&yo(t,[Nt],n,!0),Rs(),l=m.element,o.isDehydrated)if(o={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=zf(e,t,l,n);break e}else if(l!==i){i=gn(Error(c(424)),t),Es(i),t=zf(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(lt=jn(e.firstChild),Ot=t,He=!0,Na=null,yn=!0,n=Ad(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(tl(),l===i){t=aa(e,t,n);break e}zt(e,t,l,n)}t=t.child}return t;case 26:return Ji(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:He||(n=t.type,e=t.pendingProps,l=hr(ae.current).createElement(n),l[ht]=t,l[Ut]=e,Lt(l,n,e),vt(l),t.stateNode=l):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return tt(t),e===null&&He&&(l=t.stateNode=Vm(t.type,t.pendingProps,ae.current),Ot=t,yn=!0,i=lt,La(t.type)?($c=i,lt=jn(l.firstChild)):lt=i),zt(e,t,t.pendingProps.children,n),Ji(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((i=l=lt)&&(l=yg(l,t.type,t.pendingProps,yn),l!==null?(t.stateNode=l,Ot=t,lt=jn(l.firstChild),yn=!1,i=!0):i=!1),i||ja(t)),tt(t),i=t.type,o=t.pendingProps,m=e!==null?e.memoizedProps:null,l=o.children,Dc(i,o)?l=null:m!==null&&Dc(i,m)&&(t.flags|=32),t.memoizedState!==null&&(i=Oo(e,t,zx,null,null,n),Ps._currentValue=i),Ji(e,t),zt(e,t,l,n),t.child;case 6:return e===null&&He&&((e=n=lt)&&(n=Ng(n,t.pendingProps,yn),n!==null?(t.stateNode=n,Ot=t,lt=null,e=!0):e=!1),e||ja(t)),null;case 13:return Lf(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=rl(t,null,l,n):zt(e,t,l,n),t.child;case 11:return wf(e,t,t.type,t.pendingProps,n);case 7:return zt(e,t,t.pendingProps,n),t.child;case 8:return zt(e,t,t.pendingProps.children,n),t.child;case 12:return zt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Sa(t,t.type,l.value),zt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,al(t),i=Dt(i),l=l(i),t.flags|=1,zt(e,t,l,n),t.child;case 14:return Tf(e,t,t.type,t.pendingProps,n);case 15:return Af(e,t,t.type,t.pendingProps,n);case 19:return Uf(e,t,n);case 31:return Gx(e,t,n);case 22:return Mf(e,t,n,t.pendingProps);case 24:return al(t),l=Dt(Nt),e===null?(i=So(),i===null&&(i=et,o=No(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:l,cache:i},_o(t),Sa(t,Nt,i)):((e.lanes&n)!==0&&(Eo(e,t),Os(t,null,null,n),Rs()),i=e.memoizedState,o=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Sa(t,Nt,l)):(l=o.cache,Sa(t,Nt,l),l!==i.cache&&yo(t,[Nt],n,!0))),zt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function la(e){e.flags|=4}function rc(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(fm())e.flags|=8192;else throw il=Li,ko}else e.flags&=-16777217}function qf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!th(t))if(fm())e.flags|=8192;else throw il=Li,ko}function Pi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ee():536870912,e.lanes|=t,Ql|=t)}function $s(e,t){if(!He)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 st(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Xx(e,t,n){var l=t.pendingProps;switch(po(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ea(Nt),ze(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zl(t)?la(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,go())),st(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(la(t),o!==null?(st(t),qf(t,o)):(st(t),rc(t,i,null,l,n))):o?o!==e.memoizedState?(la(t),st(t),qf(t,o)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&la(t),st(t),rc(t,i,e,l,n)),null;case 27:if(Ht(t),n=ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return st(t),null}e=fe.current,zl(t)?bd(t):(e=Vm(i,l,n),t.stateNode=e,la(t))}return st(t),null;case 5:if(Ht(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return st(t),null}if(o=fe.current,zl(t))bd(t);else{var m=hr(ae.current);switch(o){case 1:o=m.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:o=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":o=m.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":o=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":o=m.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?m.createElement(i,{is:l.is}):m.createElement(i)}}o[ht]=t,o[Ut]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(Lt(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&la(t)}}return st(t),rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=ae.current,zl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=Ot,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Lm(e.nodeValue,n)),e||ja(t,!0)}else e=hr(e).createTextNode(l),e[ht]=t,t.stateNode=e}return st(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=zl(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[ht]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else n=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(on(t),t):(on(t),null);if((t.flags&128)!==0)throw Error(c(558))}return st(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[ht]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),i=!1}else i=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(on(t),t):(on(t),null)}return on(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pi(t,t.updateQueue),st(t),null);case 4:return ze(),e===null&&Ac(t.stateNode.containerInfo),st(t),null;case 10:return ea(t.type),st(t),null;case 19:if(B(xt),l=t.memoizedState,l===null)return st(t),null;if(i=(t.flags&128)!==0,o=l.rendering,o===null)if(i)$s(l,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=qi(e),o!==null){for(t.flags|=128,$s(l,!1),e=o.updateQueue,t.updateQueue=e,Pi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)md(n,e),n=n.sibling;return le(xt,xt.current&1|2),He&&Wn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ae()>lr&&(t.flags|=128,i=!0,$s(l,!1),t.lanes=4194304)}else{if(!i)if(e=qi(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Pi(t,e),$s(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!He)return st(t),null}else 2*Ae()-l.renderingStartTime>lr&&n!==536870912&&(t.flags|=128,i=!0,$s(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(e=l.last,e!==null?e.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ae(),e.sibling=null,n=xt.current,le(xt,i?n&1|2:n&1),He&&Wn(t,l.treeForkCount),e):(st(t),null);case 22:case 23:return on(t),Mo(),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&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),n=t.updateQueue,n!==null&&Pi(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&&B(ll),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ea(Nt),st(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Kx(e,t){switch(po(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(Nt),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ht(t),null;case 31:if(t.memoizedState!==null){if(on(t),t.alternate===null)throw Error(c(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(on(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(xt),null;case 4:return ze(),null;case 10:return ea(t.type),null;case 22:case 23:return on(t),Mo(),e!==null&&B(ll),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(Nt),null;case 25:return null;default:return null}}function Hf(e,t){switch(po(t),t.tag){case 3:ea(Nt),ze();break;case 26:case 27:case 5:Ht(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&on(t);break;case 13:on(t);break;case 19:B(xt);break;case 10:ea(t.type);break;case 22:case 23:on(t),Mo(),e!==null&&B(ll);break;case 24:ea(Nt)}}function qs(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var o=n.create,m=n.inst;l=o(),m.destroy=l}n=n.next}while(n!==i)}}catch(b){Ze(t,t.return,b)}}function Aa(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){var m=l.inst,b=m.destroy;if(b!==void 0){m.destroy=void 0,i=t;var E=n,$=b;try{$()}catch(Z){Ze(i,E,Z)}}}l=l.next}while(l!==o)}}catch(Z){Ze(t,t.return,Z)}}function If(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Cd(t,n)}catch(l){Ze(e,e.return,l)}}}function Gf(e,t,n){n.props=cl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Ze(e,t,l)}}function Hs(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(i){Ze(e,t,i)}}function Un(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Ze(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Ze(e,t,i)}else n.current=null}function Yf(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(i){Ze(e,e.return,i)}}function oc(e,t,n){try{var l=e.stateNode;hg(l,e.type,n,t),l[Ut]=t}catch(i){Ze(e,e.return,i)}}function Xf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function cc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xf(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&&La(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 uc(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=ce));else if(l!==4&&(l===27&&La(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(uc(e,t,n),e=e.sibling;e!==null;)uc(e,t,n),e=e.sibling}function er(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&&La(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(er(e,t,n),e=e.sibling;e!==null;)er(e,t,n),e=e.sibling}function Kf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Lt(t,l,n),t[ht]=e,t[Ut]=n}catch(o){Ze(e,e.return,o)}}var sa=!1,kt=!1,dc=!1,Vf=typeof WeakSet=="function"?WeakSet:Set,At=null;function Vx(e,t){if(e=e.containerInfo,Rc=Nr,e=ld(e),ao(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 i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var m=0,b=-1,E=-1,$=0,Z=0,ee=e,q=null;t:for(;;){for(var X;ee!==n||i!==0&&ee.nodeType!==3||(b=m+i),ee!==o||l!==0&&ee.nodeType!==3||(E=m+l),ee.nodeType===3&&(m+=ee.nodeValue.length),(X=ee.firstChild)!==null;)q=ee,ee=X;for(;;){if(ee===e)break t;if(q===n&&++$===i&&(b=m),q===o&&++Z===l&&(E=m),(X=ee.nextSibling)!==null)break;ee=q,q=ee.parentNode}ee=X}n=b===-1||E===-1?null:{start:b,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(Oc={focusedElem:e,selectionRange:n},Nr=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,l=n.stateNode;try{var ge=cl(n.type,i);e=l.getSnapshotBeforeUpdate(ge,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Ze(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Lc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function Qf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:ra(e,n),l&4&&qs(5,n);break;case 1:if(ra(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Ze(n,n.return,m)}else{var i=cl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ze(n,n.return,m)}}l&64&&If(n),l&512&&Hs(n,n.return);break;case 3:if(ra(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{Cd(e,t)}catch(m){Ze(n,n.return,m)}}break;case 27:t===null&&l&4&&Kf(n);case 26:case 5:ra(e,n),t===null&&l&4&&Yf(n),l&512&&Hs(n,n.return);break;case 12:ra(e,n);break;case 31:ra(e,n),l&4&&Jf(e,n);break;case 13:ra(e,n),l&4&&Wf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ng.bind(null,n),jg(e,n))));break;case 22:if(l=n.memoizedState!==null||sa,!l){t=t!==null&&t.memoizedState!==null||kt,i=sa;var o=kt;sa=l,(kt=t)&&!o?oa(e,n,(n.subtreeFlags&8772)!==0):ra(e,n),sa=i,kt=o}break;case 30:break;default:ra(e,n)}}function Zf(e){var t=e.alternate;t!==null&&(e.alternate=null,Zf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ds(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Jt=!1;function ia(e,t,n){for(n=n.child;n!==null;)Ff(e,t,n),n=n.sibling}function Ff(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Ya,n)}catch{}switch(n.tag){case 26:kt||Un(n,t),ia(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:kt||Un(n,t);var l=rt,i=Jt;La(n.type)&&(rt=n.stateNode,Jt=!1),ia(e,t,n),Fs(n.stateNode),rt=l,Jt=i;break;case 5:kt||Un(n,t);case 6:if(l=rt,i=Jt,rt=null,ia(e,t,n),rt=l,Jt=i,rt!==null)if(Jt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(o){Ze(n,t,o)}else try{rt.removeChild(n.stateNode)}catch(o){Ze(n,t,o)}break;case 18:rt!==null&&(Jt?(e=rt,Im(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ns(e)):Im(rt,n.stateNode));break;case 4:l=rt,i=Jt,rt=n.stateNode.containerInfo,Jt=!0,ia(e,t,n),rt=l,Jt=i;break;case 0:case 11:case 14:case 15:Aa(2,n,t),kt||Aa(4,n,t),ia(e,t,n);break;case 1:kt||(Un(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Gf(n,t,l)),ia(e,t,n);break;case 21:ia(e,t,n);break;case 22:kt=(l=kt)||n.memoizedState!==null,ia(e,t,n),kt=l;break;default:ia(e,t,n)}}function Jf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ns(e)}catch(n){Ze(t,t.return,n)}}}function Wf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ns(e)}catch(n){Ze(t,t.return,n)}}function Qx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vf),t;default:throw Error(c(435,e.tag))}}function tr(e,t){var n=Qx(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=ag.bind(null,e,l);l.then(i,i)}})}function Wt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],o=e,m=t,b=m;e:for(;b!==null;){switch(b.tag){case 27:if(La(b.type)){rt=b.stateNode,Jt=!1;break e}break;case 5:rt=b.stateNode,Jt=!1;break e;case 3:case 4:rt=b.stateNode.containerInfo,Jt=!0;break e}b=b.return}if(rt===null)throw Error(c(160));Ff(o,m,i),rt=null,Jt=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pf(t,e),t=t.sibling}var An=null;function Pf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Wt(t,e),Pt(e),l&4&&(Aa(3,e,e.return),qs(3,e),Aa(5,e,e.return));break;case 1:Wt(t,e),Pt(e),l&512&&(kt||n===null||Un(n,n.return)),l&64&&sa&&(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 i=An;if(Wt(t,e),Pt(e),l&512&&(kt||n===null||Un(n,n.return)),l&4){var o=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,i=i.ownerDocument||i;t:switch(l){case"title":o=i.getElementsByTagName("title")[0],(!o||o[Va]||o[ht]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=i.createElement(l),i.head.insertBefore(o,i.querySelector("head > title"))),Lt(o,l,n),o[ht]=e,vt(o),l=o;break e;case"link":var m=Pm("link","href",i).get(l+(n.href||""));if(m){for(var b=0;b<m.length;b++)if(o=m[b],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(b,1);break t}}o=i.createElement(l),Lt(o,l,n),i.head.appendChild(o);break;case"meta":if(m=Pm("meta","content",i).get(l+(n.content||""))){for(b=0;b<m.length;b++)if(o=m[b],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(b,1);break t}}o=i.createElement(l),Lt(o,l,n),i.head.appendChild(o);break;default:throw Error(c(468,l))}o[ht]=e,vt(o),l=o}e.stateNode=l}else eh(i,e.type,e.stateNode);else e.stateNode=Wm(i,l,e.memoizedProps);else o!==l?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,l===null?eh(i,e.type,e.stateNode):Wm(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&oc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Wt(t,e),Pt(e),l&512&&(kt||n===null||Un(n,n.return)),n!==null&&l&4&&oc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Wt(t,e),Pt(e),l&512&&(kt||n===null||Un(n,n.return)),e.flags&32){i=e.stateNode;try{ke(i,"")}catch(ge){Ze(e,e.return,ge)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,oc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(dc=!0);break;case 6:if(Wt(t,e),Pt(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ge){Ze(e,e.return,ge)}}break;case 3:if(gr=null,i=An,An=pr(t.containerInfo),Wt(t,e),An=i,Pt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ns(t.containerInfo)}catch(ge){Ze(e,e.return,ge)}dc&&(dc=!1,em(e));break;case 4:l=An,An=pr(e.stateNode.containerInfo),Wt(t,e),Pt(e),An=l;break;case 12:Wt(t,e),Pt(e);break;case 31:Wt(t,e),Pt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tr(e,l)));break;case 13:Wt(t,e),Pt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ar=Ae()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tr(e,l)));break;case 22:i=e.memoizedState!==null;var E=n!==null&&n.memoizedState!==null,$=sa,Z=kt;if(sa=$||i,kt=Z||E,Wt(t,e),kt=Z,sa=$,Pt(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||E||sa||kt||ul(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){E=n=t;try{if(o=E.stateNode,i)m=o.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{b=E.stateNode;var ee=E.memoizedProps.style,q=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;b.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(ge){Ze(E,E.return,ge)}}}else if(t.tag===6){if(n===null){E=t;try{E.stateNode.nodeValue=i?"":E.memoizedProps}catch(ge){Ze(E,E.return,ge)}}}else if(t.tag===18){if(n===null){E=t;try{var X=E.stateNode;i?Gm(X,!0):Gm(E.stateNode,!1)}catch(ge){Ze(E,E.return,ge)}}}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,tr(e,n))));break;case 19:Wt(t,e),Pt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tr(e,l)));break;case 30:break;case 21:break;default:Wt(t,e),Pt(e)}}function Pt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Xf(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var i=n.stateNode,o=cc(e);er(e,o,i);break;case 5:var m=n.stateNode;n.flags&32&&(ke(m,""),n.flags&=-33);var b=cc(e);er(e,b,m);break;case 3:case 4:var E=n.stateNode.containerInfo,$=cc(e);uc(e,$,E);break;default:throw Error(c(161))}}catch(Z){Ze(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function em(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;em(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Qf(e,t.alternate,t),t=t.sibling}function ul(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Aa(4,t,t.return),ul(t);break;case 1:Un(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Gf(t,t.return,n),ul(t);break;case 27:Fs(t.stateNode);case 26:case 5:Un(t,t.return),ul(t);break;case 22:t.memoizedState===null&&ul(t);break;case 30:ul(t);break;default:ul(t)}e=e.sibling}}function oa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,o=t,m=o.flags;switch(o.tag){case 0:case 11:case 15:oa(i,o,n),qs(4,o);break;case 1:if(oa(i,o,n),l=o,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch($){Ze(l,l.return,$)}if(l=o,i=l.updateQueue,i!==null){var b=l.stateNode;try{var E=i.shared.hiddenCallbacks;if(E!==null)for(i.shared.hiddenCallbacks=null,i=0;i<E.length;i++)Md(E[i],b)}catch($){Ze(l,l.return,$)}}n&&m&64&&If(o),Hs(o,o.return);break;case 27:Kf(o);case 26:case 5:oa(i,o,n),n&&l===null&&m&4&&Yf(o),Hs(o,o.return);break;case 12:oa(i,o,n);break;case 31:oa(i,o,n),n&&m&4&&Jf(i,o);break;case 13:oa(i,o,n),n&&m&4&&Wf(i,o);break;case 22:o.memoizedState===null&&oa(i,o,n),Hs(o,o.return);break;case 30:break;default:oa(i,o,n)}t=t.sibling}}function fc(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&&ws(n))}function mc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ws(e))}function Mn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)tm(e,t,n,l),t=t.sibling}function tm(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Mn(e,t,n,l),i&2048&&qs(9,t);break;case 1:Mn(e,t,n,l);break;case 3:Mn(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ws(e)));break;case 12:if(i&2048){Mn(e,t,n,l),e=t.stateNode;try{var o=t.memoizedProps,m=o.id,b=o.onPostCommit;typeof b=="function"&&b(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Ze(t,t.return,E)}}else Mn(e,t,n,l);break;case 31:Mn(e,t,n,l);break;case 13:Mn(e,t,n,l);break;case 23:break;case 22:o=t.stateNode,m=t.alternate,t.memoizedState!==null?o._visibility&2?Mn(e,t,n,l):Is(e,t):o._visibility&2?Mn(e,t,n,l):(o._visibility|=2,Xl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&fc(m,t);break;case 24:Mn(e,t,n,l),i&2048&&mc(t.alternate,t);break;default:Mn(e,t,n,l)}}function Xl(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,m=t,b=n,E=l,$=m.flags;switch(m.tag){case 0:case 11:case 15:Xl(o,m,b,E,i),qs(8,m);break;case 23:break;case 22:var Z=m.stateNode;m.memoizedState!==null?Z._visibility&2?Xl(o,m,b,E,i):Is(o,m):(Z._visibility|=2,Xl(o,m,b,E,i)),i&&$&2048&&fc(m.alternate,m);break;case 24:Xl(o,m,b,E,i),i&&$&2048&&mc(m.alternate,m);break;default:Xl(o,m,b,E,i)}t=t.sibling}}function Is(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:Is(n,l),i&2048&&fc(l.alternate,l);break;case 24:Is(n,l),i&2048&&mc(l.alternate,l);break;default:Is(n,l)}t=t.sibling}}var Gs=8192;function Kl(e,t,n){if(e.subtreeFlags&Gs)for(e=e.child;e!==null;)nm(e,t,n),e=e.sibling}function nm(e,t,n){switch(e.tag){case 26:Kl(e,t,n),e.flags&Gs&&e.memoizedState!==null&&Dg(n,An,e.memoizedState,e.memoizedProps);break;case 5:Kl(e,t,n);break;case 3:case 4:var l=An;An=pr(e.stateNode.containerInfo),Kl(e,t,n),An=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Gs,Gs=16777216,Kl(e,t,n),Gs=l):Kl(e,t,n));break;default:Kl(e,t,n)}}function am(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 Ys(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];At=l,sm(l,e)}am(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lm(e),e=e.sibling}function lm(e){switch(e.tag){case 0:case 11:case 15:Ys(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:Ys(e);break;case 12:Ys(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,nr(e)):Ys(e);break;default:Ys(e)}}function nr(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];At=l,sm(l,e)}am(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Aa(8,t,t.return),nr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,nr(t));break;default:nr(t)}e=e.sibling}}function sm(e,t){for(;At!==null;){var n=At;switch(n.tag){case 0:case 11:case 15:Aa(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:ws(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,At=l;else e:for(n=e;At!==null;){l=At;var i=l.sibling,o=l.return;if(Zf(l),l===n){At=null;break e}if(i!==null){i.return=o,At=i;break e}At=o}}}var Zx={getCacheForType:function(e){var t=Dt(Nt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Dt(Nt).controller.signal}},Fx=typeof WeakMap=="function"?WeakMap:Map,Ye=0,et=null,Le=null,$e=0,Qe=0,cn=null,Ma=!1,Vl=!1,hc=!1,ca=0,dt=0,Ca=0,dl=0,pc=0,un=0,Ql=0,Xs=null,en=null,xc=!1,ar=0,im=0,lr=1/0,sr=null,Ra=null,wt=0,Oa=null,Zl=null,ua=0,gc=0,bc=null,rm=null,Ks=0,vc=null;function dn(){return(Ye&2)!==0&&$e!==0?$e&-$e:y.T!==null?_c():Nl()}function om(){if(un===0)if(($e&536870912)===0||He){var e=yl;yl<<=1,(yl&3932160)===0&&(yl=262144),un=e}else un=536870912;return e=rn.current,e!==null&&(e.flags|=32),un}function tn(e,t,n){(e===et&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(Fl(e,0),Da(e,$e,un,!1)),Pe(e,n),((Ye&2)===0||e!==et)&&(e===et&&((Ye&2)===0&&(dl|=n),dt===4&&Da(e,$e,un,!1)),$n(e))}function cm(e,t,n){if((Ye&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||W(e,t),i=l?Px(e,t):Nc(e,t,!0),o=l;do{if(i===0){Vl&&!l&&Da(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Jx(n)){i=Nc(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var b=e;i=Xs;var E=b.current.memoizedState.isDehydrated;if(E&&(Fl(b,m).flags|=256),m=Nc(b,m,!1),m!==2){if(hc&&!E){b.errorRecoveryDisabledLanes|=o,dl|=o,i=4;break e}o=en,en=i,o!==null&&(en===null?en=o:en.push.apply(en,o))}i=m}if(o=!1,i!==2)continue}}if(i===1){Fl(e,0),Da(e,t,0,!0);break}e:{switch(l=e,o=i,o){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Da(l,t,un,!Ma);break e;case 2:en=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=ar+300-Ae(),10<i)){if(Da(l,t,un,!Ma),T(l,0,!0)!==0)break e;ua=t,l.timeoutHandle=qm(um.bind(null,l,n,en,sr,xc,t,un,dl,Ql,Ma,o,"Throttled",-0,0),i);break e}um(l,n,en,sr,xc,t,un,dl,Ql,Ma,o,null,-0,0)}}break}while(!0);$n(e)}function um(e,t,n,l,i,o,m,b,E,$,Z,ee,q,X){if(e.timeoutHandle=-1,ee=t.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ce},nm(t,o,ee);var ge=(o&62914560)===o?ar-Ae():(o&4194048)===o?im-Ae():0;if(ge=zg(ee,ge),ge!==null){ua=o,e.cancelPendingCommit=ge(bm.bind(null,e,t,o,n,l,i,m,b,E,Z,ee,null,q,X)),Da(e,o,m,!$);return}}bm(e,t,o,n,l,i,m,b,E)}function Jx(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],o=i.getSnapshot;i=i.value;try{if(!ln(o(),i))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 Da(e,t,n,l){t&=~pc,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var o=31-Gt(i),m=1<<o;l[o]=-1,i&=~m}n!==0&&pe(e,n,t)}function ir(){return(Ye&6)===0?(Vs(0),!1):!0}function yc(){if(Le!==null){if(Qe===0)var e=Le.return;else e=Le,Pn=nl=null,Lo(e),ql=null,As=0,e=Le;for(;e!==null;)Hf(e.alternate,e),e=e.return;Le=null}}function Fl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,gg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ua=0,yc(),et=e,Le=n=Jn(e.current,null),$e=t,Qe=0,cn=null,Ma=!1,Vl=W(e,t),hc=!1,Ql=un=pc=dl=Ca=dt=0,en=Xs=null,xc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-Gt(l),o=1<<i;t|=e[i],l&=~o}return ca=t,wi(),n}function dm(e,t){Ce=null,y.H=Bs,t===$l||t===zi?(t=Ed(),Qe=3):t===ko?(t=Ed(),Qe=4):Qe=t===Wo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cn=t,Le===null&&(dt=1,Zi(e,gn(t,e.current)))}function fm(){var e=rn.current;return e===null?!0:($e&4194048)===$e?Nn===null:($e&62914560)===$e||($e&536870912)!==0?e===Nn:!1}function mm(){var e=y.H;return y.H=Bs,e===null?Bs:e}function hm(){var e=y.A;return y.A=Zx,e}function rr(){dt=4,Ma||($e&4194048)!==$e&&rn.current!==null||(Vl=!0),(Ca&134217727)===0&&(dl&134217727)===0||et===null||Da(et,$e,un,!1)}function Nc(e,t,n){var l=Ye;Ye|=2;var i=mm(),o=hm();(et!==e||$e!==t)&&(sr=null,Fl(e,t)),t=!1;var m=dt;e:do try{if(Qe!==0&&Le!==null){var b=Le,E=cn;switch(Qe){case 8:yc(),m=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(t=!0);var $=Qe;if(Qe=0,cn=null,Jl(e,b,E,$),n&&Vl){m=0;break e}break;default:$=Qe,Qe=0,cn=null,Jl(e,b,E,$)}}Wx(),m=dt;break}catch(Z){dm(e,Z)}while(!0);return t&&e.shellSuspendCounter++,Pn=nl=null,Ye=l,y.H=i,y.A=o,Le===null&&(et=null,$e=0,wi()),m}function Wx(){for(;Le!==null;)pm(Le)}function Px(e,t){var n=Ye;Ye|=2;var l=mm(),i=hm();et!==e||$e!==t?(sr=null,lr=Ae()+500,Fl(e,t)):Vl=W(e,t);e:do try{if(Qe!==0&&Le!==null){t=Le;var o=cn;t:switch(Qe){case 1:Qe=0,cn=null,Jl(e,t,o,1);break;case 2:case 9:if(kd(o)){Qe=0,cn=null,xm(t);break}t=function(){Qe!==2&&Qe!==9||et!==e||(Qe=7),$n(e)},o.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:kd(o)?(Qe=0,cn=null,xm(t)):(Qe=0,cn=null,Jl(e,t,o,7));break;case 5:var m=null;switch(Le.tag){case 26:m=Le.memoizedState;case 5:case 27:var b=Le;if(m?th(m):b.stateNode.complete){Qe=0,cn=null;var E=b.sibling;if(E!==null)Le=E;else{var $=b.return;$!==null?(Le=$,or($)):Le=null}break t}}Qe=0,cn=null,Jl(e,t,o,5);break;case 6:Qe=0,cn=null,Jl(e,t,o,6);break;case 8:yc(),dt=6;break e;default:throw Error(c(462))}}eg();break}catch(Z){dm(e,Z)}while(!0);return Pn=nl=null,y.H=l,y.A=i,Ye=n,Le!==null?0:(et=null,$e=0,wi(),dt)}function eg(){for(;Le!==null&&!de();)pm(Le)}function pm(e){var t=$f(e.alternate,e,ca);e.memoizedProps=e.pendingProps,t===null?or(e):Le=t}function xm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Of(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Of(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Lo(t);default:Hf(n,t),t=Le=md(t,ca),t=$f(n,t,ca)}e.memoizedProps=e.pendingProps,t===null?or(e):Le=t}function Jl(e,t,n,l){Pn=nl=null,Lo(t),ql=null,As=0;var i=t.return;try{if(Ix(e,i,t,n,$e)){dt=1,Zi(e,gn(n,e.current)),Le=null;return}}catch(o){if(i!==null)throw Le=i,o;dt=1,Zi(e,gn(n,e.current)),Le=null;return}t.flags&32768?(He||l===1?e=!0:Vl||($e&536870912)!==0?e=!1:(Ma=e=!0,(l===2||l===9||l===3||l===6)&&(l=rn.current,l!==null&&l.tag===13&&(l.flags|=16384))),gm(t,e)):or(t)}function or(e){var t=e;do{if((t.flags&32768)!==0){gm(t,Ma);return}e=t.return;var n=Xx(t.alternate,t,ca);if(n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);dt===0&&(dt=5)}function gm(e,t){do{var n=Kx(e.alternate,e);if(n!==null){n.flags&=32767,Le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=n}while(e!==null);dt=6,Le=null}function bm(e,t,n,l,i,o,m,b,E){e.cancelPendingCommit=null;do cr();while(wt!==0);if((Ye&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(o=t.lanes|t.childLanes,o|=oo,be(e,n,o,m,b,E),e===et&&(Le=et=null,$e=0),Zl=t,Oa=e,ua=n,gc=o,bc=i,rm=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,lg(ft,function(){return Sm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=y.T,y.T=null,i=H.p,H.p=2,m=Ye,Ye|=4;try{Vx(e,t,n)}finally{Ye=m,H.p=i,y.T=l}}wt=1,vm(),ym(),Nm()}}function vm(){if(wt===1){wt=0;var e=Oa,t=Zl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=y.T,y.T=null;var l=H.p;H.p=2;var i=Ye;Ye|=4;try{Pf(t,e);var o=Oc,m=ld(e.containerInfo),b=o.focusedElem,E=o.selectionRange;if(m!==b&&b&&b.ownerDocument&&ad(b.ownerDocument.documentElement,b)){if(E!==null&&ao(b)){var $=E.start,Z=E.end;if(Z===void 0&&(Z=$),"selectionStart"in b)b.selectionStart=$,b.selectionEnd=Math.min(Z,b.value.length);else{var ee=b.ownerDocument||document,q=ee&&ee.defaultView||window;if(q.getSelection){var X=q.getSelection(),ge=b.textContent.length,Se=Math.min(E.start,ge),We=E.end===void 0?Se:Math.min(E.end,ge);!X.extend&&Se>We&&(m=We,We=Se,Se=m);var z=nd(b,Se),M=nd(b,We);if(z&&M&&(X.rangeCount!==1||X.anchorNode!==z.node||X.anchorOffset!==z.offset||X.focusNode!==M.node||X.focusOffset!==M.offset)){var U=ee.createRange();U.setStart(z.node,z.offset),X.removeAllRanges(),Se>We?(X.addRange(U),X.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),X.addRange(U))}}}}for(ee=[],X=b;X=X.parentNode;)X.nodeType===1&&ee.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<ee.length;b++){var P=ee[b];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Nr=!!Rc,Oc=Rc=null}finally{Ye=i,H.p=l,y.T=n}}e.current=t,wt=2}}function ym(){if(wt===2){wt=0;var e=Oa,t=Zl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=y.T,y.T=null;var l=H.p;H.p=2;var i=Ye;Ye|=4;try{Qf(e,t.alternate,t)}finally{Ye=i,H.p=l,y.T=n}}wt=3}}function Nm(){if(wt===4||wt===3){wt=0,Te();var e=Oa,t=Zl,n=ua,l=rm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,Zl=Oa=null,jm(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ra=null),Kn(n),t=t.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Ya,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=y.T,i=H.p,H.p=2,y.T=null;try{for(var o=e.onRecoverableError,m=0;m<l.length;m++){var b=l[m];o(b.value,{componentStack:b.stack})}}finally{y.T=t,H.p=i}}(ua&3)!==0&&cr(),$n(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===vc?Ks++:(Ks=0,vc=e):Ks=0,Vs(0)}}function jm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ws(t)))}function cr(){return vm(),ym(),Nm(),Sm()}function Sm(){if(wt!==5)return!1;var e=Oa,t=gc;gc=0;var n=Kn(ua),l=y.T,i=H.p;try{H.p=32>n?32:n,y.T=null,n=bc,bc=null;var o=Oa,m=ua;if(wt=0,Zl=Oa=null,ua=0,(Ye&6)!==0)throw Error(c(331));var b=Ye;if(Ye|=4,lm(o.current),tm(o,o.current,m,n),Ye=b,Vs(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Ya,o)}catch{}return!0}finally{H.p=i,y.T=l,jm(e,t)}}function km(e,t,n){t=gn(n,t),t=Jo(e.stateNode,t,2),e=Ea(e,t,2),e!==null&&(Pe(e,2),$n(e))}function Ze(e,t,n){if(e.tag===3)km(e,e,n);else for(;t!==null;){if(t.tag===3){km(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ra===null||!Ra.has(l))){e=gn(n,e),n=_f(2),l=Ea(t,n,2),l!==null&&(Ef(n,l,t,e),Pe(l,2),$n(l));break}}t=t.return}}function jc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Fx;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(hc=!0,i.add(n),e=tg.bind(null,e,t,n),t.then(e,e))}function tg(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&($e&n)===n&&(dt===4||dt===3&&($e&62914560)===$e&&300>Ae()-ar?(Ye&2)===0&&Fl(e,0):pc|=n,Ql===$e&&(Ql=0)),$n(e)}function _m(e,t){t===0&&(t=Ee()),e=Pa(e,t),e!==null&&(Pe(e,t),$n(e))}function ng(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_m(e,n)}function ag(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),_m(e,n)}function lg(e,t){return hn(e,t)}var ur=null,Wl=null,Sc=!1,dr=!1,kc=!1,za=0;function $n(e){e!==Wl&&e.next===null&&(Wl===null?ur=Wl=e:Wl=Wl.next=e),dr=!0,Sc||(Sc=!0,ig())}function Vs(e,t){if(!kc&&dr){kc=!0;do for(var n=!1,l=ur;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var m=l.suspendedLanes,b=l.pingedLanes;o=(1<<31-Gt(42|e)+1)-1,o&=i&~(m&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Am(l,o))}else o=$e,o=T(l,l===et?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||W(l,o)||(n=!0,Am(l,o));l=l.next}while(n);kc=!1}}function sg(){Em()}function Em(){dr=Sc=!1;var e=0;za!==0&&xg()&&(e=za);for(var t=Ae(),n=null,l=ur;l!==null;){var i=l.next,o=wm(l,t);o===0?(l.next=null,n===null?ur=i:n.next=i,i===null&&(Wl=n)):(n=l,(e!==0||(o&3)!==0)&&(dr=!0)),l=i}wt!==0&&wt!==5||Vs(e),za!==0&&(za=0)}function wm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var m=31-Gt(o),b=1<<m,E=i[m];E===-1?((b&n)===0||(b&l)!==0)&&(i[m]=me(b,t)):E<=t&&(e.expiredLanes|=b),o&=~b}if(t=et,n=$e,n=T(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Yn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||W(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Yn(l),Kn(n)){case 2:case 8:n=wn;break;case 32:n=ft;break;case 268435456:n=Xn;break;default:n=ft}return l=Tm.bind(null,e),n=hn(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Yn(l),e.callbackPriority=2,e.callbackNode=null,2}function Tm(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cr()&&e.callbackNode!==n)return null;var l=$e;return l=T(e,e===et?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(cm(e,l,t),wm(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?Tm.bind(null,e):null)}function Am(e,t){if(cr())return null;cm(e,t,!0)}function ig(){bg(function(){(Ye&6)!==0?hn(Et,sg):Em()})}function _c(){if(za===0){var e=Bl;e===0&&(e=Xa,Xa<<=1,(Xa&261888)===0&&(Xa=256)),za=e}return za}function Mm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ba(""+e)}function Cm(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 rg(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var o=Mm((i[Ut]||null).action),m=l.submitter;m&&(t=(t=m[Ut]||null)?Mm(t.formAction):m.getAttribute("formAction"),t!==null&&(o=t,m=null));var b=new Si("action","action",null,l,i);e.push({event:b,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(za!==0){var E=m?Cm(i,m):new FormData(i);Xo(n,{pending:!0,data:E,method:i.method,action:o},null,E)}}else typeof o=="function"&&(b.preventDefault(),E=m?Cm(i,m):new FormData(i),Xo(n,{pending:!0,data:E,method:i.method,action:o},o,E))},currentTarget:i}]})}}for(var Ec=0;Ec<ro.length;Ec++){var wc=ro[Ec],og=wc.toLowerCase(),cg=wc[0].toUpperCase()+wc.slice(1);Tn(og,"on"+cg)}Tn(rd,"onAnimationEnd"),Tn(od,"onAnimationIteration"),Tn(cd,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(_x,"onTransitionRun"),Tn(Ex,"onTransitionStart"),Tn(wx,"onTransitionCancel"),Tn(ud,"onTransitionEnd"),ie("onMouseEnter",["mouseout","mouseover"]),ie("onMouseLeave",["mouseout","mouseover"]),ie("onPointerEnter",["pointerout","pointerover"]),ie("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qs="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(" "),ug=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qs));function Rm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var m=l.length-1;0<=m;m--){var b=l[m],E=b.instance,$=b.currentTarget;if(b=b.listener,E!==o&&i.isPropagationStopped())break e;o=b,i.currentTarget=$;try{o(i)}catch(Z){Ei(Z)}i.currentTarget=null,o=E}else for(m=0;m<l.length;m++){if(b=l[m],E=b.instance,$=b.currentTarget,b=b.listener,E!==o&&i.isPropagationStopped())break e;o=b,i.currentTarget=$;try{o(i)}catch(Z){Ei(Z)}i.currentTarget=null,o=E}}}}function Be(e,t){var n=t[us];n===void 0&&(n=t[us]=new Set);var l=e+"__bubble";n.has(l)||(Om(t,e,2,!1),n.add(l))}function Tc(e,t,n){var l=0;t&&(l|=4),Om(n,e,l,t)}var fr="_reactListening"+Math.random().toString(36).slice(2);function Ac(e){if(!e[fr]){e[fr]=!0,pi.forEach(function(n){n!=="selectionchange"&&(ug.has(n)||Tc(n,!1,e),Tc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fr]||(t[fr]=!0,Tc("selectionchange",!1,t))}}function Om(e,t,n,l){switch(oh(t)){case 2:var i=Ug;break;case 8:i=$g;break;default:i=Yc}n=i.bind(null,t,n,e),i=void 0,!Qr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Mc(e,t,n,l,i){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var b=l.stateNode.containerInfo;if(b===i)break;if(m===4)for(m=l.return;m!==null;){var E=m.tag;if((E===3||E===4)&&m.stateNode.containerInfo===i)return;m=m.return}for(;b!==null;){if(m=Yt(b),m===null)return;if(E=m.tag,E===5||E===6||E===26||E===27){l=o=m;continue e}b=b.parentNode}}l=l.return}vi(function(){var $=o,Z=Me(n),ee=[];e:{var q=dd.get(e);if(q!==void 0){var X=Si,ge=e;switch(e){case"keypress":if(Ni(n)===0)break e;case"keydown":case"keyup":X=ax;break;case"focusin":ge="focus",X=Wr;break;case"focusout":ge="blur",X=Wr;break;case"beforeblur":case"afterblur":X=Wr;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":X=qu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Xp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=ix;break;case rd:case od:case cd:X=Qp;break;case ud:X=ox;break;case"scroll":case"scrollend":X=Gp;break;case"wheel":X=ux;break;case"copy":case"cut":case"paste":X=Fp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Iu;break;case"toggle":case"beforetoggle":X=fx}var Se=(t&4)!==0,We=!Se&&(e==="scroll"||e==="scrollend"),z=Se?q!==null?q+"Capture":null:q;Se=[];for(var M=$,U;M!==null;){var P=M;if(U=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||U===null||z===null||(P=xs(M,z),P!=null&&Se.push(Zs(M,P,U))),We)break;M=M.return}0<Se.length&&(q=new X(q,ge,null,n,Z),ee.push({event:q,listeners:Se}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",q&&n!==ve&&(ge=n.relatedTarget||n.fromElement)&&(Yt(ge)||ge[ha]))break e;if((X||q)&&(q=Z.window===Z?Z:(q=Z.ownerDocument)?q.defaultView||q.parentWindow:window,X?(ge=n.relatedTarget||n.toElement,X=$,ge=ge?Yt(ge):null,ge!==null&&(We=f(ge),Se=ge.tag,ge!==We||Se!==5&&Se!==27&&Se!==6)&&(ge=null)):(X=null,ge=$),X!==ge)){if(Se=qu,P="onMouseLeave",z="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Iu,P="onPointerLeave",z="onPointerEnter",M="pointer"),We=X==null?q:pa(X),U=ge==null?q:pa(ge),q=new Se(P,M+"leave",X,n,Z),q.target=We,q.relatedTarget=U,P=null,Yt(Z)===$&&(Se=new Se(z,M+"enter",ge,n,Z),Se.target=U,Se.relatedTarget=We,P=Se),We=P,X&&ge)t:{for(Se=dg,z=X,M=ge,U=0,P=z;P;P=Se(P))U++;P=0;for(var je=M;je;je=Se(je))P++;for(;0<U-P;)z=Se(z),U--;for(;0<P-U;)M=Se(M),P--;for(;U--;){if(z===M||M!==null&&z===M.alternate){Se=z;break t}z=Se(z),M=Se(M)}Se=null}else Se=null;X!==null&&Dm(ee,q,X,Se,!1),ge!==null&&We!==null&&Dm(ee,We,ge,Se,!0)}}e:{if(q=$?pa($):window,X=q.nodeName&&q.nodeName.toLowerCase(),X==="select"||X==="input"&&q.type==="file")var Ie=Fu;else if(Qu(q))if(Ju)Ie=jx;else{Ie=yx;var ye=vx}else X=q.nodeName,!X||X.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?$&&ga($.elementType)&&(Ie=Fu):Ie=Nx;if(Ie&&(Ie=Ie(e,$))){Zu(ee,Ie,n,Z);break e}ye&&ye(e,q,$),e==="focusout"&&$&&q.type==="number"&&$.memoizedProps.value!=null&&El(q,"number",q.value)}switch(ye=$?pa($):window,e){case"focusin":(Qu(ye)||ye.contentEditable==="true")&&(Al=ye,lo=$,ks=null);break;case"focusout":ks=lo=Al=null;break;case"mousedown":so=!0;break;case"contextmenu":case"mouseup":case"dragend":so=!1,sd(ee,n,Z);break;case"selectionchange":if(kx)break;case"keydown":case"keyup":sd(ee,n,Z)}var Re;if(eo)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Tl?Ku(e,n)&&(qe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(qe="onCompositionStart");qe&&(Gu&&n.locale!=="ko"&&(Tl||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Tl&&(Re=Uu()):(va=Z,Zr="value"in va?va.value:va.textContent,Tl=!0)),ye=mr($,qe),0<ye.length&&(qe=new Hu(qe,e,null,n,Z),ee.push({event:qe,listeners:ye}),Re?qe.data=Re:(Re=Vu(n),Re!==null&&(qe.data=Re)))),(Re=hx?px(e,n):xx(e,n))&&(qe=mr($,"onBeforeInput"),0<qe.length&&(ye=new Hu("onBeforeInput","beforeinput",null,n,Z),ee.push({event:ye,listeners:qe}),ye.data=Re)),rg(ee,e,$,n,Z)}Rm(ee,t)})}function Zs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mr(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=xs(e,n),i!=null&&l.unshift(Zs(e,i,o)),i=xs(e,t),i!=null&&l.push(Zs(e,i,o))),e.tag===3)return l;e=e.return}return[]}function dg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dm(e,t,n,l,i){for(var o=t._reactName,m=[];n!==null&&n!==l;){var b=n,E=b.alternate,$=b.stateNode;if(b=b.tag,E!==null&&E===l)break;b!==5&&b!==26&&b!==27||$===null||(E=$,i?($=xs(n,o),$!=null&&m.unshift(Zs(n,$,E))):i||($=xs(n,o),$!=null&&m.push(Zs(n,$,E)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var fg=/\r\n?/g,mg=/\u0000|\uFFFD/g;function zm(e){return(typeof e=="string"?e:""+e).replace(fg,`
|
|
49
|
+
`).replace(mg,"")}function Lm(e,t){return t=zm(t),zm(e)===t}function Je(e,t,n,l,i,o){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ke(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ke(e,""+l);break;case"className":nn(e,"class",l);break;case"tabIndex":nn(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":nn(e,n,l);break;case"style":Ve(e,l,o);break;case"data":if(t!=="object"){nn(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=ba(""+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 o=="function"&&(n==="formAction"?(t!=="input"&&Je(e,t,"name",i.name,i,null),Je(e,t,"formEncType",i.formEncType,i,null),Je(e,t,"formMethod",i.formMethod,i,null),Je(e,t,"formTarget",i.formTarget,i,null)):(Je(e,t,"encType",i.encType,i,null),Je(e,t,"method",i.method,i,null),Je(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ba(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=ce);break;case"onScroll":l!=null&&Be("scroll",e);break;case"onScrollEnd":l!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(c(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=ba(""+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":Be("beforetoggle",e),Be("toggle",e),$t(e,"popover",l);break;case"xlinkActuate":Qt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":$t(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=Zn.get(n)||n,$t(e,n,l))}}function Cc(e,t,n,l,i,o){switch(n){case"style":Ve(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?ke(e,l):(typeof l=="number"||typeof l=="bigint")&&ke(e,""+l);break;case"onScroll":l!=null&&Be("scroll",e);break;case"onScrollEnd":l!=null&&Be("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qa.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),o=e[Ut]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,i),typeof l=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):$t(e,n,l)}}}function Lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var l=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var m=n[o];if(m!=null)switch(o){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Je(e,t,o,m,n,null)}}i&&Je(e,t,"srcSet",n.srcSet,n,null),l&&Je(e,t,"src",n.src,n,null);return;case"input":Be("invalid",e);var b=o=m=i=null,E=null,$=null;for(l in n)if(n.hasOwnProperty(l)){var Z=n[l];if(Z!=null)switch(l){case"name":i=Z;break;case"type":m=Z;break;case"checked":E=Z;break;case"defaultChecked":$=Z;break;case"value":o=Z;break;case"defaultValue":b=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:Je(e,t,l,Z,n,null)}}Za(e,o,b,E,$,m,i,!1);return;case"select":Be("invalid",e),l=m=o=null;for(i in n)if(n.hasOwnProperty(i)&&(b=n[i],b!=null))switch(i){case"value":o=b;break;case"defaultValue":m=b;break;case"multiple":l=b;default:Je(e,t,i,b,n,null)}t=o,n=m,e.multiple=!!l,t!=null?Rt(e,!!l,t,!1):n!=null&&Rt(e,!!l,n,!0);return;case"textarea":Be("invalid",e),o=i=l=null;for(m in n)if(n.hasOwnProperty(m)&&(b=n[m],b!=null))switch(m){case"value":l=b;break;case"defaultValue":i=b;break;case"children":o=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(c(91));break;default:Je(e,t,m,b,n,null)}wl(e,l,i,o);return;case"option":for(E in n)if(n.hasOwnProperty(E)&&(l=n[E],l!=null))switch(E){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Je(e,t,E,l,n,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(l=0;l<Qs.length;l++)Be(Qs[l],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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($ in n)if(n.hasOwnProperty($)&&(l=n[$],l!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Je(e,t,$,l,n,null)}return;default:if(ga(t)){for(Z in n)n.hasOwnProperty(Z)&&(l=n[Z],l!==void 0&&Cc(e,t,Z,l,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(l=n[b],l!=null&&Je(e,t,b,l,n,null))}function hg(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 i=null,o=null,m=null,b=null,E=null,$=null,Z=null;for(X in n){var ee=n[X];if(n.hasOwnProperty(X)&&ee!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":E=ee;default:l.hasOwnProperty(X)||Je(e,t,X,null,l,ee)}}for(var q in l){var X=l[q];if(ee=n[q],l.hasOwnProperty(q)&&(X!=null||ee!=null))switch(q){case"type":o=X;break;case"name":i=X;break;case"checked":$=X;break;case"defaultChecked":Z=X;break;case"value":m=X;break;case"defaultValue":b=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(c(137,t));break;default:X!==ee&&Je(e,t,q,X,l,ee)}}ms(e,m,b,E,$,Z,o,i);return;case"select":X=m=b=q=null;for(o in n)if(E=n[o],n.hasOwnProperty(o)&&E!=null)switch(o){case"value":break;case"multiple":X=E;default:l.hasOwnProperty(o)||Je(e,t,o,null,l,E)}for(i in l)if(o=l[i],E=n[i],l.hasOwnProperty(i)&&(o!=null||E!=null))switch(i){case"value":q=o;break;case"defaultValue":b=o;break;case"multiple":m=o;default:o!==E&&Je(e,t,i,o,l,E)}t=b,n=m,l=X,q!=null?Rt(e,!!n,q,!1):!!l!=!!n&&(t!=null?Rt(e,!!n,t,!0):Rt(e,!!n,n?[]:"",!1));return;case"textarea":X=q=null;for(b in n)if(i=n[b],n.hasOwnProperty(b)&&i!=null&&!l.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Je(e,t,b,null,l,i)}for(m in l)if(i=l[m],o=n[m],l.hasOwnProperty(m)&&(i!=null||o!=null))switch(m){case"value":q=i;break;case"defaultValue":X=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==o&&Je(e,t,m,i,l,o)}gi(e,q,X);return;case"option":for(var ge in n)if(q=n[ge],n.hasOwnProperty(ge)&&q!=null&&!l.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:Je(e,t,ge,null,l,q)}for(E in l)if(q=l[E],X=n[E],l.hasOwnProperty(E)&&q!==X&&(q!=null||X!=null))switch(E){case"selected":e.selected=q&&typeof q!="function"&&typeof q!="symbol";break;default:Je(e,t,E,q,l,X)}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 Se in n)q=n[Se],n.hasOwnProperty(Se)&&q!=null&&!l.hasOwnProperty(Se)&&Je(e,t,Se,null,l,q);for($ in l)if(q=l[$],X=n[$],l.hasOwnProperty($)&&q!==X&&(q!=null||X!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(c(137,t));break;default:Je(e,t,$,q,l,X)}return;default:if(ga(t)){for(var We in n)q=n[We],n.hasOwnProperty(We)&&q!==void 0&&!l.hasOwnProperty(We)&&Cc(e,t,We,void 0,l,q);for(Z in l)q=l[Z],X=n[Z],!l.hasOwnProperty(Z)||q===X||q===void 0&&X===void 0||Cc(e,t,Z,q,l,X);return}}for(var z in n)q=n[z],n.hasOwnProperty(z)&&q!=null&&!l.hasOwnProperty(z)&&Je(e,t,z,null,l,q);for(ee in l)q=l[ee],X=n[ee],!l.hasOwnProperty(ee)||q===X||q==null&&X==null||Je(e,t,ee,q,l,X)}function Bm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],o=i.transferSize,m=i.initiatorType,b=i.duration;if(o&&b&&Bm(m)){for(m=0,b=i.responseEnd,l+=1;l<n.length;l++){var E=n[l],$=E.startTime;if($>b)break;var Z=E.transferSize,ee=E.initiatorType;Z&&Bm(ee)&&(E=E.responseEnd,m+=Z*(E<b?1:(b-$)/(E-$)))}if(--l,t+=8*(o+m)/(i.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 Rc=null,Oc=null;function hr(e){return e.nodeType===9?e:e.ownerDocument}function Um(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 $m(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 Dc(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 zc=null;function xg(){var e=window.event;return e&&e.type==="popstate"?e===zc?!1:(zc=e,!0):(zc=null,!1)}var qm=typeof setTimeout=="function"?setTimeout:void 0,gg=typeof clearTimeout=="function"?clearTimeout:void 0,Hm=typeof Promise=="function"?Promise:void 0,bg=typeof queueMicrotask=="function"?queueMicrotask:typeof Hm<"u"?function(e){return Hm.resolve(null).then(e).catch(vg)}:qm;function vg(e){setTimeout(function(){throw e})}function La(e){return e==="head"}function Im(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),ns(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Fs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Fs(n);for(var o=n.firstChild;o;){var m=o.nextSibling,b=o.nodeName;o[Va]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=m}}else n==="body"&&Fs(e.ownerDocument.body);n=i}while(n);ns(t)}function Gm(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 Lc(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":Lc(n),ds(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function yg(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function Ng(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=jn(e.nextSibling),e===null))return null;return e}function Ym(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jn(e.nextSibling),e===null))return null;return e}function Bc(e){return e.data==="$?"||e.data==="$~"}function Uc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function jg(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 jn(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 $c=null;function Xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return jn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Km(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 Vm(e,t,n){switch(t=hr(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Fs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ds(e)}var Sn=new Map,Qm=new Set;function pr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var da=H.d;H.d={f:Sg,r:kg,D:_g,C:Eg,L:wg,m:Tg,X:Mg,S:Ag,M:Cg};function Sg(){var e=da.f(),t=ir();return e||t}function kg(e){var t=Vn(e);t!==null&&t.tag===5&&t.type==="form"?df(t):da.r(e)}var Pl=typeof document>"u"?null:document;function Zm(e,t,n){var l=Pl;if(l&&typeof t=="string"&&t){var i=Zt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Qm.has(i)||(Qm.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),Lt(t,"link",e),vt(t),l.head.appendChild(t)))}}function _g(e){da.D(e),Zm("dns-prefetch",e,null)}function Eg(e,t){da.C(e,t),Zm("preconnect",e,t)}function wg(e,t,n){da.L(e,t,n);var l=Pl;if(l&&e&&t){var i='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Zt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Zt(n.imageSizes)+'"]')):i+='[href="'+Zt(e)+'"]';var o=i;switch(t){case"style":o=es(e);break;case"script":o=ts(e)}Sn.has(o)||(e=k({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Sn.set(o,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Js(o))||t==="script"&&l.querySelector(Ws(o))||(t=l.createElement("link"),Lt(t,"link",e),vt(t),l.head.appendChild(t)))}}function Tg(e,t){da.m(e,t);var n=Pl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Zt(l)+'"][href="'+Zt(e)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ts(e)}if(!Sn.has(o)&&(e=k({rel:"modulepreload",href:e},t),Sn.set(o,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ws(o)))return}l=n.createElement("link"),Lt(l,"link",e),vt(l),n.head.appendChild(l)}}}function Ag(e,t,n){da.S(e,t,n);var l=Pl;if(l&&e){var i=xa(l).hoistableStyles,o=es(e);t=t||"default";var m=i.get(o);if(!m){var b={loading:0,preload:null};if(m=l.querySelector(Js(o)))b.loading=5;else{e=k({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Sn.get(o))&&qc(e,n);var E=m=l.createElement("link");vt(E),Lt(E,"link",e),E._p=new Promise(function($,Z){E.onload=$,E.onerror=Z}),E.addEventListener("load",function(){b.loading|=1}),E.addEventListener("error",function(){b.loading|=2}),b.loading|=4,xr(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:b},i.set(o,m)}}}function Mg(e,t){da.X(e,t);var n=Pl;if(n&&e){var l=xa(n).hoistableScripts,i=ts(e),o=l.get(i);o||(o=n.querySelector(Ws(i)),o||(e=k({src:e,async:!0},t),(t=Sn.get(i))&&Hc(e,t),o=n.createElement("script"),vt(o),Lt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Cg(e,t){da.M(e,t);var n=Pl;if(n&&e){var l=xa(n).hoistableScripts,i=ts(e),o=l.get(i);o||(o=n.querySelector(Ws(i)),o||(e=k({src:e,async:!0,type:"module"},t),(t=Sn.get(i))&&Hc(e,t),o=n.createElement("script"),vt(o),Lt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Fm(e,t,n,l){var i=(i=ae.current)?pr(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=es(n.href),n=xa(i).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=es(n.href);var o=xa(i).hoistableStyles,m=o.get(e);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,m),(o=i.querySelector(Js(e)))&&!o._p&&(m.instance=o,m.state.loading=5),Sn.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},Sn.set(e,n),o||Rg(i,e,n,m.state))),t&&l===null)throw Error(c(528,""));return m}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ts(n),n=xa(i).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(c(444,e))}}function es(e){return'href="'+Zt(e)+'"'}function Js(e){return'link[rel="stylesheet"]['+e+"]"}function Jm(e){return k({},e,{"data-precedence":e.precedence,precedence:null})}function Rg(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}),Lt(t,"link",n),vt(t),e.head.appendChild(t))}function ts(e){return'[src="'+Zt(e)+'"]'}function Ws(e){return"script[async]"+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Zt(n.href)+'"]');if(l)return t.instance=l,vt(l),l;var i=k({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),vt(l),Lt(l,"style",i),xr(l,n.precedence,e),t.instance=l;case"stylesheet":i=es(n.href);var o=e.querySelector(Js(i));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;l=Jm(n),(i=Sn.get(i))&&qc(l,i),o=(e.ownerDocument||e).createElement("link"),vt(o);var m=o;return m._p=new Promise(function(b,E){m.onload=b,m.onerror=E}),Lt(o,"link",l),t.state.loading|=4,xr(o,n.precedence,e),t.instance=o;case"script":return o=ts(n.src),(i=e.querySelector(Ws(o)))?(t.instance=i,vt(i),i):(l=n,(i=Sn.get(o))&&(l=k({},n),Hc(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),vt(i),Lt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,xr(l,n.precedence,e));return t.instance}function xr(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,m=0;m<l.length;m++){var b=l[m];if(b.dataset.precedence===t)o=b;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gr=null;function Pm(e,t,n){if(gr===null){var l=new Map,i=gr=new Map;i.set(n,l)}else i=gr,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[Va]||o[ht]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var m=o.getAttribute(t)||"";m=e+m;var b=l.get(m);b?b.push(o):l.set(m,[o])}}return l}function eh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Og(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 th(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dg(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 i=es(l.href),o=t.querySelector(Js(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=br.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,vt(o);return}o=t.ownerDocument||t,l=Jm(l),(i=Sn.get(i))&&qc(l,i),o=o.createElement("link"),vt(o);var m=o;m._p=new Promise(function(b,E){m.onload=b,m.onerror=E}),Lt(o,"link",l),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=br.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ic=0;function zg(e,t){return e.stylesheets&&e.count===0&&yr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&yr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Ic===0&&(Ic=62500*pg());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Ic?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function br(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vr=null;function yr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vr=new Map,t.forEach(Lg,e),vr=null,br.call(e))}function Lg(e,t){if(!(t.state.loading&4)){var n=vr.get(e);if(n)var l=n.get(null);else{n=new Map,vr.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var m=i[o];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),l=m)}l&&n.set(null,l)}i=t.instance,m=i.getAttribute("data-precedence"),o=n.get(m)||l,o===l&&n.set(null,i),n.set(m,i),this.count++,l=br.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ps={$$typeof:J,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function Bg(e,t,n,l,i,o,m,b,E){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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function nh(e,t,n,l,i,o,m,b,E,$,Z,ee){return e=new Bg(e,t,n,m,E,$,Z,ee,b),t=1,o===!0&&(t|=24),o=sn(3,null,null,t),e.current=o,o.stateNode=e,t=No(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:n,cache:t},_o(o),e}function ah(e){return e?(e=Rl,e):Rl}function lh(e,t,n,l,i,o){i=ah(i),l.context===null?l.context=i:l.pendingContext=i,l=_a(t),l.payload={element:n},o=o===void 0?null:o,o!==null&&(l.callback=o),n=Ea(e,l,t),n!==null&&(tn(n,e,t),Cs(n,e,t))}function sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gc(e,t){sh(e,t),(e=e.alternate)&&sh(e,t)}function ih(e){if(e.tag===13||e.tag===31){var t=Pa(e,67108864);t!==null&&tn(t,e,67108864),Gc(e,67108864)}}function rh(e){if(e.tag===13||e.tag===31){var t=dn();t=it(t);var n=Pa(e,t);n!==null&&tn(n,e,t),Gc(e,t)}}var Nr=!0;function Ug(e,t,n,l){var i=y.T;y.T=null;var o=H.p;try{H.p=2,Yc(e,t,n,l)}finally{H.p=o,y.T=i}}function $g(e,t,n,l){var i=y.T;y.T=null;var o=H.p;try{H.p=8,Yc(e,t,n,l)}finally{H.p=o,y.T=i}}function Yc(e,t,n,l){if(Nr){var i=Xc(l);if(i===null)Mc(e,t,l,jr,n),ch(e,l);else if(Hg(i,e,t,n,l))l.stopPropagation();else if(ch(e,l),t&4&&-1<qg.indexOf(e)){for(;i!==null;){var o=Vn(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var m=Vt(o.pendingLanes);if(m!==0){var b=o;for(b.pendingLanes|=2,b.entangledLanes|=2;m;){var E=1<<31-Gt(m);b.entanglements[1]|=E,m&=~E}$n(o),(Ye&6)===0&&(lr=Ae()+500,Vs(0))}}break;case 31:case 13:b=Pa(o,2),b!==null&&tn(b,o,2),ir(),Gc(o,2)}if(o=Xc(l),o===null&&Mc(e,t,l,jr,n),o===i)break;i=o}i!==null&&l.stopPropagation()}else Mc(e,t,l,null,n)}}function Xc(e){return e=Me(e),Kc(e)}var jr=null;function Kc(e){if(jr=null,e=Yt(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=h(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 jr=e,null}function oh(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(Tt()){case Et:return 2;case wn:return 8;case ft:case vl:return 32;case Xn:return 268435456;default:return 32}default:return 32}}var Vc=!1,Ba=null,Ua=null,$a=null,ei=new Map,ti=new Map,qa=[],qg="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 ch(e,t){switch(e){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":ei.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ti.delete(t.pointerId)}}function ni(e,t,n,l,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Vn(t),t!==null&&ih(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hg(e,t,n,l,i){switch(t){case"focusin":return Ba=ni(Ba,e,t,n,l,i),!0;case"dragenter":return Ua=ni(Ua,e,t,n,l,i),!0;case"mouseover":return $a=ni($a,e,t,n,l,i),!0;case"pointerover":var o=i.pointerId;return ei.set(o,ni(ei.get(o)||null,e,t,n,l,i)),!0;case"gotpointercapture":return o=i.pointerId,ti.set(o,ni(ti.get(o)||null,e,t,n,l,i)),!0}return!1}function uh(e){var t=Yt(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,jl(e.priority,function(){rh(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,jl(e.priority,function(){rh(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 Sr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ve=l,n.target.dispatchEvent(l),ve=null}else return t=Vn(n),t!==null&&ih(t),e.blockedOn=n,!1;t.shift()}return!0}function dh(e,t,n){Sr(e)&&n.delete(t)}function Ig(){Vc=!1,Ba!==null&&Sr(Ba)&&(Ba=null),Ua!==null&&Sr(Ua)&&(Ua=null),$a!==null&&Sr($a)&&($a=null),ei.forEach(dh),ti.forEach(dh)}function kr(e,t){e.blockedOn===t&&(e.blockedOn=null,Vc||(Vc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Ig)))}var _r=null;function fh(e){_r!==e&&(_r=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){_r===e&&(_r=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(Kc(l||n)===null)continue;break}var o=Vn(n);o!==null&&(e.splice(t,3),t-=3,Xo(o,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function ns(e){function t(E){return kr(E,e)}Ba!==null&&kr(Ba,e),Ua!==null&&kr(Ua,e),$a!==null&&kr($a,e),ei.forEach(t),ti.forEach(t);for(var n=0;n<qa.length;n++){var l=qa[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<qa.length&&(n=qa[0],n.blockedOn===null);)uh(n),n.blockedOn===null&&qa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],o=n[l+1],m=i[Ut]||null;if(typeof o=="function")m||fh(n);else if(m){var b=null;if(o&&o.hasAttribute("formAction")){if(i=o,m=o[Ut]||null)b=m.formAction;else if(Kc(i)!==null)continue}else b=m.action;typeof b=="function"?n[l+1]=b:(n.splice(l,3),l-=3),fh(n)}}}function mh(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(m){return i=m})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=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),i!==null&&(i(),i=null)}}}function Qc(e){this._internalRoot=e}Er.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=dn();lh(n,l,e,t,null,null)},Er.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lh(e.current,2,null,e,null,null),ir(),t[ha]=null}};function Er(e){this._internalRoot=e}Er.prototype.unstable_scheduleHydration=function(e){if(e){var t=Nl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qa.length&&t!==0&&t<qa[n].priority;n++);qa.splice(n,0,e),n===0&&uh(e)}};var hh=r.version;if(hh!=="19.2.6")throw Error(c(527,hh,"19.2.6"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Gg={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:y,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wr.isDisabled&&wr.supportsFiber)try{Ya=wr.inject(Gg),Bt=wr}catch{}}return li.createRoot=function(e,t){if(!d(e))throw Error(c(299));var n=!1,l="",i=Nf,o=jf,m=Sf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=nh(e,1,!1,null,null,n,l,null,i,o,m,mh),e[ha]=t.current,Ac(e),new Qc(t)},li.hydrateRoot=function(e,t,n){if(!d(e))throw Error(c(299));var l=!1,i="",o=Nf,m=jf,b=Sf,E=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(E=n.formState)),t=nh(e,1,!0,t,n??null,l,i,E,o,m,b,mh),t.context=ah(null),n=t.current,l=dn(),l=it(l),i=_a(l),i.callback=null,Ea(n,i,l),n=l,t.current.lanes=n,Pe(t,n),$n(t),e[ha]=t.current,Ac(e),new Er(t)},li.version="19.2.6",li}var kh;function nb(){if(kh)return Jc.exports;kh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Jc.exports=tb(),Jc.exports}var ab=nb();const hl="/dashboard";function _h(){const s=window.location.pathname;return s===hl||s===hl+"/"?"/":s.startsWith(hl+"/")?s.slice(hl.length):s||"/"}function fn(s){return s==="/"||s===""?hl+"/":hl+(s.startsWith("/")?s:"/"+s)}function In(s){const r=fn(s);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",s=>{var c,d;if(s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey)return;const r=(d=(c=s.target)==null?void 0:c.closest)==null?void 0:d.call(c,"a");if(!r)return;const u=r.getAttribute("href");u&&(r.hasAttribute("target")||r.hasAttribute("download")||u.startsWith(hl)&&(s.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 lb(s,r){const u=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/:\w+/g,"([^/]+)"),c=new RegExp(`^${u}$`),d=r.match(c);return d?decodeURIComponent(d[1]):null}function sp(){const[s,r]=N.useState(_h());return N.useEffect(()=>{const u=()=>r(_h());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),s}var tu,Eh;function sb(){if(Eh)return tu;Eh=1;function s(T){return T instanceof Map?T.clear=T.delete=T.set=function(){throw new Error("map is read-only")}:T instanceof Set&&(T.add=T.clear=T.delete=function(){throw new Error("set is read-only")}),Object.freeze(T),Object.getOwnPropertyNames(T).forEach(W=>{const me=T[W],Ee=typeof me;(Ee==="object"||Ee==="function")&&!Object.isFrozen(me)&&s(me)}),T}class r{constructor(W){W.data===void 0&&(W.data={}),this.data=W.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function u(T){return T.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function c(T,...W){const me=Object.create(null);for(const Ee in T)me[Ee]=T[Ee];return W.forEach(function(Ee){for(const at in Ee)me[at]=Ee[at]}),me}const d="</span>",f=T=>!!T.scope,p=(T,{prefix:W})=>{if(T.startsWith("language:"))return T.replace("language:","language-");if(T.includes(".")){const me=T.split(".");return[`${W}${me.shift()}`,...me.map((Ee,at)=>`${Ee}${"_".repeat(at+1)}`)].join(" ")}return`${W}${T}`};class h{constructor(W,me){this.buffer="",this.classPrefix=me.classPrefix,W.walk(this)}addText(W){this.buffer+=u(W)}openNode(W){if(!f(W))return;const me=p(W.scope,{prefix:this.classPrefix});this.span(me)}closeNode(W){f(W)&&(this.buffer+=d)}value(){return this.buffer}span(W){this.buffer+=`<span class="${W}">`}}const x=(T={})=>{const W={children:[]};return Object.assign(W,T),W};class g{constructor(){this.rootNode=x(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(W){this.top.children.push(W)}openNode(W){const me=x({scope:W});this.add(me),this.stack.push(me)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(W){return this.constructor._walk(W,this.rootNode)}static _walk(W,me){return typeof me=="string"?W.addText(me):me.children&&(W.openNode(me),me.children.forEach(Ee=>this._walk(W,Ee)),W.closeNode(me)),W}static _collapse(W){typeof W!="string"&&W.children&&(W.children.every(me=>typeof me=="string")?W.children=[W.children.join("")]:W.children.forEach(me=>{g._collapse(me)}))}}class v extends g{constructor(W){super(),this.options=W}addText(W){W!==""&&this.add(W)}startScope(W){this.openNode(W)}endScope(){this.closeNode()}__addSublanguage(W,me){const Ee=W.root;me&&(Ee.scope=`language:${me}`),this.add(Ee)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function k(T){return T?typeof T=="string"?T:T.source:null}function w(T){return A("(?=",T,")")}function G(T){return A("(?:",T,")*")}function R(T){return A("(?:",T,")?")}function A(...T){return T.map(me=>k(me)).join("")}function S(T){const W=T[T.length-1];return typeof W=="object"&&W.constructor===Object?(T.splice(T.length-1,1),W):{}}function D(...T){return"("+(S(T).capture?"":"?:")+T.map(Ee=>k(Ee)).join("|")+")"}function L(T){return new RegExp(T.toString()+"|").exec("").length-1}function J(T,W){const me=T&&T.exec(W);return me&&me.index===0}const K=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(T,{joinWith:W}){let me=0;return T.map(Ee=>{me+=1;const at=me;let Pe=k(Ee),be="";for(;Pe.length>0;){const pe=K.exec(Pe);if(!pe){be+=Pe;break}be+=Pe.substring(0,pe.index),Pe=Pe.substring(pe.index+pe[0].length),pe[0][0]==="\\"&&pe[1]?be+="\\"+String(Number(pe[1])+at):(be+=pe[0],pe[0]==="("&&me++)}return be}).map(Ee=>`(${Ee})`).join(W)}const O=/\b\B/,_="[a-zA-Z]\\w*",V="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ue="\\b(0b[01]+)",te="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",oe=(T={})=>{const W=/^#![ ]*\//;return T.binary&&(T.begin=A(W,/.*\b/,T.binary,/\b.*/)),c({scope:"meta",begin:W,end:/$/,relevance:0,"on:begin":(me,Ee)=>{me.index!==0&&Ee.ignoreMatch()}},T)},xe={begin:"\\\\[\\s\\S]",relevance:0},se={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[xe]},y={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[xe]},H={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Q=function(T,W,me={}){const Ee=c({scope:"comment",begin:T,end:W,contains:[]},me);Ee.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const at=D("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ee.contains.push({begin:A(/[ ]+/,"(",at,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ee},ne=Q("//","$"),re=Q("/\\*","\\*/"),j=Q("#","$"),B={scope:"number",begin:F,relevance:0},le={scope:"number",begin:I,relevance:0},fe={scope:"number",begin:ue,relevance:0},Y={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[xe,{begin:/\[/,end:/\]/,relevance:0,contains:[xe]}]},ae={scope:"title",begin:_,relevance:0},he={scope:"title",begin:V,relevance:0},Oe={begin:"\\.\\s*"+V,relevance:0};var tt=Object.freeze({__proto__:null,APOS_STRING_MODE:se,BACKSLASH_ESCAPE:xe,BINARY_NUMBER_MODE:fe,BINARY_NUMBER_RE:ue,COMMENT:Q,C_BLOCK_COMMENT_MODE:re,C_LINE_COMMENT_MODE:ne,C_NUMBER_MODE:le,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(T){return Object.assign(T,{"on:begin":(W,me)=>{me.data._beginMatch=W[1]},"on:end":(W,me)=>{me.data._beginMatch!==W[1]&&me.ignoreMatch()}})},HASH_COMMENT_MODE:j,IDENT_RE:_,MATCH_NOTHING_RE:O,METHOD_GUARD:Oe,NUMBER_MODE:B,NUMBER_RE:F,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:y,REGEXP_MODE:Y,RE_STARTERS_RE:te,SHEBANG:oe,TITLE_MODE:ae,UNDERSCORE_IDENT_RE:V,UNDERSCORE_TITLE_MODE:he});function Ht(T,W){T.input[T.index-1]==="."&&W.ignoreMatch()}function Ct(T,W){T.className!==void 0&&(T.scope=T.className,delete T.className)}function Cn(T,W){W&&T.beginKeywords&&(T.begin="\\b("+T.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",T.__beforeBegin=Ht,T.keywords=T.keywords||T.beginKeywords,delete T.beginKeywords,T.relevance===void 0&&(T.relevance=0))}function It(T,W){Array.isArray(T.illegal)&&(T.illegal=D(...T.illegal))}function Xe(T,W){if(T.match){if(T.begin||T.end)throw new Error("begin & end are not supported with match");T.begin=T.match,delete T.match}}function Rn(T,W){T.relevance===void 0&&(T.relevance=1)}const ma=(T,W)=>{if(!T.beforeMatch)return;if(T.starts)throw new Error("beforeMatch cannot be used with starts");const me=Object.assign({},T);Object.keys(T).forEach(Ee=>{delete T[Ee]}),T.keywords=me.keywords,T.begin=A(me.beforeMatch,w(me.begin)),T.starts={relevance:0,contains:[Object.assign(me,{endsParent:!0})]},T.relevance=0,delete me.beforeMatch},On=["of","and","for","in","not","or","if","then","parent","list","value"],En="keyword";function hn(T,W,me=En){const Ee=Object.create(null);return typeof T=="string"?at(me,T.split(" ")):Array.isArray(T)?at(me,T):Object.keys(T).forEach(function(Pe){Object.assign(Ee,hn(T[Pe],W,Pe))}),Ee;function at(Pe,be){W&&(be=be.map(pe=>pe.toLowerCase())),be.forEach(function(pe){const _e=pe.split("|");Ee[_e[0]]=[Pe,Yn(_e[0],_e[1])]})}}function Yn(T,W){return W?Number(W):de(T)?0:1}function de(T){return On.includes(T.toLowerCase())}const Te={},Ae=T=>{console.error(T)},Tt=(T,...W)=>{console.log(`WARN: ${T}`,...W)},Et=(T,W)=>{Te[`${T}/${W}`]||(console.log(`Deprecated as of ${T}. ${W}`),Te[`${T}/${W}`]=!0)},wn=new Error;function ft(T,W,{key:me}){let Ee=0;const at=T[me],Pe={},be={};for(let pe=1;pe<=W.length;pe++)be[pe+Ee]=at[pe],Pe[pe+Ee]=!0,Ee+=L(W[pe-1]);T[me]=be,T[me]._emit=Pe,T[me]._multi=!0}function vl(T){if(Array.isArray(T.begin)){if(T.skip||T.excludeBegin||T.returnBegin)throw Ae("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),wn;if(typeof T.beginScope!="object"||T.beginScope===null)throw Ae("beginScope must be object"),wn;ft(T,T.begin,{key:"beginScope"}),T.begin=C(T.begin,{joinWith:""})}}function Xn(T){if(Array.isArray(T.end)){if(T.skip||T.excludeEnd||T.returnEnd)throw Ae("skip, excludeEnd, returnEnd not compatible with endScope: {}"),wn;if(typeof T.endScope!="object"||T.endScope===null)throw Ae("endScope must be object"),wn;ft(T,T.end,{key:"endScope"}),T.end=C(T.end,{joinWith:""})}}function Yr(T){T.scope&&typeof T.scope=="object"&&T.scope!==null&&(T.beginScope=T.scope,delete T.scope)}function Xr(T){Yr(T),typeof T.beginScope=="string"&&(T.beginScope={_wrap:T.beginScope}),typeof T.endScope=="string"&&(T.endScope={_wrap:T.endScope}),vl(T),Xn(T)}function Ya(T){function W(be,pe){return new RegExp(k(be),"m"+(T.case_insensitive?"i":"")+(T.unicodeRegex?"u":"")+(pe?"g":""))}class me{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(pe,_e){_e.position=this.position++,this.matchIndexes[this.matchAt]=_e,this.regexes.push([_e,pe]),this.matchAt+=L(pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const pe=this.regexes.map(_e=>_e[1]);this.matcherRe=W(C(pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(pe){this.matcherRe.lastIndex=this.lastIndex;const _e=this.matcherRe.exec(pe);if(!_e)return null;const mt=_e.findIndex((Kn,Nl)=>Nl>0&&Kn!==void 0),it=this.matchIndexes[mt];return _e.splice(0,mt),Object.assign(_e,it)}}class Ee{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(pe){if(this.multiRegexes[pe])return this.multiRegexes[pe];const _e=new me;return this.rules.slice(pe).forEach(([mt,it])=>_e.addRule(mt,it)),_e.compile(),this.multiRegexes[pe]=_e,_e}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(pe,_e){this.rules.push([pe,_e]),_e.type==="begin"&&this.count++}exec(pe){const _e=this.getMatcher(this.regexIndex);_e.lastIndex=this.lastIndex;let mt=_e.exec(pe);if(this.resumingScanAtSamePosition()&&!(mt&&mt.index===this.lastIndex)){const it=this.getMatcher(0);it.lastIndex=this.lastIndex+1,mt=it.exec(pe)}return mt&&(this.regexIndex+=mt.position+1,this.regexIndex===this.count&&this.considerAll()),mt}}function at(be){const pe=new Ee;return be.contains.forEach(_e=>pe.addRule(_e.begin,{rule:_e,type:"begin"})),be.terminatorEnd&&pe.addRule(be.terminatorEnd,{type:"end"}),be.illegal&&pe.addRule(be.illegal,{type:"illegal"}),pe}function Pe(be,pe){const _e=be;if(be.isCompiled)return _e;[Ct,Xe,Xr,ma].forEach(it=>it(be,pe)),T.compilerExtensions.forEach(it=>it(be,pe)),be.__beforeBegin=null,[Cn,It,Rn].forEach(it=>it(be,pe)),be.isCompiled=!0;let mt=null;return typeof be.keywords=="object"&&be.keywords.$pattern&&(be.keywords=Object.assign({},be.keywords),mt=be.keywords.$pattern,delete be.keywords.$pattern),mt=mt||/\w+/,be.keywords&&(be.keywords=hn(be.keywords,T.case_insensitive)),_e.keywordPatternRe=W(mt,!0),pe&&(be.begin||(be.begin=/\B|\b/),_e.beginRe=W(_e.begin),!be.end&&!be.endsWithParent&&(be.end=/\B|\b/),be.end&&(_e.endRe=W(_e.end)),_e.terminatorEnd=k(_e.end)||"",be.endsWithParent&&pe.terminatorEnd&&(_e.terminatorEnd+=(be.end?"|":"")+pe.terminatorEnd)),be.illegal&&(_e.illegalRe=W(be.illegal)),be.contains||(be.contains=[]),be.contains=[].concat(...be.contains.map(function(it){return Dn(it==="self"?be:it)})),be.contains.forEach(function(it){Pe(it,_e)}),be.starts&&Pe(be.starts,pe),_e.matcher=at(_e),_e}if(T.compilerExtensions||(T.compilerExtensions=[]),T.contains&&T.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return T.classNameAliases=c(T.classNameAliases||{}),Pe(T)}function Bt(T){return T?T.endsWithParent||Bt(T.starts):!1}function Dn(T){return T.variants&&!T.cachedVariants&&(T.cachedVariants=T.variants.map(function(W){return c(T,{variants:null},W)})),T.cachedVariants?T.cachedVariants:Bt(T)?c(T,{starts:T.starts?c(T.starts):null}):Object.isFrozen(T)?c(T):T}var Gt="11.11.1";class Kr extends Error{constructor(W,me){super(W),this.name="HTMLInjectionError",this.html=me}}const cs=u,fi=c,Xa=Symbol("nomatch"),yl=7,Ka=function(T){const W=Object.create(null),me=Object.create(null),Ee=[];let at=!0;const Pe="Could not find the language '{}', did you forget to load/include a language module?",be={disableAutodetect:!0,name:"Plain text",contains:[]};let pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:v};function _e(ie){return pe.noHighlightRe.test(ie)}function mt(ie){let Ne=ie.className+" ";Ne+=ie.parentNode?ie.parentNode.className:"";const De=pe.languageDetectRe.exec(Ne);if(De){const Ke=Yt(De[1]);return Ke||(Tt(Pe.replace("{}",De[1])),Tt("Falling back to no-highlight mode for this block.",ie)),Ke?De[1]:"no-highlight"}return Ne.split(/\s+/).find(Ke=>_e(Ke)||Yt(Ke))}function it(ie,Ne,De){let Ke="",pt="";typeof Ne=="object"?(Ke=ie,De=Ne.ignoreIllegals,pt=Ne.language):(Et("10.7.0","highlight(lang, code, ...args) has been deprecated."),Et("10.7.0",`Please use highlight(code, options) instead.
|
|
50
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),pt=ie,Ke=Ne),De===void 0&&(De=!0);const $t={code:Ke,language:pt};Qa("before:highlight",$t);const nn=$t.result?$t.result:Kn($t.language,$t.code,De);return nn.code=$t.code,Qa("after:highlight",nn),nn}function Kn(ie,Ne,De,Ke){const pt=Object.create(null);function $t(ce,ve){return ce.keywords[ve]}function nn(){if(!ke.keywords){yt.addText(Ve);return}let ce=0;ke.keywordPatternRe.lastIndex=0;let ve=ke.keywordPatternRe.exec(Ve),Me="";for(;ve;){Me+=Ve.substring(ce,ve.index);const Ue=Rt.case_insensitive?ve[0].toLowerCase():ve[0],ct=$t(ke,Ue);if(ct){const[pn,ps]=ct;if(yt.addText(Me),Me="",pt[Ue]=(pt[Ue]||0)+1,pt[Ue]<=yl&&(ga+=ps),pn.startsWith("_"))Me+=ve[0];else{const vi=Rt.classNameAliases[pn]||pn;an(ve[0],vi)}}else Me+=ve[0];ce=ke.keywordPatternRe.lastIndex,ve=ke.keywordPatternRe.exec(Ve)}Me+=Ve.substring(ce),yt.addText(Me)}function Qt(){if(Ve==="")return;let ce=null;if(typeof ke.subLanguage=="string"){if(!W[ke.subLanguage]){yt.addText(Ve);return}ce=Kn(ke.subLanguage,Ve,!0,bi[ke.subLanguage]),bi[ke.subLanguage]=ce._top}else ce=jl(Ve,ke.subLanguage.length?ke.subLanguage:null);ke.relevance>0&&(ga+=ce.relevance),yt.__addSublanguage(ce._emitter,ce.language)}function nt(){ke.subLanguage!=null?Qt():nn(),Ve=""}function an(ce,ve){ce!==""&&(yt.startScope(ve),yt.addText(ce),yt.endScope())}function xi(ce,ve){let Me=1;const Ue=ve.length-1;for(;Me<=Ue;){if(!ce._emit[Me]){Me++;continue}const ct=Rt.classNameAliases[ce[Me]]||ce[Me],pn=ve[Me];ct?an(pn,ct):(Ve=pn,nn(),Ve=""),Me++}}function kl(ce,ve){return ce.scope&&typeof ce.scope=="string"&&yt.openNode(Rt.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(an(Ve,Rt.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),Ve=""):ce.beginScope._multi&&(xi(ce.beginScope,ve),Ve="")),ke=Object.create(ce,{parent:{value:ke}}),ke}function fs(ce,ve,Me){let Ue=J(ce.endRe,Me);if(Ue){if(ce["on:end"]){const ct=new r(ce);ce["on:end"](ve,ct),ct.isMatchIgnored&&(Ue=!1)}if(Ue){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return fs(ce.parent,ve,Me)}function _l(ce){return ke.matcher.regexIndex===0?(Ve+=ce[0],1):(ba=!0,0)}function Vr(ce){const ve=ce[0],Me=ce.rule,Ue=new r(Me),ct=[Me.__beforeBegin,Me["on:begin"]];for(const pn of ct)if(pn&&(pn(ce,Ue),Ue.isMatchIgnored))return _l(ve);return Me.skip?Ve+=ve:(Me.excludeBegin&&(Ve+=ve),nt(),!Me.returnBegin&&!Me.excludeBegin&&(Ve=ve)),kl(Me,ce),Me.returnBegin?0:ve.length}function Zt(ce){const ve=ce[0],Me=Ne.substring(ce.index),Ue=fs(ke,ce,Me);if(!Ue)return Xa;const ct=ke;ke.endScope&&ke.endScope._wrap?(nt(),an(ve,ke.endScope._wrap)):ke.endScope&&ke.endScope._multi?(nt(),xi(ke.endScope,ce)):ct.skip?Ve+=ve:(ct.returnEnd||ct.excludeEnd||(Ve+=ve),nt(),ct.excludeEnd&&(Ve=ve));do ke.scope&&yt.closeNode(),!ke.skip&&!ke.subLanguage&&(ga+=ke.relevance),ke=ke.parent;while(ke!==Ue.parent);return Ue.starts&&kl(Ue.starts,ce),ct.returnEnd?0:ve.length}function ms(){const ce=[];for(let ve=ke;ve!==Rt;ve=ve.parent)ve.scope&&ce.unshift(ve.scope);ce.forEach(ve=>yt.openNode(ve))}let Za={};function El(ce,ve){const Me=ve&&ve[0];if(Ve+=ce,Me==null)return nt(),0;if(Za.type==="begin"&&ve.type==="end"&&Za.index===ve.index&&Me===""){if(Ve+=Ne.slice(ve.index,ve.index+1),!at){const Ue=new Error(`0 width match regex (${ie})`);throw Ue.languageName=ie,Ue.badRule=Za.rule,Ue}return 1}if(Za=ve,ve.type==="begin")return Vr(ve);if(ve.type==="illegal"&&!De){const Ue=new Error('Illegal lexeme "'+Me+'" for mode "'+(ke.scope||"<unnamed>")+'"');throw Ue.mode=ke,Ue}else if(ve.type==="end"){const Ue=Zt(ve);if(Ue!==Xa)return Ue}if(ve.type==="illegal"&&Me==="")return Ve+=`
|
|
51
|
+
`,1;if(hs>1e5&&hs>ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ve+=Me,Me.length}const Rt=Yt(ie);if(!Rt)throw Ae(Pe.replace("{}",ie)),new Error('Unknown language: "'+ie+'"');const gi=Ya(Rt);let wl="",ke=Ke||gi;const bi={},yt=new pe.__emitter(pe);ms();let Ve="",ga=0,Zn=0,hs=0,ba=!1;try{if(Rt.__emitTokens)Rt.__emitTokens(Ne,yt);else{for(ke.matcher.considerAll();;){hs++,ba?ba=!1:ke.matcher.considerAll(),ke.matcher.lastIndex=Zn;const ce=ke.matcher.exec(Ne);if(!ce)break;const ve=Ne.substring(Zn,ce.index),Me=El(ve,ce);Zn=ce.index+Me}El(Ne.substring(Zn))}return yt.finalize(),wl=yt.toHTML(),{language:ie,value:wl,relevance:ga,illegal:!1,_emitter:yt,_top:ke}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:ie,value:cs(Ne),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Zn,context:Ne.slice(Zn-100,Zn+100),mode:ce.mode,resultSoFar:wl},_emitter:yt};if(at)return{language:ie,value:cs(Ne),illegal:!1,relevance:0,errorRaised:ce,_emitter:yt,_top:ke};throw ce}}function Nl(ie){const Ne={value:cs(ie),illegal:!1,relevance:0,_top:be,_emitter:new pe.__emitter(pe)};return Ne._emitter.addText(ie),Ne}function jl(ie,Ne){Ne=Ne||pe.languages||Object.keys(W);const De=Nl(ie),Ke=Ne.filter(Yt).filter(pa).map(nt=>Kn(nt,ie,!1));Ke.unshift(De);const pt=Ke.sort((nt,an)=>{if(nt.relevance!==an.relevance)return an.relevance-nt.relevance;if(nt.language&&an.language){if(Yt(nt.language).supersetOf===an.language)return 1;if(Yt(an.language).supersetOf===nt.language)return-1}return 0}),[$t,nn]=pt,Qt=$t;return Qt.secondBest=nn,Qt}function zn(ie,Ne,De){const Ke=Ne&&me[Ne]||De;ie.classList.add("hljs"),ie.classList.add(`language-${Ke}`)}function ht(ie){let Ne=null;const De=mt(ie);if(_e(De))return;if(Qa("before:highlightElement",{el:ie,language:De}),ie.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ie);return}if(ie.children.length>0&&(pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ie)),pe.throwUnescapedHTML))throw new Kr("One of your code blocks includes unescaped HTML.",ie.innerHTML);Ne=ie;const Ke=Ne.textContent,pt=De?it(Ke,{language:De,ignoreIllegals:!0}):jl(Ke);ie.innerHTML=pt.value,ie.dataset.highlighted="yes",zn(ie,De,pt.language),ie.result={language:pt.language,re:pt.relevance,relevance:pt.relevance},pt.secondBest&&(ie.secondBest={language:pt.secondBest.language,relevance:pt.secondBest.relevance}),Qa("after:highlightElement",{el:ie,result:pt,text:Ke})}function Ut(ie){pe=fi(pe,ie)}const ha=()=>{Sl(),Et("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function us(){Sl(),Et("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let mi=!1;function Sl(){function ie(){Sl()}if(document.readyState==="loading"){mi||window.addEventListener("DOMContentLoaded",ie,!1),mi=!0;return}document.querySelectorAll(pe.cssSelector).forEach(ht)}function hi(ie,Ne){let De=null;try{De=Ne(T)}catch(Ke){if(Ae("Language definition for '{}' could not be registered.".replace("{}",ie)),at)Ae(Ke);else throw Ke;De=be}De.name||(De.name=ie),W[ie]=De,De.rawDefinition=Ne.bind(null,T),De.aliases&&Vn(De.aliases,{languageName:ie})}function Va(ie){delete W[ie];for(const Ne of Object.keys(me))me[Ne]===ie&&delete me[Ne]}function ds(){return Object.keys(W)}function Yt(ie){return ie=(ie||"").toLowerCase(),W[ie]||W[me[ie]]}function Vn(ie,{languageName:Ne}){typeof ie=="string"&&(ie=[ie]),ie.forEach(De=>{me[De.toLowerCase()]=Ne})}function pa(ie){const Ne=Yt(ie);return Ne&&!Ne.disableAutodetect}function xa(ie){ie["before:highlightBlock"]&&!ie["before:highlightElement"]&&(ie["before:highlightElement"]=Ne=>{ie["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),ie["after:highlightBlock"]&&!ie["after:highlightElement"]&&(ie["after:highlightElement"]=Ne=>{ie["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function vt(ie){xa(ie),Ee.push(ie)}function pi(ie){const Ne=Ee.indexOf(ie);Ne!==-1&&Ee.splice(Ne,1)}function Qa(ie,Ne){const De=ie;Ee.forEach(function(Ke){Ke[De]&&Ke[De](Ne)})}function Qn(ie){return Et("10.7.0","highlightBlock will be removed entirely in v12.0"),Et("10.7.0","Please use highlightElement now."),ht(ie)}Object.assign(T,{highlight:it,highlightAuto:jl,highlightAll:Sl,highlightElement:ht,highlightBlock:Qn,configure:Ut,initHighlighting:ha,initHighlightingOnLoad:us,registerLanguage:hi,unregisterLanguage:Va,listLanguages:ds,getLanguage:Yt,registerAliases:Vn,autoDetection:pa,inherit:fi,addPlugin:vt,removePlugin:pi}),T.debugMode=function(){at=!1},T.safeMode=function(){at=!0},T.versionString=Gt,T.regex={concat:A,lookahead:w,either:D,optional:R,anyNumberOfTimes:G};for(const ie in tt)typeof tt[ie]=="object"&&s(tt[ie]);return Object.assign(T,tt),T},Vt=Ka({});return Vt.newInstance=()=>Ka({}),tu=Vt,Vt.HighlightJS=Vt,Vt.default=Vt,tu}var ib=sb();const mn=Vg(ib);function rb(s){const r=s.regex,u={},c={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[u]}]};Object.assign(u,{className:"variable",variants:[{begin:r.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},c]});const d={className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},f=s.inherit(s.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),p={begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},h={className:"string",begin:/"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,u,d]};d.contains.push(h);const x={match:/\\"/},g={className:"string",begin:/'/,end:/'/},v={match:/\\'/},k={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,u]},w=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],G=s.SHEBANG({binary:`(${w.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],D={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],J=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],K=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],C=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:S,built_in:[...L,...J,"set","shopt",...K,...C]},contains:[G,s.SHEBANG(),R,k,f,p,D,h,x,g,v,u]}}const ob=s=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:s.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:s.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cb=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ub=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],db=[...cb,...ub],fb=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mb=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),hb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pb=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xb(s){const r=s.regex,u=ob(s),c={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},d="and or not only",f=/@-?\w[\w]*(-\w+)*/,p="[a-zA-Z-][a-zA-Z0-9_-]*",h=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[u.BLOCK_COMMENT,c,u.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+p,relevance:0},u.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+mb.join("|")+")"},{begin:":(:)?("+hb.join("|")+")"}]},u.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pb.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[u.BLOCK_COMMENT,u.HEXCOLOR,u.IMPORTANT,u.CSS_NUMBER_MODE,...h,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...h,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},u.FUNCTION_DISPATCH]},{begin:r.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:d,attribute:fb.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...h,u.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+db.join("|")+")\\b"}]}}function gb(s){const r=s.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function bb(s){const f={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:f,illegal:"</",contains:[s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE,{className:"string",variants:[s.QUOTE_STRING_MODE,s.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[s.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}const wh="[A-Za-z$_][0-9A-Za-z$_]*",vb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],yb=["true","false","null","undefined","NaN","Infinity"],ip=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],op=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jb=[].concat(op,ip,rp);function Sb(s){const r=s.regex,u=(Q,{after:ne})=>{const re="</"+Q[0].slice(1);return Q.input.indexOf(re,ne)!==-1},c=wh,d={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,ne)=>{const re=Q[0].length+Q.index,j=Q.input[re];if(j==="<"||j===","){ne.ignoreMatch();return}j===">"&&(u(Q,{after:re})||ne.ignoreMatch());let B;const le=Q.input.substring(re);if(B=le.match(/^\s*=/)){ne.ignoreMatch();return}if((B=le.match(/^\s+extends\s+/))&&B.index===0){ne.ignoreMatch();return}}},h={$pattern:wh,keyword:vb,literal:yb,built_in:jb,"variable.language":Nb},x="[0-9](_?[0-9])*",g=`\\.(${x})`,v="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${v})((${g})|\\.)?|(${g}))[eE][+-]?(${x})\\b`},{begin:`\\b(${v})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},G={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,w],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,w]},L={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},J=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,G,R,A,S,{match:/\$\d+/},k];w.contains=J.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(J)});const K=[].concat(L,w.contains),C=K.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:["self"].concat(K)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:C},_={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ip,...rp]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ue={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(Q){return r.concat("(?!",Q.join("|"),")")}const oe={match:r.concat(/\b/,te([...op,"super","import"].map(Q=>`${Q}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},xe={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,G,R,A,S,L,{match:/\$\d+/},k,V,{scope:"attr",match:c+r.lookahead(":"),relevance:0},H,{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,s.REGEXP_MODE,{className:"function",begin:y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:d.begin,end:d.end},{match:f},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,s.inherit(s.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},xe,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},oe,ue,_,se,{match:/\$[(.]/}]}}function kb(s){const r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},u={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],d={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:c},contains:[r,u,s.QUOTE_STRING_MODE,d,s.C_NUMBER_MODE,s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function _b(s){const r=s.regex,u=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),c=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:c,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},x={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},v={begin:/\{\{/,relevance:0},k={className:"string",contains:[s.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[s.BACKSLASH_ESCAPE,x],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[s.BACKSLASH_ESCAPE,x],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[s.BACKSLASH_ESCAPE,x,v,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[s.BACKSLASH_ESCAPE,x,v,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[s.BACKSLASH_ESCAPE,v,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,v,g]},s.APOS_STRING_MODE,s.QUOTE_STRING_MODE]},w="[0-9](_?[0-9])*",G=`(\\b(${w}))?\\.(${w})|\\b(${w})\\.`,R=`\\b|${c.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${w})|(${G}))[eE][+-]?(${w})[jJ]?(?=${R})`},{begin:`(${G})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${w})[jJ](?=${R})`}]},S={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},D={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",x,A,k,s.HASH_COMMENT_MODE]}]};return g.contains=[k,A,x],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[x,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},k,S,s.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,u],scope:{1:"keyword",3:"title.function"},contains:[D]},{variants:[{match:[/\bclass/,/\s+/,u,/\s*/,/\(\s*/,u,/\s*\)/]},{match:[/\bclass/,/\s+/,u]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[A,D,k]}]}}function Eb(s){const r=s.regex,u=s.COMMENT("--","$"),c={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},d={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],p=["double precision","large object","with timezone","without timezone"],h=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],x=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],v=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],k=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],w=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],G=v,R=[...g,...x].filter(C=>!v.includes(C)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},D={match:r.concat(/\b/,r.either(...G),/\s*\(/),relevance:0,keywords:{built_in:G}};function L(C){return r.concat(/\b/,r.either(...C.map(O=>O.replace(/\s+/,"\\s+"))),/\b/)}const J={scope:"keyword",match:L(w),relevance:0};function K(C,{exceptions:O,when:_}={}){const V=_;return O=O||[],C.map(F=>F.match(/\|\d+$/)||O.includes(F)?F:V(F)?`${F}|0`:F)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:K(R,{when:C=>C.length<3}),literal:f,type:h,built_in:k},contains:[{scope:"type",match:L(p)},J,D,A,c,d,s.C_NUMBER_MODE,s.C_BLOCK_COMMENT_MODE,u,S]}}const Ur="[A-Za-z$_][0-9A-Za-z$_]*",cp=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],up=["true","false","null","undefined","NaN","Infinity"],dp=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],hp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],pp=[].concat(mp,dp,fp);function wb(s){const r=s.regex,u=(Q,{after:ne})=>{const re="</"+Q[0].slice(1);return Q.input.indexOf(re,ne)!==-1},c=Ur,d={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,ne)=>{const re=Q[0].length+Q.index,j=Q.input[re];if(j==="<"||j===","){ne.ignoreMatch();return}j===">"&&(u(Q,{after:re})||ne.ignoreMatch());let B;const le=Q.input.substring(re);if(B=le.match(/^\s*=/)){ne.ignoreMatch();return}if((B=le.match(/^\s+extends\s+/))&&B.index===0){ne.ignoreMatch();return}}},h={$pattern:Ur,keyword:cp,literal:up,built_in:pp,"variable.language":hp},x="[0-9](_?[0-9])*",g=`\\.(${x})`,v="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${v})((${g})|\\.)?|(${g}))[eE][+-]?(${x})\\b`},{begin:`\\b(${v})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},G={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,w],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,w]},L={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},J=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,G,R,A,S,{match:/\$\d+/},k];w.contains=J.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(J)});const K=[].concat(L,w.contains),C=K.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:["self"].concat(K)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:C},_={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...dp,...fp]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ue={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(Q){return r.concat("(?!",Q.join("|"),")")}const oe={match:r.concat(/\b/,te([...mp,"super","import"].map(Q=>`${Q}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},xe={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,G,R,A,S,L,{match:/\$\d+/},k,V,{scope:"attr",match:c+r.lookahead(":"),relevance:0},H,{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,s.REGEXP_MODE,{className:"function",begin:y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:d.begin,end:d.end},{match:f},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,s.inherit(s.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},xe,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},oe,ue,_,se,{match:/\$[(.]/}]}}function Tb(s){const r=s.regex,u=wb(s),c=Ur,d=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,s.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},p={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:d},contains:[u.exports.CLASS_REFERENCE]},h={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},x=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Ur,keyword:cp.concat(x),literal:up,built_in:pp.concat(d),"variable.language":hp},v={className:"meta",begin:"@"+c},k=(A,S,D)=>{const L=A.contains.findIndex(J=>J.label===S);if(L===-1)throw new Error("can not find mode to replace");A.contains.splice(L,1,D)};Object.assign(u.keywords,g),u.exports.PARAMS_CONTAINS.push(v);const w=u.contains.find(A=>A.scope==="attr"),G=Object.assign({},w,{match:r.concat(c,r.lookahead(/\s*\?:/))});u.exports.PARAMS_CONTAINS.push([u.exports.CLASS_REFERENCE,w,G]),u.contains=u.contains.concat([v,f,p,G]),k(u,"shebang",s.SHEBANG()),k(u,"use_strict",h);const R=u.contains.find(A=>A.label==="func.def");return R.relevance=0,Object.assign(u,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),u}function Ab(s){const r=s.regex,u=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),c=/[\p{L}0-9._:-]+/u,d={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},p=s.inherit(f,{begin:/\(/,end:/\)/}),h=s.inherit(s.APOS_STRING_MODE,{className:"string"}),x=s.inherit(s.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:c,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[d]},{begin:/'/,end:/'/,contains:[d]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[f,x,h,p,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,p,x,h]}]}]},s.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},d,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[x]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:r.concat(/</,r.lookahead(r.concat(u,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:u,relevance:0,starts:g}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(u,/>/))),contains:[{className:"name",begin:u,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Mb(s){const r="true false yes no null",u="[\\w#;/?:@&=+$,.~*'()[\\]]+",c={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},d={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},p={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[s.BACKSLASH_ESCAPE,d]},h=s.inherit(p,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),w={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},G={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},R={begin:/\{/,end:/\}/,contains:[G],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[G],illegal:"\\n",relevance:0},S=[c,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+u},{className:"type",begin:"!<"+u+">"},{className:"type",begin:"!"+u},{className:"type",begin:"!!"+u},{className:"meta",begin:"&"+s.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+s.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},s.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},w,{className:"number",begin:s.C_NUMBER_RE+"\\b",relevance:0},R,A,f,p],D=[...S];return D.pop(),D.push(h),G.contains=D,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}mn.registerLanguage("typescript",Tb);mn.registerLanguage("javascript",Sb);mn.registerLanguage("json",kb);mn.registerLanguage("bash",rb);mn.registerLanguage("diff",gb);mn.registerLanguage("css",xb);mn.registerLanguage("xml",Ab);mn.registerLanguage("python",_b);mn.registerLanguage("go",bb);mn.registerLanguage("yaml",Mb);mn.registerLanguage("sql",Eb);const Cb={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",sh:"bash",shell:"bash",html:"xml",yml:"yaml"};function Th(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xp(s){if(!s)return"";const r=s.toLowerCase().replace(/[^a-z0-9+-]/g,"");return Cb[r]??r}function Rb(s,r){const u=xp(r);if(u&&mn.getLanguage(u))try{return mn.highlight(s,{language:u,ignoreIllegals:!0}).value}catch{return Th(s)}return Th(s)}function gp(s){let r=s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");r=r.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(f,p,h)=>`<pre class="md-code-block"><code>${h.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(`
|
|
52
|
+
`),c=[];let d=!1;for(let f=0;f<u.length;f++){const p=u[f],h=p.match(/^###\s+(.+)$/),x=p.match(/^##\s+(.+)$/),g=p.match(/^#\s+(.+)$/);if(h){d&&(c.push("</ul>"),d=!1),c.push(`<h3 class="md-h3">${h[1]}</h3>`);continue}if(x){d&&(c.push("</ul>"),d=!1),c.push(`<h2 class="md-h2">${x[1]}</h2>`);continue}if(g){d&&(c.push("</ul>"),d=!1),c.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const v=p.match(/^(\s*)[*-]\s+(.+)$/);if(v){d||(c.push('<ul class="md-list">'),d=!0),c.push(`<li>${v[2]}</li>`);continue}if(p.trim()===""){d&&(c.push("</ul>"),d=!1),c.push("");continue}d&&(c.push("</ul>"),d=!1),c.push(p)}return d&&c.push("</ul>"),c.join(`
|
|
53
|
+
`)}const oi="\0",Ob=new RegExp(oi,"g"),Db=new RegExp(`${oi}HLJS(\\d+)${oi}`,"g");function os(s){const r=[];let u=s.replace(Ob,"");u=u.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(h,x,g)=>{const v=r.length;return r.push({lang:x,body:g}),`${oi}HLJS${v}${oi}`});let c=u.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");c=c.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),c=c.replace(/<agent_finding[^&]*>/g,""),c=c.replace(/<\/agent_finding>/g,""),c=c.replace(/<cite\s+tag="file">([^&]+)<\/cite>/g,'<code class="cite-file">$1</code>'),c=c.replace(/<cite\s+tag="fn">([^&]+)<\/cite>/g,'<code class="cite-fn">$1</code>'),c=c.replace(/<fn>([^&]+)<\/fn>/g,'<code class="cite-fn">$1</code>'),c=c.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),c=c.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),c=c.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const d=c.split(`
|
|
54
|
+
`),f=[];let p=!1;for(const h of d){const x=h.match(/^###\s+(.+)$/),g=h.match(/^##\s+(.+)$/),v=h.match(/^#\s+(.+)$/);if(x){p&&(f.push("</ul>"),p=!1),f.push(`<h3 class="md-h3">${x[1]}</h3>`);continue}if(g){p&&(f.push("</ul>"),p=!1),f.push(`<h2 class="md-h2">${g[1]}</h2>`);continue}if(v){p&&(f.push("</ul>"),p=!1),f.push(`<h1 class="md-h1">${v[1]}</h1>`);continue}const k=h.match(/^(\s*)[*-]\s+(.+)$/);if(k){p||(f.push('<ul class="md-list">'),p=!0),f.push(`<li>${k[2]}</li>`);continue}if(h.trim()===""){p&&(f.push("</ul>"),p=!1),f.push("");continue}p&&(f.push("</ul>"),p=!1),f.push(h)}return p&&f.push("</ul>"),c=f.join(`
|
|
55
|
+
`),c=c.replace(Db,(h,x)=>{const g=r[Number(x)];if(!g)return"";const v=xp(g.lang),k=v?` language-${v}`:"",w=Rb(g.body.replace(/\n$/,""),g.lang);return`<pre class="md-code-block"><code class="hljs${k}">${w}</code></pre>`}),c}function _t(s){const r=Date.now(),u=typeof s=="string"?new Date(s).getTime():s,c=Math.max(0,Math.floor((r-u)/1e3));return c<60?"just now":c<3600?Math.floor(c/60)+"m ago":c<86400?Math.floor(c/3600)+"h ago":Math.floor(c/86400)+"d ago"}function bp(s){if(!s)return"—";const r=Math.round(s/1e3);return r<60?r+"s":Math.floor(r/60)+"m "+r%60+"s"}function xu(s){const r=s.split("-").filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(r[0]||s).slice(0,2).toUpperCase()}const Ah=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],Mh={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function _n(s){if(Mh[s])return Mh[s];let r=0;for(let u=0;u<s.length;u++)r=r*31+s.charCodeAt(u)>>>0;return Ah[r%Ah.length]}function Au(s){return s.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:s.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:s.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:s.endsWith("-researcher")?{label:"RESEARCH",cls:"",clsStyle:{color:"var(--text-dim)"}}:s.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function bl({title:s,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:s}),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 zb(s){return s==null||s<=0?"—":s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`}function fl({value:s,unit:r,label:u,valueClass:c="",valueColor:d,pulse:f,tooltip:p}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":p,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[f&&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] ${c}`,style:d?{color:d}:void 0,children:s}),r&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--ink-3)"},children:r})]}),a.jsx("div",{className:"h-section mt-1.5",style:{color:"var(--ink-3)",fontSize:"10px"},children:u})]})}function Lb({overview:s,activeTasks:r,mode:u="dense",showActivity:c}){const d=s.relayCount+s.nativeCount,f=s.tasksCompleted+s.tasksFailed>0?Math.round(s.tasksCompleted/(s.tasksCompleted+s.tasksFailed)*100):null,p=s.totalFindings>0?Math.round(s.confirmedFindings/s.totalFindings*100):0,h=u==="calm",x=c??!h,g=h&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-3",children:[a.jsx("div",{className:"h-section",children:"System Pulse"}),a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-confirmed"}),"LIVE"]})]}),g?a.jsx(bl,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):h?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(fl,{value:s.agentsOnline,label:"Agents Working",valueColor:s.agentsOnline>0?"var(--ok)":"var(--text)"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(fl,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0})}),a.jsx(fl,{value:`${p}%`,label:"Confirmed",valueClass:p>=50?"text-confirmed":p>0?"text-unverified":"",valueColor:p===0?"var(--ink-3)":void 0})]}):a.jsxs("div",{className:"border-b border-border",children:[a.jsxs("div",{className:"relative grid grid-cols-2",children:[a.jsx("span",{className:"pointer-events-none absolute left-0 right-0 top-1/2 h-px bg-border"}),a.jsx("span",{className:"pointer-events-none absolute bottom-0 left-1/2 top-0 w-px bg-border"}),a.jsxs("div",{className:"flex flex-col items-stretch justify-center gap-1.5 px-4 py-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:s.agentsOnline>0?"var(--ok)":"var(--text)"},children:s.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${s.relayConnected>0?"text-confirmed":""}`,style:s.relayConnected>0?void 0:{color:"var(--ink-3)"},children:s.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:"var(--ink-3)"},children:d})]})]}),a.jsx(fl,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0}),a.jsx(fl,{value:s.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(fl,{value:`${p}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:fn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/10","aria-label":"View actionable findings on Signals page",children:a.jsx(fl,{value:s.actionableFindings,label:"Actionable",valueClass:s.actionableFindings>0?"text-unverified":"",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!h&&a.jsxs("div",{className:"px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks completed"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:s.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"signals total"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:s.totalSignals})]}),s.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-bad tabular-nums",children:s.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"avg duration"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:zb(s.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${f!==null&&f>=95?"text-confirmed":f!==null&&f>=80?"text-unverified":f!==null?"text-bad":""}`,style:f===null?{color:"var(--ink-3)"}:void 0,children:f===null?"—":`${f}%`})]})]}),x&&a.jsx(Bb,{hourly:s.hourlyActivity||[]}),s.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)"},children:["last consensus ",_t(s.lastConsensusTimestamp)]})]})}function Bb({hourly:s}){const r=s.length===12?s:new Array(12).fill(0),u=Math.max(1,...r);return a.jsxs("div",{className:"border-t border-border px-3.5 py-3",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("div",{className:"h-section mb-2",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)",fontSize:"11px"},children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:r.map((c,d)=>{const f=11-d,p=c/u*100,h=d===11,x=f===0?"last hour":`${f}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${c===0?"opacity-0":h?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:c===0?"0%":`${Math.max(8,p)}%`},"data-tooltip":`${x}
|
|
56
|
+
${c} task${c===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--ink-3) 40%, transparent)"},children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const Gn=24;function Ub(s,r){const u=new Map;for(const c of r)u.set(c.id,new Array(Gn).fill(0));for(const c of(s==null?void 0:s.agents)??[]){const d=u.get(c.id);if(!d)continue;const f=c.buckets??[];for(let p=0;p<Gn;p++)d[p]=f[p]??0}return u}function $b(s,r){if(r<=0||s<=0)return 0;const u=s/r;return u<.18?1:u<.4?2:u<.68?3:4}const qb={0:.18,1:.35,2:.55,3:.78,4:1};function Hb({agents:s,activity:r,loading:u=!1,error:c=null}){const d=N.useMemo(()=>Ub(r,s),[r,s]),f=N.useMemo(()=>{const h=new Map;for(const[x,g]of d)h.set(x,g.reduce((v,k)=>v+k,0));return h},[d]),p=N.useMemo(()=>{let h=0;for(const x of f.values())h+=x;return h},[f]);if(u&&s.length===0)return a.jsx(Tr,{error:null,fleetTotal:null,children:Array.from({length:4}).map((h,x)=>a.jsx(Ib,{},x))});if(s.length===0)return a.jsx(Tr,{error:c,fleetTotal:null,children:a.jsxs("div",{className:"px-5 py-6 font-mono text-xs",style:{color:"var(--ink-3)"},children:["No agents registered yet — run ",a.jsx("code",{className:"rounded bg-[var(--surface-sunk)] px-1.5 py-0.5",children:"gossip_setup"})," to spin up the fleet."]})});if(p===0){const h=r==null?"Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.":"No active dispatches — fleet idle.";return a.jsxs(Tr,{error:c,fleetTotal:0,children:[s.map(x=>a.jsx(Gb,{agent:x},x.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:h})]})}return a.jsx(Tr,{error:c,fleetTotal:p,children:s.map(h=>{const x=d.get(h.id)??new Array(Gn).fill(0),g=Math.max(0,...x),v=f.get(h.id)??0,k=p>0?Math.round(v/p*100):0,w=_n(h.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:w}}),a.jsx("span",{className:"truncate",children:h.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Gn}, 1fr)`},role:"img","aria-label":`${h.id} 24h activity — ${v} signals`,children:x.map((G,R)=>{const A=$b(G,g);return a.jsx("div",{className:"rounded-sm",title:`hour ${R}: ${G} signal${G===1?"":"s"}`,style:{background:A===0?"var(--surface-sunk)":w,opacity:qb[A]}},R)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[v,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[k,"%"]})]})]},h.id)})})}function Tr({children:s,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(${Gn}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:Gn}).map((c,d)=>a.jsx("span",{className:"text-center",children:d%2===0?String(d).padStart(2,"0"):""},d))}),a.jsx("div",{className:"flex items-center justify-end gap-2",children:r?a.jsx("span",{className:"rounded-sm border px-2 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--danger)",background:"color-mix(in oklch, var(--danger) 12%, transparent)",color:"var(--danger)"},children:r}):u!==null?a.jsxs("div",{className:"h-section",style:{color:"var(--ink-3)"},children:["Signals · 24h ",a.jsx("span",{className:"ml-1.5 tabular-nums",style:{color:"var(--ink)"},children:u})]}):null})]}),s]})}function Ib(){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(${Gn}, 1fr)`},children:Array.from({length:Gn}).map((s,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 Gb({agent:s}){const r=_n(s.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:s.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${Gn}, 1fr)`},children:Array.from({length:Gn}).map((u,c)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--surface-sunk)",opacity:.4}},c))}),a.jsx("div",{className:"text-right font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"—"})]})}const Mu="/dashboard/api",vp="unauthorized";function Yb(s){return s instanceof Error&&s.message.includes(vp)}const $r=3e4;function yp(s){return`timeout after ${s/1e3}s`}function Cu(s){if(typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function")return{signal:AbortSignal.timeout(s),cleanup:()=>{}};const r=new AbortController,u=setTimeout(()=>r.abort(new Error(yp(s))),s);return{signal:r.signal,cleanup:()=>clearTimeout(u)}}async function ot(s,r){const{signal:u,cleanup:c}=Cu($r);try{const d=await fetch(`${Mu}/${s}`,{credentials:"include",...r,signal:u});if(d.status===401)throw new Error(vp);if(!d.ok)throw new Error(`API error: ${d.status}`);return d.json()}catch(d){throw d instanceof Error&&(d.name==="AbortError"||d.name==="TimeoutError")?new Error(yp($r)):d}finally{c()}}async function Xb(s){const{signal:r,cleanup:u}=Cu($r);try{const c=await fetch(`${Mu}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:s}),signal:r});return c.ok?await gu()?{ok:!0}:{ok:!1,kind:"no_cookie"}:c.status===401||c.status===403?{ok:!1,kind:"bad_key"}:{ok:!1,kind:"network"}}catch{return{ok:!1,kind:"network"}}finally{u()}}async function gu(){const{signal:s,cleanup:r}=Cu($r);try{return(await fetch(`${Mu}/auth/check`,{credentials:"include",signal:s})).ok}catch{return!1}finally{r()}}const Kb=7200*1e3;function Vb(s){const r=Date.now()-new Date(s).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 Qb({onCountChange:s}){const[r,u]=N.useState([]),[,c]=N.useState(0);N.useEffect(()=>{let h=!1;const x=async()=>{var v;try{const k=await ot("active-tasks");h||(u(k.tasks||[]),s==null||s(((v=k.tasks)==null?void 0:v.length)||0))}catch{}};x();const g=setInterval(x,5e3);return()=>{h=!0,clearInterval(g)}},[s]),N.useEffect(()=>{if(r.length===0)return;const h=setInterval(()=>c(x=>x+1),1e3);return()=>clearInterval(h)},[r.length]);const d=Date.now(),f=r.filter(h=>d-new Date(h.startedAt).getTime()<Kb),p=r.length-f.length;return f.length===0?p===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:[p," stale task",p===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:[f.length," active"]}),p>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",p," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:f.map(h=>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:h.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px]",style:{color:"var(--text-dim)"},children:h.task}),a.jsx("span",{className:"font-mono text-[11px] whitespace-nowrap tabular-nums",style:{color:"var(--text-dim)"},children:Vb(h.startedAt)})]},h.taskId))})]})}function Zb(s,r,u,c){const d=Math.max(0,Math.min(.9999,c)),f=-Math.PI/2,p=f+d*2*Math.PI,h=s+u*Math.cos(f),x=r+u*Math.sin(f),g=s+u*Math.cos(p),v=r+u*Math.sin(p),k=d>.5?1:0;return`M ${h.toFixed(2)} ${x.toFixed(2)} A ${u} ${u} 0 ${k} 1 ${g.toFixed(2)} ${v.toFixed(2)}`}function Fb(s,r,u){return`M ${s} ${r-u} A ${u} ${u} 0 1 1 ${s} ${r+u} A ${u} ${u} 0 1 1 ${s} ${r-u}`}function Jb({accuracy:s,size:r=90,color:u="var(--ink)"}){const c=Number.isFinite(s)?Math.max(0,Math.min(1,s)):0,d=r/2,f=r/2,p=r*.089,h=(r-p)/2-2,x=Math.round(c*100),g=Math.round(r*.22);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":`Accuracy ${x}%`,children:[a.jsx("path",{d:Fb(d,f,h),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:p,strokeLinecap:"round"}),c>0&&a.jsx("path",{d:Zb(d,f,h,c),fill:"none",stroke:u,strokeWidth:p,strokeLinecap:"round"}),a.jsxs("text",{x:d,y:f,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:g,fontFamily:"'Fraunces', serif",fontVariantNumeric:"tabular-nums",fontWeight:700},children:[x,"%"]})]}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"accuracy"})]})}const Ch={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--idle)"},Rh=["critical","high","medium","low"];function Wb({counts:s,height:r=10}){const u=s??{critical:0,high:0,medium:0,low:0},c=u.critical+u.high+u.medium+u.low,d=`critical: ${u.critical}, high: ${u.high}, medium: ${u.medium}, low: ${u.low}`;return c===0?a.jsx("div",{role:"img","aria-label":`Severity distribution: no findings yet (${d})`,title:`${d} (no findings yet)`,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",gap:2,border:"1px solid color-mix(in oklch, var(--border) 60%, transparent)",width:"100%"},children:Rh.map(f=>a.jsx("div",{style:{flex:1,background:Ch[f],opacity:.4}},f))}):a.jsx("div",{role:"img","aria-label":`Severity distribution — ${d}`,title:d,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",width:"100%"},children:Rh.map(f=>{const p=u[f];if(p===0)return null;const h=p/c*100;return a.jsx("div",{style:{width:`${h.toFixed(2)}%`,background:Ch[f],flexShrink:0}},f)})})}function Pb(s){return s.map(r=>r.signals)}function ev(s,r,u){if(s.length===0)return{line:`M 0 ${u} L ${r} ${u}`,area:""};if(s.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 c=Math.max(...s,1),d=r/(s.length-1),f=s.map((x,g)=>{const v=(g*d).toFixed(2),k=(u-x/c*u).toFixed(2);return`${v},${k}`}),p=`M ${f.join(" L ")}`,h=`M 0,${u} L ${f.join(" L ")} L ${((s.length-1)*d).toFixed(2)},${u} Z`;return{line:p,area:h}}const tv=5,bu=999;function nv(s){if(s.length<2)return null;const r=Math.floor(s.length/2),u=s.slice(0,r),c=s.slice(s.length-r),d=v=>v.reduce((k,w)=>k+w.signals,0),f=d(u),p=d(c);if(f<tv)return null;const h=f/u.length,x=p/c.length,g=Math.round((x-h)/h*100);return Math.max(-bu,Math.min(bu,g))}function Np({points:s,width:r=80,height:u=20,reducedMotion:c=!1,color:d="var(--c1)"}){const f=N.useMemo(()=>Pb(s),[s]),{line:p,area:h}=N.useMemo(()=>ev(f,r,u),[f,r,u]),x=N.useMemo(()=>nv(s),[s]),g=f.length===0||f.every(v=>v===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:[!c&&!g&&h&&a.jsx("path",{d:h,fill:d,fillOpacity:.3}),a.jsx("path",{d:p,fill:"none",stroke:g?"var(--idle)":d,strokeOpacity:g?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),x!==null&&!g&&a.jsxs("span",{title:"7d dispatch volume change — neutral indicator, not a quality metric",style:{fontSize:10,fontFamily:"Geist, Inter, sans-serif",fontVariantNumeric:"tabular-nums",fontWeight:600,color:"var(--ink-3)",flexShrink:0},children:[x>=0?"+":"",x,"%",Math.abs(x)>=bu?"+":""]})]})}function Ru(s){var r,u;return((r=s.bench)==null?void 0:r.state)==="benched"?"benched":s.circuitOpen?"struggling":((u=s.bench)==null?void 0:u.state)==="kept-for-coverage"?"kept-for-coverage":null}function av(s){var r;return((r=s.scores.bench)==null?void 0:r.state)==="benched"||s.scores.circuitOpen}function vu(s){return`${Math.round(s*100)}%`}function lv(s){var r,u,c;return s.accuracy>=.7&&((r=s.bench)==null?void 0:r.state)==="none"?{label:"healthy",dotColor:"var(--ok)",tooltip:`Accuracy ${Math.round(s.accuracy*100)}% — above 70% baseline.`}:{label:"needs skills",dotColor:"var(--warn)",tooltip:((u=s.bench)==null?void 0:u.state)!=="none"?`Benched (${((c=s.bench)==null?void 0:c.reason)??"auto"})`:`Accuracy ${Math.round(s.accuracy*100)}% — below 70% baseline.`}}function Oh({label:s,value:r,color:u,tooltip:c}){const d=Number.isFinite(r)?Math.max(0,Math.min(1,r)):0;return a.jsxs("div",{className:"grid items-center gap-2",style:{gridTemplateColumns:"56px 1fr 32px"},children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":c,children:s}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--ink) 8%, transparent)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.round(d*100)}%`,background:u}})}),a.jsx("span",{className:"text-right tabular-nums",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-2)"},children:vu(d)})]})}function sv({agent:s,severityCounts:r,trendPoints:u}){var h;const c=s.scores,d=(h=s.lastTask)!=null&&h.timestamp?_t(s.lastTask.timestamp):"",f=_n(s.id),p=lv(c);return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(s.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":p.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:p.dotColor,flexShrink:0}}),p.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(Jb,{accuracy:c.accuracy,size:90,color:f}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(Wb,{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:s.id}),(()=>{const x=Ru(c);return x==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-bad/10 px-1 py-0.5 font-mono text-[8px] font-bold text-bad","aria-label":`Benched (${c.bench.reason??"auto"}). Excluded from dispatch until recovery.`,"data-tooltip":`Benched (${c.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):x==="struggling"?a.jsx("span",{className:"shrink-0 rounded-sm bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":"Struggling: consecutive failures tripped the circuit breaker.","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):x==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded-sm border border-unverified/40 bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":`Would bench (${c.bench.reason??"rule"}), but kept as sole provider of a category.`,"data-tooltip":`Would bench (${c.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(Oh,{label:"unique",value:c.uniqueness,color:f,tooltip:`Uniqueness ${vu(c.uniqueness)}
|
|
57
|
+
Findings others missed.`}),a.jsx(Oh,{label:"impact",value:c.impactScore,color:f,tooltip:`Impact ${vu(c.impactScore)}
|
|
58
|
+
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(Np,{points:u,width:240,height:28,color:f})}),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:[c.signals," signals"]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{children:d})]})]})]})]})]})]})}function iv({agents:s,highlightedAgentId:r,severityMap:u,trendByAgent:c}){const d=[...s].sort((h,x)=>{var G,R,A,S;const g=((G=h.lastTask)==null?void 0:G.timestamp)??"",v=((R=x.lastTask)==null?void 0:R.timestamp)??"";if(g!==v)return v.localeCompare(g);const k=((A=h.scores)==null?void 0:A.signals)||0,w=((S=x.scores)==null?void 0:S.signals)||0;return k!==w?w-k:h.id.localeCompare(x.id)}),f=d.slice(0,4),p=d.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Team ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:s.length})]}),p&&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:f.map(h=>{const x=h.id===r;return a.jsx("div",{style:{borderRadius:"0.5rem",outline:x?"2px solid var(--border-strong)":void 0,transition:"outline-color 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(sv,{agent:h,severityCounts:u==null?void 0:u.get(h.id),trendPoints:c==null?void 0:c.get(h.id)})},h.id)})})]})}function ui(s){const r=s.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 Ou={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-bad/10 border-bad/30",text:"text-bad",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}},Du={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"})]})},rv=8;function ov(s){return s.length>8?s.slice(0,8):s}function cv({tasks:s,limit:r=rv}){const u=s.items.slice(0,r),c=s.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:s.total})]}),c&&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(bl,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):u.map((d,f)=>{const p=ui(d.status),h=Ou[p],x=Au(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${f>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 ${h.iconBox} ${h.text} ${h.pulse?"animate-pulse motion-reduce:animate-none":""}`,style:h.textStyle,"aria-label":`Status: ${h.label}`,"data-tooltip":h.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:Du[p]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--text-dim)"},"data-tooltip":d.taskId,children:ov(d.taskId)}),x&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${x.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...x.clsStyle},"data-tooltip":d.agentId,children:x.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug",style:{color:"var(--text)"},children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] font-normal",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:_t(d.timestamp)})]},d.taskId)})})]})}function zu({message:s,className:r}){return a.jsxs("span",{role:"alert",className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${r??""}`,style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 12%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:[a.jsx("span",{"aria-hidden":!0,style:{fontWeight:700},children:"!"}),a.jsxs("span",{children:["error · ",s]})]})}const uv={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},dv={agreement:"var(--ok)",consensus_verified:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",unique_confirmed:"var(--unique)",unique_unconfirmed:"var(--warn)",new_finding:"var(--unique)",unverified:"var(--info)"},fv={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"};function mv(s,r){return s?s.length>r?s.slice(0,r-1)+"…":s:""}function hv(s){return s.split(/(`[^`]+`)/g).map((u,c)=>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)},c):a.jsx("span",{children:u},c))}function pv(){const[s,r]=N.useState(null),[u,c]=N.useState(null);N.useEffect(()=>{ot("signals?limit=7").then(f=>r(f.items??[])).catch(f=>c(String((f==null?void 0:f.message)??f)))},[]);const d=s?s.filter(f=>Date.now()-Date.parse(f.timestamp)<36e5).length:0;return a.jsxs("section",{children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h3",{className:"h-section",children:"Signal stream"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--info)",visibility:d===0?"hidden":"visible"},children:["+",d," in last hour"]})]}),a.jsx("button",{type:"button",onClick:()=>In("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"}),u&&a.jsx(zu,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[!u&&s===null&&a.jsx("div",{"aria-busy":"true",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"py-2 pl-4 pr-3",style:{width:80},children:a.jsx("div",{className:"h-2 w-8 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:160},children:a.jsx("div",{className:"h-2 w-12 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:180},children:a.jsx("div",{className:"h-2 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-4",children:a.jsx("div",{className:"h-2 w-14 rounded",style:{background:"var(--border)",opacity:.4}})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((f,p)=>a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3",children:a.jsx("div",{className:"h-2.5 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{style:{width:3,height:14,background:"var(--border)",opacity:.4,borderRadius:1,flexShrink:0}}),a.jsx("div",{className:"h-2.5 w-14 rounded",style:{background:"var(--border)",opacity:.4}})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("div",{className:"h-2.5 w-24 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-4",children:a.jsx("div",{className:"h-2.5 rounded",style:{background:"var(--border)",opacity:.4,width:"75%"}})})]},p))})]})}),!u&&s&&s.length===0&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no signals recorded"}),u&&(!s||s.length===0)&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no cached signals to display"}),s&&s.length>0&&a.jsxs("table",{className:"w-full",style:u?{opacity:.5}:void 0,children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"h-section py-2 pl-4 pr-3 text-left",style:{fontSize:10,width:80},children:"time"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:160},children:"verdict"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:180},children:"agent"}),a.jsx("th",{className:"h-section py-2 pr-4 text-left",style:{fontSize:10},children:"finding"})]})}),a.jsx("tbody",{children:s.map((f,p)=>{const h=f.severity?fv[f.severity]:"transparent",x=dv[f.signal]??"var(--ink-2)",g=uv[f.signal]??f.signal;return a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3 align-middle font-mono text-[12px] tabular-nums",style:{color:"var(--text-dim)"},children:_t(f.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":f.severity?`severity: ${f.severity}`:"severity: unspecified",style:{display:"inline-block",width:3,height:14,background:h,borderRadius:1,flexShrink:0},title:f.severity??""}),a.jsx("span",{className:"h-section truncate",style:{color:x,fontSize:11},title:g,children:g})]})}),a.jsx("td",{className:"py-2.5 pr-3 align-middle font-mono text-[12px]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"truncate",children:f.agentId})}),a.jsx("td",{className:"py-2.5 pr-4 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:hv(mv(f.evidence??"",120))})]},`${f.timestamp}-${p}`)})})]})]})]})}const nu=[{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 xv({overview:s}){const r=s==null?void 0:s.skillVerdictSummary,u=r?nu.reduce((c,d)=>c+(r[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border p-4",style:{background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"h-section",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[u," total"]})]}),!r||u===0?a.jsx("p",{className:"font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"no skill verdicts yet"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-2 w-full gap-px overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:nu.map(c=>{const d=r[c.key]??0;if(d===0)return null;const f=d/u*100;return a.jsx("div",{style:{width:`${f}%`,background:c.color},title:`${c.label}: ${d}`},c.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:nu.map(c=>{const d=r[c.key]??0,f=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${f?"opacity-40":""}`,children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:c.color}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:c.label}),a.jsx("span",{className:"ml-auto tabular-nums",style:f?{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}:{color:c.color},children:d})]},c.key)})})]})]})}const ml=1,ri=2,gv=5;function bv({curve:s,threshold:r,stroke:u,width:c=140,height:d=30}){const f=N.useMemo(()=>yv(s),[s]),p=f.reduce((w,G)=>w+G.length,0);if(s.length===0||p<gv)return a.jsx(vv,{width:c,height:d,threshold:r});const h=c-ml*2,x=d-ri*2,g=ri+(1-yu(r))*x,v=w=>s.length<=1?ml+h/2:ml+w/(s.length-1)*h,k=w=>ri+(1-yu(w))*x;return a.jsxs("svg",{width:c,height:d,viewBox:`0 0 ${c} ${d}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:ml,x2:c-ml,y1:g,y2:g,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),f.map((w,G)=>{if(w.length===1){const{idx:A,value:S}=w[0];return a.jsx("circle",{className:"skill-spark-curve",cx:v(A),cy:k(S),r:1.4,fill:u},G)}const R=w.map((A,S)=>`${S===0?"M":"L"} ${v(A.idx).toFixed(2)} ${k(A.value).toFixed(2)}`).join(" ");return a.jsx("path",{className:"skill-spark-curve",d:R,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},G)})]})}function vv({width:s,height:r,threshold:u}){const c=r-ri*2,d=u!==void 0?ri+(1-yu(u))*c:r/2;return a.jsx("svg",{width:s,height:r,viewBox:`0 0 ${s} ${r}`,"aria-hidden":!0,style:{display:"block"},children:a.jsx("line",{x1:ml,x2:s-ml,y1:d,y2:d,stroke:"var(--ok)",strokeWidth:1,strokeDasharray:"2 2",opacity:.4})})}function yv(s){const r=[];let u=[];for(let c=0;c<s.length;c++){const d=s[c].value;if(d==null||!Number.isFinite(d)){u.length>0&&(r.push(u),u=[]);continue}u.push({idx:c,value:d})}return u.length>0&&r.push(u),r}function yu(s){return!Number.isFinite(s)||s<0?0:s>1?1:s}const jp={passed:"var(--ok)",pending:"var(--info)",insufficient_evidence:"var(--idle)",inconclusive:"var(--warn)",silent_skill:"var(--ink-3)",failed:"var(--bad)",flagged_for_manual_review:"var(--warn)"},Nv={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed",flagged_for_manual_review:"flagged"},Dh={failed:0,flagged_for_manual_review:1,inconclusive:2,insufficient_evidence:3,passed:4,pending:5,silent_skill:6},jv="var(--ink-3)";function zr(s){return s!=null&&s in jp}function Sv({skills:s,loading:r,error:u}){const{known:c,unknown:d,total:f,transitions:p}=N.useMemo(()=>kv(s==null?void 0:s.effectiveness),[s]);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-medium",style:{color:"var(--ink)",fontFamily:"'JetBrains Mono', monospace"},children:f}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["skills · ",p," transitions /24h"]})]}),a.jsx("a",{href:fn("/"),className:"text-[11px] transition hover:underline",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"skill detail →"}),u&&a.jsx(zu,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border p-4",style:{background:"var(--surface-sunk)",borderColor:"var(--border)"},children:[a.jsx("p",{className:"mb-3 text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"Top: frozen verdict + stored basis. Bottom: live 7d activity. Dashed line = graduation threshold."}),r&&!s&&a.jsx(Ev,{}),!r&&f===0&&!u&&a.jsx("p",{className:"text-[12px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"No skills bound yet — agents need at least one dispatch with a skill match."}),f>0&&a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6",style:u?{opacity:.5}:void 0,children:c.map(h=>a.jsx(Lh,{entry:h},zh(h)))}),d.length>0&&a.jsxs("details",{className:"mt-4 group",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 select-none",style:{color:"var(--ink-3)"},children:[a.jsx("span",{"aria-hidden":!0,className:"chevron inline-block transition-transform",style:{fontSize:"10px",lineHeight:1},children:"▶"}),a.jsxs("span",{className:"text-[11px]",style:{fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)",fontWeight:600},children:[d.length," unknown"]})]}),a.jsx("ul",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6",children:d.map(h=>a.jsx(Lh,{entry:h},zh(h)))}),a.jsx("style",{children:`
|
|
59
|
+
details[open] > summary > .chevron { transform: rotate(90deg); }
|
|
60
|
+
`})]})]})]})}function zh(s){return`${s.agentId}::${s.skill}`}function kv(s){if(!s)return{known:[],unknown:[],total:0,transitions:0};const r=[],u=[];let c=0;for(const d of s)if(zr(d.status)?r.push(d):u.push(d),d.curve.length>=2){const f=d.curve.slice(-2),p=f.filter(x=>x.value!=null&&x.value>=d.threshold).length,h=f.filter(x=>x.value!=null&&x.value<d.threshold).length;p>=1&&h>=1&&c++}return r.sort((d,f)=>{const p=zr(d.status)?Dh[d.status]:99,h=zr(f.status)?Dh[f.status]:99;return p!==h?p-h:d.skill.localeCompare(f.skill)}),u.sort((d,f)=>d.skill.localeCompare(f.skill)),{known:r,unknown:u,total:r.length+u.length,transitions:c}}function Lh({entry:s}){const r=zr(s.status)?s.status:null,u=r?jp[r]:jv,c=r?Nv[r]:s.status??"unknown",d=typeof s.storedEffectiveness=="number"?s.storedEffectiveness:null,f=d!==null?Math.round(d*100):null,p=s.verdictAt?_v(s.verdictAt):null,h=s.liveRecovered===!0;return a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},title:`${s.agentId} · ${s.skill} · ${c} · N=${s.n}`,children:[a.jsxs("div",{className:"flex flex-col gap-1.5 rounded-t-lg px-2.5 pt-2.5 pb-2",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("div",{className:"truncate text-[12px] font-medium leading-tight",style:{color:"var(--ink)",fontFamily:"Geist, var(--font-sans)"},children:s.skill}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{"aria-hidden":!0,className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:_n(s.agentId)}}),a.jsx("span",{className:"truncate text-[10px]",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},children:s.agentId})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[a.jsx("span",{className:"inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold",style:{color:u,background:`color-mix(in oklch, ${u} 12%, transparent)`,border:`1px solid color-mix(in oklch, ${u} 25%, transparent)`,fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)"},children:c}),h&&a.jsx("span",{className:"inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{color:"var(--ok)",background:"var(--ok-soft)",border:"1px solid color-mix(in oklch, var(--ok) 25%, transparent)",fontFamily:"Geist, var(--font-sans)",letterSpacing:"0.02em"},title:"Live 7d signals show recovery above threshold — but the stored verdict is frozen. Re-test to graduate.",children:"recovered · re-test pending"})]}),(f!==null||p)&&a.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[f!==null&&a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:f<0&&(r==="failed"||r==="flagged_for_manual_review")?"var(--bad)":f>0?"var(--ok)":"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Stored effectiveness delta: ${f>0?"+":""}${f}pp (basis for this verdict)`,children:[f>0?"+":"",f,"pp"]}),f!==null&&a.jsxs("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["vs ",s.threshold.toFixed(2)]}),p&&a.jsx("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Verdict as of: ${s.verdictAt}`,children:p})]})]}),a.jsxs("div",{className:"flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)",fontWeight:600},children:"live 7d"}),a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:"Total post-bind signals in the 7d window",children:["N=",a.jsx("span",{style:{color:"var(--ink)"},children:s.n})]})]}),a.jsx(bv,{curve:s.curve,threshold:s.threshold,stroke:_n(s.agentId),width:120,height:28})]})]})}function _v(s){try{const r=new Date(s);if(!Number.isFinite(r.getTime()))return null;const u=new Date,c=r.getFullYear()===u.getFullYear(),d=r.toLocaleString("en-US",{month:"short"}),f=r.getDate();return c?`${d} ${f}`:`${d} ${f} '${String(r.getFullYear()).slice(-2)}`}catch{return null}}function Ev(){return a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6","aria-hidden":!0,children:Array.from({length:6}).map((s,r)=>a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{borderColor:"var(--border)",background:"var(--surface-elev)",minHeight:"120px"},children:[a.jsxs("div",{className:"flex flex-col gap-1.5 px-2.5 pt-2.5 pb-2",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("span",{className:"h-3 w-3/4 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-2 w-1/3 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-2.5 w-1/2 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-5 w-16 rounded-full",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}})]}),a.jsxs("div",{className:"flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5",children:[a.jsx("span",{className:"h-2.5 w-10 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-7 w-full rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}})]})]},r))})}function wv(s){let r=0;for(let u=0;u<s.length;u++)r=(r<<5)-r+s.charCodeAt(u)|0;return Math.abs(r)}class Tv{constructor(r){Mt(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 Kt(s,r){const u=parseInt(s.slice(1,3),16),c=parseInt(s.slice(3,5),16),d=parseInt(s.slice(5,7),16);return`rgba(${u},${c},${d},${Math.max(0,Math.min(1,r))})`}function Av(s){const r=Math.max(0,s);return Math.min(1.4,Math.pow(r/2e3,.55))}class Mv{constructor(r,u,c,d,f,p,h=.5){Mt(this,"ctx");Mt(this,"size");Mt(this,"accuracy");Mt(this,"uniqueness");Mt(this,"impact");Mt(this,"colorHex");Mt(this,"time",0);Mt(this,"variant");Mt(this,"scale");Mt(this,"exp");Mt(this,"particles",[]);Mt(this,"baseRotation");Mt(this,"armSeeds");Mt(this,"binaryCenters");Mt(this,"jetAxis");Mt(this,"tailAngle");const x=r.getContext("2d");if(!x)throw new Error("Canvas 2D context unavailable");this.ctx=x,this.size=r.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,f)),this.impact=Math.max(0,Math.min(1,h)),this.colorHex=p;const g=wv(u);this.variant=g%12;const v=new Tv(g),k=Av(c);this.exp=k,this.scale=.2+k*.95;const w=Math.max(3,Math.round(4+k*180));this._buildVariant(v,w),this.baseRotation=v.next()*Math.PI*2}_buildVariant(r,u){const c=this.variant;if(c===0){this.armSeeds=[];for(let f=0;f<2;f++)this.armSeeds.push(r.next()*Math.PI*2);for(let f=0;f<u;f++){const p=f%2,h=r.next(),x=this.armSeeds[p]+h*Math.PI*2.4,g=r.range(-.04,.04)*Math.PI*2,v=x+g,k=(.08+h*.38)*this.size*this.scale;this.particles.push(this._mkParticle(r,k,v,1,1))}}else if(c===1)for(let d=0;d<u;d++){const f=r.range(.34,.42)*this.size*this.scale,p=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,f,p,1,1))}else if(c===2){const d=[.16,.28,.42];for(let f=0;f<u;f++){const p=f%3,h=(d[p]+r.range(-.015,.015))*this.size*this.scale,x=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,h,x,1,1))}}else if(c===3){const d=.18*this.size*this.scale;this.binaryCenters=[{x:-d,y:0},{x:d,y:0}];for(let f=0;f<u;f++){const p=f%2,h=r.range(.04,.22)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,h,x,1,1);g.binaryCore=p,g.angularVelocity*=p===0?1:-1,this.particles.push(g)}}else if(c===4)for(let d=0;d<u;d++){const f=r.range(.05,.32)*this.size*this.scale,p=r.next()*Math.PI*2,h=r.range(.7,1.3),x=r.range(.7,1.3),g=this._mkParticle(r,f,p,h,x);g.orbitTilt=r.range(0,Math.PI),this.particles.push(g)}else if(c===5){this.jetAxis=r.next()*Math.PI*2;const d=Math.floor(u*.7),f=u-d;for(let p=0;p<d;p++){const h=p%2===0?1:-1,x=r.next(),g=r.range(-.18,.18),v=this._mkParticle(r,x*.44*this.size*this.scale,0,1,1);v.jetSide=h,v.jetProgress=x,v.jetSpread=g,v.jetSpeed=r.range(.15,.35)*.001,v.size=r.range(.6,1.4),this.particles.push(v)}for(let p=0;p<f;p++){const h=r.range(.35,.42)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,h,x,1,1);g.isDisk=!0,g.brightness*=.35,this.particles.push(g)}}else if(c===6)for(let d=0;d<u;d++){const f=r.next()*Math.PI*2,p=r.range(.05,.45)*this.size*this.scale,h=this._mkParticle(r,p,f,1,1);h.isNebula=!0,h.driftAngle=r.next()*Math.PI*2,h.driftSpeed=r.range(6e-4,.0014),h.driftPhase=r.next()*Math.PI*2,h.size=r.range(.8,2.2),h.brightness*=.6,this.particles.push(h)}else if(c===7){this.tailAngle=r.next()*Math.PI*2;const d=.1*this.size*this.scale,f=Math.floor(u*.3);for(let h=0;h<f;h++){const x=r.range(0,d),g=r.next()*Math.PI*2,v=this._mkParticle(r,x,g,1,1);v.size=r.range(.8,1.8),this.particles.push(v)}const p=u-f;for(let h=0;h<p;h++){const x=r.next(),g=d+x*.26*this.size*this.scale,v=(1-x*.5)*r.range(-.05,.05)*this.size*this.scale,k=this._mkParticle(r,0,0,1,1);k.isComet=!0,k.cometTailDist=g,k.cometPerp=v,k.cometT=x,k.brightness*=1-x*.6,k.size=(1-x*.5)*r.range(.6,1.2),this.particles.push(k)}}else if(c===8)for(let d=0;d<u;d++){const f=d%3,p=r.range(.3,.42)*this.size*this.scale,h=r.next()*Math.PI*2,x=this._mkParticle(r,p,h,1,1);x.gyroPlane=f,x.gyroAxis=f===0?"z":f===1?"x":"y",this.particles.push(x)}else if(c===9)for(let d=0;d<u;d++){const f=r.range(.06,.42)*this.size*this.scale,h=f/(.42*this.size*this.scale)*4*Math.PI+r.range(-.2,.2),x=this._mkParticle(r,f,h,1,1);x.isMaelstrom=!0,this.particles.push(x)}else if(c===10)for(let d=0;d<u;d++){const f=d/u,p=r.range(.35,.4)*this.size*this.scale,h=f*Math.PI*2+r.range(-.03,.03),x=this._mkParticle(r,p,h,1,1);x.ouroT=f,this.particles.push(x)}else for(let d=0;d<u;d++){const f=d%2,p=r.next(),h=this._mkParticle(r,0,0,1,1);h.isHelix=!0,h.helixStrand=f,h.helixT=p,h.helixSpeed=r.range(.3,.6)*.001,this.particles.push(h)}}_mkParticle(r,u,c,d,f){const p=8e-4+(.42*this.size-u)*4e-5,h=r.next()*Math.PI*2,x=r.range(.05,.3)*this.size;return{baseRadius:u,angle:c,angularVelocity:p*(r.next()>.5?1:.85),size:r.range(.5,1.8),brightness:r.range(.4,1),wobblePhase:r.next()*Math.PI*2,wobbleSpeed:r.range(.5,1.2),ellipX:d,ellipY:f,orbitTilt:0,binaryCore:0,chaosX:Math.cos(h)*x,chaosY:Math.sin(h)*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:c,accuracy:d,uniqueness:f,impact:p,colorHex:h,variant:x}=this,g=u/2,v=u/2;r.clearRect(0,0,u,u);const k=.4+this.exp*.6,w=d*k,G=f*k,R=p*k,A=.2+w*.8,S=.3+R*1.9,D=G,L=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),J=1-L,K=r.createRadialGradient(g,v,0,g,v,u*.45);if(K.addColorStop(0,Kt(h,.05*A)),K.addColorStop(.4,Kt(h,.015)),K.addColorStop(1,"transparent"),r.fillStyle=K,r.fillRect(0,0,u,u),x===0&&this.armSeeds){const C=c*5e-4*S;for(const O of this.armSeeds){const _=O+C;r.beginPath();for(let V=0;V<1;V+=.02){const F=_+V*Math.PI*2.4,I=(.08+V*.38)*u*this.scale,ue=g+Math.cos(F)*I,te=v+Math.sin(F)*I;V===0?r.moveTo(ue,te):r.lineTo(ue,te)}r.strokeStyle=Kt(h,.12*A),r.lineWidth=1,r.stroke()}}for(const C of this.particles){const O=Math.sin(c*C.wobbleSpeed*.001+C.wobblePhase)*1.2,_=C.baseRadius+O,V=C.angle+c*C.angularVelocity*S;let F,I;if(x===3&&this.binaryCenters){const te=this.binaryCenters[C.binaryCore];F=g+te.x+Math.cos(V)*_,I=v+te.y+Math.sin(V)*_}else if(x===4){const te=Math.cos(C.orbitTilt),oe=Math.sin(C.orbitTilt),xe=Math.cos(V)*_*C.ellipX,se=Math.sin(V)*_*C.ellipY;F=g+xe*te-se*oe,I=v+xe*oe+se*te}else if(x===5&&C.jetSide!==void 0&&!C.isDisk&&this.jetAxis!==void 0){const te=(C.jetProgress+c*C.jetSpeed*S)%1,oe=te*.44*u*this.scale,xe=this.jetAxis+Math.PI/2;F=g+Math.cos(this.jetAxis)*oe*C.jetSide+Math.cos(xe)*C.jetSpread*oe,I=v+Math.sin(this.jetAxis)*oe*C.jetSide+Math.sin(xe)*C.jetSpread*oe,C._fadeMul=Math.sin(te*Math.PI)*.9+.1}else if(x===6&&C.isNebula){const te=c*C.driftSpeed*S,oe=Math.sin(te+C.driftPhase)*2;F=g+Math.cos(C.angle+te*.3)*_+Math.cos(C.driftAngle)*oe,I=v+Math.sin(C.angle+te*.3)*_+Math.sin(C.driftAngle)*oe}else if(x===7&&C.isComet&&this.tailAngle!==void 0){const te=(C.cometT+c*3e-4*S)%1,oe=C.cometTailDist+te*.06*u*this.scale,xe=this.tailAngle+Math.PI/2;F=g+Math.cos(this.tailAngle)*oe+Math.cos(xe)*C.cometPerp,I=v+Math.sin(this.tailAngle)*oe+Math.sin(xe)*C.cometPerp}else if(x===8&&C.gyroAxis){const te=c*1e-4*S;C.gyroAxis==="z"?(F=g+Math.cos(V)*_,I=v+Math.sin(V)*_*.3):C.gyroAxis==="x"?(F=g+Math.cos(V)*_*.3+Math.sin(te)*_*.1,I=v+Math.sin(V)*_):(F=g+Math.sin(V+te)*_*.6,I=v+Math.cos(V+te)*_*.8)}else if(x===9){const te=(c*5e-4*S+C.wobblePhase)%1,oe=_*(1-te*.85);F=g+Math.cos(V)*oe,I=v+Math.sin(V)*oe,C._fadeMul=1-te}else if(x===10&&C.ouroT!==void 0){const te=(C.ouroT+c*3e-4*S)%1,oe=te*Math.PI*2;F=g+Math.cos(oe)*_,I=v+Math.sin(oe)*_;const xe=Math.cos(te*Math.PI*2)*.5+.5;C._fadeMul=.3+xe*.9}else if(x===11&&C.helixT!==void 0){const te=(C.helixT+c*C.helixSpeed*S)%1,oe=(te-.5)*.65*u*this.scale,xe=C.helixStrand===0?0:Math.PI,se=.15*u*this.scale,y=Math.sin(te*Math.PI*3+xe)*se;F=g+y,I=v+oe,C._fadeMul=.4+(Math.cos(te*Math.PI*3+xe)+1)/2*.6}else F=g+Math.cos(V)*_*C.ellipX,I=v+Math.sin(V)*_*C.ellipY;if(J>.01){const te=c*C.chaosDriftSpeed,oe=Math.cos(te+C.chaosDriftPhase)*2,xe=Math.sin(te*1.13+C.chaosDriftPhase)*2,se=g+C.chaosX+oe,y=v+C.chaosY+xe;F=se*J+F*L,I=y*J+I*L}const ue=C._fadeMul!==void 0?C._fadeMul:1;if(x<=4&&L>.5){const te=2+Math.floor(p*3);for(let oe=0;oe<te;oe++){const xe=C.angularVelocity*S*(oe+1)*80,se=V-xe;let y,H;if(x===3&&this.binaryCenters){const ne=this.binaryCenters[C.binaryCore];y=g+ne.x+Math.cos(se)*_,H=v+ne.y+Math.sin(se)*_}else if(x===4){const ne=Math.cos(C.orbitTilt),re=Math.sin(C.orbitTilt),j=Math.cos(se)*_*C.ellipX,B=Math.sin(se)*_*C.ellipY;y=g+j*ne-B*re,H=v+j*re+B*ne}else y=g+Math.cos(se)*_*C.ellipX,H=v+Math.sin(se)*_*C.ellipY;const Q=(1-oe/te)*.3*C.brightness*A*L;r.beginPath(),r.arc(y,H,C.size*(1-oe*.25),0,Math.PI*2),r.fillStyle=Kt(h,Q),r.fill()}}else if(x===6&&C.isNebula){const te=C.size*3,oe=r.createRadialGradient(F,I,0,F,I,te);oe.addColorStop(0,Kt(h,C.brightness*A*.4)),oe.addColorStop(1,"transparent"),r.fillStyle=oe,r.beginPath(),r.arc(F,I,te,0,Math.PI*2),r.fill()}r.beginPath(),r.arc(F,I,C.size,0,Math.PI*2),r.fillStyle=Kt(h,C.brightness*A*ue),r.fill()}if(D>.05)for(let O=0;O<3;O++){const _=(c*7e-4*D+O*.33)%1;if(_>.5)continue;const V=(O*1.618*Math.PI+c*1e-4)%(Math.PI*2),F=u*.5*(1-_*1.6);if(F<3)continue;const I=g+Math.cos(V)*F,ue=v+Math.sin(V)*F,te=_<.2?_/.2:1-(_-.2)/.3,oe=5+(1-_)*4,xe=r.createRadialGradient(I,ue,0,I,ue,oe);xe.addColorStop(0,Kt("#ffffff",te*.95)),xe.addColorStop(.3,Kt(h,te*.7)),xe.addColorStop(1,"transparent"),r.fillStyle=xe,r.beginPath(),r.arc(I,ue,oe,0,Math.PI*2),r.fill()}if(x!==3){const C=.9+.1*Math.sin(c*.003),O=(1+this.exp*9+d*2)*this.scale,_=Math.min(O*(3+p*2),u*.4),V=r.createRadialGradient(g,v,0,g,v,_);V.addColorStop(0,Kt("#ffffff",.95*C*A)),V.addColorStop(.2,Kt(h,.75*C*A)),V.addColorStop(.5,Kt(h,.2*A)),V.addColorStop(1,"transparent"),r.fillStyle=V,r.beginPath(),r.arc(g,v,_,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(g,v,O*C,0,Math.PI*2),r.fillStyle=Kt("#ffffff",.95),r.fill()}else if(this.binaryCenters)for(const C of this.binaryCenters){const O=g+C.x,_=v+C.y,V=(.8+this.exp*5+d*1.5)*this.scale,F=Math.min(V*3.5,u*.22),I=r.createRadialGradient(O,_,0,O,_,F);I.addColorStop(0,Kt("#ffffff",.9*A)),I.addColorStop(.3,Kt(h,.6*A)),I.addColorStop(1,"transparent"),r.fillStyle=I,r.beginPath(),r.arc(O,_,F,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(O,_,V,0,Math.PI*2),r.fillStyle=Kt("#ffffff",.9),r.fill()}}}const gl=globalThis,ls=new Set;let xl=0,ss=0;const Cv=100;function Sp(s){const r=ss===0?16:Math.min(Cv,Math.max(0,s-ss));ss=s;for(const u of ls)try{u(r)}catch(c){console.error("[AnimationScheduler] subscriber threw, continuing",c)}ls.size>0?xl=gl.requestAnimationFrame(Sp):(xl=0,ss=0)}function Rv(){xl===0&&(ss=0,xl=gl.requestAnimationFrame(Sp))}function Ov(){xl!==0&&(gl.cancelAnimationFrame&&gl.cancelAnimationFrame(xl),xl=0,ss=0)}function Dv(){return gl.matchMedia?gl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function kp(s){if(!gl.requestAnimationFrame)return()=>{};if(Dv())return()=>{};ls.add(s),ls.size===1&&Rv();let r=!1;return function(){r||(r=!0,ls.delete(s),ls.size===0&&Ov())}}function di({agentId:s,size:r=64,animate:u=!0,signals:c=0,accuracy:d=.5,uniqueness:f=.5,impact:p=.5}){const h=N.useRef(null),x=N.useRef(null),g=N.useRef(!0),v=N.useRef(u);return v.current=u,N.useEffect(()=>{const k=h.current;if(!k)return;k.width=r*2,k.height=r*2;const w=k.getContext("2d");if(!w)return;w.scale(2,2);const G=_n(s),R=new Mv(k,s,c,d,f,G,p);x.current=R,R.draw();const A=kp(S=>{g.current&&v.current&&(R.update(S),R.draw())});return()=>{A(),x.current=null}},[s,r,c,d,f,p]),N.useEffect(()=>{const k=h.current;if(!k)return;const w=new IntersectionObserver(([G])=>{g.current=G.isIntersecting},{threshold:.1});return w.observe(k),()=>w.disconnect()},[]),a.jsx("canvas",{ref:h,"aria-hidden":"true",className:"shrink-0",style:{width:r,height:r,borderRadius:"50%"}})}function zv(s){return s.hallucinationsCaught>0?"catch":s.disputed>0?"mixed":s.confirmed>0?"trust":null}function Lv(s){return Math.max(1,Math.min(2.5,1+s*.15))}function ci(s,r){return s<=r?`${s}::${r}`:`${r}::${s}`}const Bv=new Set(["agreement","unique_confirmed","impl_peer_approved"]),Uv=new Set(["disagreement","impl_peer_rejected"]),$v=new Set(["hallucination_caught"]);function qv(s){const r=new Map,u=new Map;for(const c of s)if(!c.retracted)for(const d of c.signals){if(!d.counterpartId||!d.agentId)continue;const f=Bv.has(d.signal),p=Uv.has(d.signal),h=$v.has(d.signal);if(!f&&!p&&!h)continue;const x=ci(d.agentId,d.counterpartId);let g=r.get(x);g||(g={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:c.timestamp},r.set(x,g)),f&&(g.confirmed+=1),p&&(g.disputed+=1),h&&(g.hallucinationsCaught+=1);let v=u.get(x);v||(v=new Set,u.set(x,v)),v.has(c.taskId)||(v.add(c.taskId),g.rounds+=1),c.timestamp>g.lastInteraction&&(g.lastInteraction=c.timestamp)}return r}function Lr(s){return s>=2e3?84:s>=800?72:s>=200?60:48}function Hv(s,r,u){var v;const c={x:r/2,y:u/2},f=Math.max(80,Math.min(r,u)/2-24),p=new Map;if(s.length===0)return p;const h=[...s].sort((k,w)=>{var A,S;const G=((A=w.scores)==null?void 0:A.accuracy)??0,R=((S=k.scores)==null?void 0:S.accuracy)??0;return G!==R?R-G:k.id.localeCompare(w.id)}),x=h.length,g=Math.PI*(3-Math.sqrt(5));for(let k=0;k<x;k++){const w=h[k],G=Iv(((v=w.scores)==null?void 0:v.accuracy)??0,0,1),R=Math.max(f*.22,(1-G)*f),A=-Math.PI/2+k*g;p.set(w.id,{x:c.x+R*Math.cos(A),y:c.y+R*Math.sin(A),role:"fleet",angle:A})}return p}function Iv(s,r,u){return Math.min(Math.max(s,r),u)}function Bh(s){let r=s>>>0;return()=>{r=r+1831565813>>>0;let u=r;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function Gv({width:s,height:r,agentPositions:u}){const c=N.useRef(null),d=N.useRef([]),f=N.useRef([]);N.useEffect(()=>{if(s<=0||r<=0)return;const h=Bh(7311),x=170;d.current=Array.from({length:x},()=>{const g=h();let v,k;return g<.07?(v=2+h()*.6,k=.75+h()*.25):g<.32?(v=1.2+h()*.4,k=.45+h()*.35):(v=.5+h()*.4,k=.25+h()*.3),{x:h()*s,y:h()*r,baseR:v,r:v,baseO:k,o:k,consumed:null,phase:h()*Math.PI*2,twinkleHz:.25+h()*1.4}})},[s,r]),N.useEffect(()=>{if(s<=0||r<=0)return;const h=Bh(919),x=60,g=90,v=1.5,k=1.8;let w=0;const R=kp(A=>{const S=A/1e3;w+=S;const D=d.current,L=f.current;for(let J=0;J<D.length;J++){const K=D[J];if(K.consumed===null)for(let O=0;O<u.length;O++){const _=u[O].x-K.x,V=u[O].y-K.y;if(_*_+V*V<x*x){K.consumed=O;break}}if(K.consumed===null){const O=.8+.35*Math.sin(w*K.twinkleHz*Math.PI*2+K.phase);K.o=Math.min(1,K.baseO*O)}if(K.consumed!==null){const O=u[K.consumed];if(O){const _=O.x-K.x,V=O.y-K.y,F=Math.sqrt(_*_+V*V)||1,I=Math.min(F,g*S);K.x+=_/F*I,K.y+=V/F*I,K.o=Math.max(0,K.o-v*S),K.r=Math.max(0,K.r-k*S)}if(K.o<=.01||K.r<=.1){let _=0,V=0,F=!1;for(let I=0;I<8;I++){_=h()*s,V=h()*r,F=!0;for(const ue of u){const te=ue.x-_,oe=ue.y-V;if(te*te+oe*oe<x*x*1.5){F=!1;break}}if(F)break}K.x=_,K.y=V,K.r=K.baseR,K.o=K.baseO,K.consumed=null}}const C=L[J];C&&(C.setAttribute("cx",String(K.x)),C.setAttribute("cy",String(K.y)),C.setAttribute("r",String(K.r)),C.setAttribute("opacity",String(K.o)))}});return()=>R()},[s,r,u]);const p=d.current;return a.jsx("svg",{ref:c,width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:p.map((h,x)=>a.jsx("circle",{ref:g=>{f.current[x]=g},cx:h.x,cy:h.y,r:h.r,fill:"#F2EDE3",opacity:h.o},x))})}function Yv({variant:s}){const r=(()=>{switch(s){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 Xv(){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 Kv({width:s,height:r,hideLabels:u=!1}){const c=s/2,d=r/2,p=Math.max(80,Math.min(s,r)/2-40),h=[{r:p,accLabel:"0%"},{r:p*.75,accLabel:"25%"},{r:p*.5,accLabel:"50%"},{r:p*.25,accLabel:"75%"}];return a.jsx("svg",{width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:h.map(({r:x,accLabel:g})=>a.jsxs("g",{children:[a.jsx("circle",{cx:c,cy:d,r:x,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:c+6,y:d-x-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:g})]},g))})}function Vv(s,r,u,c,d){const f={x:c/2,y:d/2},p=new Map;p.set(s,{x:f.x,y:f.y,role:"center"});const h=[];for(const G of r){if(G===s)continue;const R=u.get(ci(s,G));R&&h.push({id:G,rel:R})}const x=Math.max(1,...h.map(G=>G.rel.rounds)),g=Math.max(120,Math.min(c,d)*.2),v=Math.min(c,d)*.42,k=h.slice().sort((G,R)=>G.id.localeCompare(R.id)),w=k.length;for(let G=0;G<w;G++){const{id:R,rel:A}=k[G],S=G/Math.max(1,w)*Math.PI*2-Math.PI/2,D=A.rounds/x,L=v-D*(v-g);p.set(R,{x:f.x+L*Math.cos(S),y:f.y+L*Math.sin(S),role:"peer"})}for(const G of r)p.has(G)||p.set(G,{x:f.x,y:f.y,role:"hidden"});return p}function Qv({agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:c,height:d=420}){if(s.length===0)return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)",color:"var(--stage-text-dim)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-2 h-section",children:"No agents configured"}),a.jsxs("div",{className:"font-mono text-xs",children:["Run ",a.jsx("code",{children:"gossip_setup"})," to spin up the fleet."]})]})});if(s.length===1){const f=s[0];return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-block",children:a.jsx(di,{agentId:f.id,signals:f.scores.signals,accuracy:f.scores.accuracy,uniqueness:f.scores.uniqueness,impact:f.scores.impactScore,size:Lr(f.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(Zv,{agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:c,height:d})}function Zv({agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:c,height:d=420}){const f=N.useRef(null),[p,h]=N.useState(800),[x,g]=N.useState(d),[v,k]=N.useState(0);N.useEffect(()=>{const S=f.current;if(!S)return;const D=new ResizeObserver(([L])=>{const J=L.contentRect.width,K=L.contentRect.height;J>0&&h(J),K>0&&g(K)});return D.observe(S),()=>D.disconnect()},[]);const w=N.useMemo(()=>{const S=s.map(D=>D.id);return u&&S.includes(u)?Vv(u,S,r,p,x):Hv(s,p,x)},[s,r,u,p,x]),G=N.useMemo(()=>{if(!u)return[];const S=w.get(u);if(!S)return[];const D=[];for(const J of s){if(J.id===u)continue;const K=w.get(J.id);if(!K||K.role!=="peer")continue;const C=r.get(ci(u,J.id));if(!C)continue;const O=zv(C);O&&D.push({peerId:J.id,x1:S.x,y1:S.y,x2:K.x,y2:K.y,cls:O,width:Lv(C.rounds),rounds:C.rounds})}const L={mixed:0,trust:1,catch:2};return D.sort((J,K)=>L[J.cls]-L[K.cls]),D},[s,r,u,w]),R=u?G.length:0,A=N.useMemo(()=>{const S=[];for(const D of s){const L=w.get(D.id);L&&S.push({x:L.x,y:L.y})}return S},[s,w]);return a.jsxs("div",{ref:f,className:"relative overflow-hidden rounded-lg border",style:{minHeight:d,height:"100%",background:"#14120F",borderColor:"#2B2823","--stage-bg":"#14120F","--stage-text-dim":"#B8B0A1","--stage-grid":"rgba(255,255,255,0.03)"},onClick:()=>c(null),children:[a.jsx(Gv,{width:p,height:x,agentPositions:A}),a.jsx(Kv,{width:p,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:R}),a.jsxs("span",{style:{opacity:.7},children:["peer",R===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:s.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:G.map(S=>{const D=s.find(y=>y.id===u),L=s.find(y=>y.id===S.peerId);if(!D||!L)return null;const J=Lr(D.scores.signals)/2,K=Lr(L.scores.signals)/2,C=S.x2-S.x1,O=S.y2-S.y1,_=Math.max(1,Math.hypot(C,O)),V=C/_,F=O/_,I=S.x1+V*J,ue=S.y1+F*J,te=S.x2-V*K,oe=S.y2-F*K,xe=S.cls==="trust"?"var(--success)":S.cls==="mixed"?"var(--warn)":"var(--danger)",se=S.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:I,y1:ue,x2:te,y2:oe,stroke:xe,strokeWidth:S.width,strokeDasharray:se,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},S.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(au,{stroke:"var(--success)",label:"Trust"}),a.jsx(au,{stroke:"var(--warn)",label:"Mixed",dash:"8,2"}),a.jsx(au,{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:p/2,top:x/2,cursor:"pointer"},onClick:S=>{S.stopPropagation(),k(D=>D+1)},title:v>=10?"♥":v>=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"})]}),v>0&&a.jsx(Yv,{variant:(v-1)%4},v),v>0&&a.jsx(Xv,{},`ripple-${v}`),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:v>=10?"var(--accent)":"var(--stage-text-dim)",whiteSpace:"nowrap",opacity:.7,pointerEvents:"none",transition:"color 400ms ease-out"},children:v>=10?"♥ orchestrator ♥":"orchestrator"})]}),s.map(S=>{const D=w.get(S.id);if(!D)return null;const L=Lr(S.scores.signals),J=D.role==="center",K=D.role==="hidden",C=D.role==="peer",O=K?0:1,_=J?"#F2EDE3":"var(--stage-text-dim)",V=D.angle??Math.PI/2,F=L/2+14,I=Math.cos(V)*F,ue=Math.sin(V)*F,te=Math.abs(Math.cos(V))>.7?Math.cos(V)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:oe=>{oe.stopPropagation(),c(S.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:D.x,top:D.y,opacity:O,pointerEvents:K?"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 ${S.id}`,title:S.id,children:[a.jsx("div",{className:"rounded-full",style:{width:L,height:L,boxShadow:J?"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(di,{agentId:S.id,signals:S.scores.signals,accuracy:S.scores.accuracy,uniqueness:S.scores.uniqueness,impact:S.scores.impactScore,size:L})}),a.jsx("div",{className:"absolute font-mono text-[10px] font-bold tracking-wider",style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${I}px), calc(-50% + ${ue}px))${te==="left"?" translateX(calc(50% + 4px))":te==="right"?" translateX(calc(-50% - 4px))":""}`,color:_,textAlign:te==="right"?"right":te==="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:S.id}),C&&a.jsx("div",{className:"font-mono text-[9px]",style:{color:"var(--stage-text-dim)",textAlign:"center",whiteSpace:"nowrap",marginTop:2},children:(()=>{const oe=r.get(ci(u??"",S.id));return oe?`${oe.rounds} round${oe.rounds===1?"":"s"}`:""})()})]},S.id)})]})}function au({stroke:s,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:s,strokeWidth:"1.5",strokeDasharray:u})}),a.jsx("span",{children:r})]})}function Uh(s){const r=new URLSearchParams(s).get("agent");return r&&r.length>0?r:null}function Fv(s,r,u){const c=new URLSearchParams(r);u===null?c.delete("agent"):c.set("agent",u);const d=c.toString();return d.length>0?`${s}?${d}`:s}function _p(s){const r=globalThis;if(typeof r.window>"u")return;const u=r.window,c=Fv(u.location.pathname,u.location.search,s);c!==u.location.pathname+u.location.search&&(u.history.pushState({},"",c),u.dispatchEvent(new Event("dashboard:navigate")))}function Jv({selectedAgent:s,agents:r,peerRelationships:u,height:c=420}){return a.jsx("aside",{className:"flex-shrink-0 overflow-y-auto rounded-lg border",style:{width:320,minHeight:c,background:"var(--surface-elev)",borderColor:"var(--border)"},"aria-label":s?`Agent detail: ${s.id}`:"Fleet summary",children:s?a.jsx(ey,{agent:s,peerRelationships:u,agents:r}):a.jsx(Wv,{agents:r,peerRelationships:u})})}function Wv({agents:s,peerRelationships:r}){const u=[...s].filter(f=>f.scores.signals>0).sort((f,p)=>p.scores.accuracy-f.scores.accuracy).slice(0,3),c=[];for(const[f,p]of r.entries())if(p.hallucinationsCaught>0){const[h,x]=f.split("::");c.push({pair:[h,x],catches:p.hallucinationsCaught,ts:p.lastInteraction})}c.sort((f,p)=>new Date(p.ts).getTime()-new Date(f.ts).getTime());const d=c.slice(0,5);return a.jsxs("div",{className:"flex h-full flex-col p-4",children:[a.jsx("div",{className:"mb-2 h-section",children:"Fleet at a glance"}),a.jsx("p",{className:"mb-4 font-mono text-[12px]",style:{color:"var(--ink-4)"},children:"Click a node to see detail."}),a.jsx($h,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(Nu,{text:"No agent has logged a signal yet."}):u.map(f=>a.jsxs("button",{type:"button",onClick:()=>_p(f.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:f.id}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[Math.round(f.scores.accuracy*100),"% accuracy · ",f.scores.signals," signals"]})]}),a.jsx("span",{className:"opacity-0 transition group-hover:opacity-100 font-mono text-[11px]",style:{color:"var(--accent)"},children:"→"})]},f.id))}),a.jsx($h,{label:"Recent hallucination catches",tone:"danger",children:d.length===0?a.jsx(Nu,{text:"No catches in the active window."}):d.map(f=>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:"◆"})," ",f.pair[0]," ↔ ",f.pair[1]]}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[f.catches," caught · ",Pv(f.ts)]})]},`${f.pair[0]}::${f.pair[1]}`))})]})}function $h({label:s,tone:r,children:u}){const c=r==="success"?"var(--success)":r==="danger"?"var(--danger)":"var(--ink-4)";return a.jsxs("section",{className:"mb-4",children:[a.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 h-section",children:[a.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:c,display:"inline-block",flexShrink:0}}),s]}),a.jsx("div",{className:"space-y-1",children:u})]})}function Nu({text:s}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--ink-4)"},children:s})}function Pv(s){const r=new Date(s).getTime(),u=Date.now(),c=Math.max(0,Math.floor((u-r)/1e3));return c<60?`${c}s ago`:c<3600?`${Math.floor(c/60)}m ago`:c<86400?`${Math.floor(c/3600)}h ago`:`${Math.floor(c/86400)}d ago`}function ey({agent:s,peerRelationships:r,agents:u}){const c=s.scores.bench.state==="benched"?{label:"BENCHED",color:"var(--danger)"}:s.native?{label:"READY",color:"var(--success)"}:s.online?{label:"ONLINE",color:"var(--success)"}:{label:"OFFLINE",color:"var(--ink-3)"},d=[];for(const p of u){if(p.id===s.id)continue;const h=r.get(ci(s.id,p.id));if(!h)continue;const x=h.confirmed+h.disputed+h.hallucinationsCaught;d.push({other:p.id,rel:h,total:x})}d.sort((p,h)=>h.total-p.total);const f=d.slice(0,3);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 h-section",style:{color:c.color,borderBottom:"1px solid var(--border)",background:`color-mix(in oklch, ${c.color} 6%, transparent)`},children:[a.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:c.color,display:"inline-block"}}),c.label]}),a.jsxs("div",{className:"flex items-center gap-3 px-4 pt-4",children:[a.jsx(di,{agentId:s.id,signals:s.scores.signals,accuracy:s.scores.accuracy,uniqueness:s.scores.uniqueness,impact:s.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:s.id}),a.jsx("div",{className:"truncate font-mono text-[11px]",style:{color:"var(--ink-3)"},children:s.model})]})]}),a.jsxs("div",{className:"mx-4 mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Ar,{label:"Accuracy",value:`${Math.round(s.scores.accuracy*100)}%`}),a.jsx(Ar,{label:"Reliability",value:s.scores.taskCompletionRate==null?"—":`${Math.round(s.scores.taskCompletionRate*100)}%`}),a.jsx(Ar,{label:"Signals",value:s.scores.signals.toLocaleString()}),a.jsx(Ar,{label:"Impact",value:`${Math.round(s.scores.impactScore*100)}%`})]}),a.jsxs("div",{className:"mt-4 px-4",children:[a.jsx("div",{className:"mb-1.5 h-section",children:"Top peers"}),f.length===0?a.jsx(Nu,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:f.map(({other:p,rel:h})=>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:p}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[h.confirmed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--success)"},children:"✓"})," ",h.confirmed]}),h.disputed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--warn)"},children:"≠"})," ",h.disputed]}),h.hallucinationsCaught>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",h.hallucinationsCaught]}),a.jsxs("span",{style:{opacity:.6},children:["· ",h.rounds," rounds"]})]})]},p))})]}),s.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:s.skills.length})]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:s.skills.slice(0,6).map(p=>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:p},p))})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t p-3",style:{borderColor:"var(--border)"},children:[a.jsx(lu,{label:"Open dispatch log",kbd:"⏎",href:`/agent/${encodeURIComponent(s.id)}`}),a.jsx(lu,{label:"View skill graph",kbd:"G",href:`/agent/${encodeURIComponent(s.id)}#skills`,disabled:s.skills.length===0}),a.jsx(lu,{label:"Dispatch consensus",kbd:"⌘D",href:"#",disabled:!0})]})]})}function Ar({label:s,value:r}){return a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"h-section",children:s}),a.jsx("div",{className:"mt-0.5 font-mono text-[16px] font-medium tabular-nums",style:{color:"var(--text)"},children:r})]})}function lu({label:s,kbd:r,href:u,disabled:c}){return a.jsxs("a",{href:c?void 0:`/dashboard${u}`,"aria-disabled":c,tabIndex:c?-1:void 0,className:"flex items-center justify-between rounded px-2 py-2 font-mono text-[12px] transition",style:{background:c?"transparent":"color-mix(in oklch, var(--surface) 50%, transparent)",color:c?"var(--ink-4)":"var(--text)",pointerEvents:c?"none":"auto",opacity:c?.5:1},children:[a.jsx("span",{children:s}),a.jsx("kbd",{className:"rounded border px-1 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--border)",background:"var(--surface-sunk)",color:"var(--ink-3)"},children:r})]})}let kn=null,Mr=3e3,su=null;const ju=new Set;function Ep(){if((kn==null?void 0:kn.readyState)===WebSocket.OPEN||(kn==null?void 0:kn.readyState)===WebSocket.CONNECTING)return;const s=location.protocol==="https:"?"wss:":"ws:";kn=new WebSocket(`${s}//${location.host}/dashboard/ws`),kn.onopen=()=>{Mr=3e3},kn.onmessage=r=>{try{const u=JSON.parse(r.data);ju.forEach(c=>c(u))}catch{}},kn.onclose=()=>{kn=null,su&&clearTimeout(su),su=setTimeout(()=>{Mr=Math.min(Mr*1.5,3e4),Ep()},Mr)},kn.onerror=()=>{}}function wp(s){return ju.add(s),()=>ju.delete(s)}function Tp(s){const r=N.useRef(s);r.current=s,N.useEffect(()=>(Ep(),wp(u=>r.current(u))),[])}const ty=6e4;function ny(){const[s,r]=N.useState(null),[u,c]=N.useState(null),d=N.useRef(null),f=()=>{r(null),c(null),d.current!=null&&(window.clearTimeout(d.current),d.current=null)};if(Tp(h=>{if(h.type==="task_dispatched"){r(h.taskId),c(h.agentId),d.current!=null&&window.clearTimeout(d.current),d.current=window.setTimeout(f,ty);return}if(h.type==="consensus_complete"||h.type==="task_completed"||h.type==="task_failed"){if(h.taskId!==s)return;f()}}),N.useEffect(()=>()=>f(),[]),s===null)return null;const p=s.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:p}),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 h=document.getElementById("consensus-rounds-section");h&&h.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(--ink-3)",cursor:"pointer"},children:"watch ↓"})]})}const pl=24,ay={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function Ap(s){return ay[s]}function ly(s,r,u){const c=Ap(r),d=c/pl,f=u-c,p=new Array(pl).fill(0);for(const h of s){const x=new Date(h).getTime();if(!Number.isFinite(x)||x<f||x>u)continue;const g=x-f;let v=Math.floor(g/d);v>=pl&&(v=pl-1),p[v]+=1}return p}const sy=["1h","24h","7d","30d"],iy={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function ry({runs:s,range:r,onRangeChange:u,height:c=52}){const[d,f]=N.useState(()=>Date.now());N.useEffect(()=>{const x=Ap(r)/pl,g=window.setInterval(()=>f(Date.now()),x);return()=>window.clearInterval(g)},[r]);const p=N.useMemo(()=>{var g;const x=[];for(const v of s){const k=((g=v.signals)==null?void 0:g.length)??0;for(let w=0;w<k;w++)x.push(v.timestamp)}return ly(x,r,d)},[s,r,d]),h=Math.max(1,...p);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:sy.map(x=>{const g=x===r;return a.jsx("button",{type:"button",onClick:()=>u(x),"aria-pressed":g,className:"rounded px-2 py-0.5 font-mono text-[10px] transition",style:{background:g?"var(--surface-sunk)":"transparent",color:g?"var(--text)":"var(--text-dim)",border:"1px solid",borderColor:g?"var(--border-strong)":"transparent"},children:x},x)})})]}),a.jsxs("svg",{viewBox:`0 0 ${pl} 1`,preserveAspectRatio:"none",style:{width:"100%",height:c,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:pl,height:.015,fill:"var(--ink)",opacity:.08}),p.map((x,g)=>{const v=x===0?0:x/h,k=1-v;return a.jsx("rect",{x:g+.15,y:k,width:.7,height:Math.max(v,x>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:x===0?0:.9},g)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between font-mono text-[10px] tabular-nums",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:iy[r]}),a.jsx("span",{children:"now"})]})]})}function oy(s){const r=[];for(const[u,c]of s.entries())r.push(`${u}:${c.rounds}:${c.confirmed}:${c.disputed}:${c.hallucinationsCaught}`);return r.sort(),r.join("|")}function cy(s){const r=N.useRef(""),u=N.useRef(new Map);return N.useMemo(()=>{const c=qv(s??[]),d=oy(c);return d===r.current?u.current:(r.current=d,u.current=c,c)},[s])}function uy(s){const r=[];for(const[u,c]of s.entries())r.push(`${u}:${c.critical}:${c.high}:${c.medium}:${c.low}`);return r.sort(),r.join("|")}function Mp(s){const r=N.useRef(""),u=N.useRef(new Map);return N.useMemo(()=>{const c=new Map;if(s)for(const f of s){const p=[...f.confirmed??[],...f.disputed??[],...f.unique??[],...f.unverified??[]];for(const h of p){const x=h.originalAgentId;if(!x)continue;const g=c.get(x)??{critical:0,high:0,medium:0,low:0},v=h.severity??"low";v==="critical"?g.critical+=1:v==="high"?g.high+=1:v==="medium"?g.medium+=1:g.low+=1,c.set(x,g)}}const d=uy(c);return d===r.current?u.current:(r.current=d,u.current=c,c)},[s])}function dy(){const[s,r]=N.useState(()=>typeof window>"u"?null:Uh(window.location.search));return N.useEffect(()=>{const u=()=>{const c=typeof window>"u"?null:Uh(window.location.search);r(d=>d===c?d:c)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[s,_p]}const fy=["1h","24h","7d","30d"];function my(s){return typeof s=="string"&&fy.includes(s)}function iu(s){const r=new URLSearchParams(s).get("range");return my(r)?r:null}function hy(s,r,u){const c=new URLSearchParams(r);u===null?c.delete("range"):c.set("range",u);const d=c.toString();return d.length>0?`${s}?${d}`:s}function qh(s){const r=globalThis;if(!r.window)return;const u=r.window,c=hy(u.location.pathname,u.location.search,s);c!==u.location.pathname+u.location.search&&(u.history.pushState({},"",c),u.dispatchEvent(new Event("dashboard:navigate")))}function py(){const[s,r]=N.useState(()=>typeof window>"u"?"7d":iu(window.location.search)??"7d");return N.useEffect(()=>{typeof window<"u"&&iu(window.location.search)===null&&qh(s);const u=()=>{const c=typeof window>"u"?"7d":iu(window.location.search)??"7d";r(d=>d===c?d:c)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[s,qh]}const xy=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function gy(s){if(!(s instanceof Element))return!1;const r=s.tagName;if(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||s.isContentEditable===!0)return!0;const u=s.getAttribute("role");return u!==null&&xy.has(u)}function by(s){N.useEffect(()=>{if(!s)return;function r(u){gy(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),In("/agent/"+encodeURIComponent(s))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),In("/agent/"+encodeURIComponent(s)+"#skills")))}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[s])}function vy(s){const r=globalThis.window,u=r!=null?r.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function yy({overview:s,agents:r,tasks:u,consensus:c,consensusReports:d,fleetTrend:f,signalActivity:p,skills:h,activeTaskCount:x,setActiveTaskCount:g}){const v=s.actionableFindings,k=vy(),w=cy(c==null?void 0:c.runs),G=Mp(d==null?void 0:d.reports),R=N.useMemo(()=>{const _=new Map;if(f){for(const V of f.points){const F=_.get(V.agentId)??[];F.push(V),_.set(V.agentId,F)}for(const V of _.values())V.sort((F,I)=>F.day.localeCompare(I.day))}return _},[f]),[A,S]=dy(),[D,L]=py();by(A);const J=r&&A?r.find(_=>_.id===A)??null:null,[K,C]=N.useState(!k);function O(){const _=!K;C(_);const V=new URL(window.location.href);_?V.searchParams.delete("graph"):V.searchParams.set("graph","0"),window.history.replaceState(null,"",V.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:fn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] transition hover:underline",style:{color:"var(--warn)"},"data-tooltip":"Findings open for operator review",children:[v," actionable →"]}),r&&a.jsx("button",{type:"button",onClick:O,className:"font-mono text-[10px] transition hover:underline",style:{color:"var(--text-dim)"},children:K?"[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."})]}),K&&r&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(ny,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(Qv,{agents:r,peerRelationships:w,selectedAgentId:A,onSelectAgent:S})}),a.jsx(Jv,{selectedAgent:J,agents:r,peerRelationships:w})]}),c&&a.jsx(ry,{runs:c.runs,range:D,onRangeChange:L})]}),a.jsx(Lb,{overview:s,activeTasks:x,mode:"calm"}),a.jsx(Qb,{onCountChange:g}),r&&a.jsx(Hb,{agents:r,activity:p}),a.jsx(pv,{}),u&&a.jsx(cv,{tasks:u,limit:3}),r&&a.jsx(iv,{agents:r,highlightedAgentId:K?A:null,severityMap:G,trendByAgent:R}),a.jsx(xv,{overview:s}),a.jsx(Sv,{skills:h??null})]})}const rs={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},Ir={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},Lu={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},is=["confirmed","disputed","unverified","unique"],Ny=.01;function jy({consensusId:s,data:r,onError:u}){const[c,d]=N.useState(r?{kind:"full",data:r}:s?{kind:"loading"}:{kind:"empty"});return N.useEffect(()=>{if(r)return;let f=!1;return d(p=>p.kind==="error"?p:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(s)}`).then(async p=>{const h=await p.json().catch(()=>({}));if(!p.ok){const x=typeof(h==null?void 0:h.error)=="string"?h.error:`HTTP ${p.status}`;throw new Error(x)}return h}).then(p=>{f||d({kind:"full",data:p})}).catch(p=>{f||(d(h=>({kind:"error",error:p.message,stale:h.kind==="full"?h.data:void 0})),u==null||u(p))}),()=>{f=!0}},[s,r,u]),c.kind==="loading"?a.jsx(Ty,{}):c.kind==="empty"?a.jsx(Ay,{}):c.kind==="error"?a.jsx(My,{error:c.error,stale:c.stale}):a.jsx(Cp,{data:c.data})}function Cp({data:s}){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-4 flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"h-section",style:{color:"var(--ink)"},children:"Consensus flow"}),a.jsxs("p",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[s.summary.totalFindings," findings across ",s.agentCount," agents"]})]}),s.coverageDegraded&&a.jsx(Sy,{degraded:s.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(ky,{data:s})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(Ey,{data:s})}),a.jsx(wy,{data:s})]})}function Sy({degraded:s}){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 ${s.expected}, received ${s.received}. Dropped: ${s.droppedAgents.join(", ")||"none"}`,children:"coverage degraded"})}const Bu=720,qr=320,fa=120,Su=0,ku=(Bu-fa)/2,Hh=Bu-fa,ru=8;function ky({data:s}){const r=N.useMemo(()=>_y(s),[s]),u=N.useMemo(()=>r.edges,[r.edges]),c=Cy();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Bu} ${qr}`,width:"100%",height:qr,role:"img","aria-label":`Consensus flow: ${s.summary.confirmed} confirmed, ${s.summary.disputed} disputed, ${s.summary.unverified} unverified, ${s.summary.unique} unique of ${s.summary.totalFindings} findings across ${s.agentCount} agents`,style:{display:"block"},children:[a.jsx("g",{children:u.map((d,f)=>a.jsx("path",{d:d.path,fill:d.color,fillOpacity:.55,stroke:"none",style:c?void 0:{animation:`consensus-flow-ribbon-in 480ms ease-out ${f*40}ms both`},children:a.jsx("title",{children:d.tooltip})},`${d.fromFamily}-${d.toVerdict}`))}),a.jsx("g",{children:r.left.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:Su,y:d.y,width:fa,height:d.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:Su+fa-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[Lu[d.family]," · ",d.agentCount]})]},d.family))}),a.jsx("g",{children:r.right.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:ku,y:d.y,width:fa,height:d.h,fill:rs[d.verdict],fillOpacity:.16}),a.jsxs("text",{x:ku+fa/2,y:d.y+d.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:[Ir[d.verdict]," · ",d.count]})]},d.verdict))}),a.jsx("g",{children:r.right.map(d=>{const f=s.summary.totalFindings>0?Math.round(d.count/s.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:Hh,y:d.y,width:fa,height:d.h,fill:rs[d.verdict],fillOpacity:.32}),a.jsxs("text",{x:Hh+fa-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[d.count," · ",f,"%"]})]},d.verdict)})})]}),a.jsx("style",{children:`
|
|
61
|
+
@keyframes consensus-flow-ribbon-in {
|
|
62
|
+
from { opacity: 0; }
|
|
63
|
+
to { opacity: 1; }
|
|
64
|
+
}
|
|
65
|
+
@media (prefers-reduced-motion: reduce) {
|
|
66
|
+
svg * { animation: none !important; }
|
|
67
|
+
}
|
|
68
|
+
`})]})}function _y(s){const r=s.summary.totalFindings,u=qr-ru*2,c=new Map;for(const R of s.familyToOutcome)c.set(R.from.family,(c.get(R.from.family)??0)+R.to.count);const d=s.modelFamilyToFindings.reduce((R,A)=>R+(c.get(A.family)??0),0)||1;let f=ru;const p=s.modelFamilyToFindings.map(R=>{const A=c.get(R.family)??0,S=Math.max(20,A/d*u),D={family:R.family,y:f,h:S,agentCount:R.agentCount};return f+=S,D}),h=24;let x=ru;const g=is.map(R=>{const A=s.summary[R],S=r>0?A/r:0,D=Math.max(h,S*u),L={verdict:R,y:x,h:D,count:A};return x+=D,L}),v=new Map,k=new Map,w=[],G=[...s.familyToOutcome].sort((R,A)=>R.from.family!==A.from.family?R.from.family.localeCompare(A.from.family):is.indexOf(R.to.verdict)-is.indexOf(A.to.verdict));for(const R of G){const A=p.find(Q=>Q.family===R.from.family),S=g.find(Q=>Q.verdict===R.to.verdict);if(!A||!S)continue;const D=c.get(R.from.family)??0,L=D>0?R.to.count/D*A.h:0,J=S.count||1,K=R.to.count/J*S.h,C=v.get(R.from.family)??0,O=k.get(R.to.verdict)??0;if(v.set(R.from.family,C+L),k.set(R.to.verdict,O+K),R.weight<Ny)continue;const _=A.y+C,V=_+L,F=S.y+O,I=F+K,ue=Su+fa,te=ku,oe=ue+(te-ue)*.5,xe=te-(te-ue)*.5,se=`M ${ue} ${_} C ${oe} ${_}, ${xe} ${F}, ${te} ${F} L ${te} ${I} C ${xe} ${I}, ${oe} ${V}, ${ue} ${V} Z`,y=s.modelFamilyToFindings.find(Q=>Q.family===R.from.family),H=(y==null?void 0:y.agentCount)??0;w.push({path:se,color:rs[R.to.verdict],tooltip:`${H} ${Lu[R.from.family]} agent${H===1?"":"s"} → ${R.to.count} ${Ir[R.to.verdict]} finding${R.to.count===1?"":"s"} (${Math.round(R.weight*100)}%)`,fromFamily:R.from.family,toVerdict:R.to.verdict})}return{left:p,right:g,edges:w}}function Ey({data:s}){const r=s.summary.totalFindings||1;return a.jsxs("div",{className:"space-y-4",children:[a.jsx(ou,{label:"Model families",items:s.modelFamilyToFindings.map(u=>({key:u.family,label:`${Lu[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(ou,{label:"Findings reviewed",items:is.map(u=>({key:u,label:`${Ir[u]} (${s.summary[u]})`,value:s.summary[u],color:rs[u]}))}),a.jsx(ou,{label:"Outcome verdicts",items:is.map(u=>({key:u,label:`${s.summary[u]} · ${Math.round(s.summary[u]/r*100)}%`,value:s.summary[u],color:rs[u]}))})]})}function ou({label:s,items:r}){const u=r.reduce((c,d)=>c+d.value,0)||1;return a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[10px]",style:{color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:s}),a.jsx("div",{className:"flex h-6 overflow-hidden rounded-sm border",style:{borderColor:"var(--border)"},children:r.map(c=>{const d=c.value/u*100;return d<.5?null:a.jsx("div",{title:c.label,style:{width:`${d}%`,background:c.color,opacity:.7,color:"var(--surface)",fontFamily:"var(--font-mono)",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",overflow:"hidden"},children:d>12?c.label:""},c.key)})})]})}function wy({data:s}){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:[is.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:rs[r]}}),Ir[r]," · ",s.summary[r]]},r)),s.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 · ",s.summary.newFindings]})]})}function Ty(){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:qr},children:[0,1,2].map(s=>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))},s))}),a.jsx("style",{children:`
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
.animate-pulse { animation: none !important; }
|
|
71
|
+
}
|
|
72
|
+
`})]})}function Ay(){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 My({error:s,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:s,children:["error · ",s]})}),r?a.jsx("div",{style:{opacity:.5,pointerEvents:"none"},children:a.jsx(Cp,{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 Cy(){const[s,r]=N.useState(!1);return N.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)");r(u.matches);const c=d=>r(d.matches);return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),s}function Ry({consensusId:s}){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:fn("/"),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:s})]}),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(jy,{consensusId:s})]})}function Oy({status:s}){const r=ui(s),u=Ou[r];return a.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 font-mono text-[11px] font-semibold ${u.iconBox} ${u.text}`,style:u.textStyle,children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:u.pulse?"animate-pulse motion-reduce:animate-none":"",children:Du[r]}),u.label]})}function Hr({taskId:s}){return a.jsxs("nav",{className:"mb-4 flex items-center gap-1.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},"aria-label":"Breadcrumb",children:[a.jsx("button",{onClick:()=>In("/tasks"),className:"transition hover:underline",style:{color:"var(--ink-2)"},children:"Tasks"}),a.jsx("span",{"aria-hidden":!0,children:"›"}),a.jsx("span",{style:{color:"var(--ink-3)"},children:s.slice(0,8)})]})}function Dy({task:s}){const r=ui(s.status),u=new Date(s.createdAt??s.timestamp),c=r==="running",d=c?null:new Date(s.timestamp).getTime(),f=v=>v.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}),p=r==="failed",h=p?"Failed":c?"Running…":"Completed",x=p?"var(--bad)":c?"var(--info)":"var(--ok)",g=p?"var(--bad)":c?"var(--info)":"var(--ok)";return a.jsxs("div",{className:"flex items-start gap-0","aria-label":"Task lifecycle timeline",children:[a.jsxs("div",{className:"flex flex-col items-center",style:{minWidth:120},children:[a.jsx("div",{className:"h-3 w-3 rounded-full border-2",style:{borderColor:"var(--ink-3)",background:"var(--surface)"}}),a.jsx("div",{className:"mt-1 font-mono text-[10px] font-semibold",style:{color:"var(--ink-2)"},children:"Dispatched"}),a.jsx("div",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:f(u)})]}),a.jsx("div",{className:"mt-1.5 flex-1",style:{height:2,background:p?"color-mix(in oklch, var(--bad) 30%, transparent)":"var(--border)",minWidth:40},"aria-hidden":!0}),a.jsxs("div",{className:"flex flex-col items-center",style:{minWidth:120},children:[a.jsx("div",{className:"h-3 w-3 rounded-full border-2",style:{borderColor:g,background:p?"color-mix(in oklch, var(--bad) 15%, transparent)":"var(--surface)"}}),a.jsx("div",{className:"mt-1 font-mono text-[10px] font-semibold",style:{color:x},children:h}),a.jsx("div",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:d?f(new Date(d)):"—"})]})]})}function cu({children:s}){return a.jsx("h3",{className:"mb-3 h-section pb-2",style:{borderBottom:"1px solid var(--border)"},children:s})}function si({label:s,children:r,dimmed:u=!1}){return a.jsxs("div",{className:"flex items-start gap-4 py-1.5 border-b border-border/20 last:border-0",children:[a.jsx("span",{className:"w-32 shrink-0 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:s}),a.jsx("span",{className:"flex-1 font-mono text-[11px]",style:{color:u?"color-mix(in oklch, var(--ink-3) 60%, transparent)":"var(--ink-2)"},children:r})]})}function Ih({taskId:s}){return a.jsxs("div",{children:[a.jsx(Hr,{taskId:s}),a.jsxs("div",{className:"rounded-lg border p-8 text-center",style:{borderColor:"var(--border)",background:"var(--surface)"},children:[a.jsx("div",{className:"font-mono text-sm font-semibold",style:{color:"var(--ink-2)"},children:"Task not found"}),a.jsx("div",{className:"mt-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:a.jsx("code",{className:"rounded px-1",style:{fontFamily:"JetBrains Mono, monospace",background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:s})}),a.jsxs("div",{className:"mt-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:["No task with this ID exists in task-graph.jsonl."," ",a.jsx("button",{onClick:()=>In("/tasks"),className:"underline transition hover:opacity-80",style:{color:"var(--info)"},children:"Back to Tasks list"})]})]})]})}function zy({taskId:s}){return a.jsxs("div",{children:[a.jsx(Hr,{taskId:s}),a.jsxs("div",{className:"rounded-lg border p-8 text-center",style:{borderColor:"var(--bad)",background:"color-mix(in oklch, var(--bad) 6%, var(--surface))"},children:[a.jsx("div",{className:"font-mono text-sm font-semibold",style:{color:"var(--bad)"},children:"Failed to load task"}),a.jsx("div",{className:"mt-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:a.jsx("code",{className:"rounded px-1",style:{fontFamily:"JetBrains Mono, monospace",background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:s})}),a.jsxs("div",{className:"mt-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:["The server returned an error or the response was malformed."," ",a.jsx("button",{onClick:()=>In("/tasks"),className:"underline transition hover:opacity-80",style:{color:"var(--info)"},children:"Back to Tasks list"})]})]})]})}function Cr(){return a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 50%, transparent)"},children:"○ none"})}function Ly({detail:s,loading:r}){if(r)return a.jsx("div",{className:"space-y-0",children:["consensus round","sibling tasks","round findings","signals"].map(h=>a.jsx(si,{label:h,dimmed:!0,children:a.jsx("span",{className:"inline-block h-3 w-24 rounded animate-pulse",style:{background:"color-mix(in oklch, var(--border) 60%, transparent)"},"aria-label":"loading"})},h))});const u=s==null?void 0:s.consensusId,c=(s==null?void 0:s.siblingTaskIds)??[],d=(s==null?void 0:s.siblingsTruncated)??!1,f=(s==null?void 0:s.signalCount)??0,p=(s==null?void 0:s.findingCount)??0;return a.jsxs("div",{className:"space-y-0",children:[a.jsx(si,{label:"consensus round",children:u?a.jsx("a",{href:fn(`/consensus/${encodeURIComponent(u)}`),className:"transition hover:underline",style:{color:"var(--info)",fontFamily:"JetBrains Mono, monospace"},children:u}):a.jsx(Cr,{})}),a.jsx(si,{label:"sibling tasks",children:c.length>0?a.jsxs("span",{className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[a.jsxs("span",{style:{color:"var(--ink-2)"},children:[c.length,d?"+":""]}),c.slice(0,5).map(h=>a.jsx("a",{href:fn(`/tasks/${encodeURIComponent(h)}`),className:"transition hover:underline",style:{color:"var(--info)",fontFamily:"JetBrains Mono, monospace"},children:h.slice(0,8)},h)),c.length>5&&a.jsxs("span",{style:{color:"var(--ink-3)"},children:["+",c.length-5," more"]})]}):a.jsx(Cr,{})}),a.jsx(si,{label:"round findings",children:p>0?a.jsx("span",{style:{color:"var(--ink-2)"},children:p}):a.jsx(Cr,{})}),a.jsx(si,{label:"signals",children:f>0?a.jsx("a",{href:fn("/signals"),className:"transition hover:underline",style:{color:"var(--info)"},children:f}):a.jsx(Cr,{})})]})}function By({taskId:s,tasks:r}){const u=r==null?void 0:r.items.find(S=>S.taskId===s),[c,d]=N.useState(null),[f,p]=N.useState(!0),[h,x]=N.useState(!1),[g,v]=N.useState(!1);N.useEffect(()=>{let S=!1;return p(!0),x(!1),v(!1),d(null),fetch(`/dashboard/api/tasks/${encodeURIComponent(s)}`).then(async D=>{if(D.status===404){S||x(!0);return}if(!D.ok){S||v(!0);return}const L=await D.json().catch(()=>null);S||(L&&typeof L=="object"&&"taskId"in L?d(L):v(!0))}).catch(()=>{S||v(!0)}).finally(()=>{S||p(!1)}),()=>{S=!0}},[s]);const k=c??u;if(!f&&h&&!k)return a.jsx(Ih,{taskId:s});if(!f&&g&&!k)return a.jsx(zy,{taskId:s});if(!f&&!k)return a.jsx(Ih,{taskId:s});if(f&&!k)return a.jsxs("div",{children:[a.jsx(Hr,{taskId:s}),a.jsx("div",{className:"rounded-lg border p-8 text-center font-mono text-[11px]",style:{borderColor:"var(--border)",background:"var(--surface)",color:"var(--ink-3)"},children:a.jsx("span",{className:"inline-block h-3 w-32 rounded animate-pulse",style:{background:"color-mix(in oklch, var(--border) 60%, transparent)"}})})]});const w=k,G=ui(w.status),R=Au(w.agentId),A=(w.inputTokens??0)+(w.outputTokens??0);return a.jsxs("div",{className:"space-y-6",children:[a.jsx(Hr,{taskId:s}),a.jsxs("div",{className:"rounded-lg border p-5",style:{borderColor:"var(--border)",background:"var(--surface)"},children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(Oy,{status:w.status}),R&&a.jsx("span",{className:`rounded-sm border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wider ${R.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...R.clsStyle},children:R.label}),a.jsx("code",{className:"rounded px-2 py-0.5 text-[11px]",style:{fontFamily:"JetBrains Mono, monospace",color:"var(--ink-2)",background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:w.taskId})]}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-4",children:[a.jsxs("a",{href:fn(`/agent/${encodeURIComponent(w.agentId)}`),className:"inline-flex items-center gap-2 font-mono text-xs transition hover:opacity-80",style:{color:"var(--ink-2)"},children:[a.jsx("span",{className:"inline-block h-2.5 w-2.5 shrink-0 rounded-full",style:{backgroundColor:_n(w.agentId)}}),w.agentId]}),A>0&&a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{style:{color:"var(--ink-2)"},children:(w.inputTokens??0).toLocaleString()})," ","in /"," ",a.jsx("span",{style:{color:"var(--ink-2)"},children:(w.outputTokens??0).toLocaleString()})," ","out tokens"]}),w.duration!=null&&a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},children:bp(w.duration)}),a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},children:_t(w.timestamp)})]}),a.jsx("div",{className:"mt-5",children:a.jsx(Dy,{task:w})})]}),a.jsxs("div",{className:"rounded-lg border p-5",style:{borderColor:"var(--border)",background:"var(--surface)"},children:[a.jsx(cu,{children:"context"}),a.jsx(Ly,{detail:c,loading:f})]}),a.jsxs("div",{className:"rounded-lg border p-5",style:{borderColor:"var(--border)",background:"var(--surface)"},children:[a.jsx(cu,{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(--ink) 90%, transparent)"},dangerouslySetInnerHTML:{__html:gp(w.task)}})]}),a.jsxs("div",{className:"rounded-lg border p-5",style:{borderColor:"var(--border)",background:"var(--surface)"},children:[a.jsx(cu,{children:"result"}),w.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-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:text-[var(--cite-fn)] [&_.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(--ink) 90%, transparent)"},dangerouslySetInnerHTML:{__html:os(w.result)}}):a.jsx("div",{className:"rounded-md border border-border/40 p-5 text-center font-mono text-xs",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"var(--ink-3)"},children:G==="running"?a.jsx("span",{style:{color:"var(--info)"},children:"Task is still running…"}):G==="failed"?a.jsx("span",{style:{color:"var(--bad)"},children:"Task failed — no result recorded."}):a.jsx("span",{children:"No result recorded."})})]})]})}function Uy({onLogin:s,error:r}){const[u,c]=N.useState(""),[d,f]=N.useState(!1),p=async x=>{if(x.preventDefault(),!(!u.trim()||d)){f(!0);try{await s(u.trim())}finally{f(!1)}}},h=r==="bad_key"?"Invalid key. Check your terminal for the correct key.":r==="network"?"Connection error — relay may be offline.":r==="no_cookie"?"Your browser did not store the session cookie. Disable private/incognito mode or allow cookies for this site, then try again.":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:"mb-1 font-semibold",style:{fontFamily:"'Geist', var(--font-sans)",fontSize:26,lineHeight:1.1,letterSpacing:"-0.02em",color:"var(--ink)",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:p,children:[a.jsx("input",{type:"password",value:u,onChange:x=>c(x.target.value),placeholder:"Dashboard key",autoFocus:!0,disabled:d,className:"w-full rounded-lg border [border-color:var(--border)] px-4 py-3 font-mono text-sm outline-none focus:[border-color:var(--ink-3)] focus:ring-2 focus:[--tw-ring-color:color-mix(in_oklch,var(--ink-3)_20%,transparent)] disabled:opacity-50",style:{background:"var(--surface)",color:"var(--ink)"}}),a.jsx("button",{type:"submit",disabled:d,className:"mt-4 w-full rounded-lg px-4 py-3 text-sm font-semibold transition hover:opacity-90 disabled:opacity-60",style:{background:"var(--accent)",color:"#fff"},children:d?"Unlocking…":"Unlock"})]}),h&&a.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--bad)"},children:h})]})})}const Rp="dashboard:theme",$y=["light","dark"];function qy(s){return s==="light"||s==="dark"?s:s==="editorial"?"light":s==="default"?"dark":null}function Hy(s,r){const u=qy(s);return u!==null?u:r?"dark":"light"}function Iy(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Gy(){if(typeof window>"u")return"light";let s=null;try{s=window.localStorage.getItem(Rp)}catch{}return Hy(s,Iy())}function Yy(){const[s,r]=N.useState(Gy);N.useEffect(()=>{typeof document>"u"||(s==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=s)},[s]);function u(d){if($y.includes(d)&&(r(d),typeof window<"u"))try{window.localStorage.setItem(Rp,d)}catch{}}return{theme:s,setTheme:u,toggle:()=>{u(s==="light"?"dark":"light")}}}const Xy=[{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."}],Ky={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function Vy({open:s,onClose:r}){const u=N.useRef(null);return N.useEffect(()=>{if(!s)return;const c=requestAnimationFrame(()=>{var f;(f=u.current)==null||f.focus()}),d=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(c),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[s,r]),s?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:Ky,role:"dialog","aria-modal":"true","aria-labelledby":"glossary-title",onClick:c=>c.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:Xy.map(({term:c,definition:d,seeAlso:f})=>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:c}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:d}),f&&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: ",f]})]},c))})}),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 Qy=[{to:"/",label:"Dashboard",match:s=>s==="/"||s==="/overview"},{to:"/chat",label:"Chat",match:s=>s==="/chat"},{to:"/team",label:"Team",match:s=>s==="/team"||s.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:s=>s==="/debates"},{to:"/tasks",label:"Tasks",match:s=>s==="/tasks"},{to:"/signals",label:"Signals",match:s=>s==="/signals"},{to:"/logs",label:"Logs",match:s=>s==="/logs"}];function uu(){const[s,r]=N.useState(!1),u=sp(),{theme:c,toggle:d}=Yy();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:fn("/"),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:Qy.map(f=>{const p=f.match(u);return a.jsx("a",{href:fn(f.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${p?"font-semibold":"hover:bg-accent/10"}`,style:p?{background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"var(--accent)"}:{color:"var(--ink-3)"},children:f.label},f.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{"aria-hidden":"true",title:"Search — coming soon",style:{display:"inline-flex",alignItems:"center",gap:"8px",height:"32px",padding:"0 12px",minWidth:"220px",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontSize:"13px",cursor:"default"},children:[a.jsx("span",{style:{opacity:.7},children:"Search…"}),a.jsx("kbd",{style:{marginLeft:"auto",padding:"1px 6px",borderRadius:"4px",background:"var(--surface-sunk)",border:"1px solid var(--border)",fontFamily:"var(--font-mono)",fontSize:"11px",color:"var(--ink-3)"},children:"⌘K"})]}),a.jsx("button",{type:"button",onClick:d,title:`Switch to ${c==="light"?"dark":"light"} theme`,"aria-label":`Switch to ${c==="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:c==="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(Vy,{open:s,onClose:()=>r(!1)})]})}const Zy={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 Op({task:s,onClose:r}){if(N.useEffect(()=>{if(!s)return;const d=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[s,r]),!s)return null;const u=Zy[s.status],c=(s.inputTokens||0)+(s.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:r,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border",style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-overlay)"},onClick:d=>d.stopPropagation(),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border/60 px-5 py-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.cls}`,style:u.clsStyle,children:u.label}),a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",children:s.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"truncate font-mono text-xs transition",style:{color:"var(--text-dim)"},children:s.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:_t(s.timestamp)}),s.duration!=null&&a.jsxs("span",{children:["· ",bp(s.duration)]}),c>0&&a.jsxs("span",{children:["· ",c.toLocaleString()," tokens (",(s.inputTokens||0).toLocaleString()," in / ",(s.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:gp(s.task)}})]}),s.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-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:text-[var(--cite-fn)] [&_.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:os(s.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:s.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}function _u(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const du=5,fu={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"}},Gh=[{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."}],Fy=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"critical",label:"Critical",cls:"text-bad/50 border-bad/20 hover:border-bad/40",activeCls:"text-bad bg-bad/10 border-bad/40"},{key:"high",label:"High",cls:"text-severity-high/50 border-severity-high/20 hover:border-severity-high/40",activeCls:"text-severity-high bg-severity-high/10 border-severity-high/40"},{key:"medium",label:"Medium",cls:"text-severity-medium/50 border-severity-medium/20 hover:border-severity-medium/40",activeCls:"text-severity-medium bg-severity-medium/10 border-severity-medium/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)"}}],Jy={critical:"text-bad bg-bad/10",high:"text-severity-high bg-severity-high/10",medium:"text-severity-medium bg-severity-medium/10",low:""},Wy={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Py="[&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)] [&_.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",e0={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 t0({f:s,reviewInfo:r,diagnostics:u}){const c=s.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":s.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":s.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=s.severity&&Jy[s.severity]||"",f=s.severity==="low"?Wy:void 0,p=s.findingType==="suggestion"?"SUGGESTION":s.findingType==="insight"?"INSIGHT":null,h=s.findingType==="suggestion"?"text-info bg-info/10":s.findingType==="insight"?"text-text-dim bg-text-dim/10":"",x=s.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=x?x[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors px-4 py-3.5",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${c}`,children:s.tag.toUpperCase()}),s.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,style:f,children:s.severity.toUpperCase()}),p&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${h}`,children:p}),g&&a.jsx("span",{className:"bg-info/10 px-2 py-1 font-mono text-[10px] text-info border border-info/15 rounded",children:g}),a.jsx("span",{className:"ml-auto font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:s.originalAgentId}),s.confirmedBy&&s.confirmedBy.length>0&&(()=>{const v=[...new Set(s.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:
|
|
73
|
+
${v.join(", ")}`,"data-tooltip-pos":"left",children:["+",v.length," ✓"]})})(),s.disputedBy&&s.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:
|
|
74
|
+
${s.disputedBy.map(v=>v.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[s.disputedBy.length," ⚡"]}),s.unverifiedBy&&s.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:
|
|
75
|
+
${s.unverifiedBy.map(v=>v.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[s.unverifiedBy.length," ◇"]})]}),u&&u.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:u.map((v,k)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":v.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",v.code]}),a.jsx("div",{className:"mt-0.5 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},dangerouslySetInnerHTML:{__html:_u(e0[v.code])+" — "+_u(v.message)}})]},k))}),s.disputedBy&&s.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:s.disputedBy.map((v,k)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:v.agentId}),a.jsxs("span",{style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[" — ",v.reason||v.evidence||"No reason given"]})]},k))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed ${Py}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:os(s.finding)}}),r&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[r.reviewers.map(v=>a.jsx("span",{title:v,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:_n(v)},children:xu(v)},v)),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 n0({consensus:s,reports:r,showAll:u=!1,hideHeader:c=!1,filteredRuns:d}){const f=d??s.runs,p=u?f:f.slice(0,du);!u&&f.length>du;const[h,x]=N.useState(null),[g,v]=N.useState({}),[k,w]=N.useState({}),[G,R]=N.useState(1),[A,S]=N.useState([]),[D,L]=N.useState(0),[J,K]=N.useState(!1),[C,O]=N.useState({});N.useEffect(()=>{if(!u&&(r!=null&&r.reports)&&(S(r.reports),L(r.totalReports??r.reports.length),R(1)),r!=null&&r.roundRetractions){const y={};for(const H of r.roundRetractions)y[H.consensus_id]={reason:H.reason,retracted_at:H.retracted_at};O(y)}},[r,u]),N.useEffect(()=>{if(!u)return;let y=!1;return(async()=>{var H;try{const Q=await ot("consensus-reports?page=1&pageSize=200");if(y)return;if(S(Q.reports||[]),L(Q.totalReports??(((H=Q.reports)==null?void 0:H.length)||0)),R(1),Q.roundRetractions){const ne={};for(const re of Q.roundRetractions)ne[re.consensus_id]={reason:re.reason,retracted_at:re.retracted_at};O(ne)}}catch{}})(),()=>{y=!0}},[u]);const _=A.slice().sort((y,H)=>H.timestamp.localeCompare(y.timestamp)),V=10,[F,I]=N.useState(0),ue=Math.max(1,Math.ceil(_.length/V)),te=Math.min(F,ue-1);N.useEffect(()=>{F>=ue&&I(0)},[F,ue]);const oe=u?_.slice(te*V,(te+1)*V):_.slice(0,du),xe=N.useMemo(()=>{const y=new Map;for(const H of A){const Q={};if(H.crossReviewAssignments||H.crossReviewCoverage){const ne={};if(H.crossReviewAssignments)for(const[re,j]of Object.entries(H.crossReviewAssignments))for(const B of j)(ne[B]??(ne[B]=[])).push(re);if(H.crossReviewCoverage)for(const re of H.crossReviewCoverage)Q[re.findingId]={reviewers:ne[re.findingId]||[],assigned:re.assigned,targetK:re.targetK};else for(const[re,j]of Object.entries(ne))Q[re]={reviewers:j,assigned:j.length,targetK:j.length}}y.set(H.id,Q)}return y},[A]),se=y=>{const H=new Date,Q=new Date(y),ne=j=>new Date(j.getFullYear(),j.getMonth(),j.getDate()).getTime(),re=Math.round((ne(H)-ne(Q))/864e5);return re<=0?"Today":re===1?"Yesterday":re<7?`${re} days ago`:re<30?`${Math.floor(re/7)} weeks ago`:Q.toISOString().slice(0,10)};return a.jsxs("section",{children:[!c&&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:s.totalRuns??s.runs.length})]}),!u&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),oe.length>0?a.jsxs("div",{className:"space-y-2",children:[oe.map((y,H)=>{const Q=H>0?oe[H-1]:null,ne=u?se(y.timestamp):null,re=u&&Q?se(Q.timestamp):null,j=u&&ne!==re,B=g[y.id]??"all",le=k[y.id]??"all",fe=xe.get(y.id)??{},Y=[...y.confirmed,...y.disputed,...y.unverified,...y.unique,...y.insights||[]],ae=B==="all"?Y:B==="insight"?Y.filter(de=>de.findingType==="insight"||de.findingType==="suggestion"):Y.filter(de=>de.tag===B),he=le==="all"?ae:ae.filter(de=>de.severity===le),Oe=h===y.id,ze=(()=>{const de=new Set;return Te=>{var Et;const Ae=(Et=y.authorDiagnostics)==null?void 0:Et[Te.originalAgentId];if(!Ae||Ae.length===0)return;const Tt=Ae.filter(wn=>{const ft=`${Te.originalAgentId}:${wn.code}`;return de.has(ft)?!1:(de.add(ft),!0)});return Tt.length>0?Tt:void 0}})(),tt=Y.length||1,Ht=y.confirmed.length,Ct=y.disputed.length,Cn=y.unverified.length,It=y.unique.length,Xe=(y.insights||[]).length,Rn=(()=>{if(tt===0)return"border-l-border/40";const de=Ht/tt,Te=Ct/tt;return de>=.5?"border-l-confirmed/60":Te>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),ma=[{count:Ht,textCls:"text-confirmed",label:"confirmed"},{count:Ct,textCls:"text-disputed",label:"disputed"},{count:Cn,textCls:"text-unverified",label:"unverified"},{count:It,textCls:"text-unique",label:"unique"},{count:Xe,textCls:"text-zinc-400",label:"insights"}].filter(de=>de.count>0),On=[...new Set(Y.map(de=>de.originalAgentId).filter(Boolean))],En=On.slice(0,5),hn=C[y.id],Yn=!!hn;return a.jsxs("div",{children:[j&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${H>0?"mt-4":""}`,children:[a.jsx("span",{className:"h-section",children:ne}),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
|
|
76
|
+
${Rn}
|
|
77
|
+
${Yn?"opacity-60 line-through decoration-disputed/40":""}
|
|
78
|
+
${Oe?"border-r-border/60 border-t-border/60 border-b-border/60":"hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:-translate-y-px"}`,style:{background:Oe?"var(--surface-elev)":"color-mix(in oklch, var(--surface-elev) 50%, transparent)"},"data-retracted":Yn?"true":void 0,children:[Yn&&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"}),hn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",hn.retracted_at.slice(0,10)]}),hn.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",hn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":Oe,onClick:()=>{const de=!Oe;x(de?y.id:null),de&&(v(Te=>({...Te,[y.id]:"all"})),w(Te=>({...Te,[y.id]:"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:Y.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:[y.rounds,"r"]}),En.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[En.map(de=>a.jsx("span",{title:de,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:_n(de)},children:xu(de)},de)),On.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",On.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:y.id,children:y.id.slice(0,8)}),y.zeroTagAgents&&y.zeroTagAgents.length>0&&(()=>{const de=y.zeroTagAgents,Te=y.zeroTagOverflow??0,Ae=de.length+Te,Tt=Te>0?`${de.join(", ")} (+${Te} more)`:de.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: ${Tt}`,children:[Ae," zero-tag"]})})(),y.droppedFindingsByType&&Object.keys(y.droppedFindingsByType).length>0&&(()=>{const de=Object.entries(y.droppedFindingsByType),Te=de.reduce((Tt,[,Et])=>Tt+Et,0),Ae=de.map(([Tt,Et])=>`${Tt}:${Et}`).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=: ${Ae}. These never reach the dashboard, scores, or signals.`,children:[Te," dropped"]})})(),y.warnings&&y.warnings.length>0&&(()=>{const de=new Map;for(const Te of y.warnings){const Ae=de.get(Te.code)??[];Ae.push(Te.agentId?`${Te.agentId}: ${Te.message}`:Te.message),de.set(Te.code,Ae)}return Array.from(de.entries()).map(([Te,Ae])=>a.jsxs("span",{className:"shrink-0 rounded border border-warn/30 bg-warn/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-warn",title:Ae.join(`
|
|
79
|
+
`),children:[Te,Ae.length>1?` ×${Ae.length}`:""]},Te))})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] shrink-0",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:_t(y.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:ma.map(de=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${de.textCls}`,children:[de.count," ",de.label]},de.label))}),y.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:y.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] transition-transform duration-150 ${Oe?"rotate-90":""}`,style:{color:Oe?"color-mix(in oklch, var(--ink) 60%, transparent)":"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"▸"})]}),Oe&&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:"}),Gh.map(de=>a.jsx("button",{onClick:()=>v(Te=>({...Te,[y.id]:de.key})),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${B===de.key?de.activeCls:de.cls}`,style:B===de.key?de.activeStyle:de.inactiveStyle,...de.tooltip?{"data-tooltip":de.tooltip}:{},children:de.label},de.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:"}),Fy.map(de=>a.jsx("button",{onClick:()=>w(Te=>({...Te,[y.id]:de.key})),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${le===de.key?de.activeCls:de.cls}`,style:le===de.key?de.activeStyle:de.inactiveStyle,children:de.label},de.key))]}),(y.warnings??[]).filter(de=>de.code==="coverage_degraded").map((de,Te)=>a.jsx("div",{className:"mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2",children:a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-warn",children:["⚠ ",de.message]})},`cd-${Te}`)),y.zeroTagAgents&&y.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 — ",y.zeroTagAgents.length+(y.zeroTagOverflow??0)," agent",y.zeroTagAgents.length+(y.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:[y.zeroTagAgents.join(", "),y.zeroTagOverflow&&y.zeroTagOverflow>0?` (+${y.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."})]}),(()=>{const de=(y.warnings??[]).filter(Ae=>Ae.code==="cross_review_skipped");if(de.length===0)return null;const Te=de.map(Ae=>Ae.agentId).filter(Boolean);return a.jsxs("div",{className:"mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-warn",children:["⚠ Cross-review skipped: ",de.length," relay agent",de.length===1?"":"s"," failed Phase 2"]}),Te.length>0&&a.jsx("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:Te.join(", ")})]})})(),(y.crossReviewAssignments||y.crossReviewCoverage)&&(()=>{const de=y.crossReviewAssignments||{},Te=Object.entries(de),Ae=y.crossReviewCoverage||[],Tt=Ae.length,Et=Ae.filter(ft=>ft.assigned<ft.targetK),wn=(y.warnings??[]).some(ft=>ft.code==="partial_review");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",wn&&a.jsx("span",{className:"rounded border border-warn/20 bg-warn/10 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-warn",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:[Te.length," reviewers · ",Tt," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[Te.map(([ft,vl])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:ft,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:_n(ft)},children:xu(ft)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:ft}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",vl.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:vl.map(Xn=>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:Xn.length>12?Xn.slice(0,12)+"…":Xn},Xn))})]},ft)),Tt>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Et.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:["⚠ ",Et.length," of ",Tt," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",Tt," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:he.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):he.map((de,Te)=>a.jsx(t0,{f:de,reviewInfo:de.id?fe[de.id]:void 0,diagnostics:ze(de)},Te))})]})]})]},y.id)}),u&&ue>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:()=>I(y=>Math.max(0,y-1)),disabled:te===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 ",te+1," of ",ue]}),a.jsx("button",{onClick:()=>I(y=>Math.min(ue-1,y+1)),disabled:te>=ue-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 ▸"})]})]}):p.length===0?a.jsx(bl,{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:p.map((y,H)=>{const Q=y.counts,ne=(Q.agreement||0)+(Q.disagreement||0)+(Q.hallucination||0)+(Q.unverified||0)+(Q.unique||0)+(Q.new||0),re=ne||1,j=h===y.taskId,B=[{key:"confirmed",count:Q.agreement||0,color:"bg-confirmed",text:"text-confirmed",label:"confirmed"},{key:"disputed",count:(Q.disagreement||0)+(Q.hallucination||0),color:"bg-disputed",text:"text-disputed",label:"disputed"},{key:"unverified",count:Q.unverified||0,color:"bg-unverified",text:"text-unverified",label:"unverified"},{key:"unique",count:(Q.unique||0)+(Q.new||0),color:"bg-unique",text:"text-unique",label:"unique"}],le=g[y.taskId]??"all",fe=y.signals.filter(ae=>{if(ae.signal==="signal_retracted")return!1;if(le==="all")return!!fu[ae.signal];const he=fu[ae.signal];return he&&he.filter===le}),Y=!!y.retracted;return a.jsxs("div",{className:`rounded-md border transition ${j?"border-primary/25":"border-border"} ${Y?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":Y?"true":void 0,title:Y&&y.retractionReason?`Retracted: ${y.retractionReason}`:void 0,children:[Y&&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"}),y.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",y.retractedAt.slice(0,10)]}),y.retractionReason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",y.retractionReason]})]}),a.jsxs("button",{"aria-expanded":j,onClick:()=>{const ae=!j;x(ae?y.taskId:null),ae&&v(he=>({...he,[y.taskId]:"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:j?"var(--ink)":"var(--text-dim)",fontWeight:j?600:400},children:j?"▾":"▸"}),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:y.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold ${Y?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[ne," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[y.agents.slice(0,4).map(ae=>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:ae.split("-").map(he=>he[0]).join("").toUpperCase().slice(0,2)},ae)),y.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["+",y.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:_t(y.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:B.map(ae=>ae.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${ae.text} ${Y?"line-through decoration-disputed/40":""}`,children:[ae.count," ",ae.label]},ae.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:B.map(ae=>ae.count>0&&a.jsx("div",{className:`${ae.color} transition-all`,style:{width:`${ae.count/re*100}%`}},ae.key))})]})]}),j&&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:Gh.map(ae=>a.jsx("button",{onClick:()=>v(he=>({...he,[y.taskId]:ae.key})),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${le===ae.key?ae.activeCls:ae.cls} hover:opacity-80`,style:le===ae.key?ae.activeStyle:ae.inactiveStyle,...ae.tooltip?{"data-tooltip":ae.tooltip}:{},children:ae.label},ae.key))}),fe.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:fe.map((ae,he)=>{const Oe=fu[ae.signal];return Oe?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 ${Oe.cls}`,children:Oe.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:os(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}`:""]})]})]},he):null})})]})]},y.taskId+H)})})]})}const Rr=25;function a0({commits:s}){const[r,u]=N.useState(!1);if(s.length===0)return a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"—"});const c=s[0],d=c.includes(" ")?c.slice(c.indexOf(" ")+1):c,f=s.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text)"},children:d}),f>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":r,onClick:()=>u(p=>!p),className:"font-mono text-[10px] underline",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:r?"(collapse)":`(+${f} more)`}),r&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:s.slice(1).map((p,h)=>{const x=p.includes(" ")?p.slice(p.indexOf(" ")+1):p;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:x},h)})})]})]})}function l0({row:s}){const r=s.preSha.slice(0,8),u=s.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:_t(s.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"font-mono text-[11px] hover:underline",style:{color:"var(--text)"},onMouseEnter:c=>c.currentTarget.style.color="var(--accent)",onMouseLeave:c=>c.currentTarget.style.color="var(--text)",children:s.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(a0,{commits:s.commits})})]})}function s0(){const[s,r]=N.useState([]),[u,c]=N.useState(0),[d,f]=N.useState(1),[p,h]=N.useState(!1),[x,g]=N.useState(null);N.useEffect(()=>{let k=!1;return h(!0),g(null),ot(`violations?page=${d}&pageSize=${Rr}`).then(w=>{k||(r(w.items??[]),c(w.total??0))}).catch(w=>{k||g(String((w==null?void 0:w.message)??w))}).finally(()=>{k||h(!1)}),()=>{k=!0}},[d]);const v=Math.max(1,Math.ceil(u/Rr));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:[!p&&s.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"})}),p&&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…"})}),!p&&s.map(k=>a.jsx(l0,{row:k},`${k.taskId}-${k.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:p?"loading…":u===0?"no violations":`${(d-1)*Rr+1}–${Math.min(d*Rr,u)} of ${u}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] ${v<=1?"invisible":""}`,style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>f(k=>Math.max(1,k-1)),disabled:d===1||p,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",v]}),a.jsx("button",{type:"button",onClick:()=>f(k=>Math.min(v,k+1)),disabled:d>=v||p,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 i0({categoryAccuracy:s,categoryCorrect:r,categoryHallucinated:u}){const c=Object.keys(s??{});if(c.length===0)return a.jsx(bl,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=c.map(f=>{const p=Math.max(0,Math.min(1,s[f]??0)),h=(r==null?void 0:r[f])??0,x=(u==null?void 0:u[f])??0;return{key:f,acc:p,c:h,h:x,n:h+x}}).sort((f,p)=>p.acc-f.acc);return a.jsx("div",{className:"space-y-2",children:d.map(f=>{const p=f.acc>=.7?"bg-confirmed":f.acc>=.4?"bg-unverified":"bg-disputed",h=f.n>0?`${f.c} correct / ${f.h} hallucinated / ${f.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${f.n>0&&f.n<10?"opacity-50":""}`,title:f.n>0&&f.n<10?`${h} — low sample (n<10)`:h,children:[a.jsx("span",{className:"truncate font-mono text-[11px]",style:{color:"var(--text-dim)"},children:f.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 ${p}`,style:{width:`${f.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:f.n>0?a.jsxs(a.Fragment,{children:[f.c,"/",f.n,f.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",f.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(f.acc*100),"%"]})]},f.key)})})}const r0=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function o0(s,r,u){return(!s||!r0.has(s))&&r!==void 0&&u!==void 0&&u>0}const c0={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 80 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"},u0={pending:"border-border/50",passed:"border-confirmed/40 bg-confirmed/10 text-confirmed",failed:"border-disputed/40 bg-disputed/10 text-disputed",silent_skill:"border-unverified/40 bg-unverified/10 text-unverified",insufficient_evidence:"border-unverified/40 bg-unverified/10 text-unverified",inconclusive:"border-[color:var(--warn)]/40 bg-[color:var(--warn)]/10 text-[color:var(--warn)]",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function d0(s){const r=Math.round(s*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 f0({slot:s}){const r=s.status,u=r?u0[r]:"border-border/50",c=!r||r==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,d=r==="inconclusive"&&(s.inconclusiveStrikes??0)>0,f=s.forcedDevelops??[],p=f.length>0?f[f.length-1]:null,h=typeof s.effectiveness=="number"?d0(s.effectiveness):null,x=o0(r,s.postBindSignals,s.minEvidence);return a.jsxs("div",{className:`rounded-md border p-3 ${s.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 ${s.enabled?"":"line-through"}`,style:{color:s.enabled?"var(--text)":"var(--text-dim)"},children:[s.mode==="contextual"&&"⚡ ",s.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:s.source}),s.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 ",_t(s.boundAt)]}),x&&(()=>{const g=s.postBindSignals,v=s.minEvidence,k=Math.round(g/v*100),w=Math.min(g/v,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${v} post-bind signals (${k}%)`,children:[a.jsxs("div",{className:"mb-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["post-bind: ",g," / ",v]}),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:`${w}%`}})})]})})()]}),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:c,title:c0[r],children:r.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[h&&a.jsx("span",{className:h.cls,style:h.clsStyle,title:"Effectiveness: change in hallucination rate pre/post",children:h.text}),d&&a.jsxs("span",{className:"text-unique",title:s.inconclusiveAt?`last strike ${_t(s.inconclusiveAt)}`:void 0,children:[s.inconclusiveStrikes," strike",s.inconclusiveStrikes===1?"":"s"]})]}),f.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:p!=null&&p.reason?`latest: ${p.reason}`:void 0,children:["forced ",f.length," time",f.length===1?"":"s",p&&` · last ${_t(p.timestamp)}`]})]})}function m0({open:s,onOpenChange:r,children:u}){return N.useEffect(()=>{if(!s)return;const c=f=>{f.key==="Escape"&&r(!1)};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[s,r]),s?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:c=>c.stopPropagation(),className:"contents",children:u})})]}):null}function h0({side:s="right",className:r="",children:u,style:c,...d}){return a.jsx("div",{className:`h-full p-6 ${r}`,style:{background:"var(--surface-elev)",...c},...d,children:u})}function p0({className:s="",...r}){return a.jsx("div",{className:`mb-2 ${s}`,...r})}function x0({className:s="",...r}){return a.jsx("h2",{className:`font-semibold ${s}`,...r})}function g0({citation:s}){const r=s.snippet.split(`
|
|
80
|
+
`);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:[s.file,":",s.line]})}),a.jsx("pre",{className:"overflow-x-auto",style:{background:"var(--surface-sunk)",borderLeft:"3px solid var(--border-strong)",padding:"12px 16px",borderRadius:"6px",fontFamily:"var(--font-mono)",fontSize:"12px",color:"var(--text)"},children:r.map((u,c)=>a.jsx("div",{className:"whitespace-pre",children:u||" "},c))})]})}const Yh={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:""},b0={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Xh={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"},v0={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 y0(){const s=(r,u)=>a.jsx("div",{className:`${r} ${u} rounded`,style:{background:"var(--border)",opacity:.4}});return a.jsxs("div",{className:"mt-4 space-y-4","aria-busy":"true",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[s("h-3.5","w-12"),s("h-3.5","w-14"),s("h-3.5","w-16")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-full"),s("h-2","w-[92%]"),s("h-2","w-[70%]")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-16"),s("h-12","w-full")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-16"),s("h-2","w-[60%]"),s("h-2","w-[45%]")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-20"),s("h-2","w-full"),s("h-2","w-[80%]")]})]})}function Gr({open:s,onOpenChange:r,consensusId:u,findingId:c}){const[d,f]=N.useState(null),[p,h]=N.useState(null);return N.useEffect(()=>{if(!s||!u||!c){f(null),h(null);return}f(null),h(null),ot(`finding/${encodeURIComponent(u)}/${encodeURIComponent(c)}`).then(f).catch(x=>h(x.message||"failed to load finding"))},[s,u,c]),a.jsx(m0,{open:s,onOpenChange:r,children:a.jsxs(h0,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:v0,children:[a.jsx(p0,{children:a.jsx(x0,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),p&&a.jsx("div",{className:"mt-4",children:a.jsx(zu,{message:p})}),!p&&!d&&a.jsx(y0,{}),d&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${Xh[d.finding.tag]||""}`,style:Xh[d.finding.tag]?void 0:{background:"var(--surface-sunk)"},children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${Yh[d.finding.severity]||""}`,style:d.finding.severity==="low"?b0:Yh[d.finding.severity]?void 0:{background:"var(--surface-sunk)"},children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"var(--text-dim)"},children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"font-mono text-[12px] leading-relaxed whitespace-pre-wrap",children:d.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),d.citations.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Citations"}),d.citations.map((x,g)=>a.jsx(g0,{citation:x},g))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Coverage"}),d.finding.confirmedBy.length>0&&a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",d.finding.confirmedBy.join(", ")]}),d.finding.disputedBy.map((x,g)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",x.agentId,": ",a.jsx("span",{style:{color:"var(--text-dim)"},children:x.reason})]},g)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-dim)"},children:"No peer review"})]}),d.signals.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((x,g)=>a.jsxs("div",{className:"text-[11px] border-l-2 border-border/40 pl-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono font-semibold",children:x.signal}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"·"}),a.jsx("span",{children:x.agentId}),x.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--text-dim)"},children:"→"}),a.jsx("span",{children:x.counterpartId})]}),a.jsx("span",{className:"ml-auto",style:{color:"var(--text-dim)"},children:_t(x.timestamp)})]}),x.evidence&&a.jsx("div",{className:"mt-0.5",style:{color:"var(--text-dim)"},children:x.evidence.slice(0,200)})]},g))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:fn(`/consensus/${d.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",d.consensusId]})})]})]})})}const N0={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 j0({agentId:s}){const[r,u]=N.useState([]),[c,d]=N.useState(!0),[f,p]=N.useState("all"),[h,x]=N.useState(null);N.useEffect(()=>{let w=!1;return d(!0),ot(`signals?agent=${encodeURIComponent(s)}&limit=100`).then(G=>{w||(u(G.items||[]),d(!1))}).catch(()=>{w||(u([]),d(!1))}),()=>{w=!0}},[s]);const g=[...r].sort((w,G)=>(G.timestamp||"").localeCompare(w.timestamp||"")),v=f==="all"||f==="signals"?g:[],k=({k:w,label:G,enabled:R})=>a.jsx("button",{type:"button",onClick:()=>R&&p(w),disabled:!R,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${R?"":"opacity-40 cursor-not-allowed"}`,style:f===w?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:G});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(k,{k:"all",label:"All",enabled:!0}),a.jsx(k,{k:"signals",label:"Signals",enabled:!0}),a.jsx(k,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(k,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),c?a.jsx("div",{className:"py-6 text-center text-xs",style:{color:"var(--text-dim)"},children:"Loading…"}):v.length===0?a.jsx(bl,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:v.map((w,G)=>{const R=N0[w.signal]||"text-text-dim",A=!!(w.consensusId&&w.findingId),S=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:_t(w.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${R}`,children:w.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px]",style:{color:"var(--text-dim)"},children:[w.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["→ ",w.counterpartId," · "]}),w.evidence&&a.jsx("span",{children:w.evidence.length>160?w.evidence.slice(0,160)+"…":w.evidence})]})]});return A?a.jsx("button",{type:"button",onClick:()=>x({consensusId:w.consensusId,findingId:w.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/10",children:S},G):a.jsx("div",{children:S},G)})}),a.jsx(Gr,{open:!!h,onOpenChange:w=>{w||x(null)},consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function S0(){const s=N.useRef(null),[r,u]=N.useState(0);return N.useEffect(()=>{const c=s.current;if(!c||typeof ResizeObserver>"u")return;const d=new ResizeObserver(f=>{for(const p of f)u(p.contentRect.width)});return d.observe(c),()=>d.disconnect()},[]),[s,r]}const Kh={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"},k0={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"},_0=6,E0=500,Dp=100,w0=150;function T0(s){if(s<=0)return Dp;const r=Math.floor(s/_0);return Math.max(1,Math.min(r,E0))}function A0({agentId:s}){const[r,u]=N.useState([]),[c,d]=N.useState(0),[f,p]=N.useState(!1),[h,x]=N.useState(null),[g,v]=S0(),[k,w]=N.useState(Dp),G=N.useRef(null);N.useEffect(()=>{if(v<=0)return;const L=T0(v);return G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{w(J=>J===L?J:L)},w0),()=>{G.current&&clearTimeout(G.current)}},[v]),N.useEffect(()=>{ot(`signals?agent=${encodeURIComponent(s)}&limit=${k}`).then(L=>{u(L.items||[]),d(L.total||0)}).catch(()=>{})},[s,k]);const R=N.useMemo(()=>[...r].reverse(),[r]),A={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const L of r)L.signal==="agreement"||L.signal==="consensus_verified"?A.confirmed++:L.signal==="disagreement"||L.signal==="hallucination_caught"?A.disputed++:L.signal==="unique_confirmed"||L.signal==="unique_unconfirmed"||L.signal==="new_finding"?A.unique++:L.signal==="unverified"?A.unverified++:L.signal==="citation_fabricated"&&A.fabricated++;const S=r.length,D=c>S;return r.length===0?a.jsx("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsx(bl,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:"h-section",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:D?`last ${S} of ${c}`:`${c} total`})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[a.jsxs("span",{className:"text-confirmed",children:[A.confirmed," confirmed"]}),A.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[A.disputed," disputed"]}),A.unique>0&&a.jsxs("span",{className:"text-unique",children:[A.unique," unique"]}),A.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[A.unverified," unverified"]}),A.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[A.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:R.map((L,J)=>{const K=!!(L.consensusId&&L.findingId);return a.jsx("button",{type:"button",disabled:!K,onClick:()=>{L.consensusId&&L.findingId&&(x({consensusId:L.consensusId,findingId:L.findingId}),p(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${Kh[L.signal]||""} ${K?"cursor-pointer":"cursor-default"}`,style:Kh[L.signal]?void 0:{background:"var(--surface-sunk)"},title:`${k0[L.signal]||L.signal} — ${_t(L.timestamp)}${K?" (click for detail)":""}`},J)})}),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(L=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${L.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:L.label})]},L.label))}),a.jsx(Gr,{open:f,onOpenChange:p,consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function M0(s){if(!s)return"—";if(s<1e3)return"< 1s";if(s<6e4)return Math.floor(s/1e3)+"s";if(s<36e5){const c=Math.floor(s/6e4),d=Math.floor(s%6e4/1e3);return d>0?`${c}m ${d}s`:`${c}m`}const r=Math.floor(s/36e5),u=Math.floor(s%36e5/6e4);return u>0?`${r}h ${u}m`:`${r}h`}function zp({task:s,onClick:r}){const u=ui(s.status),c=Ou[u],d=Au(s.agentId);return a.jsxs("tr",{className:"border-b border-border hover:bg-accent/10 transition-colors cursor-pointer",onClick:f=>{f.target.closest("a")||(r==null||r(s),In("/tasks/"+s.taskId))},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: ${c.label}`,children:[a.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${c.iconBox} ${c.text} ${c.pulse?"animate-pulse motion-reduce:animate-none":""}`,style:c.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:Du[u]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${c.text}`,style:c.textStyle,children:c.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"rounded border px-2 py-1 font-mono text-[10px] font-semibold",style:{borderColor:"color-mix(in oklch, var(--border) 40%, transparent)",color:"var(--ink-3)",background:"color-mix(in oklch, var(--surface) 60%, transparent)"},title:s.taskId,children:s.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(s.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:_n(s.agentId)}}),s.agentId]})}),d&&a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:`rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${d.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...d.clsStyle},children:d.label})}),!d&&a.jsx("td",{className:"py-2.5 pr-3"}),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=s.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":M0(s.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:_t(s.timestamp)})]})}function bt({className:s="",style:r}){return a.jsx("div",{className:`rounded ${s}`,style:{background:"color-mix(in oklch, var(--border) 40%, transparent)",...r}})}function C0(){return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 px-6 py-6",children:[a.jsx(bt,{className:"h-48 w-full"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx(bt,{className:"h-36"}),a.jsx(bt,{className:"h-36"}),a.jsx(bt,{className:"h-36"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsx(bt,{className:"h-48"}),a.jsx(bt,{className:"h-48"})]})]})}function R0(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(bt,{className:"mb-2 h-7 w-32"}),a.jsx(bt,{className:"h-3 w-48"})]}),a.jsx("div",{className:"grid grid-cols-2 gap-px sm:grid-cols-4",children:Array.from({length:4}).map((s,r)=>a.jsx(bt,{className:"h-16"},r))}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:6}).map((s,r)=>a.jsx(bt,{className:"h-12"},r))})]})}function O0(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(bt,{className:"mb-2 h-7 w-24"}),a.jsx(bt,{className:"h-3 w-32"})]}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:8}).map((s,r)=>a.jsx(bt,{className:"h-11"},r))})]})}function D0(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(bt,{className:"mb-2 h-7 w-48"}),a.jsx(bt,{className:"h-3 w-64"})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,r)=>a.jsxs("div",{className:"overflow-hidden rounded-md",children:[a.jsx(bt,{className:"h-14"}),a.jsx("div",{className:"mt-px space-y-px",children:Array.from({length:3}).map((u,c)=>a.jsx(bt,{className:"h-10"},c))})]},r))})]})}function z0(){return a.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((s,r)=>a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(bt,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-sm"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(bt,{className:"h-3 w-3/4"}),a.jsx(bt,{className:"h-3 w-1/2"})]})]},r))})}function L0(){return a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:5}).map((s,r)=>a.jsx(bt,{className:"h-10"},r))})}const B0=3,U0=720*60*60*1e3;function $0({agentId:s,agents:r,tasks:u,consensus:c}){const d=r.find(Y=>Y.id===s),[f,p]=N.useState([]),[h,x]=N.useState(!0),[g,v]=N.useState([]),[k,w]=N.useState(!0),[G,R]=N.useState(null),[A,S]=N.useState(null),[D,L]=N.useState(null),[J,K]=N.useState(0),[C,O]=N.useState(0),[_,V]=N.useState(null);N.useEffect(()=>{x(!0),ot(`memory/${s}`).then(Y=>{p(Y.knowledge||[])}).catch(()=>p([])).finally(()=>x(!1))},[s]),N.useEffect(()=>{let Y=!1;return w(!0),ot("consensus-reports?page=1&pageSize=200").then(ae=>{Y||v(ae.reports||[])}).catch(()=>{Y||v([])}).finally(()=>{Y||w(!1)}),()=>{Y=!0}},[]);const F=N.useMemo(()=>{var Oe;const Y=Date.now(),ae=new Map;for(const ze of g){const tt=Date.parse(ze.timestamp);if(Number.isNaN(tt)||Y-tt>U0)continue;const Ht=(Oe=ze.authorDiagnostics)==null?void 0:Oe[s];if(Ht)for(const Ct of Ht)ae.set(Ct.code,(ae.get(Ct.code)??0)+1)}const he=[];for(const[ze,tt]of ae)tt>=B0&&he.push({code:ze,count:tt});return he},[g,s]);if(!d)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",s]});const I=d.scores,ue=(u==null?void 0:u.items.filter(Y=>Y.agentId===s))||[],te=(c==null?void 0:c.runs.filter(Y=>Y.agents.includes(s)))||[],oe=[{label:"accuracy",value:I.accuracy,fill:I.accuracy>=.7?"bg-confirmed":I.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"unique",value:I.uniqueness,fill:"bg-unique"},{label:"impact",value:I.impactScore,fill:"bg-[var(--c8)]"}],xe=I.unverifiedsEmitted??0,se=I.unverifiedsReceived??0,y=xe+se,H=[{label:"Signals",value:String(I.signals),color:"",colorStyle:{color:"var(--text)"}},{label:"Agreements",value:String(I.agreements),color:"text-confirmed",colorStyle:void 0},{label:"Disagreements",value:String(I.disagreements),color:"text-disputed",colorStyle:void 0},{label:"Hallucinations",value:String(I.hallucinations),color:I.hallucinations>0?"text-disputed":"",colorStyle:I.hallucinations>0?void 0:{color:"var(--text-dim)"}},{label:"Unverified",value:y>0?`${xe}↑ ${se}↓`:"0",color:y>0?"text-unverified":"",colorStyle:y>0?void 0:{color:"var(--text-dim)"},title:y>0?`${xe} emitted (as reviewer) · ${se} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],Q=10,ne=Math.max(1,Math.ceil(ue.length/Q)),re=Math.min(J,ne-1),j=ue.slice(re*Q,(re+1)*Q),B=N.useMemo(()=>{const Y=new Map;for(const ae of f){const he=ae.filename.match(/^(\d{4}-\d{2}-\d{2})/),Oe=he?he[1]:"undated",ze=Y.get(Oe)||[];ze.push(ae),Y.set(Oe,ze)}return Array.from(Y.entries()).sort(([ae],[he])=>ae==="undated"?1:he==="undated"?-1:he.localeCompare(ae)).map(([ae,he])=>({day:ae,items:he}))},[f]),le=Math.min(C,Math.max(0,B.length-1)),fe=B[le];return a.jsxs(a.Fragment,{children:[(()=>{const Y=Ru(I);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 (",I.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:[I.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 (",I.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),F.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:F.map(({code:Y,count:ae})=>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:_u(Y)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",ae," 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(I.accuracy*100)}% · Uniqueness ${Math.round(I.uniqueness*100)}% · Impact ${Math.round(I.impactScore*100)}%`,children:a.jsx(di,{agentId:d.id,size:120,signals:I.signals,accuracy:I.accuracy,uniqueness:I.uniqueness,impact:I.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold",style:{color:"var(--text)"},children:d.id}),a.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--text-dim)"},children:[d.provider,"/",d.model]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${d.native?"":"text-confirmed bg-confirmed/10"}`,style:d.native?{color:"var(--idle)",background:"color-mix(in oklch, var(--idle) 10%, transparent)"}:void 0,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm px-2 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[I.signals," signals",d.lastTask?` · ${_t(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border px-3 py-2",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},"data-tooltip":`Dispatch weight ${I.dispatchWeight.toFixed(2)}
|
|
81
|
+
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:I.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(A0,{agentId:s})}),a.jsxs("section",{className:"mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"mb-3 h-section",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 p-4",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsx("div",{className:"space-y-2.5",children:oe.map(Y=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",children:[a.jsx("span",{className:"h-section",style:{color:"var(--text-dim)",fontSize:"10px"},children:Y.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full transition-all ${Y.fill}`,style:{width:`${Math.max(0,Math.min(100,Y.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(Y.value*100),"%"]})]},Y.label))}),a.jsx("div",{className:"mt-4 grid grid-cols-6 gap-px overflow-hidden rounded-md border border-border/30 bg-border/30",children:H.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(i0,{categoryAccuracy:I.categoryAccuracy,categoryCorrect:I.categoryCorrect,categoryHallucinated:I.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:d.skillSlots.length||d.skills.length})]}),d.skillSlots.length>0?a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:d.skillSlots.map(Y=>a.jsx(f0,{slot:Y},Y.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(Y=>a.jsx("span",{className:"rounded-sm border border-border px-2.5 py-1 font-mono text-xs",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:Y},Y))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:ue.length})]}),ne>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>K(Y=>Math.max(0,Y-1)),disabled:re===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:[re+1," / ",ne]}),a.jsx("button",{onClick:()=>K(Y=>Math.min(ne-1,Y+1)),disabled:re>=ne-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 ▸"})]})]}),ue.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:j.map(Y=>a.jsx(zp,{task:Y,onClick:V},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",!k&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",te.length]})]}),k?a.jsx(L0,{}):te.length>0?a.jsx("div",{className:"space-y-2",children:te.slice(0,20).map((Y,ae)=>{const he=Y.counts,Oe=(he.agreement||0)+(he.disagreement||0)+(he.hallucination||0)+(he.unverified||0)+(he.unique||0)+(he.new||0),ze=Oe||1,tt=[{key:"confirmed",count:he.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(he.disagreement||0)+(he.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:he.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(he.unique||0)+(he.new||0),color:"bg-unique",text:"text-unique"}],Ht={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"}},Ct=Y.signals.filter(Xe=>Xe.signal!=="signal_retracted"&&Ht[Xe.signal]),Cn=Y.taskId+":"+ae,It=A===Cn;return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"var(--surface-elev)"},children:[a.jsx("button",{type:"button",onClick:()=>S(It?null:Cn),disabled:Ct.length===0,className:`flex w-full items-center p-3 text-left transition ${Ct.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:[Ct.length>0&&a.jsx("span",{className:"mr-1.5 inline-block",style:{color:"var(--text-dim)"},children:It?"▾":"▸"}),Oe," findings"]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:_t(Y.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:tt.map(Xe=>Xe.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Xe.text}`,children:[Xe.count," ",Xe.key]},Xe.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:tt.map(Xe=>Xe.count>0&&a.jsx("div",{className:Xe.color,style:{width:`${Xe.count/ze*100}%`}},Xe.key))})]})}),It&&Ct.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:Ct.map((Xe,Rn)=>{const ma=Ht[Xe.signal],On=!!(Xe.findingId&&Y.taskId),En=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 ${ma.cls}`,children:ma.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-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]",style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:os(Xe.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Xe.agentId,Xe.counterpartId?` + ${Xe.counterpartId}`:""]})]})]});return On?a.jsx("button",{type:"button",onClick:()=>L({consensusId:Y.taskId,findingId:Xe.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/10",children:En},Rn):a.jsx("div",{children:En},Rn)})})})]},Cn)})}):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(j0,{agentId:s})}),a.jsx(Gr,{open:!!D,onOpenChange:Y=>{Y||L(null)},consensusId:(D==null?void 0:D.consensusId)??null,findingId:(D==null?void 0:D.findingId)??null}),a.jsx(Op,{task:_,onClose:()=>V(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",!h&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",f.length," files"]}),!h&&fe&&a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["· ",fe.day," (",fe.items.length,")"]})]}),!h&&B.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:()=>O(Y=>Math.max(0,Y-1)),disabled:le===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:[le+1," / ",B.length]}),a.jsx("button",{onClick:()=>O(Y=>Math.min(B.length-1,Y+1)),disabled:le>=B.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 ▸"})]})]}),h?a.jsx(z0,{}):fe&&fe.items.length>0?a.jsx("div",{className:"space-y-1.5",children:fe.items.map(Y=>{var ze,tt;const ae=G===Y.filename,he=((ze=Y.frontmatter)==null?void 0:ze.type)||"memory",Oe=((tt=Y.frontmatter)==null?void 0:tt.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:()=>R(ae?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:ae?"var(--text)":"var(--text-dim)"},children:ae?"▾":"▸"}),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:he}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:Oe}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:Y.filename})]}),ae&&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 Vh={dispatch:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},consensus:{color:"color-mix(in oklch, var(--info) 80%, transparent)"},error:{},timeout:{},worker:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},gemini:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},skill:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},boot:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},relay:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},gossip:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},utility:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},memory:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},persist:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},toolserver:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},other:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"}},q0={error:"text-disputed",timeout:"text-unverified"},H0=[[/^\[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 I0(s){for(const[r,u]of H0)if(r.test(s))return u;return"other"}const G0=[{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"}],Qh=1e3;function Y0(){const[s,r]=N.useState([]),[u,c]=N.useState(0),[d,f]=N.useState(0),[p,h]=N.useState("all"),[x,g]=N.useState(!0),[v,k]=N.useState(!0),w=N.useRef(null),G=N.useRef(0);N.useEffect(()=>{let S=!1;return(async()=>{try{const L=await ot("logs?tail=500");if(S)return;r(L.entries),c(L.totalLines),f(L.fileSize),G.current=L.totalLines+1}catch{}})(),()=>{S=!0}},[]),N.useEffect(()=>{if(v)return wp(S=>{var L;if(S.type!=="log_lines")return;const D=(L=S.data)==null?void 0:L.lines;D!=null&&D.length&&r(J=>{const K=D.map((O,_)=>({line:G.current+_,text:O,category:I0(O)}));G.current+=D.length,c(O=>O+D.length);const C=[...J,...K];return C.length>Qh?C.slice(-Qh):C})})},[v]),N.useEffect(()=>{x&&w.current&&w.current.scrollIntoView({behavior:"smooth"})},[s,x]);const R=p==="all"?s:s.filter(S=>S.category===p),A=N.useCallback(S=>S<1024?`${S} B`:S<1048576?`${(S/1024).toFixed(1)} KB`:`${(S/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:A(d)}),v&&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:[G0.map(S=>a.jsx("button",{onClick:()=>h(S.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:p===S.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:S.label},S.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>k(!v),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${v?"bg-confirmed/10 text-confirmed":""}`,style:v?void 0:{color:"var(--text-dim)"},children:v?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>g(!x),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:x?{color:"var(--ok)",background:"color-mix(in oklch, var(--ok) 10%, transparent)"}:{color:"var(--text-dim)"},children:x?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border",style:{background:"var(--surface-elev)"},children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[R.map(S=>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:S.line}),a.jsx("span",{className:q0[S.category]??"",style:Vh[S.category]??Vh.other,children:S.text})]},S.line)),R.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs",style:{color:"var(--text-dim)"},children:s.length===0?"Loading...":p==="all"?"No log entries in current tail.":`No ${p} entries in current tail.`}),a.jsx("div",{ref:w})]})})]})}const X0=["critical","high","medium","low"],K0=["manual","impl","meta","auto-provisional"];function Zh(s,r){return s.includes(r)?s.filter(u=>u!==r):[...s,r]}const qn="mb-1 block h-section",Hn={},Ia="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",Ga={background:"var(--surface)",color:"var(--text)"};function V0({filters:s,onChange:r,agents:u,signalTypes:c}){const d=f=>p=>{const h=p.target.value;r({[f]:h===""?void 0:h})};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:qn,style:Hn,children:["Agents (",s.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(f=>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:s.agents.includes(f),onChange:()=>r({agents:Zh(s.agents,f)})}),a.jsx("span",{children:f})]},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Counterpart"}),a.jsxs("select",{className:Ia,style:Ga,value:s.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),u.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:qn,style:Hn,children:["Signal types (",s.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[c.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"}),c.map(f=>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:s.signals.includes(f),onChange:()=>r({signals:Zh(s.signals,f)})}),a.jsx("span",{children:f})]},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Severity"}),a.jsxs("select",{className:Ia,style:Ga,value:s.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),X0.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Ia,style:Ga,value:s.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),K0.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Category"}),a.jsx("input",{type:"text",className:Ia,style:Ga,value:s.category??"",onChange:d("category"),placeholder:"e.g. trust_boundaries"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Ia,style:Ga,value:s.since?s.since.slice(0,16):"",onChange:f=>r({since:f.target.value?new Date(f.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Ia,style:Ga,value:s.until?s.until.slice(0,16):"",onChange:f=>r({until:f.target.value?new Date(f.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Ia,style:Ga,value:s.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Ia,style:Ga,value:s.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const Fh={agents:[],signals:[]},Q0=["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"],Z0={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"},F0={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(--unique)",unique_unconfirmed:"var(--unique)",new_finding:"var(--unique)",unverified:"var(--info)"},J0={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"},ii=100;function W0(){if(typeof window>"u")return{filters:Fh,hadAny:!1};const s=new URLSearchParams(window.location.search),r=s.getAll("signal").filter(Boolean),u=s.get("agent"),c=s.get("counterpart")??void 0,d=s.get("category")??void 0,f=s.get("severity"),p=f==="critical"||f==="high"||f==="medium"||f==="low"?f:void 0,h=s.get("since")??void 0,x=s.get("until")??void 0,g=s.get("consensus_id")??void 0,v=s.get("finding_id")??void 0,k=s.get("source"),w=k==="manual"||k==="impl"||k==="meta"||k==="auto-provisional"?k:void 0;return r.length>0||u||c||d||p||h||x||g||v||w?{filters:{agents:u?[u]:[],signals:r,counterpart:c,category:d,severity:p,since:h,until:x,consensusId:g,findingId:v,source:w},hadAny:!0}:{filters:Fh,hadAny:!1}}function P0(s,r,u=ii){const c=new URLSearchParams;c.set("limit",String(u)),c.set("offset",String(r)),s.agents.length===1&&c.set("agent",s.agents[0]),s.counterpart&&c.set("counterpart",s.counterpart);for(const d of s.signals)c.append("signal",d);return s.category&&c.set("category",s.category),s.severity&&c.set("severity",s.severity),s.since&&c.set("since",s.since),s.until&&c.set("until",s.until),s.consensusId&&c.set("consensus_id",s.consensusId),s.findingId&&c.set("finding_id",s.findingId),s.source&&c.set("source",s.source),c}function mu(s,r){return s?s.length>r?s.slice(0,r)+"…":s:""}function e1(){const[{filters:s,hadAny:r}]=N.useState(W0),[u,c]=N.useState(s),[d,f]=N.useState([]),[p,h]=N.useState(0),[x,g]=N.useState(0),[v,k]=N.useState(!1),[w,G]=N.useState(null),[R,A]=N.useState([]),[S,D]=N.useState(!1),[L,J]=N.useState(null),[K,C]=N.useState(null),O=N.useRef(null),_=N.useRef(0),V=N.useCallback(async(se,y)=>{const H=++_.current;k(!0),G(null);try{const Q=P0(se,y*ii),ne=await ot(`signals?${Q.toString()}`);if(H!==_.current)return;f(ne.items??[]),g(ne.total??0)}catch(Q){if(H!==_.current)return;G(Q instanceof Error?Q.message:"fetch failed")}finally{H===_.current&&k(!1)}},[]);N.useEffect(()=>{ot("agents").then(se=>{const y=(se??[]).map(H=>H.id).filter(Boolean).sort();y.length>0&&A(y)}).catch(()=>{})},[]),N.useEffect(()=>{h(0)},[u]),N.useEffect(()=>(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{V(u,p)},250),()=>{O.current&&clearTimeout(O.current)}),[u,p,V]);const F=N.useCallback(se=>{c(y=>({...y,...se}))},[]),I=Math.max(1,Math.ceil(x/ii)),ue=Math.min(p,I-1),te=x>0||r||v,oe=(se,y)=>{!se||!y||(J(se),C(y),D(!0))},xe=N.useMemo(()=>{const se=[];return u.agents.length&&se.push(`${u.agents.length} agents`),u.signals.length&&se.push(`${u.signals.length} signals`),u.severity&&se.push(u.severity),u.source&&se.push(u.source),(u.since||u.until)&&se.push("time window"),se.length?se.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:[xe," — showing ",d.length," of ",x]})]})}),r&&a.jsxs("div",{className:"rounded-md border border-border/40 px-3 py-2 font-mono text-[10px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"},children:["Filtered view — ",u.signals.length," signal type",u.signals.length!==1?"s":"",u.agents.length>0?` · ${u.agents.length} agent${u.agents.length!==1?"s":""}`:"",u.severity?` · severity: ${u.severity}`:"",u.source?` · source: ${u.source}`:"",". ",a.jsx("a",{href:fn("/signals"),style:{color:"var(--accent)"},children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${te?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[te&&a.jsx("div",{className:r?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(V0,{filters:u,onChange:F,agents:R,signalTypes:Q0})}),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:[w&&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:w}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"h-section border-b border-border/60 text-left",style:{color:"color-mix(in oklch, var(--ink-2) 80%, transparent)"},children:[a.jsx("th",{className:"w-[6px] p-0","aria-label":"severity"}),a.jsx("th",{className:"px-2 py-1.5",children:"time"}),a.jsx("th",{className:"px-2 py-1.5",children:"agent"}),a.jsx("th",{className:"px-2 py-1.5",children:"verdict"}),a.jsx("th",{className:"px-2 py-1.5",children:"finding"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"The other agent in this signal — e.g. the peer who agreed or disputed",children:"counterpart"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"Finding ID — click row to open finding detail",children:"id"}),a.jsx("th",{className:"px-2 py-1.5",children:"consensus"})]})}),a.jsxs("tbody",{children:[d.length===0&&!v&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals match these filters"})}),d.map((se,y)=>{const H=!!(se.consensusId&&se.findingId),Q=se.severity?J0[se.severity]:"transparent",ne=F0[se.signal]??"var(--ink-2)",re=Z0[se.signal]??se.signal;return a.jsxs("tr",{className:`border-b border-border/30 ${H?"cursor-pointer transition-colors":""}`,style:H?{"--row-hover-bg":"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"}:void 0,role:H?"button":void 0,tabIndex:H?0:void 0,"aria-label":H?`View finding ${se.findingId??""}`:void 0,onMouseEnter:j=>{H&&(j.currentTarget.style.background="color-mix(in oklch, var(--surface-sunk) 40%, transparent)")},onMouseLeave:j=>{H&&(j.currentTarget.style.background="")},onClick:()=>H&&oe(se.consensusId,se.findingId),onKeyDown:j=>{H&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),oe(se.consensusId,se.findingId))},children:[a.jsx("td",{className:"p-0",style:{background:Q,width:6},title:se.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:se.timestamp,children:_t(se.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"var(--text)"},children:se.agentId}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:a.jsx("span",{className:"h-section",style:{color:ne,fontSize:11},children:re})}),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:se.evidence,children:mu(se.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:se.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:se.findingId,children:se.findingId?mu(se.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:se.consensusId,children:se.consensusId?mu(se.consensusId,16):"—"})]},`${se.timestamp}-${se.agentId}-${y}`)})]})]})}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:v?"loading…":`${ue*ii+1}–${ue*ii+d.length} of ${x}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>h(se=>Math.max(0,se-1)),disabled:ue===0||v,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:[ue+1," / ",I]}),a.jsx("button",{type:"button",onClick:()=>h(se=>Math.min(I-1,se+1)),disabled:ue>=I-1||v,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(Gr,{open:S,onOpenChange:D,consensusId:L,findingId:K})]})}function t1(){if(typeof window>"u")return null;const s=new URLSearchParams(window.location.search),r=s.get("key");if(r===null)return null;s.delete("key");const u=s.toString(),c=window.location.pathname+(u?`?${u}`:"")+window.location.hash;return window.history.replaceState(null,"",c),r.trim()||null}function n1(){const[s,r]=N.useState(null),[u,c]=N.useState(null),d=N.useRef(!1),f=N.useCallback(async h=>{c(null);const x=await Xb(h);x.ok?r(!0):(c(x.kind),r(!1))},[]),p=N.useCallback(async()=>{if(d.current)return s===!0;d.current=!0;try{const h=await gu();return r(h),h}finally{d.current=!1}},[s]);return N.useEffect(()=>{let h=!1;const x=t1();return d.current=!0,(async()=>{try{if(await gu()){h||r(!0);return}if(x){h||await f(x);return}h||r(!1)}finally{d.current=!1}})(),()=>{h=!0}},[f]),{authed:s,login:f,error:u,recheck:p}}function a1(s,r){const u=r.match(/^API error: (\d+)$/),c=u?`HTTP ${u[1]}`:r;return`${s}: ${c}`}const l1=5e3;async function Or(s,r){try{return await ot(r)}catch(u){const c=u instanceof Error?u.message:String(u);throw new Error(a1(s,c))}}function s1(s){const[r,u]=N.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,fleetTrend:null,signalActivity:null,skills:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),c=N.useRef(!1),d=N.useRef(s);d.current=s;const f=N.useCallback(async()=>{var p;if(!c.current){c.current=!0;try{const[h,x,g,v,k,w,G,R,A,S]=await Promise.all([Or("overview","overview"),Or("agents","agents"),Or("tasks","tasks?limit=2000"),Or("consensus","consensus?pageSize=500"),ot("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),ot("fleet-trend?days=7").catch(()=>({days:7,points:[]})),ot("signal-activity").catch(()=>({agents:[],total:0,generatedAt:""})),ot("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),ot("native-memory").catch(()=>({knowledge:[]})),ot("gossip-memory").catch(()=>({knowledge:[]}))]),D=[...A.knowledge||[]].map(J=>({...J,origin:"native"})).sort((J,K)=>K.filename>J.filename?1:-1),L=[...S.knowledge||[]].map(J=>({...J,origin:"gossip"})).sort((J,K)=>K.filename>J.filename?1:-1);u({overview:h,agents:x,tasks:g,consensus:v,consensusReports:k,fleetTrend:w,signalActivity:G,skills:R,nativeMemories:D,gossipMemories:L,memories:D,loading:!1,error:null})}catch(h){Yb(h)?((p=d.current)==null||p.call(d),u(x=>({...x,loading:!1}))):u(x=>({...x,loading:!1,error:h.message}))}finally{c.current=!1}}},[]);return N.useEffect(()=>{f()},[f]),N.useEffect(()=>{const p=setInterval(()=>{f()},l1);return()=>clearInterval(p)},[f]),{...r,refresh:f}}const Lp="dashboard:lastEventId";function i1(){if(typeof window>"u")return 0;const s=window.localStorage.getItem(Lp);if(!s)return 0;const r=parseInt(s,10);return Number.isFinite(r)?r:0}function r1(s){typeof window>"u"||window.localStorage.setItem(Lp,String(s))}const Jh=1e3,o1=5e3;function Bp(s){N.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let r=null,u=null,c=Jh,d=!1;function f(){if(d)return;const p=i1();r=new window.EventSource(`/dashboard/api/events?last_id=${p}`),r.onmessage=h=>{try{const x=JSON.parse(h.data);s(x),r1(x.id),c=Jh}catch{}},r.onerror=()=>{r&&(r.close(),r=null),!d&&(u=setTimeout(()=>{f()},c),c=Math.min(c*2,o1))}}return f(),()=>{d=!0,u!==null&&clearTimeout(u),r&&(r.close(),r=null)}},[])}const Wh=5,c1=6e3;function u1({toast:s,onDismiss:r}){const u=N.useRef(null),c=N.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),d=N.useCallback(()=>{c(),u.current=setTimeout(()=>r(s.id),c1)},[s.id,r,c]);N.useEffect(()=>(d(),c),[d,c]);const{type:f,payload:p}=s.event,h=f==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):p.confirmed>p.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let x;if(f==="task.completed"){const v=String(p.agentId??"agent"),k=typeof p.durationMs=="number"?p.durationMs:null,w=k!==null?`${(k/1e3).toFixed(1)}s`:"—";x=`${v} finished in ${w}`}else{const v=Number(p.confirmed??0),k=Number(p.disputed??0);x=`Consensus done — ${v} confirmed · ${k} disputed`}const g=()=>{c(),f==="task.completed"&&p.taskId?In("/tasks"):f==="consensus.completed"&&p.consensusId&&In("/debates"),r(s.id)};return a.jsx("div",{className:["pointer-events-auto border rounded px-4 py-3 max-w-sm cursor-pointer","transition-all duration-200","motion-reduce:transition-none motion-reduce:transform-none","hover:border-border",s.exiting?"opacity-0 scale-95 opacity-0 translate-y-2":"opacity-100 scale-100 translate-x-0"].join(" "),style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-card)"},onClick:g,onMouseEnter:c,onMouseLeave:d,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"shrink-0 text-sm font-bold",children:h}),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:v=>{v.stopPropagation(),c(),r(s.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function d1(){const[s,r]=N.useState([]),u=N.useCallback(d=>{r(f=>f.map(p=>p.id===d?{...p,exiting:!0}:p)),setTimeout(()=>{r(f=>f.filter(p=>p.id!==d))},250)},[]),c=N.useCallback(d=>{r(f=>{const p={id:d.id,event:d,exiting:!1},h=[...f,p];if(h.length>Wh){const x=h.length-Wh;return h.slice(x)}return h})},[]);return Bp(c),a.jsx("div",{className:"fixed bottom-20 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:s.map(d=>a.jsx(u1,{toast:d,onDismiss:u},d.id))})}const hu=1e3,f1=5e3,m1="/dashboard/api/bridge/stream",h1=4,Ph="/dashboard/api/bridge",ep=3e4;function tp(s){switch(s){case 400:return"message rejected — invalid or empty";case 429:return"rate limited — slow down";case 503:return"no live Claude Code session — start `gossipcat code`";case 401:return"session expired — reload to re-authenticate";default:return`send failed — HTTP ${s}`}}let p1=1;function as(s,r,u,c){return{id:p1++,role:s,text:r,ts:u??new Date().toISOString(),serverId:c}}function Dr(s,r){const u=s[s.length-1];if(!u||r.ts>=u.ts)return[...s,r];const c=s.findIndex(d=>d.ts>r.ts);return c<0?[...s,r]:[...s.slice(0,c),r,...s.slice(c)]}function x1(s={}){const{initialChatId:r=null,active:u=!0}=s,[c,d]=N.useState([]),[f,p]=N.useState("connecting"),[h,x]=N.useState(!1),[g,v]=N.useState(r),[k,w]=N.useState(null),[G,R]=N.useState(0),[A,S]=N.useState(null),D=N.useRef(u);D.current=u;const L=N.useCallback(()=>R(0),[]),J=N.useCallback(()=>{D.current||R(I=>I+1)},[]),K=N.useRef(r),C=N.useCallback(I=>{var te;const ue=K.current;K.current=I,v(I),ue!==I&&((te=_.current)==null||te.call(_))},[]),O=N.useRef(0),_=N.useRef(null);N.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let I=null,ue=null,te=hu,oe=!1,xe=0;function se(){if(oe)return;p("connecting");const ne=O.current,re=K.current?`&chat_id=${encodeURIComponent(K.current)}`:"";I=new window.EventSource(`${m1}?last_id=${ne}${re}`),I.onopen=()=>{oe||(xe=0,p("open"),te=hu)},I.onmessage=j=>{var fe;let B;try{B=JSON.parse(j.data)}catch{return}const le=K.current;!le||B.chat_id!==le||(B.type==="reply"?(x(!1),d(Y=>Dr(Y,as("assistant",B.text??"",B.ts))),J()):B.type==="ack"?d(Y=>Dr(Y,as("ack","received — working…",B.ts))):B.type==="error"?(x(!1),d(Y=>Dr(Y,as("error",B.text??"the live session reported an error",B.ts))),J()):B.type==="question"?H(B):B.type==="mirror"?y(B):B.type==="restart"&&(O.current=0,(fe=_.current)==null||fe.call(_)))},I.onerror=()=>{I&&(I.close(),I=null),!oe&&(xe+=1,xe>=h1?p("error"):p("connecting"),ue=setTimeout(()=>se(),te),te=Math.min(te*2,f1))}}function y(ne){const re=ne.role;if(re!=="user"&&re!=="assistant"&&re!=="activity")return;typeof ne.id=="number"&&ne.id>O.current&&(O.current=ne.id),re==="assistant"&&x(!1);const j=typeof ne.text=="string"?ne.text:"",B=typeof ne.ts=="string"&&/^\d{4}-\d{2}-\d{2}T/.test(ne.ts)?ne.ts:void 0;d(le=>Dr(le,as(re,j,B,ne.id))),J()}function H(ne){if(typeof ne.qid!="string"||ne.qid.length===0||!Array.isArray(ne.questions)||ne.questions.length===0)return;for(const j of ne.questions)if(!j||typeof j.questionId!="string"||typeof j.header!="string"||typeof j.question!="string"||!Array.isArray(j.options)||j.options.length===0||j.options.some(B=>!B||typeof B.label!="string"))return;const re=typeof ne.ts=="string"&&/^\d{4}-\d{2}-\d{2}T/.test(ne.ts)?ne.ts:new Date().toISOString();S({qid:ne.qid,questions:ne.questions,ts:re}),J()}function Q(){oe||(ue!==null&&(clearTimeout(ue),ue=null),I&&(I.close(),I=null),te=hu,se())}return _.current=Q,se(),()=>{oe=!0,_.current=null,p("closed"),ue!==null&&clearTimeout(ue),I&&(I.close(),I=null)}},[J]);const V=N.useCallback(async I=>{const ue=I.trim();if(ue.length===0)return;w(null),d(y=>[...y,as("user",ue)]),x(!0);const te=K.current,oe={message:ue};te&&(oe.chat_id=te);const xe=new AbortController,se=setTimeout(()=>xe.abort(),ep);try{const y=await fetch(Ph,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(oe),signal:xe.signal});let H={};try{H=await y.json()}catch{}if(typeof H.chat_id=="string"&&H.chat_id.length>0&&!K.current&&C(H.chat_id),y.status===202)return;x(!1),w(H.error??tp(y.status))}catch(y){x(!1);const H=y instanceof Error&&y.name==="AbortError";w(H?"send timed out — relay unreachable":"send failed — relay unreachable")}finally{clearTimeout(se)}},[C]),F=N.useCallback(async I=>{const ue=A,te=K.current;if(!ue||!te)return!1;w(null);const oe=I.map(y=>{const H=ue.questions.find(re=>re.questionId===y.questionId),Q=(H==null?void 0:H.header)??y.questionId,ne=[];return y.selected.length>0&&ne.push(y.selected.join(", ")),y.other&&y.other.trim().length>0&&ne.push(`other: "${y.other.trim()}"`),`${Q}: ${ne.join(" · ")}`}).join(" · ");d(y=>[...y,as("user",oe)]),x(!0),S(null);const xe=new AbortController,se=setTimeout(()=>xe.abort(),ep);try{const y=await fetch(Ph,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({chat_id:te,answer:{qid:ue.qid,responses:I}}),signal:xe.signal});if(y.status===202)return!0;let H={};try{H=await y.json()}catch{}return x(!1),w(H.error??tp(y.status)),!1}catch(y){x(!1);const H=y instanceof Error&&y.name==="AbortError";return w(H?"answer timed out — relay unreachable":"answer failed — relay unreachable"),!1}finally{clearTimeout(se)}},[A]);return{messages:c,status:f,awaitingReply:h,chatId:g,unread:G,send:V,sendError:k,markRead:L,pendingQuestion:A,submitAnswer:F}}const Eu="gossipcat_chat_tabs",wu=8,np=18,Up=N.createContext(null);let ap=0;function Br(){return ap+=1,`tab-${Date.now().toString(36)}-${ap}`}function g1(s,r){const u=s.find(c=>c.role==="user"&&c.text.trim().length>0);if(u){const c=u.text.trim().replace(/\s+/g," ");return c.length>np?`${c.slice(0,np)}…`:c}return r&&r.length>0?r.slice(0,6):"new chat"}function b1(){try{if(typeof localStorage>"u")return null;const s=localStorage.getItem(Eu);if(!s||s.length>64e3)return null;const r=JSON.parse(s);if(!r||!Array.isArray(r.tabs))return null;const u=[];for(const d of r.tabs){if(!d||typeof d.chatId!="string"||d.chatId.length===0)continue;const f=typeof d.label=="string"&&d.label.length>0?d.label.slice(0,64):d.chatId.slice(0,6),p=typeof d.customLabel=="string"&&d.customLabel.trim().length>0?d.customLabel.slice(0,40):void 0;if(u.push({key:Br(),chatId:d.chatId,label:f,customLabel:p}),u.length>=wu)break}if(u.length===0)return null;const c=u.find(d=>d.chatId===r.activeChatId);return{tabs:u,activeKey:(c??u[0]).key}}catch{return null}}function v1(s,r){try{if(typeof localStorage>"u")return;const u=s.filter(f=>typeof f.chatId=="string"),c=s.find(f=>f.key===r),d={tabs:u.map(f=>({chatId:f.chatId,label:f.label,...f.customLabel?{customLabel:f.customLabel}:{}})),activeChatId:(c==null?void 0:c.chatId)??null};if(d.tabs.length===0){localStorage.removeItem(Eu);return}localStorage.setItem(Eu,JSON.stringify(d))}catch{}}function y1({meta:s,active:r,onState:u,onChatIdMinted:c,registerHandle:d}){const f=x1({initialChatId:s.chatId,active:r});N.useEffect(()=>(d(s.key,{send:f.send,markRead:f.markRead,submitAnswer:f.submitAnswer}),()=>d(s.key,null)),[s.key,f.send,f.markRead,f.submitAnswer,d]);const p=g1(f.messages,f.chatId),h=s.customLabel??p;N.useEffect(()=>{u({key:s.key,chatId:f.chatId,label:h,customLabel:s.customLabel,messages:f.messages,status:f.status,awaitingReply:f.awaitingReply,unread:f.unread,sendError:f.sendError,pendingQuestion:f.pendingQuestion})},[s.key,s.customLabel,f.chatId,h,f.messages,f.status,f.awaitingReply,f.unread,f.sendError,f.pendingQuestion,u]);const x=N.useRef(s.chatId);return N.useEffect(()=>{f.chatId&&f.chatId!==x.current&&(x.current=f.chatId,c(s.key,f.chatId,p))},[s.key,f.chatId,p,c]),null}function N1({children:s}){const r=N.useRef(void 0);if(r.current===void 0){const O=b1();r.current=O??(()=>{const _={key:Br(),chatId:null,label:"new chat"};return{tabs:[_],activeKey:_.key}})()}const[u,c]=N.useState(()=>r.current.tabs),[d,f]=N.useState(()=>r.current.activeKey);N.useEffect(()=>{!u.some(O=>O.key===d)&&u.length>0&&f(u[0].key)},[u,d]);const[p,h]=N.useState({}),x=N.useRef({}),g=N.useCallback((O,_)=>{_?x.current[O]=_:delete x.current[O]},[]),v=N.useCallback(O=>{h(_=>{const V=_[O.key];return V&&V.chatId===O.chatId&&V.label===O.label&&V.messages===O.messages&&V.status===O.status&&V.awaitingReply===O.awaitingReply&&V.unread===O.unread&&V.sendError===O.sendError&&V.pendingQuestion===O.pendingQuestion?_:{..._,[O.key]:O}})},[]),k=N.useCallback((O,_,V)=>{c(F=>F.map(I=>I.key===O?{...I,chatId:_,label:V}:I))},[]);N.useEffect(()=>{v1(u,d)},[u,d]);const w=N.useCallback(()=>{c(O=>{if(O.length>=wu)return O;const _=Br();return f(_),[...O,{key:_,chatId:null,label:"new chat"}]})},[]),G=N.useCallback(O=>{var _;f(O),(_=x.current[O])==null||_.markRead()},[]),R=N.useCallback((O,_)=>{const V=_.trim().slice(0,40);c(F=>F.map(I=>I.key===O?{...I,customLabel:V.length>0?V:void 0}:I))},[]),A=N.useCallback(O=>{c(_=>{const V=_.findIndex(I=>I.key===O);if(V<0)return _;const F=_.filter(I=>I.key!==O);if(F.length===0){const I={key:Br(),chatId:null,label:"new chat"};return f(I.key),[I]}return f(I=>{var te;if(I!==O)return I;const ue=F[Math.max(0,V-1)]??F[0];return(te=x.current[ue.key])==null||te.markRead(),ue.key}),F}),h(_=>{if(!(O in _))return _;const{[O]:V,...F}=_;return F})},[]),S=N.useCallback(O=>{const _=x.current[d];return _?_.send(O):Promise.resolve()},[d]),D=N.useCallback(O=>{const _=x.current[d];return _?_.submitAnswer(O):Promise.resolve(!1)},[d]),L=N.useMemo(()=>u.map(O=>p[O.key]??{key:O.key,chatId:O.chatId,label:O.label,messages:[],status:"connecting",awaitingReply:!1,unread:0,sendError:null,pendingQuestion:null}),[u,p]),J=L.find(O=>O.key===d)??L[0]??null,K=(J==null?void 0:J.sendError)??null,C=N.useMemo(()=>({conversations:L,activeId:d,active:J,sendError:K,send:S,submitAnswer:D,newConversation:w,closeConversation:A,switchConversation:G,renameConversation:R,canAddTab:u.length<wu}),[L,d,J,K,S,D,w,A,G,R,u.length]);return a.jsxs(Up.Provider,{value:C,children:[u.map(O=>a.jsx(y1,{meta:O,active:O.key===d,onState:v,onChatIdMinted:k,registerHandle:g},O.key)),s]})}function $p(){const s=N.useContext(Up);if(s===null)throw new Error("useBridgeStore must be used inside <BridgeProvider>");return s}function j1(){const s=$p(),r=s.active;return{messages:(r==null?void 0:r.messages)??[],status:(r==null?void 0:r.status)??"connecting",awaitingReply:(r==null?void 0:r.awaitingReply)??!1,chatId:(r==null?void 0:r.chatId)??null,sendError:s.sendError,send:s.send}}function qp({status:s,compact:r=!1}){const u={open:{color:"var(--ok)",label:"live"},connecting:{color:"var(--warn)",label:"connecting"},closed:{color:"var(--idle)",label:"offline"},error:{color:"var(--bad)",label:"relay down"}},{color:c,label:d}=u[s]??u.closed,f=r?"h-1.5 w-1.5":"h-2 w-2",p=r?"font-mono text-[10px]":"font-mono text-[12px]";return a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:`inline-block ${f} rounded-full ${s==="connecting"?"animate-pulse motion-reduce:animate-none":""}`,style:{background:c},"aria-hidden":!0}),a.jsx("span",{className:p,style:{color:"var(--ink-3)"},children:d})]})}function Hp({compact:s=!1}){const r=s?"h-1.5 w-1.5":"h-2 w-2",u=s?"text-[10px]":"text-[12px]",c=s?"px-1 py-1":"px-1 py-2";return a.jsxs("div",{className:`flex items-center gap-2 ${c}`,children:[a.jsxs("span",{className:"inline-flex gap-1","aria-hidden":!0,children:[a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)"}}),a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)",animationDelay:"150ms"}}),a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)",animationDelay:"300ms"}})]}),a.jsx("span",{className:u,style:{color:"var(--ink-3)"},children:"working…"})]})}function S1({msg:s}){return a.jsxs("div",{className:"cx-turn user",children:[a.jsx("div",{className:"cx-gutter","aria-hidden":!0,children:"›"}),a.jsx("div",{className:"cx-body whitespace-pre-wrap break-words",children:s.text})]})}function k1({text:s}){return a.jsx("div",{className:"cx-prose finding-md",dangerouslySetInnerHTML:{__html:os(s)}})}const _1=/^([\p{Emoji_Presentation}\p{Extended_Pictographic}🔧📡🗒]+)\s*/u;function E1(s){let r="",u=s.trim();const c=u.match(_1);c&&(r=c[1],u=u.slice(c[0].length).trim());const d=u.indexOf("→");if(d>=0){const p=u.slice(0,d+1).trim(),h=u.slice(d+1).trim();return{icon:r,label:p,agent:h}}const f=u.indexOf("·");if(f>=0){const p=u.slice(0,f+1).trim(),h=u.slice(f+1).trim();return{icon:r,label:p,cmd:h}}return{icon:r,label:"",cmd:u}}function w1({text:s}){const{icon:r,label:u,cmd:c,agent:d}=E1(s);return a.jsxs("div",{className:"cx-activity",children:[r&&a.jsx("span",{className:"cx-ic","aria-hidden":!0,children:r}),u&&a.jsx("span",{className:"cx-label",children:u}),d&&a.jsx("span",{className:"cx-agent",children:d}),c&&a.jsx("span",{className:!u&&!d?"cx-cmd cx-cmd-bare":"cx-cmd",children:c})]})}function T1({text:s}){return a.jsx("div",{className:"cx-activity",children:a.jsx("span",{className:"cx-cmd cx-cmd-bare",children:s})})}function A1({text:s}){return a.jsxs("div",{className:"cx-state err",role:"alert",children:[a.jsx("span",{className:"cx-chip-bad",children:"session error"}),a.jsx("span",{children:s})]})}function M1({pending:s,onSubmit:r,submitting:u=!1}){const[c,d]=N.useState(()=>{const R={};for(const A of s.questions)R[A.questionId]={selected:[],other:""};return R}),[f,p]=N.useState(!1),h=f||u,x=R=>c[R]??{selected:[],other:""},g=(R,A)=>{d(S=>({...S,[R]:{...x(R),selected:[A]}}))},v=(R,A)=>{d(S=>{const D=S[R]??{selected:[],other:""},J=D.selected.includes(A)?D.selected.filter(K=>K!==A):[...D.selected,A];return{...S,[R]:{...D,selected:J}}})},k=(R,A)=>{d(S=>({...S,[R]:{...x(R),other:A}}))},w=N.useMemo(()=>s.questions.every(R=>{const A=c[R.questionId]??{selected:[],other:""},S=R.allowOther===!0&&A.other.trim().length>0;return A.selected.length>0||S}),[s.questions,c]),G=async()=>{if(!w||h)return;const R=s.questions.map(A=>{const S=c[A.questionId]??{selected:[],other:""},D={questionId:A.questionId,selected:S.selected};return A.allowOther===!0&&S.other.trim().length>0&&(D.other=S.other.trim()),D});p(!0);try{await r(R)}finally{p(!1)}};return a.jsxs("div",{className:"cx-qcard",role:"group","aria-label":"Question from the live session",children:[s.questions.map(R=>{const A=x(R.questionId),S=R.multiSelect===!0,D=`q-${s.qid}-${R.questionId}`;return a.jsxs("fieldset",{className:"cx-qfield",children:[a.jsx("legend",{className:"cx-qlegend",children:R.header}),a.jsx("p",{className:"cx-qprompt",children:R.question}),a.jsx("div",{className:"cx-qoptions",role:S?"group":"radiogroup","aria-label":R.question,children:R.options.map(L=>{const J=A.selected.includes(L.label);return a.jsxs("label",{className:`cx-qopt${J?" is-selected":""}`,children:[a.jsx("input",{type:S?"checkbox":"radio",name:D,value:L.label,checked:J,disabled:h,onChange:()=>S?v(R.questionId,L.label):g(R.questionId,L.label),className:"cx-qinput"}),a.jsxs("span",{className:"cx-qopt-body",children:[a.jsx("span",{className:"cx-qopt-label",children:L.label}),L.description&&a.jsx("span",{className:"cx-qopt-desc",children:L.description})]})]},L.label)})}),R.allowOther===!0&&a.jsxs("label",{className:"cx-qother",children:[a.jsx("span",{className:"cx-qother-label",children:"Other"}),a.jsx("input",{type:"text",value:A.other,disabled:h,placeholder:"type a different answer…",onChange:L=>k(R.questionId,L.target.value),className:"cx-qother-input","aria-label":`Other answer for ${R.header}`})]})]},R.questionId)}),a.jsx("div",{className:"cx-qactions",children:a.jsx("button",{type:"button",className:"cx-qsubmit",onClick:G,disabled:!w||h,"aria-label":"Submit answer",children:h?"submitting…":"Submit answer"})})]})}function C1({msg:s}){switch(s.role){case"user":return a.jsx(S1,{msg:s});case"activity":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(w1,{text:s.text})})]})});case"ack":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(T1,{text:s.text})})]})});case"error":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(A1,{text:s.text})})]})});case"assistant":default:return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0,children:"●"}),a.jsx("div",{className:"cx-body",children:a.jsx(k1,{text:s.text})})]})})}}function R1(){return a.jsxs("div",{"aria-busy":"true","aria-label":"Loading transcript",children:[a.jsx("div",{className:"cx-skel",style:{width:"46%"}}),a.jsx("div",{className:"cx-skel",style:{width:"72%"}}),a.jsx("div",{className:"cx-skel",style:{width:"38%"}})]})}function O1(){return a.jsxs("div",{className:"cx-state",children:[a.jsx("span",{"aria-hidden":!0,children:"○"}),a.jsx("span",{children:"No activity yet — terminal session idle"})]})}function Ip({messages:s,status:r,pendingQuestion:u,onSubmitAnswer:c}){const d=s.length>0,f=u&&c?a.jsx(M1,{pending:u,onSubmit:c}):null;if(!d&&r==="connecting"&&!f)return a.jsx(R1,{});if(!d&&!f)return a.jsx(O1,{});const p=r==="error";return a.jsxs("div",{children:[p&&a.jsxs("div",{className:"cx-state err",role:"status",children:[a.jsx("span",{className:"cx-chip-bad",children:"relay disconnected"}),a.jsx("span",{className:"cx-dimmed",children:"showing last-known frames"})]}),a.jsx("div",{className:p?"cx-dimmed":void 0,children:s.map(h=>a.jsx(C1,{msg:h},h.id))}),f]})}function D1(){const[s,r]=N.useState(!1),[u,c]=N.useState(""),{messages:d,status:f,awaitingReply:p,chatId:h,send:x,sendError:g}=j1(),v=N.useRef(null),k=N.useRef(null);N.useEffect(()=>{if(!s)return;const A=v.current;A&&(A.scrollTop=A.scrollHeight)},[d,p,s]),N.useEffect(()=>{var A;s&&((A=k.current)==null||A.focus())},[s]);const w=()=>{const A=u.trim();A&&(x(A),c(""))},G=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),w())},R=()=>{r(!1),In("/chat")};return s?a.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex w-[360px] max-w-[calc(100vw-2rem)] flex-col rounded-xl",style:{height:"min(560px, calc(100vh - 6rem))",background:"var(--surface-elev)",border:"1px solid var(--border)",boxShadow:"var(--shadow-card)"},role:"region","aria-label":"Live Claude Code session chat",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},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:"h-section",children:"live claude code"}),a.jsx(qp,{status:f,compact:!0})]}),a.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:h?`chat ${h.slice(0,8)}`:"same session as your terminal"})]}),a.jsx("button",{type:"button",onClick:R,className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--ink-3)"},"aria-label":"Open full Chat page","data-tooltip":"Open full Chat page","data-tooltip-pos":"left",children:"⤢"}),a.jsx("button",{type:"button",onClick:()=>r(!1),className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--ink-3)"},"aria-label":"Minimize chat","data-tooltip":"Minimize chat","data-tooltip-pos":"left",children:"–"})]}),a.jsxs("div",{ref:v,className:"chat-surface flex-1 overflow-y-auto px-3 py-3",children:[a.jsx(Ip,{messages:d,status:f}),p&&a.jsx(Hp,{compact:!0})]}),g&&a.jsx("div",{role:"alert",className:"mx-3 mb-1 rounded-sm px-2 py-1 font-mono text-[10px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:g}),a.jsxs("div",{className:"flex items-end gap-2 border-t px-3 py-3",style:{borderColor:"var(--border)"},children:[a.jsx("textarea",{ref:k,value:u,onChange:A=>c(A.target.value),onKeyDown:G,rows:1,placeholder:"Message the live session…",className:"max-h-28 min-h-[36px] flex-1 resize-none rounded-md border px-3 py-2 text-[13px] focus:outline-none",style:{background:"var(--surface)",color:"var(--text)",borderColor:"var(--border)"}}),a.jsx("button",{type:"button",onClick:w,disabled:u.trim().length===0,className:"shrink-0 rounded-md px-3 py-2 text-sm font-medium transition-opacity disabled:opacity-40",style:{background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Send message",children:"Send"})]})]}):a.jsxs("button",{type:"button",onClick:()=>r(!0),className:"fixed bottom-5 right-5 z-50 flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-colors",style:{position:"fixed",background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Open live Claude Code chat","data-tooltip":"Talk to the live Claude Code session","data-tooltip-pos":"left",children:[a.jsx("span",{"aria-hidden":!0,children:"◎"}),a.jsx("span",{children:"Live session"})]})}function z1(s){const r=new Map;for(const u of s)r.set(u.day,(r.get(u.day)??0)+u.signals);return Array.from(r.entries()).sort(([u],[c])=>u.localeCompare(c)).map(([u,c])=>({day:u,agentId:"_fleet",accuracy:0,signals:c}))}function L1(){const[s,r]=N.useState(null);return N.useEffect(()=>{const u=new AbortController;return ot("fleet-trend?days=7").then(c=>{u.signal.aborted||r(z1(c.points))}).catch(()=>{u.signal.aborted||r([])}),()=>u.abort()},[]),s===null?null:s.length<2?a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-4)"},"aria-label":"no trend data yet",children:"—"}):a.jsx("div",{style:{width:"100%",paddingTop:"4px",paddingBottom:"4px"},children:a.jsx(Np,{points:s,width:240,height:28,color:"var(--c1)"})})}const B1=8;function U1({agents:s}){const r=s.map(c=>{const d=(c.scores.agreements??0)+(c.scores.uniqueFindings??0),f=(c.scores.hallucinations??0)+(c.scores.disagreements??0),p=d+f;return{id:c.id,pos:d,neg:f,total:p}}).filter(c=>c.total>0).sort((c,d)=>d.total-c.total).slice(0,B1);if(r.length===0)return null;const u=r[0].total;return a.jsxs("div",{style:{marginTop:"6px"},children:[a.jsx("span",{style:{display:"block",fontSize:"10px",fontVariant:"small-caps",letterSpacing:"0.04em",color:"var(--ink-4)",marginBottom:"6px"},children:"by agent"}),a.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"5px"},children:r.map(({id:c,pos:d,neg:f,total:p})=>{const h=u>0?p/u:0,x=p>0?d/p:0,g=p>0?f/p:0;return a.jsxs("li",{style:{display:"flex",flexDirection:"column",gap:"3px"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"6px",minWidth:0},children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1 1 0",minWidth:0},title:c,children:c}),a.jsxs("span",{className:"font-mono text-[10px]",style:{flexShrink:0,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[d>0&&a.jsxs("span",{style:{color:"var(--ok)"},children:["↑",d]}),d>0&&f>0&&a.jsx("span",{style:{color:"var(--ink-4)",margin:"0 2px"},children:" "}),f>0&&a.jsxs("span",{style:{color:"var(--bad)"},children:["↓",f]})]})]}),a.jsx("div",{style:{height:"3px",borderRadius:"1.5px",background:"var(--border)",overflow:"hidden"},"aria-hidden":!0,children:a.jsxs("div",{style:{height:"100%",width:`${Math.round(h*100)}%`,display:"flex",borderRadius:"1.5px",overflow:"hidden",transition:"width 200ms ease-out"},children:[d>0&&a.jsx("div",{style:{height:"100%",width:`${Math.round(x*100)}%`,background:"var(--ok)",flexShrink:0}}),f>0&&a.jsx("div",{style:{height:"100%",width:`${Math.round(g*100)}%`,background:"var(--bad)",flexShrink:0}})]})})]},c)})})]})}const lp=20,$1=7200*1e3,q1={"task.completed":"✓","consensus.completed":"◈"};function H1(s){const{type:r,payload:u}=s;if(r==="task.completed"){const c=typeof u.agentId=="string"?u.agentId:"";return c?`task · ${c}`:"task completed"}if(r==="consensus.completed"){const c=typeof u.consensusId=="string"?u.consensusId.slice(0,8):"";return c?`consensus ${c}`:"consensus done"}return r}function I1(s){const r=new Date(s);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function G1(s){const r=Date.now()-new Date(s).getTime();return r<0?"0s":r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m`:`${Math.floor(r/36e5)}h`}function Y1({tasks:s}){const r=Date.now(),u=s.filter(c=>r-new Date(c.startedAt).getTime()<$1);return a.jsxs("section",{children:[a.jsx("h2",{className:"h-section",style:{marginBottom:"8px",borderBottom:"1px solid var(--border)",paddingBottom:"6px"},children:"agents"}),u.length===0?a.jsx("p",{className:"text-[11px]",style:{color:"var(--ink-3)",margin:0,lineHeight:1.5},children:"No agents dispatched — fleet idle"}):a.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"6px"},children:u.map(c=>a.jsx(X1,{task:c},c.taskId))})]})}function X1({task:s}){const r=_n(s.agentId);return a.jsxs("li",{className:"agent-working-row",style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",borderRadius:"var(--r-md)",background:"color-mix(in srgb, var(--surface) 30%, transparent)",border:"1px solid var(--border)",transition:"background 100ms ease-out"},children:[a.jsx("span",{className:"agent-working-dot shrink-0 mt-[3px]",style:{"--dot-color":r},"aria-hidden":!0}),a.jsxs("div",{style:{flex:1,minWidth:0},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"},children:[a.jsx("span",{className:"font-mono text-[11px] font-medium truncate",style:{color:"var(--ink-2)"},children:s.agentId}),a.jsx("span",{className:"font-mono text-[10px] shrink-0 tabular-nums",style:{color:"var(--ink-3)"},children:G1(s.startedAt)})]}),s.task&&a.jsx("span",{className:"text-[11px] block truncate",style:{color:"var(--ink-3)",marginTop:"1px",lineHeight:1.4},title:s.task,children:s.task})]})]})}function K1({events:s}){return a.jsxs("section",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:"8px"},children:[a.jsx("h2",{className:"h-section shrink-0",style:{borderBottom:"1px solid var(--border)",paddingBottom:"6px"},children:"activity"}),s.length===0&&a.jsx("p",{className:"text-[11px] shrink-0",style:{color:"var(--ink-3)",margin:"0 0 2px",lineHeight:1.5},children:"No recent activity — fleet idle"}),a.jsx("div",{className:"shrink-0",children:a.jsx(L1,{})}),s.length>0&&a.jsx("ul",{"aria-label":"Recent activity",style:{flex:1,minHeight:0,overflowY:"auto",listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"2px"},children:s.map(r=>a.jsx(V1,{event:r},r.id))})]})}function V1({event:s}){const r=q1[s.type]??"·",u=H1(s),c=I1(s.ts);return a.jsxs("li",{className:"activity-event-row",style:{display:"flex",alignItems:"center",gap:"6px",padding:"4px 6px",borderRadius:"var(--r-sm)",transition:"background 100ms ease-out"},children:[c&&a.jsx("span",{className:"font-mono text-[10px] shrink-0 tabular-nums",style:{color:"var(--ink-3)"},"aria-hidden":!0,children:c}),a.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--info)",minWidth:"10px",textAlign:"center"},"aria-hidden":!0,children:r}),a.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--ink-2)",lineHeight:1.4},children:u})]})}function Q1({status:s,chatId:r}){const[u,c]=N.useState([]),[d,f]=N.useState({gitBranch:null,projectName:null,activeTasks:0}),[p,h]=N.useState(null),[x,g]=N.useState(null),[v,k]=N.useState([]),[,w]=N.useState(0);N.useEffect(()=>{const A=new AbortController;return ot("session").then(S=>{A.signal.aborted||f({gitBranch:S.gitBranch??null,projectName:S.projectName??null,activeTasks:typeof S.activeTasks=="number"?S.activeTasks:0})}).catch(()=>{}),()=>A.abort()},[]),N.useEffect(()=>{const A=new AbortController;return ot("signal-activity").then(S=>{A.signal.aborted||typeof S.total=="number"&&h(S.total)}).catch(()=>{}),()=>A.abort()},[]),N.useEffect(()=>{const A=new AbortController;return ot("agents").then(S=>{if(!A.signal.aborted&&Array.isArray(S)){const D=S.filter(L=>typeof L=="object"&&L!==null&&typeof L.id=="string"&&typeof L.scores=="object"&&L.scores!==null);g(D)}}).catch(()=>{}),()=>A.abort()},[]),N.useEffect(()=>{let A=!1;const S=async()=>{try{const L=await ot("active-tasks");A||k(L.tasks||[])}catch{}};S();const D=setInterval(()=>{S()},5e3);return()=>{A=!0,clearInterval(D)}},[]),N.useEffect(()=>{if(v.length===0)return;const A=setInterval(()=>w(S=>S+1),1e3);return()=>clearInterval(A)},[v.length]);const G=N.useCallback(A=>{c(S=>{const D=[A,...S];return D.length>lp?D.slice(0,lp):D})},[]);Bp(G);const R=typeof d.gitBranch=="string"&&d.gitBranch.length>0;return a.jsxs("aside",{className:"chat-surface",style:{width:"100%",minWidth:0,border:"1px solid var(--border)",borderRadius:"var(--r-lg)",padding:"14px 14px",display:"flex",flexDirection:"column",gap:"14px",alignSelf:"stretch",overflow:"hidden"},"aria-label":"Session info and live activity",children:[a.jsxs("section",{className:"shrink-0",children:[a.jsx("h2",{className:"h-section",style:{marginBottom:"8px",borderBottom:"1px solid var(--border)",paddingBottom:"6px"},children:"session"}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[a.jsx(qp,{status:s,compact:!0}),r&&a.jsx("span",{className:"font-mono text-[10px] truncate",style:{color:"var(--ink-3)"},title:r,children:r}),R&&a.jsxs("span",{className:"font-mono text-[10px] truncate",style:{color:"var(--ink-3)"},title:`${d.projectName} · ${d.gitBranch}`,children:[d.projectName," · ",d.gitBranch]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{style:{color:"var(--ink-2)",fontWeight:500},children:d.activeTasks})," ","tasks"]}),p!==null&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{style:{color:"var(--ink-2)",fontWeight:500},children:p})," ","signals · 24h"]})]}),x!==null&&x.length>0&&a.jsx(U1,{agents:x})]})]}),a.jsx("div",{className:"shrink-0",children:a.jsx(Y1,{tasks:v})}),a.jsx(K1,{events:u})]})}function Z1({conversations:s,activeId:r,canAddTab:u,onSwitch:c,onClose:d,onNew:f,onRename:p}){const h=N.useRef({}),[x,g]=N.useState(null),[v,k]=N.useState(""),w=(D,L)=>{var C;if(D.key==="F2"){D.preventDefault();const O=s[L];O&&G(O);return}if(D.key!=="ArrowLeft"&&D.key!=="ArrowRight")return;D.preventDefault();const J=D.key==="ArrowRight"?1:-1,K=s[(L+J+s.length)%s.length];K&&((C=h.current[K.key])==null||C.focus())},G=N.useCallback(D=>{g(D.key),k(D.customLabel??D.label)},[]),R=N.useCallback(D=>{p(D,v),g(null),requestAnimationFrame(()=>{var L;(L=h.current[D])==null||L.focus()})},[v,p]),A=N.useCallback(D=>{g(null),requestAnimationFrame(()=>{var L;(L=h.current[D])==null||L.focus()})},[]),S=N.useCallback((D,L)=>{D.key==="Enter"?(D.preventDefault(),R(L)):D.key==="Escape"&&(D.preventDefault(),A(L))},[R,A]);return a.jsxs("div",{className:"cx-tabstrip shrink-0",role:"tablist","aria-label":"Conversations",children:[a.jsx("div",{className:"cx-tabstrip-scroll",children:s.map((D,L)=>{const J=D.key===r,K=D.key===x,C=!D.customLabel&&!!D.chatId&&D.label===D.chatId.slice(0,6),O=!J&&D.unread>0;return a.jsxs("div",{className:`cx-tab ${J?"is-active":""}`,children:[K?a.jsx("input",{className:"cx-tab-rename-input",type:"text",value:v,maxLength:40,"aria-label":"Rename conversation",autoFocus:!0,onChange:_=>k(_.target.value),onKeyDown:_=>S(_,D.key),onBlur:()=>R(D.key),onClick:_=>_.stopPropagation()}):a.jsxs("button",{ref:_=>{h.current[D.key]=_},type:"button",role:"tab","aria-selected":J,tabIndex:J?0:-1,className:"cx-tab-btn",onClick:()=>c(D.key),onDoubleClick:_=>{_.preventDefault(),G(D)},onKeyDown:_=>w(_,L),title:D.chatId??"new conversation","aria-label":`${D.label}${O?`, ${D.unread} unread`:""}`,children:[O&&a.jsx("span",{className:"cx-tab-unread","aria-hidden":"true"}),a.jsx("span",{className:C?"cx-tab-label font-mono":"cx-tab-label",children:D.label})]}),a.jsx("button",{type:"button",className:"cx-tab-close",onClick:_=>{_.stopPropagation(),d(D.key)},"aria-label":`Close conversation ${D.label}`,title:"Close conversation",children:"×"})]},D.key)})}),a.jsx("button",{type:"button",className:"cx-tab-new shrink-0",onClick:f,disabled:!u,"aria-label":"New conversation",title:u?"New conversation":"Maximum conversations open",children:"+"})]})}function F1(){const{conversations:s,activeId:r,active:u,sendError:c,send:d,submitAnswer:f,newConversation:p,closeConversation:h,switchConversation:x,renameConversation:g,canAddTab:v}=$p(),[k,w]=N.useState(""),G=(u==null?void 0:u.messages)??[],R=(u==null?void 0:u.status)??"connecting",A=(u==null?void 0:u.awaitingReply)??!1,S=(u==null?void 0:u.chatId)??null,D=(u==null?void 0:u.pendingQuestion)??null,L=N.useRef(null),J=N.useRef(null);N.useEffect(()=>{const F=L.current;F&&(F.scrollTop=F.scrollHeight)},[G,A,r,D]),N.useEffect(()=>{var F;(F=J.current)==null||F.focus()},[r]);const K=()=>{const F=k.trim();F&&(d(F),w(""))},C=F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),K())},O={open:{color:"var(--ok)",label:"live"},connecting:{color:"var(--warn)",label:"connecting"},closed:{color:"var(--idle)",label:"offline"},error:{color:"var(--bad)",label:"down"}},{color:_,label:V}=O[R]??O.closed;return a.jsx("div",{className:"flex flex-col",style:{height:"100%",minHeight:0,overflow:"hidden",padding:"16px 24px",boxSizing:"border-box",gap:"0"},children:a.jsxs("div",{className:"flex flex-col gap-4 lg:grid",style:{flex:1,minHeight:0,gridTemplateColumns:"1fr 288px",alignItems:"stretch",height:"100%"},children:[a.jsxs("div",{className:"chat-surface flex flex-col",style:{minHeight:0,border:"1px solid var(--border)",borderRadius:"var(--r-lg)",overflow:"hidden"},children:[a.jsxs("div",{className:"chat-info-bar flex items-center gap-3 shrink-0",style:{padding:"10px 16px",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--surface) 80%, var(--bg))",minHeight:"44px",flexWrap:"wrap",rowGap:"4px"},children:[a.jsx("span",{className:"h-section h-section--lg shrink-0",children:"chat"}),a.jsx("span",{"aria-hidden":!0,style:{width:"1px",height:"20px",background:"var(--border)",flexShrink:0}}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 shrink-0",children:[a.jsx("span",{className:`inline-block h-2 w-2 rounded-full shrink-0 ${R==="connecting"?"animate-pulse motion-reduce:animate-none":""}`,style:{background:_},"aria-hidden":!0}),a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},"aria-label":`Bridge status: ${V}`,children:V})]}),S&&a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,style:{width:"1px",height:"20px",background:"var(--border)",flexShrink:0}}),a.jsx("span",{className:"font-mono text-[11px] truncate",style:{color:"var(--ink-3)",maxWidth:"160px"},title:S,"aria-label":`Chat ID: ${S}`,children:S})]}),a.jsx("span",{style:{flex:1}}),a.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--ink-3)",letterSpacing:"0.03em"},"aria-hidden":!0,children:"cc transcript"})]}),a.jsx(Z1,{conversations:s,activeId:r,canAddTab:v,onSwitch:x,onClose:h,onNew:p,onRename:g}),a.jsxs("div",{ref:L,className:"flex-1 overflow-y-auto",style:{padding:"16px 16px 8px",minHeight:0},children:[a.jsx(Ip,{messages:G,status:R,pendingQuestion:D,onSubmitAnswer:f}),A&&a.jsx(Hp,{compact:!1})]}),c&&a.jsx("div",{role:"alert",className:"mx-4 mb-2 rounded px-3 py-1.5 font-mono text-[11px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:c}),a.jsxs("div",{className:"flex items-end gap-2.5 border-t shrink-0",style:{borderColor:"var(--border)",padding:"12px 16px",background:"color-mix(in srgb, var(--surface) 60%, var(--bg))"},children:[a.jsx("textarea",{ref:J,value:k,onChange:F=>w(F.target.value),onKeyDown:C,rows:2,placeholder:"Message the live session… (Enter to send)","aria-label":"Compose message",className:"flex-1 resize-none text-[13px] focus:outline-none",style:{background:"color-mix(in srgb, var(--surface) 50%, var(--bg))",color:"var(--ink)",border:"1px solid var(--border)",borderRadius:"var(--r-md)",padding:"10px 12px",minHeight:"60px",maxHeight:"140px",boxSizing:"border-box",outline:"none",transition:"border-color 100ms ease-out, box-shadow 100ms ease-out",fontFamily:"var(--font-sans)",lineHeight:"1.5"},onFocus:F=>{F.currentTarget.style.borderColor="color-mix(in srgb, var(--accent) 60%, var(--border))",F.currentTarget.style.boxShadow="0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent)"},onBlur:F=>{F.currentTarget.style.borderColor="var(--border)",F.currentTarget.style.boxShadow="none"}}),a.jsxs("button",{type:"button",onClick:K,disabled:k.trim().length===0,className:"chat-send-btn shrink-0 rounded-lg flex items-center gap-1.5 font-medium",style:{padding:"10px 14px",fontSize:"13px",minHeight:"40px"},"aria-label":"Send message",children:[a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),"Send"]})]})]}),a.jsx(Q1,{status:R,chatId:S})]})})}function J1({agents:s,tasks:r,consensusReports:u,fleetTrend:c}){const[d,f]=N.useState("weight"),[p,h]=N.useState("desc"),[x,g]=N.useState(""),v=N.useMemo(()=>{const C=new Map;if(r)for(const O of r.items){const _=C.get(O.agentId);(!_||O.timestamp>_.timestamp)&&C.set(O.agentId,O)}return C},[r]);Mp(u==null?void 0:u.reports),N.useMemo(()=>{const C=new Map;if(c){for(const O of c.points){const _=C.get(O.agentId)??[];_.push(O),C.set(O.agentId,_)}for(const O of C.values())O.sort((_,V)=>_.day.localeCompare(V.day))}return C},[c]);const k=s.filter(av).length,w=s.filter(C=>C.scores.accuracy>=.5).length,G=s.reduce((C,O)=>C+O.scores.signals,0),R=s.reduce((C,O)=>C+O.totalTokens,0),A=x.trim().toLowerCase(),S=A?s.filter(C=>C.id.toLowerCase().includes(A)||C.provider.toLowerCase().includes(A)||C.model.toLowerCase().includes(A)):s,D=C=>{const O=C.scores;switch(d){case"weight":return O.dispatchWeight;case"accuracy":return O.accuracy;case"uniqueness":return O.uniqueness;case"impact":return O.impactScore;case"signals":return O.signals;case"agreements":return O.agreements;case"hallucinations":return O.hallucinations;case"lastTask":{const _=v.get(C.id);return _?new Date(_.timestamp).getTime():0}}},L=[...S].sort((C,O)=>{const _=D(C),V=D(O);return p==="desc"?V-_:_-V}),J=C=>{d===C?h(O=>O==="desc"?"asc":"desc"):(f(C),h("desc"))},K=C=>d===C?p==="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:s.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:w,varColor:"var(--ok)"},{label:"Benched",value:k,varColor:k>0?"var(--bad)":"var(--ink-3)"},{label:"Total Signals",value:G.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:R.toLocaleString(),varColor:"var(--ink)"}].map(C=>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:C.varColor},children:C.value}),a.jsx("div",{className:"h-section mt-0.5",children:C.label})]},C.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:x,onChange:C=>g(C.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:()=>J("weight"),children:["Weight ",K("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:()=>J("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",K("accuracy")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>J("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",K("uniqueness")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>J("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",K("impact")]})]})}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>J("signals"),children:["Signals ",K("signals")]}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>J("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",K("hallucinations")]}),a.jsxs("th",{className:"h-section py-2.5 pr-5 text-left cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>J("lastTask"),children:["Last Task ",K("lastTask")]})]})}),a.jsx("tbody",{children:L.map((C,O)=>{const _=C.scores,V=v.get(C.id),F=_.dispatchWeight>=1.2?"var(--ok)":_.dispatchWeight>=.8?"var(--ink)":"var(--bad)",I=O+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:I===1?"var(--ink)":I===2||I===3?"color-mix(in oklch, var(--ink-2) 80%, transparent)":"var(--ink-3)",fontWeight:I===1?"bold":I<=3?600:void 0},children:I})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(C.id)}`,className:"flex items-center gap-3",children:[a.jsx(di,{agentId:C.id,size:32,signals:_.signals,accuracy:_.accuracy,uniqueness:_.uniqueness,impact:_.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:C.id}),(()=>{const ue=Ru(_);return ue==="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 (${_.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):ue==="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"}):ue==="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 (${_.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:[C.provider,"/",C.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:F},children:_.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(pu,{label:"A",value:_.accuracy,fillClass:_.accuracy>=.7?"bg-confirmed":_.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(pu,{label:"U",value:_.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(pu,{label:"I",value:_.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:_.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:_.hallucinations>0?"var(--bad)":"var(--ink-3)",fontWeight:_.hallucinations>10?"bold":void 0},"data-tooltip":`Agreements ${_.agreements} · Disagreements ${_.disagreements} · Hallucinations ${_.hallucinations}`,children:_.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:V?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:V.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:V.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:_t(V.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},C.id)})})]})})]})}function pu({label:s,value:r,fillClass:u,tooltip:c}){return a.jsxs("div",{className:"flex items-center gap-2","data-tooltip":c,"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:s}),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 W1({tasks:s}){const[r,u]=N.useState(""),[c,d]=N.useState(0),[f,p]=N.useState(null),h=100,x=s.items.filter(S=>S.status==="completed").length,g=s.items.filter(S=>S.status==="failed").length,v=s.items.filter(S=>S.status==="running").length,k=r.trim().toLowerCase(),w=k?s.items.filter(S=>{var D,L,J,K;return((D=S.task)==null?void 0:D.toLowerCase().includes(k))||((L=S.agentId)==null?void 0:L.toLowerCase().includes(k))||((J=S.taskId)==null?void 0:J.toLowerCase().includes(k))||((K=S.status)==null?void 0:K.toLowerCase().includes(k))}):s.items,G=Math.max(1,Math.ceil(w.length/h)),R=Math.min(c,G-1),A=w.slice(R*h,(R+1)*h);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:s.total})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:x})," completed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:g})," failed"]}),v>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:v})," running"]}),a.jsxs("span",{children:["showing ",A.length," of ",w.length,k&&` (filtered from ${s.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:r,onChange:S=>{u(S.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:color-mix(in_oklch,var(--accent)_40%,transparent)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] ${G<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>d(S=>Math.max(0,S-1)),disabled:R===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:[R+1," / ",G]}),a.jsx("button",{onClick:()=>d(S=>Math.min(G-1,S+1)),disabled:R>=G-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:A.length===0?k?a.jsx("div",{className:"py-12 text-center text-sm",style:{color:"var(--ink-3)"},children:"No tasks match your search."}):a.jsx(bl,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):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:"Kind"}),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:A.map(S=>a.jsx(zp,{task:S,onClick:p},S.taskId))})]})}),a.jsx(Op,{task:f,onClose:()=>p(null)})]})}function P1({consensus:s,consensusReports:r}){const[u,c]=N.useState(!1),d=u?s.runs:s.runs.filter(g=>!g.retracted),f=s.runs.filter(g=>g.retracted).length,p=d.reduce((g,v)=>g+(v.counts.agreement||0),0),h=d.reduce((g,v)=>g+((v.counts.disagreement||0)+(v.counts.hallucination||0)),0),x=d.reduce((g,v)=>g+(v.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Consensus Rounds"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:d.length}),!u&&f>0&&a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:["/ ",s.totalRuns??s.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:p})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:h})," disputed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:x})," unverified"]}),a.jsxs("span",{children:[s.totalSignals," total signals"]})]}),f>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?`${f} retracted run${f===1?"":"s"} shown`:`${f} retracted run${f===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>c(g=>!g),className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 text-[10px] transition hover:bg-accent/10 hover:[color:var(--ink)]",style:{background:"var(--surface-elev)"},children:u?"hide":"show"})]})]}),a.jsx(n0,{consensus:s,filteredRuns:d,reports:r,showAll:!0,hideHeader:!0})]})}function eN({onUnauthorized:s}){const r=sp(),{overview:u,agents:c,tasks:d,consensus:f,consensusReports:p,fleetTrend:h,signalActivity:x,skills:g,loading:v,error:k,refresh:w}=s1(s),[G,R]=N.useState(0),A=N.useCallback(_=>{_.type!=="log_lines"&&w()},[w]);if(Tp(A),!v&&k&&(!u||!f))return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(uu,{}),a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border p-8 text-center",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsx("p",{className:"mb-2 text-sm font-semibold",style:{color:"var(--bad)"},children:"Dashboard fetch failed"}),a.jsx("p",{className:"mb-4 font-mono text-xs",style:{color:"var(--bad)"},children:k}),a.jsx("p",{className:"text-xs",style:{color:"var(--ink-3)"},children:"Relay may be restarting — retrying every 5s. Check the relay terminal if this persists."})]})})]});if(v||!u||!f)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(uu,{}),a.jsx(C0,{})]});let S;const D=r.match(/^\/agent\/(.+)$/),L=r.match(/^\/consensus\/(.+)$/),J=lb("/tasks/:id",r);if(D&&c){const _=decodeURIComponent(D[1]);S=a.jsx($0,{agentId:_,agents:c,tasks:d,consensus:f})}else if(L){const _=decodeURIComponent(L[1]);S=a.jsx(Ry,{consensusId:_})}else J?S=a.jsx(By,{taskId:J,tasks:d}):r==="/team"?S=c?a.jsx(J1,{agents:c,tasks:d,consensusReports:p,fleetTrend:h}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(R0,{})}):r==="/tasks"?S=d?a.jsx(W1,{tasks:d}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(O0,{})}):r==="/debates"?S=f?a.jsx(P1,{consensus:f,consensusReports:p}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(D0,{})}):r==="/chat"?S=a.jsx(F1,{}):r==="/logs"?S=a.jsx(Y0,{}):r==="/signals"?S=a.jsx(e1,{}):r==="/violations"?S=a.jsx(s0,{}):S=a.jsx(yy,{overview:u,agents:c,tasks:d,consensus:f,consensusReports:p,fleetTrend:h,signalActivity:x,skills:g,activeTaskCount:G,setActiveTaskCount:R});const C=r==="/"||r==="/overview"||!/^\/(agent\/|consensus\/|tasks\/|team|tasks|debates|logs|signals|violations|chat)/.test(r)?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6",O=r==="/chat";return a.jsxs("div",{className:O?"flex h-screen flex-col overflow-hidden":"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(uu,{}),O?a.jsx("main",{className:"min-h-0 flex-1",children:S}):a.jsx("main",{className:C,children:S})]})}function tN(){const{authed:s,login:r,error:u,recheck:c}=n1();return s===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center",style:{color:"var(--ink-3)"},children:"Loading..."}):s?a.jsxs(N1,{children:[a.jsx(eN,{onUnauthorized:c}),a.jsx(d1,{}),a.jsx(D1,{})]}):a.jsx(Uy,{onLogin:r,error:u})}ab.createRoot(document.getElementById("root")).render(a.jsx(N.StrictMode,{children:a.jsx(tN,{})}));
|