gossipcat 0.4.22 → 0.4.23

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.
@@ -0,0 +1,71 @@
1
+ var Ix=Object.defineProperty;var Px=(c,u,f)=>u in c?Ix(c,u,{enumerable:!0,configurable:!0,writable:!0,value:f}):c[u]=f;var Pe=(c,u,f)=>Px(c,typeof u!="symbol"?u+"":u,f);(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const j of h.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&o(j)}).observe(document,{childList:!0,subtree:!0});function f(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=f(d);fetch(d.href,h)}})();var wu={exports:{}},Va={};/**
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 Jf;function eg(){if(Jf)return Va;Jf=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(o,d,h){var j=null;if(h!==void 0&&(j=""+h),d.key!==void 0&&(j=""+d.key),"key"in d){h={};for(var v in d)v!=="key"&&(h[v]=d[v])}else h=d;return d=h.ref,{$$typeof:c,type:o,key:j,ref:d!==void 0?d:null,props:h}}return Va.Fragment=u,Va.jsx=f,Va.jsxs=f,Va}var Ff;function tg(){return Ff||(Ff=1,wu.exports=eg()),wu.exports}var a=tg(),Du={exports:{}},me={};/**
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 Wf;function ng(){if(Wf)return me;Wf=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),j=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),H=Symbol.iterator;function Q(g){return g===null||typeof g!="object"?null:(g=H&&g[H]||g["@@iterator"],typeof g=="function"?g:null)}var F={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,X={};function de(g,D,Y){this.props=g,this.context=D,this.refs=X,this.updater=Y||F}de.prototype.isReactComponent={},de.prototype.setState=function(g,D){if(typeof g!="object"&&typeof g!="function"&&g!=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,g,D,"setState")},de.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function Z(){}Z.prototype=de.prototype;function K(g,D,Y){this.props=g,this.context=D,this.refs=X,this.updater=Y||F}var V=K.prototype=new Z;V.constructor=K,W(V,de.prototype),V.isPureReactComponent=!0;var O=Array.isArray;function ae(){}var G={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ue(g,D,Y){var L=Y.ref;return{$$typeof:c,type:g,key:D,ref:L!==void 0?L:null,props:Y}}function oe(g,D){return ue(g.type,D,g.props)}function Se(g){return typeof g=="object"&&g!==null&&g.$$typeof===c}function J(g){var D={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(Y){return D[Y]})}var ie=/\/+/g;function he(g,D){return typeof g=="object"&&g!==null&&g.key!=null?J(""+g.key):D.toString(36)}function A(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status=="string"?g.then(ae,ae):(g.status="pending",g.then(function(D){g.status==="pending"&&(g.status="fulfilled",g.value=D)},function(D){g.status==="pending"&&(g.status="rejected",g.reason=D)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function S(g,D,Y,L,ne){var ce=typeof g;(ce==="undefined"||ce==="boolean")&&(g=null);var pe=!1;if(g===null)pe=!0;else switch(ce){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(g.$$typeof){case c:case u:pe=!0;break;case E:return pe=g._init,S(pe(g._payload),D,Y,L,ne)}}if(pe)return ne=ne(g),pe=L===""?"."+he(g,0):L,O(ne)?(Y="",pe!=null&&(Y=pe.replace(ie,"$&/")+"/"),S(ne,D,Y,"",function(Lt){return Lt})):ne!=null&&(Se(ne)&&(ne=oe(ne,Y+(ne.key==null||g&&g.key===ne.key?"":(""+ne.key).replace(ie,"$&/")+"/")+pe)),D.push(ne)),1;pe=0;var Be=L===""?".":L+":";if(O(g))for(var fe=0;fe<g.length;fe++)L=g[fe],ce=Be+he(L,fe),pe+=S(L,D,Y,ce,ne);else if(fe=Q(g),typeof fe=="function")for(g=fe.call(g),fe=0;!(L=g.next()).done;)L=L.value,ce=Be+he(L,fe++),pe+=S(L,D,Y,ce,ne);else if(ce==="object"){if(typeof g.then=="function")return S(A(g),D,Y,L,ne);throw D=String(g),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return pe}function q(g,D,Y){if(g==null)return g;var L=[],ne=0;return S(g,L,"","",function(ce){return D.call(Y,ce,ne++)}),L}function $(g){if(g._status===-1){var D=g._result;D=D(),D.then(function(Y){(g._status===0||g._status===-1)&&(g._status=1,g._result=Y)},function(Y){(g._status===0||g._status===-1)&&(g._status=2,g._result=Y)}),g._status===-1&&(g._status=0,g._result=D)}if(g._status===1)return g._result.default;throw g._result}var R=typeof reportError=="function"?reportError:function(g){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof g=="object"&&g!==null&&typeof g.message=="string"?String(g.message):String(g),error:g});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",g);return}console.error(g)},I={map:q,forEach:function(g,D,Y){q(g,function(){D.apply(this,arguments)},Y)},count:function(g){var D=0;return q(g,function(){D++}),D},toArray:function(g){return q(g,function(D){return D})||[]},only:function(g){if(!Se(g))throw Error("React.Children.only expected to receive a single React element child.");return g}};return me.Activity=w,me.Children=I,me.Component=de,me.Fragment=f,me.Profiler=d,me.PureComponent=K,me.StrictMode=o,me.Suspense=b,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,me.__COMPILER_RUNTIME={__proto__:null,c:function(g){return G.H.useMemoCache(g)}},me.cache=function(g){return function(){return g.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(g,D,Y){if(g==null)throw Error("The argument must be a React element, but you passed "+g+".");var L=W({},g.props),ne=g.key;if(D!=null)for(ce in D.key!==void 0&&(ne=""+D.key),D)!te.call(D,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&D.ref===void 0||(L[ce]=D[ce]);var ce=arguments.length-2;if(ce===1)L.children=Y;else if(1<ce){for(var pe=Array(ce),Be=0;Be<ce;Be++)pe[Be]=arguments[Be+2];L.children=pe}return ue(g.type,ne,L)},me.createContext=function(g){return g={$$typeof:j,_currentValue:g,_currentValue2:g,_threadCount:0,Provider:null,Consumer:null},g.Provider=g,g.Consumer={$$typeof:h,_context:g},g},me.createElement=function(g,D,Y){var L,ne={},ce=null;if(D!=null)for(L in D.key!==void 0&&(ce=""+D.key),D)te.call(D,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(ne[L]=D[L]);var pe=arguments.length-2;if(pe===1)ne.children=Y;else if(1<pe){for(var Be=Array(pe),fe=0;fe<pe;fe++)Be[fe]=arguments[fe+2];ne.children=Be}if(g&&g.defaultProps)for(L in pe=g.defaultProps,pe)ne[L]===void 0&&(ne[L]=pe[L]);return ue(g,ce,ne)},me.createRef=function(){return{current:null}},me.forwardRef=function(g){return{$$typeof:v,render:g}},me.isValidElement=Se,me.lazy=function(g){return{$$typeof:E,_payload:{_status:-1,_result:g},_init:$}},me.memo=function(g,D){return{$$typeof:x,type:g,compare:D===void 0?null:D}},me.startTransition=function(g){var D=G.T,Y={};G.T=Y;try{var L=g(),ne=G.S;ne!==null&&ne(Y,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(ae,R)}catch(ce){R(ce)}finally{D!==null&&Y.types!==null&&(D.types=Y.types),G.T=D}},me.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},me.use=function(g){return G.H.use(g)},me.useActionState=function(g,D,Y){return G.H.useActionState(g,D,Y)},me.useCallback=function(g,D){return G.H.useCallback(g,D)},me.useContext=function(g){return G.H.useContext(g)},me.useDebugValue=function(){},me.useDeferredValue=function(g,D){return G.H.useDeferredValue(g,D)},me.useEffect=function(g,D){return G.H.useEffect(g,D)},me.useEffectEvent=function(g){return G.H.useEffectEvent(g)},me.useId=function(){return G.H.useId()},me.useImperativeHandle=function(g,D,Y){return G.H.useImperativeHandle(g,D,Y)},me.useInsertionEffect=function(g,D){return G.H.useInsertionEffect(g,D)},me.useLayoutEffect=function(g,D){return G.H.useLayoutEffect(g,D)},me.useMemo=function(g,D){return G.H.useMemo(g,D)},me.useOptimistic=function(g,D){return G.H.useOptimistic(g,D)},me.useReducer=function(g,D,Y){return G.H.useReducer(g,D,Y)},me.useRef=function(g){return G.H.useRef(g)},me.useState=function(g){return G.H.useState(g)},me.useSyncExternalStore=function(g,D,Y){return G.H.useSyncExternalStore(g,D,Y)},me.useTransition=function(){return G.H.useTransition()},me.version="19.2.4",me}var If;function Vu(){return If||(If=1,Du.exports=ng()),Du.exports}var C=Vu(),Ou={exports:{}},Za={},Ru={exports:{}},Uu={};/**
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 Pf;function lg(){return Pf||(Pf=1,(function(c){function u(S,q){var $=S.length;S.push(q);e:for(;0<$;){var R=$-1>>>1,I=S[R];if(0<d(I,q))S[R]=q,S[$]=I,$=R;else break e}}function f(S){return S.length===0?null:S[0]}function o(S){if(S.length===0)return null;var q=S[0],$=S.pop();if($!==q){S[0]=$;e:for(var R=0,I=S.length,g=I>>>1;R<g;){var D=2*(R+1)-1,Y=S[D],L=D+1,ne=S[L];if(0>d(Y,$))L<I&&0>d(ne,Y)?(S[R]=ne,S[L]=$,R=L):(S[R]=Y,S[D]=$,R=D);else if(L<I&&0>d(ne,$))S[R]=ne,S[L]=$,R=L;else break e}}return q}function d(S,q){var $=S.sortIndex-q.sortIndex;return $!==0?$:S.id-q.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;c.unstable_now=function(){return h.now()}}else{var j=Date,v=j.now();c.unstable_now=function(){return j.now()-v}}var b=[],x=[],E=1,w=null,H=3,Q=!1,F=!1,W=!1,X=!1,de=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function V(S){for(var q=f(x);q!==null;){if(q.callback===null)o(x);else if(q.startTime<=S)o(x),q.sortIndex=q.expirationTime,u(b,q);else break;q=f(x)}}function O(S){if(W=!1,V(S),!F)if(f(b)!==null)F=!0,ae||(ae=!0,J());else{var q=f(x);q!==null&&A(O,q.startTime-S)}}var ae=!1,G=-1,te=5,ue=-1;function oe(){return X?!0:!(c.unstable_now()-ue<te)}function Se(){if(X=!1,ae){var S=c.unstable_now();ue=S;var q=!0;try{e:{F=!1,W&&(W=!1,Z(G),G=-1),Q=!0;var $=H;try{t:{for(V(S),w=f(b);w!==null&&!(w.expirationTime>S&&oe());){var R=w.callback;if(typeof R=="function"){w.callback=null,H=w.priorityLevel;var I=R(w.expirationTime<=S);if(S=c.unstable_now(),typeof I=="function"){w.callback=I,V(S),q=!0;break t}w===f(b)&&o(b),V(S)}else o(b);w=f(b)}if(w!==null)q=!0;else{var g=f(x);g!==null&&A(O,g.startTime-S),q=!1}}break e}finally{w=null,H=$,Q=!1}q=void 0}}finally{q?J():ae=!1}}}var J;if(typeof K=="function")J=function(){K(Se)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,he=ie.port2;ie.port1.onmessage=Se,J=function(){he.postMessage(null)}}else J=function(){de(Se,0)};function A(S,q){G=de(function(){S(c.unstable_now())},q)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(S){S.callback=null},c.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<S?Math.floor(1e3/S):5},c.unstable_getCurrentPriorityLevel=function(){return H},c.unstable_next=function(S){switch(H){case 1:case 2:case 3:var q=3;break;default:q=H}var $=H;H=q;try{return S()}finally{H=$}},c.unstable_requestPaint=function(){X=!0},c.unstable_runWithPriority=function(S,q){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var $=H;H=S;try{return q()}finally{H=$}},c.unstable_scheduleCallback=function(S,q,$){var R=c.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?R+$:R):$=R,S){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=$+I,S={id:E++,callback:q,priorityLevel:S,startTime:$,expirationTime:I,sortIndex:-1},$>R?(S.sortIndex=$,u(x,S),f(b)===null&&S===f(x)&&(W?(Z(G),G=-1):W=!0,A(O,$-R))):(S.sortIndex=I,u(b,S),F||Q||(F=!0,ae||(ae=!0,J()))),S},c.unstable_shouldYield=oe,c.unstable_wrapCallback=function(S){var q=H;return function(){var $=H;H=q;try{return S.apply(this,arguments)}finally{H=$}}}})(Uu)),Uu}var em;function ag(){return em||(em=1,Ru.exports=lg()),Ru.exports}var ku={exports:{}},st={};/**
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 tm;function ig(){if(tm)return st;tm=1;var c=Vu();function u(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)x+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var o={d:{f,r:function(){throw Error(u(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(b,x,E){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:w==null?null:""+w,children:b,containerInfo:x,implementation:E}}var j=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,st.createPortal=function(b,x){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(u(299));return h(b,x,null,E)},st.flushSync=function(b){var x=j.T,E=o.p;try{if(j.T=null,o.p=2,b)return b()}finally{j.T=x,o.p=E,o.d.f()}},st.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(b,x))},st.prefetchDNS=function(b){typeof b=="string"&&o.d.D(b)},st.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var E=x.as,w=v(E,x.crossOrigin),H=typeof x.integrity=="string"?x.integrity:void 0,Q=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;E==="style"?o.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:w,integrity:H,fetchPriority:Q}):E==="script"&&o.d.X(b,{crossOrigin:w,integrity:H,fetchPriority:Q,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},st.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var E=v(x.as,x.crossOrigin);o.d.M(b,{crossOrigin:E,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(b)},st.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var E=x.as,w=v(E,x.crossOrigin);o.d.L(b,E,{crossOrigin:w,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},st.preloadModule=function(b,x){if(typeof b=="string")if(x){var E=v(x.as,x.crossOrigin);o.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:E,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(b)},st.requestFormReset=function(b){o.d.r(b)},st.unstable_batchedUpdates=function(b,x){return b(x)},st.useFormState=function(b,x,E){return j.H.useFormState(b,x,E)},st.useFormStatus=function(){return j.H.useHostTransitionStatus()},st.version="19.2.4",st}var nm;function sg(){if(nm)return ku.exports;nm=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),ku.exports=ig(),ku.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 lm;function cg(){if(lm)return Za;lm=1;var c=ag(),u=Vu(),f=sg();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(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 j(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 v(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 b(e){if(h(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return b(i),e;if(s===l)return b(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==l.return)n=i,l=s;else{for(var r=!1,m=i.child;m;){if(m===n){r=!0,n=i,l=s;break}if(m===l){r=!0,l=i,n=s;break}m=m.sibling}if(!r){for(m=s.child;m;){if(m===n){r=!0,n=s,l=i;break}if(m===l){r=!0,l=s,n=i;break}m=m.sibling}if(!r)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}var w=Object.assign,H=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),K=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=Se&&e[Se]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case de:return"Profiler";case X:return"StrictMode";case O:return"Suspense";case ae:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case F:return"Portal";case K:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var A=Array.isArray,S=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},R=[],I=-1;function g(e){return{current:e}}function D(e){0>I||(e.current=R[I],R[I]=null,I--)}function Y(e,t){I++,R[I]=e.current,e.current=t}var L=g(null),ne=g(null),ce=g(null),pe=g(null);function Be(e,t){switch(Y(ce,t),Y(ne,e),Y(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bf(t),e=vf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(L),Y(L,e)}function fe(){D(L),D(ne),D(ce)}function Lt(e){e.memoizedState!==null&&Y(pe,e);var t=L.current,n=vf(t,e.type);t!==n&&(Y(ne,e),Y(L,n))}function Zt(e){ne.current===e&&(D(L),D(ne)),pe.current===e&&(D(pe),Ya._currentValue=$)}var Ln,Yn;function Kt(e){if(Ln===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ln=t&&t[1]||"",Yn=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ln+e+Yn}var Gn=!1;function ml(e,t){if(!e||Gn)return"";Gn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(z){var M=z}Reflect.construct(e,[],B)}else{try{B.call()}catch(z){M=z}e.call(B.prototype)}}else{try{throw Error()}catch(z){M=z}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(z){if(z&&M&&typeof z.stack=="string")return[z.stack,M.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 s=l.DetermineComponentFrameRoot(),r=s[0],m=s[1];if(r&&m){var p=r.split(`
44
+ `),T=m.split(`
45
+ `);for(i=l=0;l<p.length&&!p[l].includes("DetermineComponentFrameRoot");)l++;for(;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;if(l===p.length||i===T.length)for(l=p.length-1,i=T.length-1;1<=l&&0<=i&&p[l]!==T[i];)i--;for(;1<=l&&0<=i;l--,i--)if(p[l]!==T[i]){if(l!==1||i!==1)do if(l--,i--,0>i||p[l]!==T[i]){var U=`
46
+ `+p[l].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=l&&0<=i);break}}}finally{Gn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Kt(n):""}function Xn(e,t){switch(e.tag){case 26:case 27:case 5:return Kt(e.type);case 16:return Kt("Lazy");case 13:return e.child!==t&&t!==null?Kt("Suspense Fallback"):Kt("Suspense");case 19:return Kt("SuspenseList");case 0:case 15:return ml(e.type,!1);case 11:return ml(e.type.render,!1);case 1:return ml(e.type,!0);case 31:return Kt("Activity");default:return""}}function hl(e){try{var t="",n=null;do t+=Xn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var P=Object.prototype.hasOwnProperty,Ue=c.unstable_scheduleCallback,Fe=c.unstable_cancelCallback,et=c.unstable_shouldYield,kt=c.unstable_requestPaint,ke=c.unstable_now,Qn=c.unstable_getCurrentPriorityLevel,Vn=c.unstable_ImmediatePriority,Ju=c.unstable_UserBlockingPriority,Ja=c.unstable_NormalPriority,Om=c.unstable_LowPriority,Fu=c.unstable_IdlePriority,Rm=c.log,Um=c.unstable_setDisableYieldValue,Pl=null,pt=null;function mn(e){if(typeof Rm=="function"&&Um(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Pl,e)}catch{}}var bt=Math.clz32?Math.clz32:Hm,km=Math.log,qm=Math.LN2;function Hm(e){return e>>>=0,e===0?32:31-(km(e)/qm|0)|0}var Fa=256,Wa=262144,Ia=4194304;function Zn(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 Pa(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes;e=e.warmLanes;var m=l&134217727;return m!==0?(l=m&~s,l!==0?i=Zn(l):(r&=m,r!==0?i=Zn(r):n||(n=m&~e,n!==0&&(i=Zn(n))))):(m=l&~s,m!==0?i=Zn(m):r!==0?i=Zn(r):n||(n=l&~e,n!==0&&(i=Zn(n)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Bm(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 Wu(){var e=Ia;return Ia<<=1,(Ia&62914560)===0&&(Ia=4194304),e}function vs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lm(e,t,n,l,i,s){var r=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 m=e.entanglements,p=e.expirationTimes,T=e.hiddenUpdates;for(n=r&~n;0<n;){var U=31-bt(n),B=1<<U;m[U]=0,p[U]=-1;var M=T[U];if(M!==null)for(T[U]=null,U=0;U<M.length;U++){var z=M[U];z!==null&&(z.lane&=-536870913)}n&=~B}l!==0&&Iu(e,l,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(r&~t))}function Iu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-bt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Pu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-bt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function er(e,t){var n=t&-t;return n=(n&42)!==0?1:ys(n),(n&(e.suspendedLanes|t))!==0?0:n}function ys(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 js(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function tr(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Gf(e.type))}function nr(e,t){var n=q.p;try{return q.p=e,t()}finally{q.p=n}}var hn=Math.random().toString(36).slice(2),tt="__reactFiber$"+hn,ot="__reactProps$"+hn,xl="__reactContainer$"+hn,Ns="__reactEvents$"+hn,Ym="__reactListeners$"+hn,Gm="__reactHandles$"+hn,lr="__reactResources$"+hn,na="__reactMarker$"+hn;function Ss(e){delete e[tt],delete e[ot],delete e[Ns],delete e[Ym],delete e[Gm]}function gl(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xl]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ef(e);e!==null;){if(n=e[tt])return n;e=Ef(e)}return t}e=n,n=e.parentNode}return null}function pl(e){if(e=e[tt]||e[xl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function bl(e){var t=e[lr];return t||(t=e[lr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[na]=!0}var ar=new Set,ir={};function Kn(e,t){vl(e,t),vl(e+"Capture",t)}function vl(e,t){for(ir[e]=t,e=0;e<t.length;e++)ar.add(t[e])}var Xm=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]*$"),sr={},cr={};function Qm(e){return P.call(cr,e)?!0:P.call(sr,e)?!1:Xm.test(e)?cr[e]=!0:(sr[e]=!0,!1)}function ei(e,t,n){if(Qm(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 ti(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 $t(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ur(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vm(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,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(r){n=""+r,s.call(this,r)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(r){n=""+r},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _s(e){if(!e._valueTracker){var t=ur(e)?"checked":"value";e._valueTracker=Vm(e,t,""+e[t])}}function rr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=ur(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function ni(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 Zm=/[\n"\\]/g;function At(e){return e.replace(Zm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ts(e,t,n,l,i,s,r,m){e.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.type=r:e.removeAttribute("type"),t!=null?r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):r!=="submit"&&r!=="reset"||e.removeAttribute("value"),t!=null?Es(e,r,Et(t)):n!=null?Es(e,r,Et(n)):l!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Et(m):e.removeAttribute("name")}function or(e,t,n,l,i,s,r,m){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){_s(e);return}n=n!=null?""+Et(n):"",t=t!=null?""+Et(t):n,m||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=m?e.checked:!!l,e.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.name=r),_s(e)}function Es(e,t,n){t==="number"&&ni(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yl(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=""+Et(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 dr(e,t,n){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Et(n):""}function fr(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(A(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Et(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),_s(e)}function jl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Km=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 mr(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||Km.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function hr(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&mr(e,i,l)}else for(var s in t)t.hasOwnProperty(s)&&mr(e,s,t[s])}function As(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 $m=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"]]),Jm=/^[\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 li(e){return Jm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var Ms=null;function Cs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nl=null,Sl=null;function xr(e){var t=pl(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ts(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="'+At(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[ot]||null;if(!i)throw Error(o(90));Ts(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&&rr(l)}break e;case"textarea":dr(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var zs=!1;function gr(e,t,n){if(zs)return e(t,n);zs=!0;try{var l=e(t);return l}finally{if(zs=!1,(Nl!==null||Sl!==null)&&(Qi(),Nl&&(t=Nl,e=Sl,Sl=Nl=null,xr(t),e)))for(t=0;t<e.length;t++)xr(e[t])}}function aa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ot]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ws=!1;if(Ft)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){ws=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{ws=!1}var xn=null,Ds=null,ai=null;function pr(){if(ai)return ai;var e,t=Ds,n=t.length,l,i="value"in xn?xn.value:xn.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var r=n-e;for(l=1;l<=r&&t[n-l]===i[s-l];l++);return ai=i.slice(e,1<l?1-l:void 0)}function ii(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 si(){return!0}function br(){return!1}function dt(e){function t(n,l,i,s,r){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=s,this.target=r,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(s):s[m]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?si:br,this.isPropagationStopped=br,this}return w(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=si)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=si)},persist:function(){},isPersistent:si}),t}var $n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ci=dt($n),sa=w({},$n,{view:0,detail:0}),Fm=dt(sa),Os,Rs,ca,ui=w({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ks,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!==ca&&(ca&&e.type==="mousemove"?(Os=e.screenX-ca.screenX,Rs=e.screenY-ca.screenY):Rs=Os=0,ca=e),Os)},movementY:function(e){return"movementY"in e?e.movementY:Rs}}),vr=dt(ui),Wm=w({},ui,{dataTransfer:0}),Im=dt(Wm),Pm=w({},sa,{relatedTarget:0}),Us=dt(Pm),eh=w({},$n,{animationName:0,elapsedTime:0,pseudoElement:0}),th=dt(eh),nh=w({},$n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lh=dt(nh),ah=w({},$n,{data:0}),yr=dt(ah),ih={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sh={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"},ch={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ch[e])?!!t[e]:!1}function ks(){return uh}var rh=w({},sa,{key:function(e){if(e.key){var t=ih[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ks,charCode:function(e){return e.type==="keypress"?ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),oh=dt(rh),dh=w({},ui,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jr=dt(dh),fh=w({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ks}),mh=dt(fh),hh=w({},$n,{propertyName:0,elapsedTime:0,pseudoElement:0}),xh=dt(hh),gh=w({},ui,{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}),ph=dt(gh),bh=w({},$n,{newState:0,oldState:0}),vh=dt(bh),yh=[9,13,27,32],qs=Ft&&"CompositionEvent"in window,ua=null;Ft&&"documentMode"in document&&(ua=document.documentMode);var jh=Ft&&"TextEvent"in window&&!ua,Nr=Ft&&(!qs||ua&&8<ua&&11>=ua),Sr=" ",_r=!1;function Tr(e,t){switch(e){case"keyup":return yh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Er(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _l=!1;function Nh(e,t){switch(e){case"compositionend":return Er(t);case"keypress":return t.which!==32?null:(_r=!0,Sr);case"textInput":return e=t.data,e===Sr&&_r?null:e;default:return null}}function Sh(e,t){if(_l)return e==="compositionend"||!qs&&Tr(e,t)?(e=pr(),ai=Ds=xn=null,_l=!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 Nr&&t.locale!=="ko"?null:t.data;default:return null}}var _h={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 Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_h[e.type]:t==="textarea"}function Mr(e,t,n,l){Nl?Sl?Sl.push(l):Sl=[l]:Nl=l,t=Wi(t,"onChange"),0<t.length&&(n=new ci("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ra=null,oa=null;function Th(e){ff(e,0)}function ri(e){var t=la(e);if(rr(t))return e}function Cr(e,t){if(e==="change")return t}var zr=!1;if(Ft){var Hs;if(Ft){var Bs="oninput"in document;if(!Bs){var wr=document.createElement("div");wr.setAttribute("oninput","return;"),Bs=typeof wr.oninput=="function"}Hs=Bs}else Hs=!1;zr=Hs&&(!document.documentMode||9<document.documentMode)}function Dr(){ra&&(ra.detachEvent("onpropertychange",Or),oa=ra=null)}function Or(e){if(e.propertyName==="value"&&ri(oa)){var t=[];Mr(t,oa,e,Cs(e)),gr(Th,t)}}function Eh(e,t,n){e==="focusin"?(Dr(),ra=t,oa=n,ra.attachEvent("onpropertychange",Or)):e==="focusout"&&Dr()}function Ah(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ri(oa)}function Mh(e,t){if(e==="click")return ri(t)}function Ch(e,t){if(e==="input"||e==="change")return ri(t)}function zh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:zh;function da(e,t){if(vt(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(!P.call(t,i)||!vt(e[i],t[i]))return!1}return!0}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ur(e,t){var n=Rr(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=Rr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(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=ni(e.document)}return t}function Ls(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 wh=Ft&&"documentMode"in document&&11>=document.documentMode,Tl=null,Ys=null,fa=null,Gs=!1;function Hr(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gs||Tl==null||Tl!==ni(l)||(l=Tl,"selectionStart"in l&&Ls(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}),fa&&da(fa,l)||(fa=l,l=Wi(Ys,"onSelect"),0<l.length&&(t=new ci("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Tl)))}function Jn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:Jn("Animation","AnimationEnd"),animationiteration:Jn("Animation","AnimationIteration"),animationstart:Jn("Animation","AnimationStart"),transitionrun:Jn("Transition","TransitionRun"),transitionstart:Jn("Transition","TransitionStart"),transitioncancel:Jn("Transition","TransitionCancel"),transitionend:Jn("Transition","TransitionEnd")},Xs={},Br={};Ft&&(Br=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function Fn(e){if(Xs[e])return Xs[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return Xs[e]=t[n];return e}var Lr=Fn("animationend"),Yr=Fn("animationiteration"),Gr=Fn("animationstart"),Dh=Fn("transitionrun"),Oh=Fn("transitionstart"),Rh=Fn("transitioncancel"),Xr=Fn("transitionend"),Qr=new Map,Qs="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(" ");Qs.push("scrollEnd");function qt(e,t){Qr.set(e,t),Kn(t,[e])}var oi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Mt=[],Al=0,Vs=0;function di(){for(var e=Al,t=Vs=Al=0;t<e;){var n=Mt[t];Mt[t++]=null;var l=Mt[t];Mt[t++]=null;var i=Mt[t];Mt[t++]=null;var s=Mt[t];if(Mt[t++]=null,l!==null&&i!==null){var r=l.pending;r===null?i.next=i:(i.next=r.next,r.next=i),l.pending=i}s!==0&&Vr(n,i,s)}}function fi(e,t,n,l){Mt[Al++]=e,Mt[Al++]=t,Mt[Al++]=n,Mt[Al++]=l,Vs|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Zs(e,t,n,l){return fi(e,t,n,l),mi(e)}function Wn(e,t){return fi(e,null,null,t),mi(e)}function Vr(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-bt(n),e=s.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),s):null}function mi(e){if(50<Ra)throw Ra=0,tu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ml={};function Uh(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 yt(e,t,n,l){return new Uh(e,t,n,l)}function Ks(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wt(e,t){var n=e.alternate;return n===null?(n=yt(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 Zr(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 hi(e,t,n,l,i,s){var r=0;if(l=e,typeof e=="function")Ks(e)&&(r=1);else if(typeof e=="string")r=Lx(e,n,L.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ue:return e=yt(31,n,t,i),e.elementType=ue,e.lanes=s,e;case W:return In(n.children,i,s,t);case X:r=8,i|=24;break;case de:return e=yt(12,n,t,i|2),e.elementType=de,e.lanes=s,e;case O:return e=yt(13,n,t,i),e.elementType=O,e.lanes=s,e;case ae:return e=yt(19,n,t,i),e.elementType=ae,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:r=10;break e;case Z:r=9;break e;case V:r=11;break e;case G:r=14;break e;case te:r=16,l=null;break e}r=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=yt(r,n,t,i),t.elementType=e,t.type=l,t.lanes=s,t}function In(e,t,n,l){return e=yt(7,e,l,t),e.lanes=n,e}function $s(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Kr(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function Js(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var $r=new WeakMap;function Ct(e,t){if(typeof e=="object"&&e!==null){var n=$r.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hl(t)},$r.set(e,t),t)}return{value:e,source:t,stack:hl(t)}}var Cl=[],zl=0,xi=null,ma=0,zt=[],wt=0,gn=null,Yt=1,Gt="";function It(e,t){Cl[zl++]=ma,Cl[zl++]=xi,xi=e,ma=t}function Jr(e,t,n){zt[wt++]=Yt,zt[wt++]=Gt,zt[wt++]=gn,gn=e;var l=Yt;e=Gt;var i=32-bt(l)-1;l&=~(1<<i),n+=1;var s=32-bt(t)+i;if(30<s){var r=i-i%5;s=(l&(1<<r)-1).toString(32),l>>=r,i-=r,Yt=1<<32-bt(t)+i|n<<i|l,Gt=s+e}else Yt=1<<s|n<<i|l,Gt=e}function Fs(e){e.return!==null&&(It(e,1),Jr(e,1,0))}function Ws(e){for(;e===xi;)xi=Cl[--zl],Cl[zl]=null,ma=Cl[--zl],Cl[zl]=null;for(;e===gn;)gn=zt[--wt],zt[wt]=null,Gt=zt[--wt],zt[wt]=null,Yt=zt[--wt],zt[wt]=null}function Fr(e,t){zt[wt++]=Yt,zt[wt++]=Gt,zt[wt++]=gn,Yt=t.id,Gt=t.overflow,gn=e}var nt=null,Oe=null,Ne=!1,pn=null,Dt=!1,Is=Error(o(519));function bn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ha(Ct(t,e)),Is}function Wr(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[tt]=e,t[ot]=l,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<ka.length;n++)ve(ka[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),or(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),fr(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||gf(t.textContent,n)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||bn(e,!0)}function Ir(e){for(nt=e.return;nt;)switch(nt.tag){case 5:case 31:case 13:Dt=!1;return;case 27:case 3:Dt=!0;return;default:nt=nt.return}}function wl(e){if(e!==nt)return!1;if(!Ne)return Ir(e),Ne=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||gu(e.type,e.memoizedProps)),n=!n),n&&Oe&&bn(e),Ir(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Oe=Tf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Oe=Tf(e)}else t===27?(t=Oe,Dn(e.type)?(e=ju,ju=null,Oe=e):Oe=t):Oe=nt?Rt(e.stateNode.nextSibling):null;return!0}function Pn(){Oe=nt=null,Ne=!1}function Ps(){var e=pn;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),pn=null),e}function ha(e){pn===null?pn=[e]:pn.push(e)}var ec=g(null),el=null,Pt=null;function vn(e,t,n){Y(ec,t._currentValue),t._currentValue=n}function en(e){e._currentValue=ec.current,D(ec)}function tc(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 nc(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var r=i.child;s=s.firstContext;e:for(;s!==null;){var m=s;s=i;for(var p=0;p<t.length;p++)if(m.context===t[p]){s.lanes|=n,m=s.alternate,m!==null&&(m.lanes|=n),tc(s.return,n,e),l||(r=null);break e}s=m.next}}else if(i.tag===18){if(r=i.return,r===null)throw Error(o(341));r.lanes|=n,s=r.alternate,s!==null&&(s.lanes|=n),tc(r,n,e),r=null}else r=i.child;if(r!==null)r.return=i;else for(r=i;r!==null;){if(r===e){r=null;break}if(i=r.sibling,i!==null){i.return=r.return,r=i;break}r=r.return}i=r}}function Dl(e,t,n,l){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var r=i.alternate;if(r===null)throw Error(o(387));if(r=r.memoizedProps,r!==null){var m=i.type;vt(i.pendingProps.value,r.value)||(e!==null?e.push(m):e=[m])}}else if(i===pe.current){if(r=i.alternate,r===null)throw Error(o(387));r.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ya):e=[Ya])}i=i.return}e!==null&&nc(t,e,n,l),t.flags|=262144}function gi(e){for(e=e.firstContext;e!==null;){if(!vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function tl(e){el=e,Pt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return Pr(el,e)}function pi(e,t){return el===null&&tl(e),Pr(e,t)}function Pr(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pt===null){if(e===null)throw Error(o(308));Pt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pt=Pt.next=t;return n}var kh=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()})}},qh=c.unstable_scheduleCallback,Hh=c.unstable_NormalPriority,Ve={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new kh,data:new Map,refCount:0}}function xa(e){e.refCount--,e.refCount===0&&qh(Hh,function(){e.controller.abort()})}var ga=null,ac=0,Ol=0,Rl=null;function Bh(e,t){if(ga===null){var n=ga=[];ac=0,Ol=cu(),Rl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return ac++,t.then(eo,eo),t}function eo(){if(--ac===0&&ga!==null){Rl!==null&&(Rl.status="fulfilled");var e=ga;ga=null,Ol=0,Rl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Lh(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 to=S.S;S.S=function(e,t){Bd=ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Bh(e,t),to!==null&&to(e,t)};var nl=g(null);function ic(){var e=nl.current;return e!==null?e:De.pooledCache}function bi(e,t){t===null?Y(nl,nl.current):Y(nl,t.pool)}function no(){var e=ic();return e===null?null:{parent:Ve._currentValue,pool:e}}var Ul=Error(o(460)),sc=Error(o(474)),vi=Error(o(542)),yi={then:function(){}};function lo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ao(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,so(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(o(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,so(e),e}throw al=t,Ul}}function ll(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(al=n,Ul):n}}var al=null;function io(){if(al===null)throw Error(o(459));var e=al;return al=null,e}function so(e){if(e===Ul||e===vi)throw Error(o(483))}var kl=null,pa=0;function ji(e){var t=pa;return pa+=1,kl===null&&(kl=[]),ao(kl,e,t)}function ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ni(e,t){throw t.$$typeof===H?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function co(e){function t(N,y){if(e){var _=N.deletions;_===null?(N.deletions=[y],N.flags|=16):_.push(y)}}function n(N,y){if(!e)return null;for(;y!==null;)t(N,y),y=y.sibling;return null}function l(N){for(var y=new Map;N!==null;)N.key!==null?y.set(N.key,N):y.set(N.index,N),N=N.sibling;return y}function i(N,y){return N=Wt(N,y),N.index=0,N.sibling=null,N}function s(N,y,_){return N.index=_,e?(_=N.alternate,_!==null?(_=_.index,_<y?(N.flags|=67108866,y):_):(N.flags|=67108866,y)):(N.flags|=1048576,y)}function r(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function m(N,y,_,k){return y===null||y.tag!==6?(y=$s(_,N.mode,k),y.return=N,y):(y=i(y,_),y.return=N,y)}function p(N,y,_,k){var se=_.type;return se===W?U(N,y,_.props.children,k,_.key):y!==null&&(y.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===te&&ll(se)===y.type)?(y=i(y,_.props),ba(y,_),y.return=N,y):(y=hi(_.type,_.key,_.props,null,N.mode,k),ba(y,_),y.return=N,y)}function T(N,y,_,k){return y===null||y.tag!==4||y.stateNode.containerInfo!==_.containerInfo||y.stateNode.implementation!==_.implementation?(y=Js(_,N.mode,k),y.return=N,y):(y=i(y,_.children||[]),y.return=N,y)}function U(N,y,_,k,se){return y===null||y.tag!==7?(y=In(_,N.mode,k,se),y.return=N,y):(y=i(y,_),y.return=N,y)}function B(N,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=$s(""+y,N.mode,_),y.return=N,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Q:return _=hi(y.type,y.key,y.props,null,N.mode,_),ba(_,y),_.return=N,_;case F:return y=Js(y,N.mode,_),y.return=N,y;case te:return y=ll(y),B(N,y,_)}if(A(y)||J(y))return y=In(y,N.mode,_,null),y.return=N,y;if(typeof y.then=="function")return B(N,ji(y),_);if(y.$$typeof===K)return B(N,pi(N,y),_);Ni(N,y)}return null}function M(N,y,_,k){var se=y!==null?y.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return se!==null?null:m(N,y,""+_,k);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Q:return _.key===se?p(N,y,_,k):null;case F:return _.key===se?T(N,y,_,k):null;case te:return _=ll(_),M(N,y,_,k)}if(A(_)||J(_))return se!==null?null:U(N,y,_,k,null);if(typeof _.then=="function")return M(N,y,ji(_),k);if(_.$$typeof===K)return M(N,y,pi(N,_),k);Ni(N,_)}return null}function z(N,y,_,k,se){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return N=N.get(_)||null,m(y,N,""+k,se);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Q:return N=N.get(k.key===null?_:k.key)||null,p(y,N,k,se);case F:return N=N.get(k.key===null?_:k.key)||null,T(y,N,k,se);case te:return k=ll(k),z(N,y,_,k,se)}if(A(k)||J(k))return N=N.get(_)||null,U(y,N,k,se,null);if(typeof k.then=="function")return z(N,y,_,ji(k),se);if(k.$$typeof===K)return z(N,y,_,pi(y,k),se);Ni(y,k)}return null}function ee(N,y,_,k){for(var se=null,_e=null,le=y,ge=y=0,je=null;le!==null&&ge<_.length;ge++){le.index>ge?(je=le,le=null):je=le.sibling;var Te=M(N,le,_[ge],k);if(Te===null){le===null&&(le=je);break}e&&le&&Te.alternate===null&&t(N,le),y=s(Te,y,ge),_e===null?se=Te:_e.sibling=Te,_e=Te,le=je}if(ge===_.length)return n(N,le),Ne&&It(N,ge),se;if(le===null){for(;ge<_.length;ge++)le=B(N,_[ge],k),le!==null&&(y=s(le,y,ge),_e===null?se=le:_e.sibling=le,_e=le);return Ne&&It(N,ge),se}for(le=l(le);ge<_.length;ge++)je=z(le,N,ge,_[ge],k),je!==null&&(e&&je.alternate!==null&&le.delete(je.key===null?ge:je.key),y=s(je,y,ge),_e===null?se=je:_e.sibling=je,_e=je);return e&&le.forEach(function(qn){return t(N,qn)}),Ne&&It(N,ge),se}function re(N,y,_,k){if(_==null)throw Error(o(151));for(var se=null,_e=null,le=y,ge=y=0,je=null,Te=_.next();le!==null&&!Te.done;ge++,Te=_.next()){le.index>ge?(je=le,le=null):je=le.sibling;var qn=M(N,le,Te.value,k);if(qn===null){le===null&&(le=je);break}e&&le&&qn.alternate===null&&t(N,le),y=s(qn,y,ge),_e===null?se=qn:_e.sibling=qn,_e=qn,le=je}if(Te.done)return n(N,le),Ne&&It(N,ge),se;if(le===null){for(;!Te.done;ge++,Te=_.next())Te=B(N,Te.value,k),Te!==null&&(y=s(Te,y,ge),_e===null?se=Te:_e.sibling=Te,_e=Te);return Ne&&It(N,ge),se}for(le=l(le);!Te.done;ge++,Te=_.next())Te=z(le,N,ge,Te.value,k),Te!==null&&(e&&Te.alternate!==null&&le.delete(Te.key===null?ge:Te.key),y=s(Te,y,ge),_e===null?se=Te:_e.sibling=Te,_e=Te);return e&&le.forEach(function(Wx){return t(N,Wx)}),Ne&&It(N,ge),se}function we(N,y,_,k){if(typeof _=="object"&&_!==null&&_.type===W&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Q:e:{for(var se=_.key;y!==null;){if(y.key===se){if(se=_.type,se===W){if(y.tag===7){n(N,y.sibling),k=i(y,_.props.children),k.return=N,N=k;break e}}else if(y.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===te&&ll(se)===y.type){n(N,y.sibling),k=i(y,_.props),ba(k,_),k.return=N,N=k;break e}n(N,y);break}else t(N,y);y=y.sibling}_.type===W?(k=In(_.props.children,N.mode,k,_.key),k.return=N,N=k):(k=hi(_.type,_.key,_.props,null,N.mode,k),ba(k,_),k.return=N,N=k)}return r(N);case F:e:{for(se=_.key;y!==null;){if(y.key===se)if(y.tag===4&&y.stateNode.containerInfo===_.containerInfo&&y.stateNode.implementation===_.implementation){n(N,y.sibling),k=i(y,_.children||[]),k.return=N,N=k;break e}else{n(N,y);break}else t(N,y);y=y.sibling}k=Js(_,N.mode,k),k.return=N,N=k}return r(N);case te:return _=ll(_),we(N,y,_,k)}if(A(_))return ee(N,y,_,k);if(J(_)){if(se=J(_),typeof se!="function")throw Error(o(150));return _=se.call(_),re(N,y,_,k)}if(typeof _.then=="function")return we(N,y,ji(_),k);if(_.$$typeof===K)return we(N,y,pi(N,_),k);Ni(N,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,y!==null&&y.tag===6?(n(N,y.sibling),k=i(y,_),k.return=N,N=k):(n(N,y),k=$s(_,N.mode,k),k.return=N,N=k),r(N)):n(N,y)}return function(N,y,_,k){try{pa=0;var se=we(N,y,_,k);return kl=null,se}catch(le){if(le===Ul||le===vi)throw le;var _e=yt(29,le,null,N.mode);return _e.lanes=k,_e.return=N,_e}finally{}}}var il=co(!0),uo=co(!1),yn=!1;function cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(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 jn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Nn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ee&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=mi(e),Vr(e,null,n),t}return fi(e,l,t,n),mi(e)}function va(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,Pu(e,n)}}function rc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 oc=!1;function ya(){if(oc){var e=Rl;if(e!==null)throw e}}function ja(e,t,n,l){oc=!1;var i=e.updateQueue;yn=!1;var s=i.firstBaseUpdate,r=i.lastBaseUpdate,m=i.shared.pending;if(m!==null){i.shared.pending=null;var p=m,T=p.next;p.next=null,r===null?s=T:r.next=T,r=p;var U=e.alternate;U!==null&&(U=U.updateQueue,m=U.lastBaseUpdate,m!==r&&(m===null?U.firstBaseUpdate=T:m.next=T,U.lastBaseUpdate=p))}if(s!==null){var B=i.baseState;r=0,U=T=p=null,m=s;do{var M=m.lane&-536870913,z=M!==m.lane;if(z?(ye&M)===M:(l&M)===M){M!==0&&M===Ol&&(oc=!0),U!==null&&(U=U.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var ee=e,re=m;M=t;var we=n;switch(re.tag){case 1:if(ee=re.payload,typeof ee=="function"){B=ee.call(we,B,M);break e}B=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=re.payload,M=typeof ee=="function"?ee.call(we,B,M):ee,M==null)break e;B=w({},B,M);break e;case 2:yn=!0}}M=m.callback,M!==null&&(e.flags|=64,z&&(e.flags|=8192),z=i.callbacks,z===null?i.callbacks=[M]:z.push(M))}else z={lane:M,tag:m.tag,payload:m.payload,callback:m.callback,next:null},U===null?(T=U=z,p=B):U=U.next=z,r|=M;if(m=m.next,m===null){if(m=i.shared.pending,m===null)break;z=m,m=z.next,z.next=null,i.lastBaseUpdate=z,i.shared.pending=null}}while(!0);U===null&&(p=B),i.baseState=p,i.firstBaseUpdate=T,i.lastBaseUpdate=U,s===null&&(i.shared.lanes=0),An|=r,e.lanes=r,e.memoizedState=B}}function ro(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ro(n[e],t)}var ql=g(null),Si=g(0);function fo(e,t){e=on,Y(Si,e),Y(ql,t),on=e|t.baseLanes}function dc(){Y(Si,on),Y(ql,ql.current)}function fc(){on=Si.current,D(ql),D(Si)}var jt=g(null),Ot=null;function Sn(e){var t=e.alternate;Y(Ge,Ge.current&1),Y(jt,e),Ot===null&&(t===null||ql.current!==null||t.memoizedState!==null)&&(Ot=e)}function mc(e){Y(Ge,Ge.current),Y(jt,e),Ot===null&&(Ot=e)}function mo(e){e.tag===22?(Y(Ge,Ge.current),Y(jt,e),Ot===null&&(Ot=e)):_n()}function _n(){Y(Ge,Ge.current),Y(jt,jt.current)}function Nt(e){D(jt),Ot===e&&(Ot=null),D(Ge)}var Ge=g(0);function _i(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vu(n)||yu(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 tn=0,xe=null,Ce=null,Ze=null,Ti=!1,Hl=!1,sl=!1,Ei=0,Na=0,Bl=null,Yh=0;function Le(){throw Error(o(321))}function hc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vt(e[n],t[n]))return!1;return!0}function xc(e,t,n,l,i,s){return tn=s,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,S.H=e===null||e.memoizedState===null?Fo:zc,sl=!1,s=n(l,i),sl=!1,Hl&&(s=xo(t,n,l,i)),ho(e),s}function ho(e){S.H=Ta;var t=Ce!==null&&Ce.next!==null;if(tn=0,Ze=Ce=xe=null,Ti=!1,Na=0,Bl=null,t)throw Error(o(300));e===null||Ke||(e=e.dependencies,e!==null&&gi(e)&&(Ke=!0))}function xo(e,t,n,l){xe=e;var i=0;do{if(Hl&&(Bl=null),Na=0,Hl=!1,25<=i)throw Error(o(301));if(i+=1,Ze=Ce=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}S.H=Wo,s=t(n,l)}while(Hl);return s}function Gh(){var e=S.H,t=e.useState()[0];return t=typeof t.then=="function"?Sa(t):t,e=e.useState()[0],(Ce!==null?Ce.memoizedState:null)!==e&&(xe.flags|=1024),t}function gc(){var e=Ei!==0;return Ei=0,e}function pc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bc(e){if(Ti){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ti=!1}tn=0,Ze=Ce=xe=null,Hl=!1,Na=Ei=0,Bl=null}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(Ce===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=Ze===null?xe.memoizedState:Ze.next;if(t!==null)Ze=t,Ce=e;else{if(e===null)throw xe.alternate===null?Error(o(467)):Error(o(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},Ze===null?xe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Ai(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var t=Na;return Na+=1,Bl===null&&(Bl=[]),e=ao(Bl,e,t),t=xe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,S.H=t===null||t.memoizedState===null?Fo:zc),e}function Mi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===K)return lt(e)}throw Error(o(438,String(e)))}function vc(e){var t=null,n=xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=xe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ai(),xe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=oe;return t.index++,n}function nn(e,t){return typeof t=="function"?t(e):t}function Ci(e){var t=Xe();return yc(t,Ce,e)}function yc(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var i=e.baseQueue,s=l.pending;if(s!==null){if(i!==null){var r=i.next;i.next=s.next,s.next=r}t.baseQueue=i=s,l.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var m=r=null,p=null,T=t,U=!1;do{var B=T.lane&-536870913;if(B!==T.lane?(ye&B)===B:(tn&B)===B){var M=T.revertLane;if(M===0)p!==null&&(p=p.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),B===Ol&&(U=!0);else if((tn&M)===M){T=T.next,M===Ol&&(U=!0);continue}else B={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},p===null?(m=p=B,r=s):p=p.next=B,xe.lanes|=M,An|=M;B=T.action,sl&&n(s,B),s=T.hasEagerState?T.eagerState:n(s,B)}else M={lane:B,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},p===null?(m=p=M,r=s):p=p.next=M,xe.lanes|=B,An|=B;T=T.next}while(T!==null&&T!==t);if(p===null?r=s:p.next=m,!vt(s,e.memoizedState)&&(Ke=!0,U&&(n=Rl,n!==null)))throw n;e.memoizedState=s,e.baseState=r,e.baseQueue=p,l.lastRenderedState=s}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function jc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var r=i=i.next;do s=e(s,r.action),r=r.next;while(r!==i);vt(s,t.memoizedState)||(Ke=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function go(e,t,n){var l=xe,i=Xe(),s=Ne;if(s){if(n===void 0)throw Error(o(407));n=n()}else n=t();var r=!vt((Ce||i).memoizedState,n);if(r&&(i.memoizedState=n,Ke=!0),i=i.queue,_c(vo.bind(null,l,i,e),[e]),i.getSnapshot!==t||r||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Ll(9,{destroy:void 0},bo.bind(null,l,i,n,t),null),De===null)throw Error(o(349));s||(tn&127)!==0||po(l,t,n)}return n}function po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t=Ai(),xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bo(e,t,n,l){t.value=n,t.getSnapshot=l,yo(t)&&jo(e)}function vo(e,t,n){return n(function(){yo(t)&&jo(e)})}function yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function jo(e){var t=Wn(e,2);t!==null&&gt(t,e,2)}function Nc(e){var t=ct();if(typeof e=="function"){var n=e;if(e=n(),sl){mn(!0);try{n()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:e},t}function No(e,t,n,l){return e.baseState=n,yc(e,Ce,typeof l=="function"?l:nn)}function Xh(e,t,n,l,i){if(Di(e))throw Error(o(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(r){s.listeners.push(r)}};S.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,So(t,s)):(s.next=n.next,t.pending=n.next=s)}}function So(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var s=S.T,r={};S.T=r;try{var m=n(i,l),p=S.S;p!==null&&p(r,m),_o(e,t,m)}catch(T){Sc(e,t,T)}finally{s!==null&&r.types!==null&&(s.types=r.types),S.T=s}}else try{s=n(i,l),_o(e,t,s)}catch(T){Sc(e,t,T)}}function _o(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){To(e,t,l)},function(l){return Sc(e,t,l)}):To(e,t,n)}function To(e,t,n){t.status="fulfilled",t.value=n,Eo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,So(e,n)))}function Sc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Eo(t),t=t.next;while(t!==l)}e.action=null}function Eo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ao(e,t){return t}function Mo(e,t){if(Ne){var n=De.formState;if(n!==null){e:{var l=xe;if(Ne){if(Oe){t:{for(var i=Oe,s=Dt;i.nodeType!==8;){if(!s){i=null;break t}if(i=Rt(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Oe=Rt(i.nextSibling),l=i.data==="F!";break e}}bn(l)}l=!1}l&&(t=n[0])}}return n=ct(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:t},n.queue=l,n=Ko.bind(null,xe,l),l.dispatch=n,l=Nc(!1),s=Cc.bind(null,xe,!1,l.queue),l=ct(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Xh.bind(null,xe,i,s,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Co(e){var t=Xe();return zo(t,Ce,e)}function zo(e,t,n){if(t=yc(e,t,Ao)[0],e=Ci(nn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Sa(t)}catch(r){throw r===Ul?vi:r}else l=t;t=Xe();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Ll(9,{destroy:void 0},Qh.bind(null,i,n),null)),[l,s,e]}function Qh(e,t){e.action=t}function wo(e){var t=Xe(),n=Ce;if(n!==null)return zo(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ll(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Ai(),xe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Do(){return Xe().memoizedState}function zi(e,t,n,l){var i=ct();xe.flags|=e,i.memoizedState=Ll(1|t,{destroy:void 0},n,l===void 0?null:l)}function wi(e,t,n,l){var i=Xe();l=l===void 0?null:l;var s=i.memoizedState.inst;Ce!==null&&l!==null&&hc(l,Ce.memoizedState.deps)?i.memoizedState=Ll(t,s,n,l):(xe.flags|=e,i.memoizedState=Ll(1|t,s,n,l))}function Oo(e,t){zi(8390656,8,e,t)}function _c(e,t){wi(2048,8,e,t)}function Vh(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Ai(),xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ro(e){var t=Xe().memoizedState;return Vh({ref:t,nextImpl:e}),function(){if((Ee&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Uo(e,t){return wi(4,2,e,t)}function ko(e,t){return wi(4,4,e,t)}function qo(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 Ho(e,t,n){n=n!=null?n.concat([e]):null,wi(4,4,qo.bind(null,t,e),n)}function Tc(){}function Bo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&hc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Lo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&hc(t,l[1]))return l[0];if(l=e(),sl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l}function Ec(e,t,n){return n===void 0||(tn&1073741824)!==0&&(ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Yd(),xe.lanes|=e,An|=e,n)}function Yo(e,t,n,l){return vt(n,t)?n:ql.current!==null?(e=Ec(e,n,l),vt(e,t)||(Ke=!0),e):(tn&42)===0||(tn&1073741824)!==0&&(ye&261930)===0?(Ke=!0,e.memoizedState=n):(e=Yd(),xe.lanes|=e,An|=e,t)}function Go(e,t,n,l,i){var s=q.p;q.p=s!==0&&8>s?s:8;var r=S.T,m={};S.T=m,Cc(e,!1,t,n);try{var p=i(),T=S.S;if(T!==null&&T(m,p),p!==null&&typeof p=="object"&&typeof p.then=="function"){var U=Lh(p,l);_a(e,t,U,Tt(e))}else _a(e,t,l,Tt(e))}catch(B){_a(e,t,{then:function(){},status:"rejected",reason:B},Tt())}finally{q.p=s,r!==null&&m.types!==null&&(r.types=m.types),S.T=r}}function Zh(){}function Ac(e,t,n,l){if(e.tag!==5)throw Error(o(476));var i=Xo(e).queue;Go(e,i,t,$,n===null?Zh:function(){return Qo(e),n(l)})}function Xo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:$},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qo(e){var t=Xo(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Tt())}function Mc(){return lt(Ya)}function Vo(){return Xe().memoizedState}function Zo(){return Xe().memoizedState}function Kh(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=jn(n);var l=Nn(t,e,n);l!==null&&(gt(l,t,n),va(l,t,n)),t={cache:lc()},e.payload=t;return}t=t.return}}function $h(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Di(e)?$o(t,n):(n=Zs(e,t,n,l),n!==null&&(gt(n,e,l),Jo(n,t,l)))}function Ko(e,t,n){var l=Tt();_a(e,t,n,l)}function _a(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Di(e))$o(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var r=t.lastRenderedState,m=s(r,n);if(i.hasEagerState=!0,i.eagerState=m,vt(m,r))return fi(e,t,i,0),De===null&&di(),!1}catch{}finally{}if(n=Zs(e,t,i,l),n!==null)return gt(n,e,l),Jo(n,t,l),!0}return!1}function Cc(e,t,n,l){if(l={lane:2,revertLane:cu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Di(e)){if(t)throw Error(o(479))}else t=Zs(e,n,l,2),t!==null&&gt(t,e,2)}function Di(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function $o(e,t){Hl=Ti=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jo(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Pu(e,n)}}var Ta={readContext:lt,use:Mi,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ta.useEffectEvent=Le;var Fo={readContext:lt,use:Mi,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Oo,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,zi(4194308,4,qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zi(4194308,4,e,t)},useInsertionEffect:function(e,t){zi(4,2,e,t)},useMemo:function(e,t){var n=ct();t=t===void 0?null:t;var l=e();if(sl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=ct();if(n!==void 0){var i=n(t);if(sl){mn(!0);try{n(t)}finally{mn(!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=$h.bind(null,xe,e),[l.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=Nc(e);var t=e.queue,n=Ko.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Tc,useDeferredValue:function(e,t){var n=ct();return Ec(n,e,t)},useTransition:function(){var e=Nc(!1);return e=Go.bind(null,xe,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=xe,i=ct();if(Ne){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),De===null)throw Error(o(349));(ye&127)!==0||po(l,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Oo(vo.bind(null,l,s,e),[e]),l.flags|=2048,Ll(9,{destroy:void 0},bo.bind(null,l,s,n,t),null),n},useId:function(){var e=ct(),t=De.identifierPrefix;if(Ne){var n=Gt,l=Yt;n=(l&~(1<<32-bt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ei++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Yh++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mc,useFormState:Mo,useActionState:Mo,useOptimistic:function(e){var t=ct();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Cc.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:vc,useCacheRefresh:function(){return ct().memoizedState=Kh.bind(null,xe)},useEffectEvent:function(e){var t=ct(),n={impl:e};return t.memoizedState=n,function(){if((Ee&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},zc={readContext:lt,use:Mi,useCallback:Bo,useContext:lt,useEffect:_c,useImperativeHandle:Ho,useInsertionEffect:Uo,useLayoutEffect:ko,useMemo:Lo,useReducer:Ci,useRef:Do,useState:function(){return Ci(nn)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=Xe();return Yo(n,Ce.memoizedState,e,t)},useTransition:function(){var e=Ci(nn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:go,useId:Vo,useHostTransitionStatus:Mc,useFormState:Co,useActionState:Co,useOptimistic:function(e,t){var n=Xe();return No(n,Ce,e,t)},useMemoCache:vc,useCacheRefresh:Zo};zc.useEffectEvent=Ro;var Wo={readContext:lt,use:Mi,useCallback:Bo,useContext:lt,useEffect:_c,useImperativeHandle:Ho,useInsertionEffect:Uo,useLayoutEffect:ko,useMemo:Lo,useReducer:jc,useRef:Do,useState:function(){return jc(nn)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=Xe();return Ce===null?Ec(n,e,t):Yo(n,Ce.memoizedState,e,t)},useTransition:function(){var e=jc(nn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Sa(e),t]},useSyncExternalStore:go,useId:Vo,useHostTransitionStatus:Mc,useFormState:wo,useActionState:wo,useOptimistic:function(e,t){var n=Xe();return Ce!==null?No(n,Ce,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:vc,useCacheRefresh:Zo};Wo.useEffectEvent=Ro;function wc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Tt(),i=jn(l);i.payload=t,n!=null&&(i.callback=n),t=Nn(e,i,l),t!==null&&(gt(t,e,l),va(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Tt(),i=jn(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Nn(e,i,l),t!==null&&(gt(t,e,l),va(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),l=jn(n);l.tag=2,t!=null&&(l.callback=t),t=Nn(e,l,n),t!==null&&(gt(t,e,n),va(t,e,n))}};function Io(e,t,n,l,i,s,r){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,r):t.prototype&&t.prototype.isPureReactComponent?!da(n,l)||!da(i,s):!0}function Po(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&&Dc.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=w({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function ed(e){oi(e)}function td(e){console.error(e)}function nd(e){oi(e)}function Oi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ld(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 Oc(e,t,n){return n=jn(n),n.tag=3,n.payload={element:null},n.callback=function(){Oi(e,t)},n}function ad(e){return e=jn(e),e.tag=3,e}function id(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=l.value;e.payload=function(){return i(s)},e.callback=function(){ld(t,n,l)}}var r=n.stateNode;r!==null&&typeof r.componentDidCatch=="function"&&(e.callback=function(){ld(t,n,l),typeof i!="function"&&(Mn===null?Mn=new Set([this]):Mn.add(this));var m=l.stack;this.componentDidCatch(l.value,{componentStack:m!==null?m:""})})}function Jh(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Dl(t,n,i,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:return Ot===null?Vi():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===yi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),au(e,l,i)),!1;case 22:return n.flags|=65536,l===yi?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)),au(e,l,i)),!1}throw Error(o(435,n.tag))}return au(e,l,i),Vi(),!1}if(Ne)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Is&&(e=Error(o(422),{cause:l}),ha(Ct(e,n)))):(l!==Is&&(t=Error(o(423),{cause:l}),ha(Ct(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=Ct(l,n),i=Oc(e.stateNode,l,i),rc(e,i),Ye!==4&&(Ye=2)),!1;var s=Error(o(520),{cause:l});if(s=Ct(s,n),Oa===null?Oa=[s]:Oa.push(s),Ye!==4&&(Ye=2),t===null)return!0;l=Ct(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Oc(n.stateNode,l,e),rc(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Mn===null||!Mn.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=ad(i),id(i,e,n,l),rc(n,i),!1}n=n.return}while(n!==null);return!1}var Rc=Error(o(461)),Ke=!1;function at(e,t,n,l){t.child=e===null?uo(t,null,n,l):il(t,e.child,n,l)}function sd(e,t,n,l,i){n=n.render;var s=t.ref;if("ref"in l){var r={};for(var m in l)m!=="ref"&&(r[m]=l[m])}else r=l;return tl(t),l=xc(e,t,n,r,s,i),m=gc(),e!==null&&!Ke?(pc(e,t,i),ln(e,t,i)):(Ne&&m&&Fs(t),t.flags|=1,at(e,t,l,i),t.child)}function cd(e,t,n,l,i){if(e===null){var s=n.type;return typeof s=="function"&&!Ks(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,ud(e,t,s,l,i)):(e=hi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Gc(e,i)){var r=s.memoizedProps;if(n=n.compare,n=n!==null?n:da,n(r,l)&&e.ref===t.ref)return ln(e,t,i)}return t.flags|=1,e=Wt(s,l),e.ref=t.ref,e.return=t,t.child=e}function ud(e,t,n,l,i){if(e!==null){var s=e.memoizedProps;if(da(s,l)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=l=s,Gc(e,i))(e.flags&131072)!==0&&(Ke=!0);else return t.lanes=e.lanes,ln(e,t,i)}return Uc(e,t,n,l,i)}function rd(e,t,n,l){var i=l.children,s=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(s=s!==null?s.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&~s}else l=0,t.child=null;return od(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bi(t,s!==null?s.cachePool:null),s!==null?fo(t,s):dc(),mo(t);else return l=t.lanes=536870912,od(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(bi(t,s.cachePool),fo(t,s),_n(),t.memoizedState=null):(e!==null&&bi(t,null),dc(),_n());return at(e,t,i,n),t.child}function Ea(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function od(e,t,n,l,i){var s=ic();return s=s===null?null:{parent:Ve._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&bi(t,null),dc(),mo(t),e!==null&&Dl(e,t,l,!0),t.childLanes=i,null}function Ri(e,t){return t=ki({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dd(e,t,n){return il(t,e.child,null,n),e=Ri(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function Fh(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(l.mode==="hidden")return e=Ri(t,l),t.lanes=536870912,Ea(null,e);if(mc(t),(e=Oe)?(e=_f(e,Dt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Kr(e),n.return=t,t.child=n,nt=t,Oe=null)):e=null,e===null)throw bn(t);return t.lanes=536870912,null}return Ri(t,l)}var s=e.memoizedState;if(s!==null){var r=s.dehydrated;if(mc(t),i)if(t.flags&256)t.flags&=-257,t=dd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ke||Dl(e,t,n,!1),i=(n&e.childLanes)!==0,Ke||i){if(l=De,l!==null&&(r=er(l,n),r!==0&&r!==s.retryLane))throw s.retryLane=r,Wn(e,r),gt(l,e,r),Rc;Vi(),t=dd(e,t,n)}else e=s.treeContext,Oe=Rt(r.nextSibling),nt=t,Ne=!0,pn=null,Dt=!1,e!==null&&Fr(t,e),t=Ri(t,l),t.flags|=4096;return t}return e=Wt(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ui(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,l,i){return tl(t),n=xc(e,t,n,l,void 0,i),l=gc(),e!==null&&!Ke?(pc(e,t,i),ln(e,t,i)):(Ne&&l&&Fs(t),t.flags|=1,at(e,t,n,i),t.child)}function fd(e,t,n,l,i,s){return tl(t),t.updateQueue=null,n=xo(t,l,n,i),ho(e),l=gc(),e!==null&&!Ke?(pc(e,t,s),ln(e,t,s)):(Ne&&l&&Fs(t),t.flags|=1,at(e,t,n,s),t.child)}function md(e,t,n,l,i){if(tl(t),t.stateNode===null){var s=Ml,r=n.contextType;typeof r=="object"&&r!==null&&(s=lt(r)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Dc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},cc(t),r=n.contextType,s.context=typeof r=="object"&&r!==null?lt(r):Ml,s.state=t.memoizedState,r=n.getDerivedStateFromProps,typeof r=="function"&&(wc(t,n,r,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(r=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),r!==s.state&&Dc.enqueueReplaceState(s,s.state,null),ja(t,l,s,i),ya(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var m=t.memoizedProps,p=cl(n,m);s.props=p;var T=s.context,U=n.contextType;r=Ml,typeof U=="object"&&U!==null&&(r=lt(U));var B=n.getDerivedStateFromProps;U=typeof B=="function"||typeof s.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,U||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(m||T!==r)&&Po(t,s,l,r),yn=!1;var M=t.memoizedState;s.state=M,ja(t,l,s,i),ya(),T=t.memoizedState,m||M!==T||yn?(typeof B=="function"&&(wc(t,n,B,l),T=t.memoizedState),(p=yn||Io(t,n,p,l,M,T,r))?(U||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=T),s.props=l,s.state=T,s.context=r,l=p):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,uc(e,t),r=t.memoizedProps,U=cl(n,r),s.props=U,B=t.pendingProps,M=s.context,T=n.contextType,p=Ml,typeof T=="object"&&T!==null&&(p=lt(T)),m=n.getDerivedStateFromProps,(T=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(r!==B||M!==p)&&Po(t,s,l,p),yn=!1,M=t.memoizedState,s.state=M,ja(t,l,s,i),ya();var z=t.memoizedState;r!==B||M!==z||yn||e!==null&&e.dependencies!==null&&gi(e.dependencies)?(typeof m=="function"&&(wc(t,n,m,l),z=t.memoizedState),(U=yn||Io(t,n,U,l,M,z,p)||e!==null&&e.dependencies!==null&&gi(e.dependencies))?(T||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,z,p),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,z,p)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=z),s.props=l,s.state=z,s.context=p,l=U):(typeof s.componentDidUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,Ui(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=il(t,e.child,null,i),t.child=il(t,null,n,i)):at(e,t,n,i),t.memoizedState=s.state,e=t.child):e=ln(e,t,i),e}function hd(e,t,n,l){return Pn(),t.flags|=256,at(e,t,n,l),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:no()}}function Hc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=_t),e}function xd(e,t,n){var l=t.pendingProps,i=!1,s=(t.flags&128)!==0,r;if((r=s)||(r=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),r&&(i=!0,t.flags&=-129),r=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(i?Sn(t):_n(),(e=Oe)?(e=_f(e,Dt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Kr(e),n.return=t,t.child=n,nt=t,Oe=null)):e=null,e===null)throw bn(t);return yu(e)?t.lanes=32:t.lanes=536870912,null}var m=l.children;return l=l.fallback,i?(_n(),i=t.mode,m=ki({mode:"hidden",children:m},i),l=In(l,i,n,null),m.return=t,l.return=t,m.sibling=l,t.child=m,l=t.child,l.memoizedState=qc(n),l.childLanes=Hc(e,r,n),t.memoizedState=kc,Ea(null,l)):(Sn(t),Bc(t,m))}var p=e.memoizedState;if(p!==null&&(m=p.dehydrated,m!==null)){if(s)t.flags&256?(Sn(t),t.flags&=-257,t=Lc(e,t,n)):t.memoizedState!==null?(_n(),t.child=e.child,t.flags|=128,t=null):(_n(),m=l.fallback,i=t.mode,l=ki({mode:"visible",children:l.children},i),m=In(m,i,n,null),m.flags|=2,l.return=t,m.return=t,l.sibling=m,t.child=l,il(t,e.child,null,n),l=t.child,l.memoizedState=qc(n),l.childLanes=Hc(e,r,n),t.memoizedState=kc,t=Ea(null,l));else if(Sn(t),yu(m)){if(r=m.nextSibling&&m.nextSibling.dataset,r)var T=r.dgst;r=T,l=Error(o(419)),l.stack="",l.digest=r,ha({value:l,source:null,stack:null}),t=Lc(e,t,n)}else if(Ke||Dl(e,t,n,!1),r=(n&e.childLanes)!==0,Ke||r){if(r=De,r!==null&&(l=er(r,n),l!==0&&l!==p.retryLane))throw p.retryLane=l,Wn(e,l),gt(r,e,l),Rc;vu(m)||Vi(),t=Lc(e,t,n)}else vu(m)?(t.flags|=192,t.child=e.child,t=null):(e=p.treeContext,Oe=Rt(m.nextSibling),nt=t,Ne=!0,pn=null,Dt=!1,e!==null&&Fr(t,e),t=Bc(t,l.children),t.flags|=4096);return t}return i?(_n(),m=l.fallback,i=t.mode,p=e.child,T=p.sibling,l=Wt(p,{mode:"hidden",children:l.children}),l.subtreeFlags=p.subtreeFlags&65011712,T!==null?m=Wt(T,m):(m=In(m,i,n,null),m.flags|=2),m.return=t,l.return=t,l.sibling=m,t.child=l,Ea(null,l),l=t.child,m=e.child.memoizedState,m===null?m=qc(n):(i=m.cachePool,i!==null?(p=Ve._currentValue,i=i.parent!==p?{parent:p,pool:p}:i):i=no(),m={baseLanes:m.baseLanes|n,cachePool:i}),l.memoizedState=m,l.childLanes=Hc(e,r,n),t.memoizedState=kc,Ea(e.child,l)):(Sn(t),n=e.child,e=n.sibling,n=Wt(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Bc(e,t){return t=ki({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ki(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function Lc(e,t,n){return il(t,e.child,null,n),e=Bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),tc(e.return,t,n)}function Yc(e,t,n,l,i,s){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:s}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=l,r.tail=n,r.tailMode=i,r.treeForkCount=s)}function pd(e,t,n){var l=t.pendingProps,i=l.revealOrder,s=l.tail;l=l.children;var r=Ge.current,m=(r&2)!==0;if(m?(r=r&1|2,t.flags|=128):r&=1,Y(Ge,r),at(e,t,l,n),l=Ne?ma:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gd(e,n,t);else if(e.tag===19)gd(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&&_i(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Yc(t,!1,i,n,s,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&&_i(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Yc(t,!0,n,null,s,l);break;case"together":Yc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Dl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Wt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Gc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&gi(e)))}function Wh(e,t,n){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),vn(t,Ve,e.memoizedState.cache),Pn();break;case 27:case 5:Lt(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Sn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?xd(e,t,n):(Sn(t),e=ln(e,t,n),e!==null?e.sibling:null);Sn(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Dl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return pd(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Y(Ge,Ge.current),l)break;return null;case 22:return t.lanes=0,rd(e,t,n,t.pendingProps);case 24:vn(t,Ve,e.memoizedState.cache)}return ln(e,t,n)}function bd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ke=!0;else{if(!Gc(e,n)&&(t.flags&128)===0)return Ke=!1,Wh(e,t,n);Ke=(e.flags&131072)!==0}else Ke=!1,Ne&&(t.flags&1048576)!==0&&Jr(t,ma,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ll(t.elementType),t.type=e,typeof e=="function")Ks(e)?(l=cl(e,l),t.tag=1,t=md(null,t,e,l,n)):(t.tag=0,t=Uc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===V){t.tag=11,t=sd(null,t,e,l,n);break e}else if(i===G){t.tag=14,t=cd(null,t,e,l,n);break e}}throw t=he(e)||e,Error(o(306,t,""))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=cl(l,t.pendingProps),md(e,t,l,i,n);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var s=t.memoizedState;i=s.element,uc(e,t),ja(t,l,null,n);var r=t.memoizedState;if(l=r.cache,vn(t,Ve,l),l!==s.cache&&nc(t,[Ve],n,!0),ya(),l=r.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:r.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=hd(e,t,l,n);break e}else if(l!==i){i=Ct(Error(o(424)),t),ha(i),t=hd(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(Oe=Rt(e.firstChild),nt=t,Ne=!0,pn=null,Dt=!0,n=uo(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pn(),l===i){t=ln(e,t,n);break e}at(e,t,l,n)}t=t.child}return t;case 26:return Ui(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,l=Ii(ce.current).createElement(n),l[tt]=t,l[ot]=e,it(l,n,e),We(l),t.stateNode=l):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Lt(t),e===null&&Ne&&(l=t.stateNode=Af(t.type,t.pendingProps,ce.current),nt=t,Dt=!0,i=Oe,Dn(t.type)?(ju=i,Oe=Rt(l.firstChild)):Oe=i),at(e,t,t.pendingProps.children,n),Ui(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((i=l=Oe)&&(l=Ax(l,t.type,t.pendingProps,Dt),l!==null?(t.stateNode=l,nt=t,Oe=Rt(l.firstChild),Dt=!1,i=!0):i=!1),i||bn(t)),Lt(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,l=s.children,gu(i,s)?l=null:r!==null&&gu(i,r)&&(t.flags|=32),t.memoizedState!==null&&(i=xc(e,t,Gh,null,null,n),Ya._currentValue=i),Ui(e,t),at(e,t,l,n),t.child;case 6:return e===null&&Ne&&((e=n=Oe)&&(n=Mx(n,t.pendingProps,Dt),n!==null?(t.stateNode=n,nt=t,Oe=null,e=!0):e=!1),e||bn(t)),null;case 13:return xd(e,t,n);case 4:return Be(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=il(t,null,l,n):at(e,t,l,n),t.child;case 11:return sd(e,t,t.type,t.pendingProps,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vn(t,t.type,l.value),at(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,tl(t),i=lt(i),l=l(i),t.flags|=1,at(e,t,l,n),t.child;case 14:return cd(e,t,t.type,t.pendingProps,n);case 15:return ud(e,t,t.type,t.pendingProps,n);case 19:return pd(e,t,n);case 31:return Fh(e,t,n);case 22:return rd(e,t,n,t.pendingProps);case 24:return tl(t),l=lt(Ve),e===null?(i=ic(),i===null&&(i=De,s=lc(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:l,cache:i},cc(t),vn(t,Ve,i)):((e.lanes&n)!==0&&(uc(e,t),ja(t,null,null,n),ya()),i=e.memoizedState,s=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),vn(t,Ve,l)):(l=s.cache,vn(t,Ve,l),l!==i.cache&&nc(t,[Ve],n,!0))),at(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function an(e){e.flags|=4}function Xc(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(Vd())e.flags|=8192;else throw al=yi,sc}else e.flags&=-16777217}function vd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Uf(t))if(Vd())e.flags|=8192;else throw al=yi,sc}function qi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wu():536870912,e.lanes|=t,Ql|=t)}function Aa(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Re(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 Ih(e,t,n){var l=t.pendingProps;switch(Ws(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Re(t),null;case 1:return Re(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),en(Ve),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(wl(t)?an(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ps())),Re(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(an(t),s!==null?(Re(t),vd(t,s)):(Re(t),Xc(t,i,null,l,n))):s?s!==e.memoizedState?(an(t),Re(t),vd(t,s)):(Re(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&an(t),Re(t),Xc(t,i,e,l,n)),null;case 27:if(Zt(t),n=ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Re(t),null}e=L.current,wl(t)?Wr(t):(e=Af(i,l,n),t.stateNode=e,an(t))}return Re(t),null;case 5:if(Zt(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Re(t),null}if(s=L.current,wl(t))Wr(t);else{var r=Ii(ce.current);switch(s){case 1:s=r.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=r.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=r.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=r.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=r.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(i,{is:l.is}):r.createElement(i)}}s[tt]=t,s[ot]=l;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=s;e:switch(it(s,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&&an(t)}}return Re(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&an(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ce.current,wl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=nt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||gf(e.nodeValue,n)),e||bn(t,!0)}else e=Ii(e).createTextNode(l),e[tt]=t,t.stateNode=e}return Re(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=wl(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[tt]=t}else Pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),e=!1}else n=Ps(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Re(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=wl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[tt]=t}else Pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Re(t),i=!1}else i=Ps(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),qi(t,t.updateQueue),Re(t),null);case 4:return fe(),e===null&&du(t.stateNode.containerInfo),Re(t),null;case 10:return en(t.type),Re(t),null;case 19:if(D(Ge),l=t.memoizedState,l===null)return Re(t),null;if(i=(t.flags&128)!==0,s=l.rendering,s===null)if(i)Aa(l,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=_i(e),s!==null){for(t.flags|=128,Aa(l,!1),e=s.updateQueue,t.updateQueue=e,qi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Zr(n,e),n=n.sibling;return Y(Ge,Ge.current&1|2),Ne&&It(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ke()>Gi&&(t.flags|=128,i=!0,Aa(l,!1),t.lanes=4194304)}else{if(!i)if(e=_i(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,qi(t,e),Aa(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ne)return Re(t),null}else 2*ke()-l.renderingStartTime>Gi&&n!==536870912&&(t.flags|=128,i=!0,Aa(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ke(),e.sibling=null,n=Ge.current,Y(Ge,i?n&1|2:n&1),Ne&&It(t,l.treeForkCount),e):(Re(t),null);case 22:case 23:return Nt(t),fc(),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&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),n=t.updateQueue,n!==null&&qi(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&&D(nl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),en(Ve),Re(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Ph(e,t){switch(Ws(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return en(Ve),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zt(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(o(340));Pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Ge),null;case 4:return fe(),null;case 10:return en(t.type),null;case 22:case 23:return Nt(t),fc(),e!==null&&D(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return en(Ve),null;case 25:return null;default:return null}}function yd(e,t){switch(Ws(t),t.tag){case 3:en(Ve),fe();break;case 26:case 27:case 5:Zt(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:D(Ge);break;case 10:en(t.type);break;case 22:case 23:Nt(t),fc(),e!==null&&D(nl);break;case 24:en(Ve)}}function Ma(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 s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==i)}}catch(m){Me(t,t.return,m)}}function Tn(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){var r=l.inst,m=r.destroy;if(m!==void 0){r.destroy=void 0,i=t;var p=n,T=m;try{T()}catch(U){Me(i,p,U)}}}l=l.next}while(l!==s)}}catch(U){Me(t,t.return,U)}}function jd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{oo(t,n)}catch(l){Me(e,e.return,l)}}}function Nd(e,t,n){n.props=cl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Me(e,t,l)}}function Ca(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){Me(e,t,i)}}function Xt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Me(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){Me(e,t,i)}else n.current=null}function Sd(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){Me(e,e.return,i)}}function Qc(e,t,n){try{var l=e.stateNode;jx(l,e.type,n,t),l[ot]=t}catch(i){Me(e,e.return,i)}}function _d(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dn(e.type)||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_d(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&&Dn(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 Zc(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=Jt));else if(l!==4&&(l===27&&Dn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Hi(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&&Dn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Hi(e,t,n),e=e.sibling;e!==null;)Hi(e,t,n),e=e.sibling}function Td(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);it(t,l,n),t[tt]=e,t[ot]=n}catch(s){Me(e,e.return,s)}}var sn=!1,$e=!1,Kc=!1,Ed=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function ex(e,t){if(e=e.containerInfo,hu=is,e=qr(e),Ls(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,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var r=0,m=-1,p=-1,T=0,U=0,B=e,M=null;t:for(;;){for(var z;B!==n||i!==0&&B.nodeType!==3||(m=r+i),B!==s||l!==0&&B.nodeType!==3||(p=r+l),B.nodeType===3&&(r+=B.nodeValue.length),(z=B.firstChild)!==null;)M=B,B=z;for(;;){if(B===e)break t;if(M===n&&++T===i&&(m=r),M===s&&++U===l&&(p=r),(z=B.nextSibling)!==null)break;B=M,M=B.parentNode}B=z}n=m===-1||p===-1?null:{start:m,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for(xu={focusedElem:e,selectionRange:n},is=!1,Ie=t;Ie!==null;)if(t=Ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ie=e;else for(;Ie!==null;){switch(t=Ie,s=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&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var ee=cl(n.type,i);e=l.getSnapshotBeforeUpdate(ee,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(re){Me(n,n.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)bu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ie=e;break}Ie=t.return}}function Ad(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:un(e,n),l&4&&Ma(5,n);break;case 1:if(un(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(r){Me(n,n.return,r)}else{var i=cl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){Me(n,n.return,r)}}l&64&&jd(n),l&512&&Ca(n,n.return);break;case 3:if(un(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{oo(e,t)}catch(r){Me(n,n.return,r)}}break;case 27:t===null&&l&4&&Td(n);case 26:case 5:un(e,n),t===null&&l&4&&Sd(n),l&512&&Ca(n,n.return);break;case 12:un(e,n);break;case 31:un(e,n),l&4&&zd(e,n);break;case 13:un(e,n),l&4&&wd(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rx.bind(null,n),Cx(e,n))));break;case 22:if(l=n.memoizedState!==null||sn,!l){t=t!==null&&t.memoizedState!==null||$e,i=sn;var s=$e;sn=l,($e=t)&&!s?rn(e,n,(n.subtreeFlags&8772)!==0):un(e,n),sn=i,$e=s}break;case 30:break;default:un(e,n)}}function Md(e){var t=e.alternate;t!==null&&(e.alternate=null,Md(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ss(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 qe=null,ft=!1;function cn(e,t,n){for(n=n.child;n!==null;)Cd(e,t,n),n=n.sibling}function Cd(e,t,n){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 26:$e||Xt(n,t),cn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$e||Xt(n,t);var l=qe,i=ft;Dn(n.type)&&(qe=n.stateNode,ft=!1),cn(e,t,n),Ha(n.stateNode),qe=l,ft=i;break;case 5:$e||Xt(n,t);case 6:if(l=qe,i=ft,qe=null,cn(e,t,n),qe=l,ft=i,qe!==null)if(ft)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(s){Me(n,t,s)}else try{qe.removeChild(n.stateNode)}catch(s){Me(n,t,s)}break;case 18:qe!==null&&(ft?(e=qe,Nf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Il(e)):Nf(qe,n.stateNode));break;case 4:l=qe,i=ft,qe=n.stateNode.containerInfo,ft=!0,cn(e,t,n),qe=l,ft=i;break;case 0:case 11:case 14:case 15:Tn(2,n,t),$e||Tn(4,n,t),cn(e,t,n);break;case 1:$e||(Xt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Nd(n,t,l)),cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:$e=(l=$e)||n.memoizedState!==null,cn(e,t,n),$e=l;break;default:cn(e,t,n)}}function zd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Il(e)}catch(n){Me(t,t.return,n)}}}function wd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Il(e)}catch(n){Me(t,t.return,n)}}function tx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ed),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ed),t;default:throw Error(o(435,e.tag))}}function Bi(e,t){var n=tx(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=ox.bind(null,e,l);l.then(i,i)}})}function mt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],s=e,r=t,m=r;e:for(;m!==null;){switch(m.tag){case 27:if(Dn(m.type)){qe=m.stateNode,ft=!1;break e}break;case 5:qe=m.stateNode,ft=!1;break e;case 3:case 4:qe=m.stateNode.containerInfo,ft=!0;break e}m=m.return}if(qe===null)throw Error(o(160));Cd(s,r,i),qe=null,ft=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Dd(t,e),t=t.sibling}var Ht=null;function Dd(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mt(t,e),ht(e),l&4&&(Tn(3,e,e.return),Ma(3,e),Tn(5,e,e.return));break;case 1:mt(t,e),ht(e),l&512&&($e||n===null||Xt(n,n.return)),l&64&&sn&&(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=Ht;if(mt(t,e),ht(e),l&512&&($e||n===null||Xt(n,n.return)),l&4){var s=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":s=i.getElementsByTagName("title")[0],(!s||s[na]||s[tt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(l),i.head.insertBefore(s,i.querySelector("head > title"))),it(s,l,n),s[tt]=e,We(s),l=s;break e;case"link":var r=Of("link","href",i).get(l+(n.href||""));if(r){for(var m=0;m<r.length;m++)if(s=r[m],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(m,1);break t}}s=i.createElement(l),it(s,l,n),i.head.appendChild(s);break;case"meta":if(r=Of("meta","content",i).get(l+(n.content||""))){for(m=0;m<r.length;m++)if(s=r[m],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(m,1);break t}}s=i.createElement(l),it(s,l,n),i.head.appendChild(s);break;default:throw Error(o(468,l))}s[tt]=e,We(s),l=s}e.stateNode=l}else Rf(i,e.type,e.stateNode);else e.stateNode=Df(i,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?Rf(i,e.type,e.stateNode):Df(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,n.memoizedProps)}break;case 27:mt(t,e),ht(e),l&512&&($e||n===null||Xt(n,n.return)),n!==null&&l&4&&Qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(mt(t,e),ht(e),l&512&&($e||n===null||Xt(n,n.return)),e.flags&32){i=e.stateNode;try{jl(i,"")}catch(ee){Me(e,e.return,ee)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,Qc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Kc=!0);break;case 6:if(mt(t,e),ht(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ee){Me(e,e.return,ee)}}break;case 3:if(ts=null,i=Ht,Ht=Pi(t.containerInfo),mt(t,e),Ht=i,ht(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Il(t.containerInfo)}catch(ee){Me(e,e.return,ee)}Kc&&(Kc=!1,Od(e));break;case 4:l=Ht,Ht=Pi(e.stateNode.containerInfo),mt(t,e),ht(e),Ht=l;break;case 12:mt(t,e),ht(e);break;case 31:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 13:mt(t,e),ht(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Yi=ke()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 22:i=e.memoizedState!==null;var p=n!==null&&n.memoizedState!==null,T=sn,U=$e;if(sn=T||i,$e=U||p,mt(t,e),$e=U,sn=T,ht(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||p||sn||$e||ul(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){p=n=t;try{if(s=p.stateNode,i)r=s.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{m=p.stateNode;var B=p.memoizedProps.style,M=B!=null&&B.hasOwnProperty("display")?B.display:null;m.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ee){Me(p,p.return,ee)}}}else if(t.tag===6){if(n===null){p=t;try{p.stateNode.nodeValue=i?"":p.memoizedProps}catch(ee){Me(p,p.return,ee)}}}else if(t.tag===18){if(n===null){p=t;try{var z=p.stateNode;i?Sf(z,!0):Sf(p.stateNode,!1)}catch(ee){Me(p,p.return,ee)}}}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,Bi(e,n))));break;case 19:mt(t,e),ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Bi(e,l)));break;case 30:break;case 21:break;default:mt(t,e),ht(e)}}function ht(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(_d(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,s=Vc(e);Hi(e,s,i);break;case 5:var r=n.stateNode;n.flags&32&&(jl(r,""),n.flags&=-33);var m=Vc(e);Hi(e,m,r);break;case 3:case 4:var p=n.stateNode.containerInfo,T=Vc(e);Zc(e,T,p);break;default:throw Error(o(161))}}catch(U){Me(e,e.return,U)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Od(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Od(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ad(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:Tn(4,t,t.return),ul(t);break;case 1:Xt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Nd(t,t.return,n),ul(t);break;case 27:Ha(t.stateNode);case 26:case 5:Xt(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 rn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,s=t,r=s.flags;switch(s.tag){case 0:case 11:case 15:rn(i,s,n),Ma(4,s);break;case 1:if(rn(i,s,n),l=s,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(T){Me(l,l.return,T)}if(l=s,i=l.updateQueue,i!==null){var m=l.stateNode;try{var p=i.shared.hiddenCallbacks;if(p!==null)for(i.shared.hiddenCallbacks=null,i=0;i<p.length;i++)ro(p[i],m)}catch(T){Me(l,l.return,T)}}n&&r&64&&jd(s),Ca(s,s.return);break;case 27:Td(s);case 26:case 5:rn(i,s,n),n&&l===null&&r&4&&Sd(s),Ca(s,s.return);break;case 12:rn(i,s,n);break;case 31:rn(i,s,n),n&&r&4&&zd(i,s);break;case 13:rn(i,s,n),n&&r&4&&wd(i,s);break;case 22:s.memoizedState===null&&rn(i,s,n),Ca(s,s.return);break;case 30:break;default:rn(i,s,n)}t=t.sibling}}function $c(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&&xa(n))}function Jc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xa(e))}function Bt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rd(e,t,n,l),t=t.sibling}function Rd(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Bt(e,t,n,l),i&2048&&Ma(9,t);break;case 1:Bt(e,t,n,l);break;case 3:Bt(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&&xa(e)));break;case 12:if(i&2048){Bt(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,r=s.id,m=s.onPostCommit;typeof m=="function"&&m(r,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(p){Me(t,t.return,p)}}else Bt(e,t,n,l);break;case 31:Bt(e,t,n,l);break;case 13:Bt(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,r=t.alternate,t.memoizedState!==null?s._visibility&2?Bt(e,t,n,l):za(e,t):s._visibility&2?Bt(e,t,n,l):(s._visibility|=2,Yl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&$c(r,t);break;case 24:Bt(e,t,n,l),i&2048&&Jc(t.alternate,t);break;default:Bt(e,t,n,l)}}function Yl(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,r=t,m=n,p=l,T=r.flags;switch(r.tag){case 0:case 11:case 15:Yl(s,r,m,p,i),Ma(8,r);break;case 23:break;case 22:var U=r.stateNode;r.memoizedState!==null?U._visibility&2?Yl(s,r,m,p,i):za(s,r):(U._visibility|=2,Yl(s,r,m,p,i)),i&&T&2048&&$c(r.alternate,r);break;case 24:Yl(s,r,m,p,i),i&&T&2048&&Jc(r.alternate,r);break;default:Yl(s,r,m,p,i)}t=t.sibling}}function za(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:za(n,l),i&2048&&$c(l.alternate,l);break;case 24:za(n,l),i&2048&&Jc(l.alternate,l);break;default:za(n,l)}t=t.sibling}}var wa=8192;function Gl(e,t,n){if(e.subtreeFlags&wa)for(e=e.child;e!==null;)Ud(e,t,n),e=e.sibling}function Ud(e,t,n){switch(e.tag){case 26:Gl(e,t,n),e.flags&wa&&e.memoizedState!==null&&Yx(n,Ht,e.memoizedState,e.memoizedProps);break;case 5:Gl(e,t,n);break;case 3:case 4:var l=Ht;Ht=Pi(e.stateNode.containerInfo),Gl(e,t,n),Ht=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=wa,wa=16777216,Gl(e,t,n),wa=l):Gl(e,t,n));break;default:Gl(e,t,n)}}function kd(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 Da(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];Ie=l,Hd(l,e)}kd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qd(e),e=e.sibling}function qd(e){switch(e.tag){case 0:case 11:case 15:Da(e),e.flags&2048&&Tn(9,e,e.return);break;case 3:Da(e);break;case 12:Da(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Li(e)):Da(e);break;default:Da(e)}}function Li(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];Ie=l,Hd(l,e)}kd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tn(8,t,t.return),Li(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Li(t));break;default:Li(t)}e=e.sibling}}function Hd(e,t){for(;Ie!==null;){var n=Ie;switch(n.tag){case 0:case 11:case 15:Tn(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:xa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Ie=l;else e:for(n=e;Ie!==null;){l=Ie;var i=l.sibling,s=l.return;if(Md(l),l===n){Ie=null;break e}if(i!==null){i.return=s,Ie=i;break e}Ie=s}}}var nx={getCacheForType:function(e){var t=lt(Ve),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return lt(Ve).controller.signal}},lx=typeof WeakMap=="function"?WeakMap:Map,Ee=0,De=null,be=null,ye=0,Ae=0,St=null,En=!1,Xl=!1,Fc=!1,on=0,Ye=0,An=0,rl=0,Wc=0,_t=0,Ql=0,Oa=null,xt=null,Ic=!1,Yi=0,Bd=0,Gi=1/0,Xi=null,Mn=null,Je=0,Cn=null,Vl=null,dn=0,Pc=0,eu=null,Ld=null,Ra=0,tu=null;function Tt(){return(Ee&2)!==0&&ye!==0?ye&-ye:S.T!==null?cu():tr()}function Yd(){if(_t===0)if((ye&536870912)===0||Ne){var e=Wa;Wa<<=1,(Wa&3932160)===0&&(Wa=262144),_t=e}else _t=536870912;return e=jt.current,e!==null&&(e.flags|=32),_t}function gt(e,t,n){(e===De&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(Zl(e,0),zn(e,ye,_t,!1)),ta(e,n),((Ee&2)===0||e!==De)&&(e===De&&((Ee&2)===0&&(rl|=n),Ye===4&&zn(e,ye,_t,!1)),Qt(e))}function Gd(e,t,n){if((Ee&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ea(e,t),i=l?sx(e,t):lu(e,t,!0),s=l;do{if(i===0){Xl&&!l&&zn(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!ax(n)){i=lu(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var r=0;else r=e.pendingLanes&-536870913,r=r!==0?r:r&536870912?536870912:0;if(r!==0){t=r;e:{var m=e;i=Oa;var p=m.current.memoizedState.isDehydrated;if(p&&(Zl(m,r).flags|=256),r=lu(m,r,!1),r!==2){if(Fc&&!p){m.errorRecoveryDisabledLanes|=s,rl|=s,i=4;break e}s=xt,xt=i,s!==null&&(xt===null?xt=s:xt.push.apply(xt,s))}i=r}if(s=!1,i!==2)continue}}if(i===1){Zl(e,0),zn(e,t,0,!0);break}e:{switch(l=e,s=i,s){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:zn(l,t,_t,!En);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=Yi+300-ke(),10<i)){if(zn(l,t,_t,!En),Pa(l,0,!0)!==0)break e;dn=t,l.timeoutHandle=yf(Xd.bind(null,l,n,xt,Xi,Ic,t,_t,rl,Ql,En,s,"Throttled",-0,0),i);break e}Xd(l,n,xt,Xi,Ic,t,_t,rl,Ql,En,s,null,-0,0)}}break}while(!0);Qt(e)}function Xd(e,t,n,l,i,s,r,m,p,T,U,B,M,z){if(e.timeoutHandle=-1,B=t.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Ud(t,s,B);var ee=(s&62914560)===s?Yi-ke():(s&4194048)===s?Bd-ke():0;if(ee=Gx(B,ee),ee!==null){dn=s,e.cancelPendingCommit=ee(Wd.bind(null,e,t,s,n,l,i,r,m,p,U,B,null,M,z)),zn(e,s,r,!T);return}}Wd(e,t,s,n,l,i,r,m,p)}function ax(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],s=i.getSnapshot;i=i.value;try{if(!vt(s(),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 zn(e,t,n,l){t&=~Wc,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var s=31-bt(i),r=1<<s;l[s]=-1,i&=~r}n!==0&&Iu(e,n,t)}function Qi(){return(Ee&6)===0?(Ua(0),!1):!0}function nu(){if(be!==null){if(Ae===0)var e=be.return;else e=be,Pt=el=null,bc(e),kl=null,pa=0,e=be;for(;e!==null;)yd(e.alternate,e),e=e.return;be=null}}function Zl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,_x(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),dn=0,nu(),De=e,be=n=Wt(e.current,null),ye=t,Ae=0,St=null,En=!1,Xl=ea(e,t),Fc=!1,Ql=_t=Wc=rl=An=Ye=0,xt=Oa=null,Ic=!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-bt(l),s=1<<i;t|=e[i],l&=~s}return on=t,di(),n}function Qd(e,t){xe=null,S.H=Ta,t===Ul||t===vi?(t=io(),Ae=3):t===sc?(t=io(),Ae=4):Ae=t===Rc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,St=t,be===null&&(Ye=1,Oi(e,Ct(t,e.current)))}function Vd(){var e=jt.current;return e===null?!0:(ye&4194048)===ye?Ot===null:(ye&62914560)===ye||(ye&536870912)!==0?e===Ot:!1}function Zd(){var e=S.H;return S.H=Ta,e===null?Ta:e}function Kd(){var e=S.A;return S.A=nx,e}function Vi(){Ye=4,En||(ye&4194048)!==ye&&jt.current!==null||(Xl=!0),(An&134217727)===0&&(rl&134217727)===0||De===null||zn(De,ye,_t,!1)}function lu(e,t,n){var l=Ee;Ee|=2;var i=Zd(),s=Kd();(De!==e||ye!==t)&&(Xi=null,Zl(e,t)),t=!1;var r=Ye;e:do try{if(Ae!==0&&be!==null){var m=be,p=St;switch(Ae){case 8:nu(),r=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var T=Ae;if(Ae=0,St=null,Kl(e,m,p,T),n&&Xl){r=0;break e}break;default:T=Ae,Ae=0,St=null,Kl(e,m,p,T)}}ix(),r=Ye;break}catch(U){Qd(e,U)}while(!0);return t&&e.shellSuspendCounter++,Pt=el=null,Ee=l,S.H=i,S.A=s,be===null&&(De=null,ye=0,di()),r}function ix(){for(;be!==null;)$d(be)}function sx(e,t){var n=Ee;Ee|=2;var l=Zd(),i=Kd();De!==e||ye!==t?(Xi=null,Gi=ke()+500,Zl(e,t)):Xl=ea(e,t);e:do try{if(Ae!==0&&be!==null){t=be;var s=St;t:switch(Ae){case 1:Ae=0,St=null,Kl(e,t,s,1);break;case 2:case 9:if(lo(s)){Ae=0,St=null,Jd(t);break}t=function(){Ae!==2&&Ae!==9||De!==e||(Ae=7),Qt(e)},s.then(t,t);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:lo(s)?(Ae=0,St=null,Jd(t)):(Ae=0,St=null,Kl(e,t,s,7));break;case 5:var r=null;switch(be.tag){case 26:r=be.memoizedState;case 5:case 27:var m=be;if(r?Uf(r):m.stateNode.complete){Ae=0,St=null;var p=m.sibling;if(p!==null)be=p;else{var T=m.return;T!==null?(be=T,Zi(T)):be=null}break t}}Ae=0,St=null,Kl(e,t,s,5);break;case 6:Ae=0,St=null,Kl(e,t,s,6);break;case 8:nu(),Ye=6;break e;default:throw Error(o(462))}}cx();break}catch(U){Qd(e,U)}while(!0);return Pt=el=null,S.H=l,S.A=i,Ee=n,be!==null?0:(De=null,ye=0,di(),Ye)}function cx(){for(;be!==null&&!et();)$d(be)}function $d(e){var t=bd(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?Zi(e):be=t}function Jd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fd(n,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=fd(n,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:bc(t);default:yd(n,t),t=be=Zr(t,on),t=bd(n,t,on)}e.memoizedProps=e.pendingProps,t===null?Zi(e):be=t}function Kl(e,t,n,l){Pt=el=null,bc(t),kl=null,pa=0;var i=t.return;try{if(Jh(e,i,t,n,ye)){Ye=1,Oi(e,Ct(n,e.current)),be=null;return}}catch(s){if(i!==null)throw be=i,s;Ye=1,Oi(e,Ct(n,e.current)),be=null;return}t.flags&32768?(Ne||l===1?e=!0:Xl||(ye&536870912)!==0?e=!1:(En=e=!0,(l===2||l===9||l===3||l===6)&&(l=jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Fd(t,e)):Zi(t)}function Zi(e){var t=e;do{if((t.flags&32768)!==0){Fd(t,En);return}e=t.return;var n=Ih(t.alternate,t,on);if(n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ye===0&&(Ye=5)}function Fd(e,t){do{var n=Ph(e.alternate,e);if(n!==null){n.flags&=32767,be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=n}while(e!==null);Ye=6,be=null}function Wd(e,t,n,l,i,s,r,m,p){e.cancelPendingCommit=null;do Ki();while(Je!==0);if((Ee&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(s=t.lanes|t.childLanes,s|=Vs,Lm(e,n,s,r,m,p),e===De&&(be=De=null,ye=0),Vl=t,Cn=e,dn=n,Pc=s,eu=i,Ld=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,dx(Ja,function(){return nf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=S.T,S.T=null,i=q.p,q.p=2,r=Ee,Ee|=4;try{ex(e,t,n)}finally{Ee=r,q.p=i,S.T=l}}Je=1,Id(),Pd(),ef()}}function Id(){if(Je===1){Je=0;var e=Cn,t=Vl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=S.T,S.T=null;var l=q.p;q.p=2;var i=Ee;Ee|=4;try{Dd(t,e);var s=xu,r=qr(e.containerInfo),m=s.focusedElem,p=s.selectionRange;if(r!==m&&m&&m.ownerDocument&&kr(m.ownerDocument.documentElement,m)){if(p!==null&&Ls(m)){var T=p.start,U=p.end;if(U===void 0&&(U=T),"selectionStart"in m)m.selectionStart=T,m.selectionEnd=Math.min(U,m.value.length);else{var B=m.ownerDocument||document,M=B&&B.defaultView||window;if(M.getSelection){var z=M.getSelection(),ee=m.textContent.length,re=Math.min(p.start,ee),we=p.end===void 0?re:Math.min(p.end,ee);!z.extend&&re>we&&(r=we,we=re,re=r);var N=Ur(m,re),y=Ur(m,we);if(N&&y&&(z.rangeCount!==1||z.anchorNode!==N.node||z.anchorOffset!==N.offset||z.focusNode!==y.node||z.focusOffset!==y.offset)){var _=B.createRange();_.setStart(N.node,N.offset),z.removeAllRanges(),re>we?(z.addRange(_),z.extend(y.node,y.offset)):(_.setEnd(y.node,y.offset),z.addRange(_))}}}}for(B=[],z=m;z=z.parentNode;)z.nodeType===1&&B.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<B.length;m++){var k=B[m];k.element.scrollLeft=k.left,k.element.scrollTop=k.top}}is=!!hu,xu=hu=null}finally{Ee=i,q.p=l,S.T=n}}e.current=t,Je=2}}function Pd(){if(Je===2){Je=0;var e=Cn,t=Vl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=S.T,S.T=null;var l=q.p;q.p=2;var i=Ee;Ee|=4;try{Ad(e,t.alternate,t)}finally{Ee=i,q.p=l,S.T=n}}Je=3}}function ef(){if(Je===4||Je===3){Je=0,kt();var e=Cn,t=Vl,n=dn,l=Ld;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Vl=Cn=null,tf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Mn=null),js(n),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=S.T,i=q.p,q.p=2,S.T=null;try{for(var s=e.onRecoverableError,r=0;r<l.length;r++){var m=l[r];s(m.value,{componentStack:m.stack})}}finally{S.T=t,q.p=i}}(dn&3)!==0&&Ki(),Qt(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===tu?Ra++:(Ra=0,tu=e):Ra=0,Ua(0)}}function tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xa(t)))}function Ki(){return Id(),Pd(),ef(),nf()}function nf(){if(Je!==5)return!1;var e=Cn,t=Pc;Pc=0;var n=js(dn),l=S.T,i=q.p;try{q.p=32>n?32:n,S.T=null,n=eu,eu=null;var s=Cn,r=dn;if(Je=0,Vl=Cn=null,dn=0,(Ee&6)!==0)throw Error(o(331));var m=Ee;if(Ee|=4,qd(s.current),Rd(s,s.current,r,n),Ee=m,Ua(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Pl,s)}catch{}return!0}finally{q.p=i,S.T=l,tf(e,t)}}function lf(e,t,n){t=Ct(n,t),t=Oc(e.stateNode,t,2),e=Nn(e,t,2),e!==null&&(ta(e,2),Qt(e))}function Me(e,t,n){if(e.tag===3)lf(e,e,n);else for(;t!==null;){if(t.tag===3){lf(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Mn===null||!Mn.has(l))){e=Ct(n,e),n=ad(2),l=Nn(t,n,2),l!==null&&(id(n,l,t,e),ta(l,2),Qt(l));break}}t=t.return}}function au(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lx;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)||(Fc=!0,i.add(n),e=ux.bind(null,e,t,n),t.then(e,e))}function ux(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,De===e&&(ye&n)===n&&(Ye===4||Ye===3&&(ye&62914560)===ye&&300>ke()-Yi?(Ee&2)===0&&Zl(e,0):Wc|=n,Ql===ye&&(Ql=0)),Qt(e)}function af(e,t){t===0&&(t=Wu()),e=Wn(e,t),e!==null&&(ta(e,t),Qt(e))}function rx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),af(e,n)}function ox(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(o(314))}l!==null&&l.delete(t),af(e,n)}function dx(e,t){return Ue(e,t)}var $i=null,$l=null,iu=!1,Ji=!1,su=!1,wn=0;function Qt(e){e!==$l&&e.next===null&&($l===null?$i=$l=e:$l=$l.next=e),Ji=!0,iu||(iu=!0,mx())}function Ua(e,t){if(!su&&Ji){su=!0;do for(var n=!1,l=$i;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var s=0;else{var r=l.suspendedLanes,m=l.pingedLanes;s=(1<<31-bt(42|e)+1)-1,s&=i&~(r&~m),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,rf(l,s))}else s=ye,s=Pa(l,l===De?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||ea(l,s)||(n=!0,rf(l,s));l=l.next}while(n);su=!1}}function fx(){sf()}function sf(){Ji=iu=!1;var e=0;wn!==0&&Sx()&&(e=wn);for(var t=ke(),n=null,l=$i;l!==null;){var i=l.next,s=cf(l,t);s===0?(l.next=null,n===null?$i=i:n.next=i,i===null&&($l=n)):(n=l,(e!==0||(s&3)!==0)&&(Ji=!0)),l=i}Je!==0&&Je!==5||Ua(e),wn!==0&&(wn=0)}function cf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var r=31-bt(s),m=1<<r,p=i[r];p===-1?((m&n)===0||(m&l)!==0)&&(i[r]=Bm(m,t)):p<=t&&(e.expiredLanes|=m),s&=~m}if(t=De,n=ye,n=Pa(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Fe(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Fe(l),js(n)){case 2:case 8:n=Ju;break;case 32:n=Ja;break;case 268435456:n=Fu;break;default:n=Ja}return l=uf.bind(null,e),n=Ue(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Fe(l),e.callbackPriority=2,e.callbackNode=null,2}function uf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ki()&&e.callbackNode!==n)return null;var l=ye;return l=Pa(e,e===De?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Gd(e,l,t),cf(e,ke()),e.callbackNode!=null&&e.callbackNode===n?uf.bind(null,e):null)}function rf(e,t){if(Ki())return null;Gd(e,t,!0)}function mx(){Tx(function(){(Ee&6)!==0?Ue(Vn,fx):sf()})}function cu(){if(wn===0){var e=Ol;e===0&&(e=Fa,Fa<<=1,(Fa&261888)===0&&(Fa=256)),wn=e}return wn}function of(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:li(""+e)}function df(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 hx(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var s=of((i[ot]||null).action),r=l.submitter;r&&(t=(t=r[ot]||null)?of(t.formAction):r.getAttribute("formAction"),t!==null&&(s=t,r=null));var m=new ci("action","action",null,l,i);e.push({event:m,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(wn!==0){var p=r?df(i,r):new FormData(i);Ac(n,{pending:!0,data:p,method:i.method,action:s},null,p)}}else typeof s=="function"&&(m.preventDefault(),p=r?df(i,r):new FormData(i),Ac(n,{pending:!0,data:p,method:i.method,action:s},s,p))},currentTarget:i}]})}}for(var uu=0;uu<Qs.length;uu++){var ru=Qs[uu],xx=ru.toLowerCase(),gx=ru[0].toUpperCase()+ru.slice(1);qt(xx,"on"+gx)}qt(Lr,"onAnimationEnd"),qt(Yr,"onAnimationIteration"),qt(Gr,"onAnimationStart"),qt("dblclick","onDoubleClick"),qt("focusin","onFocus"),qt("focusout","onBlur"),qt(Dh,"onTransitionRun"),qt(Oh,"onTransitionStart"),qt(Rh,"onTransitionCancel"),qt(Xr,"onTransitionEnd"),vl("onMouseEnter",["mouseout","mouseover"]),vl("onMouseLeave",["mouseout","mouseover"]),vl("onPointerEnter",["pointerout","pointerover"]),vl("onPointerLeave",["pointerout","pointerover"]),Kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ka="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(" "),px=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ka));function ff(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 s=void 0;if(t)for(var r=l.length-1;0<=r;r--){var m=l[r],p=m.instance,T=m.currentTarget;if(m=m.listener,p!==s&&i.isPropagationStopped())break e;s=m,i.currentTarget=T;try{s(i)}catch(U){oi(U)}i.currentTarget=null,s=p}else for(r=0;r<l.length;r++){if(m=l[r],p=m.instance,T=m.currentTarget,m=m.listener,p!==s&&i.isPropagationStopped())break e;s=m,i.currentTarget=T;try{s(i)}catch(U){oi(U)}i.currentTarget=null,s=p}}}}function ve(e,t){var n=t[Ns];n===void 0&&(n=t[Ns]=new Set);var l=e+"__bubble";n.has(l)||(mf(t,e,2,!1),n.add(l))}function ou(e,t,n){var l=0;t&&(l|=4),mf(n,e,l,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function du(e){if(!e[Fi]){e[Fi]=!0,ar.forEach(function(n){n!=="selectionchange"&&(px.has(n)||ou(n,!1,e),ou(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,ou("selectionchange",!1,t))}}function mf(e,t,n,l){switch(Gf(t)){case 2:var i=Vx;break;case 8:i=Zx;break;default:i=Eu}n=i.bind(null,t,n,e),i=void 0,!ws||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 fu(e,t,n,l,i){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var r=l.tag;if(r===3||r===4){var m=l.stateNode.containerInfo;if(m===i)break;if(r===4)for(r=l.return;r!==null;){var p=r.tag;if((p===3||p===4)&&r.stateNode.containerInfo===i)return;r=r.return}for(;m!==null;){if(r=gl(m),r===null)return;if(p=r.tag,p===5||p===6||p===26||p===27){l=s=r;continue e}m=m.parentNode}}l=l.return}gr(function(){var T=s,U=Cs(n),B=[];e:{var M=Qr.get(e);if(M!==void 0){var z=ci,ee=e;switch(e){case"keypress":if(ii(n)===0)break e;case"keydown":case"keyup":z=oh;break;case"focusin":ee="focus",z=Us;break;case"focusout":ee="blur",z=Us;break;case"beforeblur":case"afterblur":z=Us;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":z=vr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=Im;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=mh;break;case Lr:case Yr:case Gr:z=th;break;case Xr:z=xh;break;case"scroll":case"scrollend":z=Fm;break;case"wheel":z=ph;break;case"copy":case"cut":case"paste":z=lh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=jr;break;case"toggle":case"beforetoggle":z=vh}var re=(t&4)!==0,we=!re&&(e==="scroll"||e==="scrollend"),N=re?M!==null?M+"Capture":null:M;re=[];for(var y=T,_;y!==null;){var k=y;if(_=k.stateNode,k=k.tag,k!==5&&k!==26&&k!==27||_===null||N===null||(k=aa(y,N),k!=null&&re.push(qa(y,k,_))),we)break;y=y.return}0<re.length&&(M=new z(M,ee,null,n,U),B.push({event:M,listeners:re}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",M&&n!==Ms&&(ee=n.relatedTarget||n.fromElement)&&(gl(ee)||ee[xl]))break e;if((z||M)&&(M=U.window===U?U:(M=U.ownerDocument)?M.defaultView||M.parentWindow:window,z?(ee=n.relatedTarget||n.toElement,z=T,ee=ee?gl(ee):null,ee!==null&&(we=h(ee),re=ee.tag,ee!==we||re!==5&&re!==27&&re!==6)&&(ee=null)):(z=null,ee=T),z!==ee)){if(re=vr,k="onMouseLeave",N="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(re=jr,k="onPointerLeave",N="onPointerEnter",y="pointer"),we=z==null?M:la(z),_=ee==null?M:la(ee),M=new re(k,y+"leave",z,n,U),M.target=we,M.relatedTarget=_,k=null,gl(U)===T&&(re=new re(N,y+"enter",ee,n,U),re.target=_,re.relatedTarget=we,k=re),we=k,z&&ee)t:{for(re=bx,N=z,y=ee,_=0,k=N;k;k=re(k))_++;k=0;for(var se=y;se;se=re(se))k++;for(;0<_-k;)N=re(N),_--;for(;0<k-_;)y=re(y),k--;for(;_--;){if(N===y||y!==null&&N===y.alternate){re=N;break t}N=re(N),y=re(y)}re=null}else re=null;z!==null&&hf(B,M,z,re,!1),ee!==null&&we!==null&&hf(B,we,ee,re,!0)}}e:{if(M=T?la(T):window,z=M.nodeName&&M.nodeName.toLowerCase(),z==="select"||z==="input"&&M.type==="file")var _e=Cr;else if(Ar(M))if(zr)_e=Ch;else{_e=Ah;var le=Eh}else z=M.nodeName,!z||z.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?T&&As(T.elementType)&&(_e=Cr):_e=Mh;if(_e&&(_e=_e(e,T))){Mr(B,_e,n,U);break e}le&&le(e,M,T),e==="focusout"&&T&&M.type==="number"&&T.memoizedProps.value!=null&&Es(M,"number",M.value)}switch(le=T?la(T):window,e){case"focusin":(Ar(le)||le.contentEditable==="true")&&(Tl=le,Ys=T,fa=null);break;case"focusout":fa=Ys=Tl=null;break;case"mousedown":Gs=!0;break;case"contextmenu":case"mouseup":case"dragend":Gs=!1,Hr(B,n,U);break;case"selectionchange":if(wh)break;case"keydown":case"keyup":Hr(B,n,U)}var ge;if(qs)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else _l?Tr(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(Nr&&n.locale!=="ko"&&(_l||je!=="onCompositionStart"?je==="onCompositionEnd"&&_l&&(ge=pr()):(xn=U,Ds="value"in xn?xn.value:xn.textContent,_l=!0)),le=Wi(T,je),0<le.length&&(je=new yr(je,e,null,n,U),B.push({event:je,listeners:le}),ge?je.data=ge:(ge=Er(n),ge!==null&&(je.data=ge)))),(ge=jh?Nh(e,n):Sh(e,n))&&(je=Wi(T,"onBeforeInput"),0<je.length&&(le=new yr("onBeforeInput","beforeinput",null,n,U),B.push({event:le,listeners:je}),le.data=ge)),hx(B,e,T,n,U)}ff(B,t)})}function qa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Wi(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=aa(e,n),i!=null&&l.unshift(qa(e,i,s)),i=aa(e,t),i!=null&&l.push(qa(e,i,s))),e.tag===3)return l;e=e.return}return[]}function bx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hf(e,t,n,l,i){for(var s=t._reactName,r=[];n!==null&&n!==l;){var m=n,p=m.alternate,T=m.stateNode;if(m=m.tag,p!==null&&p===l)break;m!==5&&m!==26&&m!==27||T===null||(p=T,i?(T=aa(n,s),T!=null&&r.unshift(qa(n,T,p))):i||(T=aa(n,s),T!=null&&r.push(qa(n,T,p)))),n=n.return}r.length!==0&&e.push({event:t,listeners:r})}var vx=/\r\n?/g,yx=/\u0000|\uFFFD/g;function xf(e){return(typeof e=="string"?e:""+e).replace(vx,`
49
+ `).replace(yx,"")}function gf(e,t){return t=xf(t),xf(e)===t}function ze(e,t,n,l,i,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||jl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&jl(e,""+l);break;case"className":ti(e,"class",l);break;case"tabIndex":ti(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ti(e,n,l);break;case"style":hr(e,l,s);break;case"data":if(t!=="object"){ti(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=li(""+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 s=="function"&&(n==="formAction"?(t!=="input"&&ze(e,t,"name",i.name,i,null),ze(e,t,"formEncType",i.formEncType,i,null),ze(e,t,"formMethod",i.formMethod,i,null),ze(e,t,"formTarget",i.formTarget,i,null)):(ze(e,t,"encType",i.encType,i,null),ze(e,t,"method",i.method,i,null),ze(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=li(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=li(""+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":ve("beforetoggle",e),ve("toggle",e),ei(e,"popover",l);break;case"xlinkActuate":$t(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":$t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":$t(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":$t(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":$t(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":$t(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":$t(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":$t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":$t(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ei(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=$m.get(n)||n,ei(e,n,l))}}function mu(e,t,n,l,i,s){switch(n){case"style":hr(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?jl(e,l):(typeof l=="number"||typeof l=="bigint")&&jl(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ir.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[ot]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof l=="function")){typeof s!="function"&&s!==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,""):ei(e,n,l)}}}function it(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,i=!1,s;for(s in n)if(n.hasOwnProperty(s)){var r=n[s];if(r!=null)switch(s){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ze(e,t,s,r,n,null)}}i&&ze(e,t,"srcSet",n.srcSet,n,null),l&&ze(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var m=s=r=i=null,p=null,T=null;for(l in n)if(n.hasOwnProperty(l)){var U=n[l];if(U!=null)switch(l){case"name":i=U;break;case"type":r=U;break;case"checked":p=U;break;case"defaultChecked":T=U;break;case"value":s=U;break;case"defaultValue":m=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:ze(e,t,l,U,n,null)}}or(e,s,m,p,T,r,i,!1);return;case"select":ve("invalid",e),l=r=s=null;for(i in n)if(n.hasOwnProperty(i)&&(m=n[i],m!=null))switch(i){case"value":s=m;break;case"defaultValue":r=m;break;case"multiple":l=m;default:ze(e,t,i,m,n,null)}t=s,n=r,e.multiple=!!l,t!=null?yl(e,!!l,t,!1):n!=null&&yl(e,!!l,n,!0);return;case"textarea":ve("invalid",e),s=i=l=null;for(r in n)if(n.hasOwnProperty(r)&&(m=n[r],m!=null))switch(r){case"value":l=m;break;case"defaultValue":i=m;break;case"children":s=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:ze(e,t,r,m,n,null)}fr(e,l,i,s);return;case"option":for(p in n)if(n.hasOwnProperty(p)&&(l=n[p],l!=null))switch(p){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ze(e,t,p,l,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<ka.length;l++)ve(ka[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(T in n)if(n.hasOwnProperty(T)&&(l=n[T],l!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ze(e,t,T,l,n,null)}return;default:if(As(t)){for(U in n)n.hasOwnProperty(U)&&(l=n[U],l!==void 0&&mu(e,t,U,l,n,void 0));return}}for(m in n)n.hasOwnProperty(m)&&(l=n[m],l!=null&&ze(e,t,m,l,n,null))}function jx(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,s=null,r=null,m=null,p=null,T=null,U=null;for(z in n){var B=n[z];if(n.hasOwnProperty(z)&&B!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":p=B;default:l.hasOwnProperty(z)||ze(e,t,z,null,l,B)}}for(var M in l){var z=l[M];if(B=n[M],l.hasOwnProperty(M)&&(z!=null||B!=null))switch(M){case"type":s=z;break;case"name":i=z;break;case"checked":T=z;break;case"defaultChecked":U=z;break;case"value":r=z;break;case"defaultValue":m=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(137,t));break;default:z!==B&&ze(e,t,M,z,l,B)}}Ts(e,r,m,p,T,U,s,i);return;case"select":z=r=m=M=null;for(s in n)if(p=n[s],n.hasOwnProperty(s)&&p!=null)switch(s){case"value":break;case"multiple":z=p;default:l.hasOwnProperty(s)||ze(e,t,s,null,l,p)}for(i in l)if(s=l[i],p=n[i],l.hasOwnProperty(i)&&(s!=null||p!=null))switch(i){case"value":M=s;break;case"defaultValue":m=s;break;case"multiple":r=s;default:s!==p&&ze(e,t,i,s,l,p)}t=m,n=r,l=z,M!=null?yl(e,!!n,M,!1):!!l!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:"",!1));return;case"textarea":z=M=null;for(m in n)if(i=n[m],n.hasOwnProperty(m)&&i!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:ze(e,t,m,null,l,i)}for(r in l)if(i=l[r],s=n[r],l.hasOwnProperty(r)&&(i!=null||s!=null))switch(r){case"value":M=i;break;case"defaultValue":z=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==s&&ze(e,t,r,i,l,s)}dr(e,M,z);return;case"option":for(var ee in n)if(M=n[ee],n.hasOwnProperty(ee)&&M!=null&&!l.hasOwnProperty(ee))switch(ee){case"selected":e.selected=!1;break;default:ze(e,t,ee,null,l,M)}for(p in l)if(M=l[p],z=n[p],l.hasOwnProperty(p)&&M!==z&&(M!=null||z!=null))switch(p){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:ze(e,t,p,M,l,z)}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 re in n)M=n[re],n.hasOwnProperty(re)&&M!=null&&!l.hasOwnProperty(re)&&ze(e,t,re,null,l,M);for(T in l)if(M=l[T],z=n[T],l.hasOwnProperty(T)&&M!==z&&(M!=null||z!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:ze(e,t,T,M,l,z)}return;default:if(As(t)){for(var we in n)M=n[we],n.hasOwnProperty(we)&&M!==void 0&&!l.hasOwnProperty(we)&&mu(e,t,we,void 0,l,M);for(U in l)M=l[U],z=n[U],!l.hasOwnProperty(U)||M===z||M===void 0&&z===void 0||mu(e,t,U,M,l,z);return}}for(var N in n)M=n[N],n.hasOwnProperty(N)&&M!=null&&!l.hasOwnProperty(N)&&ze(e,t,N,null,l,M);for(B in l)M=l[B],z=n[B],!l.hasOwnProperty(B)||M===z||M==null&&z==null||ze(e,t,B,M,l,z)}function pf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Nx(){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],s=i.transferSize,r=i.initiatorType,m=i.duration;if(s&&m&&pf(r)){for(r=0,m=i.responseEnd,l+=1;l<n.length;l++){var p=n[l],T=p.startTime;if(T>m)break;var U=p.transferSize,B=p.initiatorType;U&&pf(B)&&(p=p.responseEnd,r+=U*(p<m?1:(m-T)/(p-T)))}if(--l,t+=8*(s+r)/(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 hu=null,xu=null;function Ii(e){return e.nodeType===9?e:e.ownerDocument}function bf(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 vf(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 gu(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 pu=null;function Sx(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var yf=typeof setTimeout=="function"?setTimeout:void 0,_x=typeof clearTimeout=="function"?clearTimeout:void 0,jf=typeof Promise=="function"?Promise:void 0,Tx=typeof queueMicrotask=="function"?queueMicrotask:typeof jf<"u"?function(e){return jf.resolve(null).then(e).catch(Ex)}:yf;function Ex(e){setTimeout(function(){throw e})}function Dn(e){return e==="head"}function Nf(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),Il(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Ha(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ha(n);for(var s=n.firstChild;s;){var r=s.nextSibling,m=s.nodeName;s[na]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=r}}else n==="body"&&Ha(e.ownerDocument.body);n=i}while(n);Il(t)}function Sf(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 bu(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":bu(n),Ss(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Ax(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[na])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==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(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Rt(e.nextSibling),e===null)break}return null}function Mx(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rt(e.nextSibling),e===null))return null;return e}function _f(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rt(e.nextSibling),e===null))return null;return e}function vu(e){return e.data==="$?"||e.data==="$~"}function yu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Cx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Rt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ju=null;function Tf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Ef(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 Af(e,t,n){switch(t=Ii(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ha(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ss(e)}var Ut=new Map,Mf=new Set;function Pi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fn=q.d;q.d={f:zx,r:wx,D:Dx,C:Ox,L:Rx,m:Ux,X:qx,S:kx,M:Hx};function zx(){var e=fn.f(),t=Qi();return e||t}function wx(e){var t=pl(e);t!==null&&t.tag===5&&t.type==="form"?Qo(t):fn.r(e)}var Jl=typeof document>"u"?null:document;function Cf(e,t,n){var l=Jl;if(l&&typeof t=="string"&&t){var i=At(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Mf.has(i)||(Mf.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),it(t,"link",e),We(t),l.head.appendChild(t)))}}function Dx(e){fn.D(e),Cf("dns-prefetch",e,null)}function Ox(e,t){fn.C(e,t),Cf("preconnect",e,t)}function Rx(e,t,n){fn.L(e,t,n);var l=Jl;if(l&&e&&t){var i='link[rel="preload"][as="'+At(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+At(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+At(n.imageSizes)+'"]')):i+='[href="'+At(e)+'"]';var s=i;switch(t){case"style":s=Fl(e);break;case"script":s=Wl(e)}Ut.has(s)||(e=w({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ut.set(s,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ba(s))||t==="script"&&l.querySelector(La(s))||(t=l.createElement("link"),it(t,"link",e),We(t),l.head.appendChild(t)))}}function Ux(e,t){fn.m(e,t);var n=Jl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+At(l)+'"][href="'+At(e)+'"]',s=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Wl(e)}if(!Ut.has(s)&&(e=w({rel:"modulepreload",href:e},t),Ut.set(s,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(La(s)))return}l=n.createElement("link"),it(l,"link",e),We(l),n.head.appendChild(l)}}}function kx(e,t,n){fn.S(e,t,n);var l=Jl;if(l&&e){var i=bl(l).hoistableStyles,s=Fl(e);t=t||"default";var r=i.get(s);if(!r){var m={loading:0,preload:null};if(r=l.querySelector(Ba(s)))m.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ut.get(s))&&Nu(e,n);var p=r=l.createElement("link");We(p),it(p,"link",e),p._p=new Promise(function(T,U){p.onload=T,p.onerror=U}),p.addEventListener("load",function(){m.loading|=1}),p.addEventListener("error",function(){m.loading|=2}),m.loading|=4,es(r,t,l)}r={type:"stylesheet",instance:r,count:1,state:m},i.set(s,r)}}}function qx(e,t){fn.X(e,t);var n=Jl;if(n&&e){var l=bl(n).hoistableScripts,i=Wl(e),s=l.get(i);s||(s=n.querySelector(La(i)),s||(e=w({src:e,async:!0},t),(t=Ut.get(i))&&Su(e,t),s=n.createElement("script"),We(s),it(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function Hx(e,t){fn.M(e,t);var n=Jl;if(n&&e){var l=bl(n).hoistableScripts,i=Wl(e),s=l.get(i);s||(s=n.querySelector(La(i)),s||(e=w({src:e,async:!0,type:"module"},t),(t=Ut.get(i))&&Su(e,t),s=n.createElement("script"),We(s),it(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function zf(e,t,n,l){var i=(i=ce.current)?Pi(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Fl(n.href),n=bl(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=Fl(n.href);var s=bl(i).hoistableStyles,r=s.get(e);if(r||(i=i.ownerDocument||i,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,r),(s=i.querySelector(Ba(e)))&&!s._p&&(r.instance=s,r.state.loading=5),Ut.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},Ut.set(e,n),s||Bx(i,e,n,r.state))),t&&l===null)throw Error(o(528,""));return r}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wl(n),n=bl(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(o(444,e))}}function Fl(e){return'href="'+At(e)+'"'}function Ba(e){return'link[rel="stylesheet"]['+e+"]"}function wf(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Bx(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),it(t,"link",n),We(t),e.head.appendChild(t))}function Wl(e){return'[src="'+At(e)+'"]'}function La(e){return"script[async]"+e}function Df(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+At(n.href)+'"]');if(l)return t.instance=l,We(l),l;var i=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),We(l),it(l,"style",i),es(l,n.precedence,e),t.instance=l;case"stylesheet":i=Fl(n.href);var s=e.querySelector(Ba(i));if(s)return t.state.loading|=4,t.instance=s,We(s),s;l=wf(n),(i=Ut.get(i))&&Nu(l,i),s=(e.ownerDocument||e).createElement("link"),We(s);var r=s;return r._p=new Promise(function(m,p){r.onload=m,r.onerror=p}),it(s,"link",l),t.state.loading|=4,es(s,n.precedence,e),t.instance=s;case"script":return s=Wl(n.src),(i=e.querySelector(La(s)))?(t.instance=i,We(i),i):(l=n,(i=Ut.get(s))&&(l=w({},n),Su(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),We(i),it(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,es(l,n.precedence,e));return t.instance}function es(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,s=i,r=0;r<l.length;r++){var m=l[r];if(m.dataset.precedence===t)s=m;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Nu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ts=null;function Of(e,t,n){if(ts===null){var l=new Map,i=ts=new Map;i.set(n,l)}else i=ts,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 s=n[i];if(!(s[na]||s[tt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var r=s.getAttribute(t)||"";r=e+r;var m=l.get(r);m?m.push(s):l.set(r,[s])}}return l}function Rf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Lx(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 Uf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Yx(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=Fl(l.href),s=t.querySelector(Ba(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ns.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,We(s);return}s=t.ownerDocument||t,l=wf(l),(i=Ut.get(i))&&Nu(l,i),s=s.createElement("link"),We(s);var r=s;r._p=new Promise(function(m,p){r.onload=m,r.onerror=p}),it(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ns.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var _u=0;function Gx(e,t){return e.stylesheets&&e.count===0&&as(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&as(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&_u===0&&(_u=62500*Nx());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&as(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>_u?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function ns(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)as(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ls=null;function as(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ls=new Map,t.forEach(Xx,e),ls=null,ns.call(e))}function Xx(e,t){if(!(t.state.loading&4)){var n=ls.get(e);if(n)var l=n.get(null);else{n=new Map,ls.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var r=i[s];(r.nodeName==="LINK"||r.getAttribute("media")!=="not all")&&(n.set(r.dataset.precedence,r),l=r)}l&&n.set(null,l)}i=t.instance,r=i.getAttribute("data-precedence"),s=n.get(r)||l,s===l&&n.set(null,i),n.set(r,i),this.count++,l=ns.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ya={$$typeof:K,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function Qx(e,t,n,l,i,s,r,m,p){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=vs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vs(0),this.hiddenUpdates=vs(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=r,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=p,this.incompleteTransitions=new Map}function kf(e,t,n,l,i,s,r,m,p,T,U,B){return e=new Qx(e,t,n,r,p,T,U,B,m),t=1,s===!0&&(t|=24),s=yt(3,null,null,t),e.current=s,s.stateNode=e,t=lc(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},cc(s),e}function qf(e){return e?(e=Ml,e):Ml}function Hf(e,t,n,l,i,s){i=qf(i),l.context===null?l.context=i:l.pendingContext=i,l=jn(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=Nn(e,l,t),n!==null&&(gt(n,e,t),va(n,e,t))}function Bf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tu(e,t){Bf(e,t),(e=e.alternate)&&Bf(e,t)}function Lf(e){if(e.tag===13||e.tag===31){var t=Wn(e,67108864);t!==null&&gt(t,e,67108864),Tu(e,67108864)}}function Yf(e){if(e.tag===13||e.tag===31){var t=Tt();t=ys(t);var n=Wn(e,t);n!==null&&gt(n,e,t),Tu(e,t)}}var is=!0;function Vx(e,t,n,l){var i=S.T;S.T=null;var s=q.p;try{q.p=2,Eu(e,t,n,l)}finally{q.p=s,S.T=i}}function Zx(e,t,n,l){var i=S.T;S.T=null;var s=q.p;try{q.p=8,Eu(e,t,n,l)}finally{q.p=s,S.T=i}}function Eu(e,t,n,l){if(is){var i=Au(l);if(i===null)fu(e,t,l,ss,n),Xf(e,l);else if($x(i,e,t,n,l))l.stopPropagation();else if(Xf(e,l),t&4&&-1<Kx.indexOf(e)){for(;i!==null;){var s=pl(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var r=Zn(s.pendingLanes);if(r!==0){var m=s;for(m.pendingLanes|=2,m.entangledLanes|=2;r;){var p=1<<31-bt(r);m.entanglements[1]|=p,r&=~p}Qt(s),(Ee&6)===0&&(Gi=ke()+500,Ua(0))}}break;case 31:case 13:m=Wn(s,2),m!==null&&gt(m,s,2),Qi(),Tu(s,2)}if(s=Au(l),s===null&&fu(e,t,l,ss,n),s===i)break;i=s}i!==null&&l.stopPropagation()}else fu(e,t,l,null,n)}}function Au(e){return e=Cs(e),Mu(e)}var ss=null;function Mu(e){if(ss=null,e=gl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=j(t),e!==null)return e;e=null}else if(n===31){if(e=v(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 ss=e,null}function Gf(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(Qn()){case Vn:return 2;case Ju:return 8;case Ja:case Om:return 32;case Fu:return 268435456;default:return 32}default:return 32}}var Cu=!1,On=null,Rn=null,Un=null,Ga=new Map,Xa=new Map,kn=[],Kx="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 Xf(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Un=null;break;case"pointerover":case"pointerout":Ga.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xa.delete(t.pointerId)}}function Qa(e,t,n,l,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[i]},t!==null&&(t=pl(t),t!==null&&Lf(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function $x(e,t,n,l,i){switch(t){case"focusin":return On=Qa(On,e,t,n,l,i),!0;case"dragenter":return Rn=Qa(Rn,e,t,n,l,i),!0;case"mouseover":return Un=Qa(Un,e,t,n,l,i),!0;case"pointerover":var s=i.pointerId;return Ga.set(s,Qa(Ga.get(s)||null,e,t,n,l,i)),!0;case"gotpointercapture":return s=i.pointerId,Xa.set(s,Qa(Xa.get(s)||null,e,t,n,l,i)),!0}return!1}function Qf(e){var t=gl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=j(n),t!==null){e.blockedOn=t,nr(e.priority,function(){Yf(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,nr(e.priority,function(){Yf(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 cs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Au(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Ms=l,n.target.dispatchEvent(l),Ms=null}else return t=pl(n),t!==null&&Lf(t),e.blockedOn=n,!1;t.shift()}return!0}function Vf(e,t,n){cs(e)&&n.delete(t)}function Jx(){Cu=!1,On!==null&&cs(On)&&(On=null),Rn!==null&&cs(Rn)&&(Rn=null),Un!==null&&cs(Un)&&(Un=null),Ga.forEach(Vf),Xa.forEach(Vf)}function us(e,t){e.blockedOn===t&&(e.blockedOn=null,Cu||(Cu=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,Jx)))}var rs=null;function Zf(e){rs!==e&&(rs=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){rs===e&&(rs=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(Mu(l||n)===null)continue;break}var s=pl(n);s!==null&&(e.splice(t,3),t-=3,Ac(s,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Il(e){function t(p){return us(p,e)}On!==null&&us(On,e),Rn!==null&&us(Rn,e),Un!==null&&us(Un,e),Ga.forEach(t),Xa.forEach(t);for(var n=0;n<kn.length;n++){var l=kn[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<kn.length&&(n=kn[0],n.blockedOn===null);)Qf(n),n.blockedOn===null&&kn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],s=n[l+1],r=i[ot]||null;if(typeof s=="function")r||Zf(n);else if(r){var m=null;if(s&&s.hasAttribute("formAction")){if(i=s,r=s[ot]||null)m=r.formAction;else if(Mu(i)!==null)continue}else m=r.action;typeof m=="function"?n[l+1]=m:(n.splice(l,3),l-=3),Zf(n)}}}function Kf(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(r){return i=r})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.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 zu(e){this._internalRoot=e}os.prototype.render=zu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=Tt();Hf(n,l,e,t,null,null)},os.prototype.unmount=zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hf(e.current,2,null,e,null,null),Qi(),t[xl]=null}};function os(e){this._internalRoot=e}os.prototype.unstable_scheduleHydration=function(e){if(e){var t=tr();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kn.length&&t!==0&&t<kn[n].priority;n++);kn.splice(n,0,e),n===0&&Qf(e)}};var $f=u.version;if($f!=="19.2.4")throw Error(o(527,$f,"19.2.4"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var Fx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:S,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ds=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ds.isDisabled&&ds.supportsFiber)try{Pl=ds.inject(Fx),pt=ds}catch{}}return Za.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",i=ed,s=td,r=nd;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&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=kf(e,1,!1,null,null,n,l,null,i,s,r,Kf),e[xl]=t.current,du(e),new zu(t)},Za.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,i="",s=ed,r=td,m=nd,p=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(r=n.onCaughtError),n.onRecoverableError!==void 0&&(m=n.onRecoverableError),n.formState!==void 0&&(p=n.formState)),t=kf(e,1,!0,t,n??null,l,i,p,s,r,m,Kf),t.context=qf(null),n=t.current,l=Tt(),l=ys(l),i=jn(l),i.callback=null,Nn(n,i,l),n=l,t.current.lanes=n,ta(t,n),Qt(t),e[xl]=t.current,du(e),new os(t)},Za.version="19.2.4",Za}var am;function ug(){if(am)return Ou.exports;am=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),Ou.exports=cg(),Ou.exports}var rg=ug();const dl="/dashboard";function im(){const c=window.location.pathname;return c===dl||c===dl+"/"?"/":c.startsWith(dl+"/")?c.slice(dl.length):c||"/"}function fl(c){return c==="/"||c===""?dl+"/":dl+(c.startsWith("/")?c:"/"+c)}function gm(c){const u=fl(c);u!==window.location.pathname+window.location.search&&window.history.pushState({},"",u),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",c=>{var o,d;if(c.defaultPrevented||c.button!==0||c.metaKey||c.ctrlKey||c.shiftKey||c.altKey)return;const u=(d=(o=c.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!u)return;const f=u.getAttribute("href");f&&(u.hasAttribute("target")||u.hasAttribute("download")||f.startsWith(dl)&&(c.preventDefault(),f!==window.location.pathname+window.location.search&&window.history.pushState({},"",f),window.dispatchEvent(new Event("dashboard:navigate"))))}),window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("dashboard:navigate"))}));function pm(){const[c,u]=C.useState(im());return C.useEffect(()=>{const f=()=>u(im());return window.addEventListener("popstate",f),window.addEventListener("dashboard:navigate",f),()=>{window.removeEventListener("popstate",f),window.removeEventListener("dashboard:navigate",f)}},[]),c}function og(c){return new URLSearchParams(c).get("expert")==="1"}function sm(){return typeof window>"u"?!1:og(window.location.search)}function bm(){const[c,u]=C.useState(sm);return C.useEffect(()=>{if(typeof window>"u")return;const f=window,o=()=>u(sm());return f.addEventListener("dashboard:navigate",o),()=>f.removeEventListener("dashboard:navigate",o)},[]),c}function vm(c){let u=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");u=u.replace(/```(\w*)\n?([\s\S]*?)```/g,(h,j,v)=>`<pre class="md-code-block"><code>${v.trimEnd()}</code></pre>`),u=u.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),u=u.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),u=u.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const f=u.split(`
50
+ `),o=[];let d=!1;for(let h=0;h<f.length;h++){const j=f[h],v=j.match(/^###\s+(.+)$/),b=j.match(/^##\s+(.+)$/),x=j.match(/^#\s+(.+)$/);if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${v[1]}</h3>`);continue}if(b){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${b[1]}</h2>`);continue}if(x){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${x[1]}</h1>`);continue}const E=j.match(/^(\s*)[*-]\s+(.+)$/);if(E){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${E[2]}</li>`);continue}if(j.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(j)}return d&&o.push("</ul>"),o.join(`
51
+ `)}function ps(c){let u=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");u=u.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),u=u.replace(/&lt;agent_finding[^&]*&gt;/g,""),u=u.replace(/&lt;\/agent_finding&gt;/g,""),u=u.replace(/&lt;cite\s+tag=&quot;file&quot;&gt;([^&]+)&lt;\/cite&gt;/g,'<code class="cite-file">$1</code>'),u=u.replace(/&lt;cite\s+tag=&quot;fn&quot;&gt;([^&]+)&lt;\/cite&gt;/g,'<code class="cite-fn">$1</code>'),u=u.replace(/&lt;fn&gt;([^&]+)&lt;\/fn&gt;/g,'<code class="cite-fn">$1</code>'),u=u.replace(/```(\w*)\n?([\s\S]*?)```/g,'<pre class="md-code-block"><code>$2</code></pre>'),u=u.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),u=u.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),u=u.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const f=u.split(`
52
+ `),o=[];let d=!1;for(const h of f){const j=h.match(/^###\s+(.+)$/),v=h.match(/^##\s+(.+)$/),b=h.match(/^#\s+(.+)$/);if(j){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${j[1]}</h3>`);continue}if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${v[1]}</h2>`);continue}if(b){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${b[1]}</h1>`);continue}const x=h.match(/^(\s*)[*-]\s+(.+)$/);if(x){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${x[2]}</li>`);continue}if(h.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(h)}return d&&o.push("</ul>"),o.join(`
53
+ `)}function He(c){const u=Date.now(),f=typeof c=="string"?new Date(c).getTime():c,o=Math.max(0,Math.floor((u-f)/1e3));return o<60?"just now":o<3600?Math.floor(o/60)+"m ago":o<86400?Math.floor(o/3600)+"h ago":Math.floor(o/86400)+"d ago"}function dg(c){if(!c)return"—";const u=Math.round(c/1e3);return u<60?u+"s":Math.floor(u/60)+"m "+u%60+"s"}function Gu(c){const u=c.split("-").filter(Boolean);return u.length>=2?(u[0][0]+u[1][0]).toUpperCase():(u[0]||c).slice(0,2).toUpperCase()}const cm=["#8b5cf6","#06b6d4","#f97316","#34d399","#f43f5e","#fbbf24","#60a5fa","#e879f9"];function $a(c){let u=0;for(let f=0;f<c.length;f++)u=u*31+c.charCodeAt(f)>>>0;return cm[u%cm.length]}function Bn({title:c,hint:u,compact:f=!1}){return a.jsxs("div",{className:`text-center ${f?"py-3":"py-6"}`,children:[a.jsx("div",{className:"font-mono text-xs text-muted-foreground",children:c}),u&&a.jsx("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:u})]})}function fg(c){return c==null||c<=0?"—":c<1e3?`${c}ms`:c<6e4?`${(c/1e3).toFixed(1)}s`:`${(c/6e4).toFixed(1)}m`}function ol({value:c,unit:u,label:f,valueClass:o,pulse:d,tooltip:h}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":h,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[d&&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-bold leading-none ${o}`,children:c}),u&&a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:u})]}),a.jsx("div",{className:"mt-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:f})]})}function ym({overview:c,activeTasks:u,mode:f="dense",showActivity:o}){const d=c.relayCount+c.nativeCount,h=c.tasksCompleted+c.tasksFailed>0?Math.round(c.tasksCompleted/(c.tasksCompleted+c.tasksFailed)*100):null,j=c.totalFindings>0?Math.round(c.confirmedFindings/c.totalFindings*100):0,v=f==="calm",b=o??!v,x=v&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-primary/[0.03] px-3.5 py-3",children:[a.jsx("div",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-primary",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 shadow-[0_0_6px_rgba(52,211,153,0.5)]"}),"LIVE"]})]}),x?a.jsx(Bn,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):v?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(ol,{value:c.agentsOnline,label:"Agents Online",valueClass:c.agentsOnline>0?"text-primary":"text-foreground"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(ol,{value:u,label:"Active Tasks",valueClass:u>0?"text-unverified":"text-muted-foreground",pulse:u>0})}),a.jsx(ol,{value:`${j}%`,label:"Confirmed",valueClass:"text-confirmed"})]}):a.jsxs("div",{className:"border-b border-border",children:[a.jsxs("div",{className:"relative grid grid-cols-2",children:[a.jsx("span",{className:"pointer-events-none absolute left-0 right-0 top-1/2 h-px bg-border"}),a.jsx("span",{className:"pointer-events-none absolute bottom-0 left-1/2 top-0 w-px bg-border"}),a.jsxs("div",{className:"flex flex-col items-stretch justify-center gap-1.5 px-4 py-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${c.agentsOnline>0?"text-primary":"text-foreground"}`,children:c.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${c.relayConnected>0?"text-confirmed":"text-muted-foreground"}`,children:c.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground","data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none text-muted-foreground",children:d})]})]}),a.jsx(ol,{value:u,label:"Active Tasks",valueClass:u>0?"text-unverified":"text-muted-foreground",pulse:u>0}),a.jsx(ol,{value:c.consensusRuns,label:"Consensus",valueClass:"text-foreground"}),a.jsx(ol,{value:`${j}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:fl("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/30","aria-label":"View actionable findings on Signals page",children:a.jsx(ol,{value:c.actionableFindings,label:"Actionable",valueClass:c.actionableFindings>0?"text-orange-400":"text-confirmed",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!v&&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",{className:"text-muted-foreground",children:"tasks completed"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:c.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"signals total"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:c.totalSignals})]}),c.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-destructive tabular-nums",children:c.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"avg duration"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:fg(c.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{className:"text-muted-foreground",children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${h===null?"text-muted-foreground":h>=95?"text-confirmed":h>=80?"text-unverified":"text-destructive"}`,children:h===null?"—":`${h}%`})]})]}),b&&a.jsx(mg,{hourly:c.hourlyActivity||[]}),c.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px] text-muted-foreground/60",children:["last consensus ",He(c.lastConsensusTimestamp)]})]})}function mg({hourly:c}){const u=c.length===12?c:new Array(12).fill(0),f=Math.max(1,...u);return a.jsxs("div",{className:"border-t border-border bg-primary/[0.02] px-3.5 py-3",children:[a.jsx("div",{className:"mb-2 font-mono text-[9px] font-bold uppercase tracking-widest text-muted-foreground/60",children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:u.map((o,d)=>{const h=11-d,j=o/f*100,v=d===11,b=h===0?"last hour":`${h}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${o===0?"opacity-0":v?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:o===0?"0%":`${Math.max(8,j)}%`},"data-tooltip":`${b}
54
+ ${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px] text-muted-foreground/40",children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const Zu="/dashboard/api";async function Qe(c,u){const f=await fetch(`${Zu}/${c}`,{credentials:"include",...u});if(f.status===401)throw new Error("unauthorized");if(!f.ok)throw new Error(`API error: ${f.status}`);return f.json()}async function hg(c){return(await fetch(`${Zu}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:c})})).ok}async function xg(){try{return(await fetch(`${Zu}/overview`,{credentials:"include"})).ok}catch{return!1}}const gg=7200*1e3;function pg(c){const u=Date.now()-new Date(c).getTime();return u<0?"0s":u<6e4?`${Math.floor(u/1e3)}s`:u<36e5?`${Math.floor(u/6e4)}m ${Math.floor(u%6e4/1e3)}s`:`${Math.floor(u/36e5)}h ${Math.floor(u%36e5/6e4)}m`}function jm({onCountChange:c}){const[u,f]=C.useState([]),[,o]=C.useState(0);C.useEffect(()=>{let v=!1;const b=async()=>{var E;try{const w=await Qe("active-tasks");v||(f(w.tasks||[]),c==null||c(((E=w.tasks)==null?void 0:E.length)||0))}catch{}};b();const x=setInterval(b,5e3);return()=>{v=!0,clearInterval(x)}},[c]),C.useEffect(()=>{if(u.length===0)return;const v=setInterval(()=>o(b=>b+1),1e3);return()=>clearInterval(v)},[u.length]);const d=Date.now(),h=u.filter(v=>d-new Date(v.startedAt).getTime()<gg),j=u.length-h.length;return h.length===0?j===0?null:a.jsx("div",{className:"rounded-lg border border-border bg-card/60 px-4 py-2.5",children:a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[j," stale task",j===1?"":"s"," — likely orphaned (>2h since last update)"]})}):a.jsxs("div",{className:"rounded-lg border border-border bg-card/60 px-4 py-2.5",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 shadow-[0_0_6px_rgba(52,211,153,0.5)]"}),a.jsx("span",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:"Live"}),a.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[h.length," active"]}),j>0&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:["· ",j," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:h.map(v=>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 text-foreground truncate",children:v.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:v.task}),a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground whitespace-nowrap tabular-nums",children:pg(v.startedAt)})]},v.taskId))})]})}function bg(c){let u=0;for(let f=0;f<c.length;f++)u=(u<<5)-u+c.charCodeAt(f)|0;return Math.abs(u)}class vg{constructor(u){Pe(this,"s");this.s=u}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(u,f){return u+this.next()*(f-u)}}function ut(c,u){const f=parseInt(c.slice(1,3),16),o=parseInt(c.slice(3,5),16),d=parseInt(c.slice(5,7),16);return`rgba(${f},${o},${d},${Math.max(0,Math.min(1,u))})`}function yg(c){const u=Math.max(0,c);return Math.min(1.4,Math.pow(u/2e3,.55))}class jg{constructor(u,f,o,d,h,j,v=.5){Pe(this,"ctx");Pe(this,"size");Pe(this,"accuracy");Pe(this,"uniqueness");Pe(this,"impact");Pe(this,"colorHex");Pe(this,"time",0);Pe(this,"variant");Pe(this,"scale");Pe(this,"exp");Pe(this,"particles",[]);Pe(this,"baseRotation");Pe(this,"armSeeds");Pe(this,"binaryCenters");Pe(this,"jetAxis");Pe(this,"tailAngle");const b=u.getContext("2d");if(!b)throw new Error("Canvas 2D context unavailable");this.ctx=b,this.size=u.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,h)),this.impact=Math.max(0,Math.min(1,v)),this.colorHex=j;const x=bg(f);this.variant=x%12;const E=new vg(x),w=yg(o);this.exp=w,this.scale=.2+w*.95;const H=Math.max(3,Math.round(4+w*180));this._buildVariant(E,H),this.baseRotation=E.next()*Math.PI*2}_buildVariant(u,f){const o=this.variant;if(o===0){this.armSeeds=[];for(let h=0;h<2;h++)this.armSeeds.push(u.next()*Math.PI*2);for(let h=0;h<f;h++){const j=h%2,v=u.next(),b=this.armSeeds[j]+v*Math.PI*2.4,x=u.range(-.04,.04)*Math.PI*2,E=b+x,w=(.08+v*.38)*this.size*this.scale;this.particles.push(this._mkParticle(u,w,E,1,1))}}else if(o===1)for(let d=0;d<f;d++){const h=u.range(.34,.42)*this.size*this.scale,j=u.next()*Math.PI*2;this.particles.push(this._mkParticle(u,h,j,1,1))}else if(o===2){const d=[.16,.28,.42];for(let h=0;h<f;h++){const j=h%3,v=(d[j]+u.range(-.015,.015))*this.size*this.scale,b=u.next()*Math.PI*2;this.particles.push(this._mkParticle(u,v,b,1,1))}}else if(o===3){const d=.18*this.size*this.scale;this.binaryCenters=[{x:-d,y:0},{x:d,y:0}];for(let h=0;h<f;h++){const j=h%2,v=u.range(.04,.22)*this.size*this.scale,b=u.next()*Math.PI*2,x=this._mkParticle(u,v,b,1,1);x.binaryCore=j,x.angularVelocity*=j===0?1:-1,this.particles.push(x)}}else if(o===4)for(let d=0;d<f;d++){const h=u.range(.05,.32)*this.size*this.scale,j=u.next()*Math.PI*2,v=u.range(.7,1.3),b=u.range(.7,1.3),x=this._mkParticle(u,h,j,v,b);x.orbitTilt=u.range(0,Math.PI),this.particles.push(x)}else if(o===5){this.jetAxis=u.next()*Math.PI*2;const d=Math.floor(f*.7),h=f-d;for(let j=0;j<d;j++){const v=j%2===0?1:-1,b=u.next(),x=u.range(-.18,.18),E=this._mkParticle(u,b*.44*this.size*this.scale,0,1,1);E.jetSide=v,E.jetProgress=b,E.jetSpread=x,E.jetSpeed=u.range(.15,.35)*.001,E.size=u.range(.6,1.4),this.particles.push(E)}for(let j=0;j<h;j++){const v=u.range(.35,.42)*this.size*this.scale,b=u.next()*Math.PI*2,x=this._mkParticle(u,v,b,1,1);x.isDisk=!0,x.brightness*=.35,this.particles.push(x)}}else if(o===6)for(let d=0;d<f;d++){const h=u.next()*Math.PI*2,j=u.range(.05,.45)*this.size*this.scale,v=this._mkParticle(u,j,h,1,1);v.isNebula=!0,v.driftAngle=u.next()*Math.PI*2,v.driftSpeed=u.range(6e-4,.0014),v.driftPhase=u.next()*Math.PI*2,v.size=u.range(.8,2.2),v.brightness*=.6,this.particles.push(v)}else if(o===7){this.tailAngle=u.next()*Math.PI*2;const d=.1*this.size*this.scale,h=Math.floor(f*.3);for(let v=0;v<h;v++){const b=u.range(0,d),x=u.next()*Math.PI*2,E=this._mkParticle(u,b,x,1,1);E.size=u.range(.8,1.8),this.particles.push(E)}const j=f-h;for(let v=0;v<j;v++){const b=u.next(),x=d+b*.26*this.size*this.scale,E=(1-b*.5)*u.range(-.05,.05)*this.size*this.scale,w=this._mkParticle(u,0,0,1,1);w.isComet=!0,w.cometTailDist=x,w.cometPerp=E,w.cometT=b,w.brightness*=1-b*.6,w.size=(1-b*.5)*u.range(.6,1.2),this.particles.push(w)}}else if(o===8)for(let d=0;d<f;d++){const h=d%3,j=u.range(.3,.42)*this.size*this.scale,v=u.next()*Math.PI*2,b=this._mkParticle(u,j,v,1,1);b.gyroPlane=h,b.gyroAxis=h===0?"z":h===1?"x":"y",this.particles.push(b)}else if(o===9)for(let d=0;d<f;d++){const h=u.range(.06,.42)*this.size*this.scale,v=h/(.42*this.size*this.scale)*4*Math.PI+u.range(-.2,.2),b=this._mkParticle(u,h,v,1,1);b.isMaelstrom=!0,this.particles.push(b)}else if(o===10)for(let d=0;d<f;d++){const h=d/f,j=u.range(.35,.4)*this.size*this.scale,v=h*Math.PI*2+u.range(-.03,.03),b=this._mkParticle(u,j,v,1,1);b.ouroT=h,this.particles.push(b)}else for(let d=0;d<f;d++){const h=d%2,j=u.next(),v=this._mkParticle(u,0,0,1,1);v.isHelix=!0,v.helixStrand=h,v.helixT=j,v.helixSpeed=u.range(.3,.6)*.001,this.particles.push(v)}}_mkParticle(u,f,o,d,h){const j=8e-4+(.42*this.size-f)*4e-5,v=u.next()*Math.PI*2,b=u.range(.05,.3)*this.size;return{baseRadius:f,angle:o,angularVelocity:j*(u.next()>.5?1:.85),size:u.range(.5,1.8),brightness:u.range(.4,1),wobblePhase:u.next()*Math.PI*2,wobbleSpeed:u.range(.5,1.2),ellipX:d,ellipY:h,orbitTilt:0,binaryCore:0,chaosX:Math.cos(v)*b,chaosY:Math.sin(v)*b,chaosDriftPhase:u.next()*Math.PI*2,chaosDriftSpeed:u.range(3e-4,8e-4)}}update(u){this.time+=u}draw(){const{ctx:u,size:f,time:o,accuracy:d,uniqueness:h,impact:j,colorHex:v,variant:b}=this,x=f/2,E=f/2;u.clearRect(0,0,f,f);const w=.4+this.exp*.6,H=d*w,Q=h*w,F=j*w,W=.2+H*.8,X=.3+F*1.9,de=Q,Z=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),K=1-Z,V=u.createRadialGradient(x,E,0,x,E,f*.45);if(V.addColorStop(0,ut(v,.05*W)),V.addColorStop(.4,ut(v,.015)),V.addColorStop(1,"transparent"),u.fillStyle=V,u.fillRect(0,0,f,f),b===0&&this.armSeeds){const O=o*5e-4*X;for(const ae of this.armSeeds){const G=ae+O;u.beginPath();for(let te=0;te<1;te+=.02){const ue=G+te*Math.PI*2.4,oe=(.08+te*.38)*f*this.scale,Se=x+Math.cos(ue)*oe,J=E+Math.sin(ue)*oe;te===0?u.moveTo(Se,J):u.lineTo(Se,J)}u.strokeStyle=ut(v,.12*W),u.lineWidth=1,u.stroke()}}for(const O of this.particles){const ae=Math.sin(o*O.wobbleSpeed*.001+O.wobblePhase)*1.2,G=O.baseRadius+ae,te=O.angle+o*O.angularVelocity*X;let ue,oe;if(b===3&&this.binaryCenters){const J=this.binaryCenters[O.binaryCore];ue=x+J.x+Math.cos(te)*G,oe=E+J.y+Math.sin(te)*G}else if(b===4){const J=Math.cos(O.orbitTilt),ie=Math.sin(O.orbitTilt),he=Math.cos(te)*G*O.ellipX,A=Math.sin(te)*G*O.ellipY;ue=x+he*J-A*ie,oe=E+he*ie+A*J}else if(b===5&&O.jetSide!==void 0&&!O.isDisk&&this.jetAxis!==void 0){const J=(O.jetProgress+o*O.jetSpeed*X)%1,ie=J*.44*f*this.scale,he=this.jetAxis+Math.PI/2;ue=x+Math.cos(this.jetAxis)*ie*O.jetSide+Math.cos(he)*O.jetSpread*ie,oe=E+Math.sin(this.jetAxis)*ie*O.jetSide+Math.sin(he)*O.jetSpread*ie,O._fadeMul=Math.sin(J*Math.PI)*.9+.1}else if(b===6&&O.isNebula){const J=o*O.driftSpeed*X,ie=Math.sin(J+O.driftPhase)*2;ue=x+Math.cos(O.angle+J*.3)*G+Math.cos(O.driftAngle)*ie,oe=E+Math.sin(O.angle+J*.3)*G+Math.sin(O.driftAngle)*ie}else if(b===7&&O.isComet&&this.tailAngle!==void 0){const J=(O.cometT+o*3e-4*X)%1,ie=O.cometTailDist+J*.06*f*this.scale,he=this.tailAngle+Math.PI/2;ue=x+Math.cos(this.tailAngle)*ie+Math.cos(he)*O.cometPerp,oe=E+Math.sin(this.tailAngle)*ie+Math.sin(he)*O.cometPerp}else if(b===8&&O.gyroAxis){const J=o*1e-4*X;O.gyroAxis==="z"?(ue=x+Math.cos(te)*G,oe=E+Math.sin(te)*G*.3):O.gyroAxis==="x"?(ue=x+Math.cos(te)*G*.3+Math.sin(J)*G*.1,oe=E+Math.sin(te)*G):(ue=x+Math.sin(te+J)*G*.6,oe=E+Math.cos(te+J)*G*.8)}else if(b===9){const J=(o*5e-4*X+O.wobblePhase)%1,ie=G*(1-J*.85);ue=x+Math.cos(te)*ie,oe=E+Math.sin(te)*ie,O._fadeMul=1-J}else if(b===10&&O.ouroT!==void 0){const J=(O.ouroT+o*3e-4*X)%1,ie=J*Math.PI*2;ue=x+Math.cos(ie)*G,oe=E+Math.sin(ie)*G;const he=Math.cos(J*Math.PI*2)*.5+.5;O._fadeMul=.3+he*.9}else if(b===11&&O.helixT!==void 0){const J=(O.helixT+o*O.helixSpeed*X)%1,ie=(J-.5)*.65*f*this.scale,he=O.helixStrand===0?0:Math.PI,A=.15*f*this.scale,S=Math.sin(J*Math.PI*3+he)*A;ue=x+S,oe=E+ie,O._fadeMul=.4+(Math.cos(J*Math.PI*3+he)+1)/2*.6}else ue=x+Math.cos(te)*G*O.ellipX,oe=E+Math.sin(te)*G*O.ellipY;if(K>.01){const J=o*O.chaosDriftSpeed,ie=Math.cos(J+O.chaosDriftPhase)*2,he=Math.sin(J*1.13+O.chaosDriftPhase)*2,A=x+O.chaosX+ie,S=E+O.chaosY+he;ue=A*K+ue*Z,oe=S*K+oe*Z}const Se=O._fadeMul!==void 0?O._fadeMul:1;if(b<=4&&Z>.5){const J=2+Math.floor(j*3);for(let ie=0;ie<J;ie++){const he=O.angularVelocity*X*(ie+1)*80,A=te-he;let S,q;if(b===3&&this.binaryCenters){const R=this.binaryCenters[O.binaryCore];S=x+R.x+Math.cos(A)*G,q=E+R.y+Math.sin(A)*G}else if(b===4){const R=Math.cos(O.orbitTilt),I=Math.sin(O.orbitTilt),g=Math.cos(A)*G*O.ellipX,D=Math.sin(A)*G*O.ellipY;S=x+g*R-D*I,q=E+g*I+D*R}else S=x+Math.cos(A)*G*O.ellipX,q=E+Math.sin(A)*G*O.ellipY;const $=(1-ie/J)*.3*O.brightness*W*Z;u.beginPath(),u.arc(S,q,O.size*(1-ie*.25),0,Math.PI*2),u.fillStyle=ut(v,$),u.fill()}}else if(b===6&&O.isNebula){const J=O.size*3,ie=u.createRadialGradient(ue,oe,0,ue,oe,J);ie.addColorStop(0,ut(v,O.brightness*W*.4)),ie.addColorStop(1,"transparent"),u.fillStyle=ie,u.beginPath(),u.arc(ue,oe,J,0,Math.PI*2),u.fill()}u.beginPath(),u.arc(ue,oe,O.size,0,Math.PI*2),u.fillStyle=ut(v,O.brightness*W*Se),u.fill()}if(de>.05)for(let ae=0;ae<3;ae++){const G=(o*7e-4*de+ae*.33)%1;if(G>.5)continue;const te=(ae*1.618*Math.PI+o*1e-4)%(Math.PI*2),ue=f*.5*(1-G*1.6);if(ue<3)continue;const oe=x+Math.cos(te)*ue,Se=E+Math.sin(te)*ue,J=G<.2?G/.2:1-(G-.2)/.3,ie=5+(1-G)*4,he=u.createRadialGradient(oe,Se,0,oe,Se,ie);he.addColorStop(0,ut("#ffffff",J*.95)),he.addColorStop(.3,ut(v,J*.7)),he.addColorStop(1,"transparent"),u.fillStyle=he,u.beginPath(),u.arc(oe,Se,ie,0,Math.PI*2),u.fill()}if(b!==3){const O=.9+.1*Math.sin(o*.003),ae=(1+this.exp*9+d*2)*this.scale,G=Math.min(ae*(3+j*2),f*.4),te=u.createRadialGradient(x,E,0,x,E,G);te.addColorStop(0,ut("#ffffff",.95*O*W)),te.addColorStop(.2,ut(v,.75*O*W)),te.addColorStop(.5,ut(v,.2*W)),te.addColorStop(1,"transparent"),u.fillStyle=te,u.beginPath(),u.arc(x,E,G,0,Math.PI*2),u.fill(),u.beginPath(),u.arc(x,E,ae*O,0,Math.PI*2),u.fillStyle=ut("#ffffff",.95),u.fill()}else if(this.binaryCenters)for(const O of this.binaryCenters){const ae=x+O.x,G=E+O.y,te=(.8+this.exp*5+d*1.5)*this.scale,ue=Math.min(te*3.5,f*.22),oe=u.createRadialGradient(ae,G,0,ae,G,ue);oe.addColorStop(0,ut("#ffffff",.9*W)),oe.addColorStop(.3,ut(v,.6*W)),oe.addColorStop(1,"transparent"),u.fillStyle=oe,u.beginPath(),u.arc(ae,G,ue,0,Math.PI*2),u.fill(),u.beginPath(),u.arc(ae,G,te,0,Math.PI*2),u.fillStyle=ut("#ffffff",.9),u.fill()}}}function Ku({agentId:c,size:u=64,signals:f=0,accuracy:o=.5,uniqueness:d=.5,impact:h=.5}){const j=C.useRef(null),v=C.useRef(null),b=C.useRef(0),x=C.useRef(!0);return C.useEffect(()=>{const E=j.current;if(!E)return;E.width=u*2,E.height=u*2;const w=E.getContext("2d");if(!w)return;w.scale(2,2);const H=$a(c),Q=new jg(E,c,f,o,d,H,h);v.current=Q,Q.draw();const F=()=>{x.current&&(Q.update(16),Q.draw()),b.current=requestAnimationFrame(F)};return b.current=requestAnimationFrame(F),()=>{cancelAnimationFrame(b.current),v.current=null}},[c,u,f,o,d,h]),C.useEffect(()=>{const E=j.current;if(!E)return;const w=new IntersectionObserver(([H])=>{x.current=H.isIntersecting},{threshold:.1});return w.observe(E),()=>w.disconnect()},[]),a.jsx("canvas",{ref:j,"aria-hidden":"true",className:"shrink-0",style:{width:u,height:u,borderRadius:"50%"}})}function $u(c){var u,f;return((u=c.bench)==null?void 0:u.state)==="benched"?"benched":c.circuitOpen?"struggling":((f=c.bench)==null?void 0:f.state)==="kept-for-coverage"?"kept-for-coverage":null}function Nm(c){var u;return((u=c.scores.bench)==null?void 0:u.state)==="benched"||c.scores.circuitOpen}function fs(c){return`${Math.round(c*100)}%`}function Ng(c){return c>=1.2?"good":c>=.8?"mid":"low"}function Sg(c){return c>=.7?"good":c>=.4?"mid":"low"}function _g({agent:c}){var v;const u=c.scores,f=(v=c.lastTask)!=null&&v.timestamp?He(c.lastTask.timestamp):"",o=Ng(u.dispatchWeight),d=o==="good"?"text-confirmed":o==="low"?"text-disputed":"text-foreground",h=Sg(u.accuracy),j=h==="good"?"bg-confirmed":h==="mid"?"bg-unverified":"bg-disputed";return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(c.id)}`,className:"group relative block rounded-lg border border-border bg-card p-3 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:bg-card/90",children:[a.jsxs("div",{className:"mb-2.5 flex items-center gap-2.5",children:[a.jsx("div",{className:"relative shrink-0",children:a.jsx(Ku,{agentId:c.id,size:48,animate:c.online,signals:u.signals,accuracy:u.accuracy,uniqueness:u.uniqueness,impact:u.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-foreground",children:c.id}),(()=>{const b=$u(u);return b==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-destructive/10 px-1 py-0.5 font-mono text-[8px] font-bold text-destructive","data-tooltip":`Benched (${u.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):b==="struggling"?a.jsx("span",{className:"shrink-0 rounded-sm bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):b==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded-sm border border-unverified/40 bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","data-tooltip":`Would bench (${u.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"KEPT FOR COVERAGE"}):null})()]}),a.jsxs("div",{className:"mt-1 flex items-center gap-2 font-inter text-[10px] text-muted-foreground/60",children:[a.jsxs("span",{className:`rounded-sm border border-border/60 bg-background/60 px-1.5 py-0.5 font-bold tabular-nums ${d}`,"data-tooltip":`Dispatch weight ${u.dispatchWeight.toFixed(2)}
55
+ Scale 0.3 → 2.0`,"data-tooltip-pos":"bottom",children:[u.dispatchWeight.toFixed(2)," wt"]}),a.jsxs("span",{className:"truncate",children:[u.signals," signals",f?` · ${f}`:""]})]})]})]}),a.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/30 bg-background/40 px-2.5 py-2",children:[a.jsx(ms,{label:"accuracy",value:u.accuracy,fillClass:j,tooltip:`Accuracy ${fs(u.accuracy)}
56
+ Ratio of confirmed findings.
57
+ Higher = more trustworthy.`}),a.jsx(ms,{label:"reliability",value:u.taskCompletionRate??0,fillClass:"bg-chart",tooltip:`Reliability ${fs(u.taskCompletionRate??0)}
58
+ Task completion rate — fraction of dispatched tasks that finished without pipeline error or timeout.`}),a.jsx(ms,{label:"unique",value:u.uniqueness,fillClass:"bg-unique",tooltip:`Uniqueness ${fs(u.uniqueness)}
59
+ Findings others missed.
60
+ Higher = this agent sees what peers don't.`}),a.jsx(ms,{label:"impact",value:u.impactScore,fillClass:"bg-[var(--color-impact)]",tooltip:`Impact ${fs(u.impactScore)}
61
+ Severity-weighted findings.
62
+ Critical and high findings count more.`})]})]})}function ms({label:c,value:u,fillClass:f,tooltip:o}){const d=Number.isFinite(u)?u:0;return a.jsxs("div",{className:"grid grid-cols-[72px_1fr_38px] items-center gap-2.5",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground","data-tooltip":o,children:c}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-background/80",children:a.jsx("div",{className:`h-full rounded-full transition-all ${f}`,style:{width:`${Math.max(0,Math.min(100,d*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(d*100),"%"]})]})}function Sm({agents:c}){const u=[...c].sort((d,h)=>{var E,w,H,Q;const j=((E=d.lastTask)==null?void 0:E.timestamp)??"",v=((w=h.lastTask)==null?void 0:w.timestamp)??"";if(j!==v)return v.localeCompare(j);const b=((H=d.scores)==null?void 0:H.signals)||0,x=((Q=h.scores)==null?void 0:Q.signals)||0;return b!==x?x-b:d.id.localeCompare(h.id)}),f=u.slice(0,4),o=u.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",a.jsx("span",{className:"text-primary",children:c.length})]}),o&&a.jsx("a",{href:"/dashboard/team",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:f.map(d=>a.jsx(_g,{agent:d},d.id))})]})}const Tg=8;function Eg(c){const u=c.toLowerCase();return u==="completed"||u==="done"||u==="success"||u==="succeeded"?"completed":u==="running"||u==="active"||u==="in_progress"||u==="pending"?"running":u==="failed"||u==="error"||u==="errored"||u==="timeout"||u==="timed_out"?"failed":u==="cancelled"||u==="canceled"||u==="queued"||u==="waiting"?"cancelled":"unknown"}const Ag={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},Mg={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function Cg(c){return c.length>8?c.slice(0,8):c}function zg(c){return c.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:c.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:c.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:c.endsWith("-researcher")?{label:"RESEARCH",cls:"text-muted-foreground"}:c.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function _m({tasks:c,limit:u=Tg}){const f=c.items.slice(0,u),o=c.items.length>u;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:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"text-primary",children:c.total})]}),o&&a.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs text-muted-foreground transition hover:text-foreground",children:"view all"})]}),a.jsx("div",{className:"flex-1 rounded-md border border-border/40 bg-card/80",children:f.length===0?a.jsx(Bn,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):f.map((d,h)=>{const j=Eg(d.status),v=Ag[j],b=zg(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${h>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 ${v.iconBox} ${v.text} ${v.pulse?"animate-pulse":""}`,"aria-label":`Status: ${v.label}`,"data-tooltip":v.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:Mg[j]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 bg-background/60 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground","data-tooltip":d.taskId,children:Cg(d.taskId)}),b&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 bg-background/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${b.cls}`,"data-tooltip":d.agentId,children:b.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug text-foreground",children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/60 font-normal",children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/50",children:He(d.timestamp)})]},d.taskId)})})]})}const wg={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"};function Dg(c,u){return c?c.length>u?c.slice(0,u-1)+"…":c:""}function Tm(){const[c,u]=C.useState(null),[f,o]=C.useState(null);return C.useEffect(()=>{Qe("signals?limit=5").then(d=>u(d.items??[])).catch(d=>o(String((d==null?void 0:d.message)??d)))},[]),a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Recent Signals"}),a.jsx("button",{type:"button",onClick:()=>gm("/signals"),className:"font-mono text-[10px] text-muted-foreground hover:underline",children:"all signals →"})]}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"unavailable"}),!f&&c&&c.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"no signals recorded"}),!f&&c&&c.length>0&&a.jsx("ul",{className:"space-y-1.5",children:c.map((d,h)=>a.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"w-14 shrink-0 text-muted-foreground tabular-nums",children:He(d.timestamp)}),a.jsx("span",{className:"w-20 shrink-0 font-mono uppercase tracking-wide text-foreground",children:wg[d.signal]??d.signal}),a.jsx("span",{className:"w-24 shrink-0 truncate font-mono text-muted-foreground",children:d.agentId}),a.jsx("span",{className:"flex-1 truncate font-mono text-muted-foreground",children:Dg(d.evidence??"",80)})]},`${d.timestamp}-${h}`))})]})}function Og({overview:c,agents:u,tasks:f,activeTaskCount:o,setActiveTaskCount:d}){const h=c.actionableFindings;return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[a.jsx("h1",{className:"font-mono text-2xl font-bold tracking-tight text-foreground",children:"Overview"}),h>0&&a.jsxs("a",{href:fl("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] text-orange-400 transition hover:underline","data-tooltip":"Findings open for operator review",children:[h," actionable →"]})]}),a.jsx("p",{className:"mt-1 font-mono text-[13px] text-muted-foreground",children:"What your agents are doing right now."})]}),a.jsx(ym,{overview:c,activeTasks:o,mode:"calm"}),a.jsx(jm,{onCountChange:d}),u&&a.jsx(Sm,{agents:u}),f&&a.jsx(_m,{tasks:f,limit:3}),a.jsx(Tm,{})]})}function Rg({onLogin:c,error:u}){const[f,o]=C.useState(""),d=h=>{h.preventDefault(),f.trim()&&c(f.trim())};return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-8 text-center shadow-2xl",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 drop-shadow-[0_0_28px_rgba(139,92,246,0.45)]"})}),a.jsx("p",{className:"mb-1 text-[30px] font-bold tracking-tight text-foreground",style:{fontFamily:"'Space Grotesk', system-ui, sans-serif",letterSpacing:"-0.02em",textShadow:"0 0 24px rgba(139,92,246,0.4)"},children:"Gossipcat"}),a.jsx("p",{className:"mb-6 text-sm text-muted-foreground",children:"Authenticate to access the dashboard"}),a.jsxs("form",{onSubmit:d,children:[a.jsx("input",{type:"password",value:f,onChange:h=>o(h.target.value),placeholder:"Dashboard key",autoFocus:!0,className:"w-full rounded-lg border border-border bg-background px-4 py-3 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20"}),a.jsx("button",{type:"submit",className:"mt-4 w-full rounded-lg bg-primary px-4 py-3 text-sm font-semibold text-primary-foreground transition hover:opacity-90",children:"Unlock"})]}),u&&a.jsx("p",{className:"mt-3 text-sm text-destructive",children:"Invalid key. Check your terminal for the correct key."})]})})}let rt=null,hs=3e3,qu=null;const Xu=new Set;function Em(){if((rt==null?void 0:rt.readyState)===WebSocket.OPEN||(rt==null?void 0:rt.readyState)===WebSocket.CONNECTING)return;const c=location.protocol==="https:"?"wss:":"ws:";rt=new WebSocket(`${c}//${location.host}/dashboard/ws`),rt.onopen=()=>{hs=3e3},rt.onmessage=u=>{try{const f=JSON.parse(u.data);Xu.forEach(o=>o(f))}catch{}},rt.onclose=()=>{rt=null,qu&&clearTimeout(qu),qu=setTimeout(()=>{hs=Math.min(hs*1.5,3e4),Em()},hs)},rt.onerror=()=>{}}function Am(c){return Xu.add(c),()=>Xu.delete(c)}function Ug(){return(rt==null?void 0:rt.readyState)??WebSocket.CLOSED}const kg=[{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."}];function qg({open:c,onClose:u}){const f=C.useRef(null);return C.useEffect(()=>{if(!c)return;const o=requestAnimationFrame(()=>{var h;(h=f.current)==null||h.focus()}),d=h=>{h.key==="Escape"&&u()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[c,u]),c?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-6 backdrop-blur-sm",onClick:u,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-border bg-card shadow-2xl",role:"dialog","aria-modal":"true","aria-labelledby":"glossary-title",onClick:o=>o.stopPropagation(),children:[a.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-5 py-3.5",children:[a.jsx("h2",{id:"glossary-title",className:"font-mono text-sm font-semibold text-foreground",children:"Gossipcat Glossary"}),a.jsx("button",{ref:f,onClick:u,"aria-label":"Close glossary",className:"flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 bg-card font-mono text-xs text-muted-foreground transition hover:bg-muted hover:text-foreground",children:"×"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a.jsx("dl",{className:"space-y-5",children:kg.map(({term:o,definition:d,seeAlso:h})=>a.jsxs("div",{className:"rounded-md border border-border/40 bg-background/40 px-4 py-3",children:[a.jsx("dt",{className:"font-mono text-[11px] font-bold uppercase tracking-[0.12em] text-amber-400",children:o}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed text-foreground/80",children:d}),h&&a.jsxs("dd",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground/60",children:["See also: ",h]})]},o))})}),a.jsx("div",{className:"shrink-0 border-t border-border/60 px-5 py-3",children:a.jsx("a",{href:"https://github.com/gossipcat-ai/gossipcat-ai/blob/master/docs/HANDBOOK.md",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-amber-400 transition hover:text-amber-300 hover:underline",children:"Read the full HANDBOOK →"})})]})}):null}const Hg=[{to:"/",label:"Dashboard",match:c=>c==="/"||c==="/overview"},{to:"/team",label:"Team",match:c=>c==="/team"||c.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:c=>c==="/debates"},{to:"/tasks",label:"Tasks",match:c=>c==="/tasks"},{to:"/signals",label:"Signals",match:c=>c==="/signals"},{to:"/logs",label:"Logs",match:c=>c==="/logs"}];function um(){const[c,u]=C.useState(!1),[f,o]=C.useState(!1),d=pm(),h=bm();return C.useEffect(()=>{const j=setInterval(()=>{u(Ug()===WebSocket.OPEN)},2e3);return()=>clearInterval(j)},[]),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:fl("/"),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 text-primary",children:"gossipcat"})]}),a.jsx("div",{className:"flex gap-1",children:Hg.map(j=>{const v=j.match(d);return a.jsx("a",{href:fl(j.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${v?"bg-primary/10 font-semibold text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:j.label},j.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>gm(h?"/":"/?expert=1"),"aria-label":h?"Return to overview":"Switch to expert view",className:`font-mono text-[10px] uppercase tracking-widest border border-border/40 rounded-sm px-2.5 py-1 transition ${h?"text-foreground hover:text-foreground":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:h?"← Overview":"Expert view →"}),a.jsx("button",{onClick:()=>o(!0),"aria-label":"Open glossary",className:"flex items-center justify-center rounded-md border border-border/60 bg-card px-2.5 py-1 font-mono text-xs font-semibold text-foreground transition hover:border-border hover:text-foreground",children:"Glossary"}),a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3.5 py-1.5 font-mono text-xs text-muted-foreground",children:[a.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${c?"bg-confirmed shadow-[0_0_6px_rgba(52,211,153,0.5)]":"bg-destructive"}`}),c?"Connected":"Disconnected"]})]}),a.jsx(qg,{open:f,onClose:()=>o(!1)})]})}function Bg(c){var f,o;const u=c.scores;return((f=u.bench)==null?void 0:f.state)==="benched"?u.bench.reason==="chronic-low-accuracy"?{label:"benched (chronic)",cls:"bg-destructive/15 text-destructive"}:u.bench.reason==="burst-hallucination"?{label:"benched (burst)",cls:"bg-destructive/15 text-destructive"}:{label:"benched",cls:"bg-destructive/15 text-destructive"}:((o=u.bench)==null?void 0:o.state)==="kept-for-coverage"?{label:"kept for coverage",cls:"border border-unverified/40 bg-unverified/10 text-unverified"}:u.circuitOpen?{label:`struggling (${u.consecutiveFailures} fails)`,cls:"bg-unverified/15 text-unverified"}:{label:"",cls:""}}function Lg({agents:c}){const u=c.filter(Nm);return u.length===0?null:a.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-destructive/[0.04] px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center rounded-sm bg-destructive/15 font-mono text-[11px] font-bold text-destructive",children:"!"}),a.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-destructive",children:"Agents Needing Attention"})]}),a.jsx("span",{className:"rounded-full border border-destructive/20 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:u.length})]}),a.jsx("div",{children:u.map((f,o)=>{var v,b;const d=(v=f.lastTask)!=null&&v.timestamp?He(f.lastTask.timestamp):"",h=Bg(f),j=((b=f.scores.bench)==null?void 0:b.state)==="benched";return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(f.id)}`,className:`block px-3.5 py-3 transition hover:bg-destructive/[0.03] ${o>0?"border-t border-border/40":""}`,children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2.5",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${j?"bg-destructive shadow-[0_0_6px_rgba(248,113,113,0.6)]":"bg-unverified"}`}),a.jsx("span",{className:"text-sm font-semibold text-foreground",children:f.id}),h.label&&a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${h.cls}`,children:h.label})]}),a.jsxs("div",{className:"flex items-center justify-between pl-4 font-mono text-[10px] text-muted-foreground",children:[a.jsxs("span",{children:[f.scores.consecutiveFailures," consecutive fails"]}),d&&a.jsx("span",{className:"text-muted-foreground/50",children:d})]})]},f.id)})})]})}function Qu(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Hu=5,Bu={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"}},rm=[{key:"all",label:"All",cls:"text-muted-foreground border-border/40 hover:border-border/60",activeCls:"text-foreground bg-muted border-border"},{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-zinc-500 border-zinc-500/20 hover:border-zinc-500/40",activeCls:"text-zinc-400 bg-zinc-500/10 border-zinc-500/40",tooltip:"Observations without a specific file:line anchor. Not scored — cannot be confirmed or disputed by peers."}],Yg=[{key:"all",label:"All",cls:"text-muted-foreground border-border/40 hover:border-border/60",activeCls:"text-foreground bg-muted border-border"},{key:"critical",label:"Critical",cls:"text-red-400/50 border-red-400/20 hover:border-red-400/40",activeCls:"text-red-400 bg-red-400/10 border-red-400/40"},{key:"high",label:"High",cls:"text-orange-400/50 border-orange-400/20 hover:border-orange-400/40",activeCls:"text-orange-400 bg-orange-400/10 border-orange-400/40"},{key:"medium",label:"Medium",cls:"text-yellow-400/50 border-yellow-400/20 hover:border-yellow-400/40",activeCls:"text-yellow-400 bg-yellow-400/10 border-yellow-400/40"},{key:"low",label:"Low",cls:"text-muted-foreground/50 border-border/40 hover:border-border/60",activeCls:"text-muted-foreground bg-muted/50 border-border"}],Gg={critical:"text-red-400 bg-red-500/10",high:"text-orange-400 bg-orange-500/10",medium:"text-yellow-400 bg-yellow-500/10",low:"text-muted-foreground bg-muted/50"},Xg="[&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:text-foreground/80 [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/70 [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:text-foreground/70 [&_.inline-code-block]:overflow-x-auto",Qg={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 Vg({f:c,reviewInfo:u,diagnostics:f}){const o=c.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":c.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":c.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=c.severity&&Gg[c.severity]||"",h=c.findingType==="suggestion"?"SUGGESTION":c.findingType==="insight"?"INSIGHT":null,j=c.findingType==="suggestion"?"text-blue-400 bg-blue-500/10":c.findingType==="insight"?"text-zinc-400 bg-zinc-500/10":"",v=c.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),b=v?v[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors bg-card/30 px-4 py-3.5",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${o}`,children:c.tag.toUpperCase()}),c.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,children:c.severity.toUpperCase()}),h&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${j}`,children:h}),b&&a.jsx("span",{className:"bg-blue-500/10 px-2 py-1 font-mono text-[10px] text-blue-400 border border-blue-500/15 rounded",children:b}),a.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/40",children:c.originalAgentId}),c.confirmedBy&&c.confirmedBy.length>0&&(()=>{const x=[...new Set(c.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:
63
+ ${x.join(", ")}`,"data-tooltip-pos":"left",children:["+",x.length," ✓"]})})(),c.disputedBy&&c.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:
64
+ ${c.disputedBy.map(x=>x.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[c.disputedBy.length," ⚡"]}),c.unverifiedBy&&c.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:
65
+ ${c.unverifiedBy.map(x=>x.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[c.unverifiedBy.length," ◇"]})]}),f&&f.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:f.map((x,E)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":x.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",x.code]}),a.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground/80",dangerouslySetInnerHTML:{__html:Qu(Qg[x.code])+" — "+Qu(x.message)}})]},E))}),c.disputedBy&&c.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:c.disputedBy.map((x,E)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:x.agentId}),a.jsxs("span",{className:"text-muted-foreground/60",children:[" — ",x.reason||x.evidence||"No reason given"]})]},E))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed text-muted-foreground ${Xg}`,dangerouslySetInnerHTML:{__html:ps(c.finding)}}),u&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[u.reviewers.map(x=>a.jsx("span",{title:x,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:$a(x)},children:Gu(x)},x)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.assigned>=u.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[u.assigned>=u.targetK?"✓":"⚠"," ",u.assigned,"/",u.targetK]})]})]})}function Mm({consensus:c,reports:u,showAll:f=!1,hideHeader:o=!1,filteredRuns:d}){const h=d??c.runs,j=f?h:h.slice(0,Hu);!f&&h.length>Hu;const[v,b]=C.useState(null),[x,E]=C.useState("all"),[w,H]=C.useState("all"),[Q,F]=C.useState(1),[W,X]=C.useState([]),[de,Z]=C.useState(0),[K,V]=C.useState(!1),[O,ae]=C.useState({});C.useEffect(()=>{if(!f&&(u!=null&&u.reports)&&(X(u.reports),Z(u.totalReports??u.reports.length),F(1)),u!=null&&u.roundRetractions){const A={};for(const S of u.roundRetractions)A[S.consensus_id]={reason:S.reason,retracted_at:S.retracted_at};ae(A)}},[u,f]),C.useEffect(()=>{if(!f)return;let A=!1;return(async()=>{var S;try{const q=await Qe("consensus-reports?page=1&pageSize=200");if(A)return;if(X(q.reports||[]),Z(q.totalReports??(((S=q.reports)==null?void 0:S.length)||0)),F(1),q.roundRetractions){const $={};for(const R of q.roundRetractions)$[R.consensus_id]={reason:R.reason,retracted_at:R.retracted_at};ae($)}}catch{}})(),()=>{A=!0}},[f]);const G=W.slice().sort((A,S)=>S.timestamp.localeCompare(A.timestamp)),te=10,[ue,oe]=C.useState(0),Se=Math.max(1,Math.ceil(G.length/te)),J=Math.min(ue,Se-1),ie=f?G.slice(J*te,(J+1)*te):G.slice(0,Hu),he=A=>{const S=new Date,q=new Date(A),$=I=>new Date(I.getFullYear(),I.getMonth(),I.getDate()).getTime(),R=Math.round(($(S)-$(q))/864e5);return R<=0?"Today":R===1?"Yesterday":R<7?`${R} days ago`:R<30?`${Math.floor(R/7)} weeks ago`:q.toISOString().slice(0,10)};return a.jsxs("section",{children:[!o&&a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Consensus Rounds ",a.jsx("span",{className:"text-primary",children:c.totalRuns??c.runs.length})]}),!f&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),ie.length>0?a.jsxs("div",{className:"space-y-2",children:[ie.map((A,S)=>{const q=S>0?ie[S-1]:null,$=f?he(A.timestamp):null,R=f&&q?he(q.timestamp):null,I=f&&$!==R,g={};if(A.crossReviewAssignments||A.crossReviewCoverage){const P={};if(A.crossReviewAssignments)for(const[Ue,Fe]of Object.entries(A.crossReviewAssignments))for(const et of Fe)(P[et]??(P[et]=[])).push(Ue);if(A.crossReviewCoverage)for(const Ue of A.crossReviewCoverage)g[Ue.findingId]={reviewers:P[Ue.findingId]||[],assigned:Ue.assigned,targetK:Ue.targetK};else for(const[Ue,Fe]of Object.entries(P))g[Ue]={reviewers:Fe,assigned:Fe.length,targetK:Fe.length}}const D=[...A.confirmed,...A.disputed,...A.unverified,...A.unique,...A.insights||[]],Y=x==="all"?D:x==="insight"?D.filter(P=>P.findingType==="insight"||P.findingType==="suggestion"):D.filter(P=>P.tag===x),L=w==="all"?Y:Y.filter(P=>P.severity===w),ne=v===A.id,ce=(()=>{const P=new Set;return Ue=>{var kt;const Fe=(kt=A.authorDiagnostics)==null?void 0:kt[Ue.originalAgentId];if(!Fe||Fe.length===0)return;const et=Fe.filter(ke=>{const Qn=`${Ue.originalAgentId}:${ke.code}`;return P.has(Qn)?!1:(P.add(Qn),!0)});return et.length>0?et:void 0}})(),pe=D.length||1,Be=A.confirmed.length,fe=A.disputed.length,Lt=A.unverified.length,Zt=A.unique.length,Ln=(A.insights||[]).length,Yn=(()=>{if(pe<=1)return"border-l-border/40";const P=Be/pe,Ue=fe/pe;return P>=.5?"border-l-confirmed/60":Ue>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),Kt=[{count:Be,textCls:"text-confirmed",label:"confirmed"},{count:fe,textCls:"text-disputed",label:"disputed"},{count:Lt,textCls:"text-unverified",label:"unverified"},{count:Zt,textCls:"text-unique",label:"unique"},{count:Ln,textCls:"text-zinc-400",label:"insights"}].filter(P=>P.count>0),Gn=[...new Set(D.map(P=>P.originalAgentId).filter(Boolean))],ml=Gn.slice(0,5),Xn=O[A.id],hl=!!Xn;return a.jsxs("div",{children:[I&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${S>0?"mt-4":""}`,children:[a.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:$}),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
66
+ ${Yn}
67
+ ${hl?"opacity-60 line-through decoration-disputed/40":""}
68
+ ${ne?"bg-card border-r-border/60 border-t-border/60 border-b-border/60":"bg-card/50 hover:bg-card/70 hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:shadow-sm hover:shadow-black/20 hover:-translate-y-px"}`,"data-retracted":hl?"true":void 0,children:[hl&&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"}),Xn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Xn.retracted_at.slice(0,10)]}),Xn.reason&&a.jsxs("span",{className:"ml-2 text-muted-foreground/80",children:["— ",Xn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":ne,onClick:()=>{const P=!ne;b(P?A.id:null),P&&(E("all"),H("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 text-foreground",children:D.length}),a.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"findings"}),a.jsx("span",{className:"text-muted-foreground/30 text-[10px]",children:"·"}),a.jsxs("span",{className:"text-[11px] text-muted-foreground/60",children:[A.rounds,"r"]}),ml.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[ml.map(P=>a.jsx("span",{title:P,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background",style:{backgroundColor:$a(P)},children:Gu(P)},P)),Gn.length>5&&a.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground/40",children:["+",Gn.length-5]})]}),a.jsx("span",{className:"shrink-0 rounded border border-border/30 bg-muted/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground",title:A.id,children:A.id.slice(0,8)}),A.droppedFindingsByType&&Object.keys(A.droppedFindingsByType).length>0&&(()=>{const P=Object.entries(A.droppedFindingsByType),Ue=P.reduce((et,[,kt])=>et+kt,0),Fe=P.map(([et,kt])=>`${et}:${kt}`).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=: ${Fe}. These never reach the dashboard, scores, or signals.`,children:[Ue," dropped"]})})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/50 shrink-0",children:He(A.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:Kt.map(P=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${P.textCls}`,children:[P.count," ",P.label]},P.label))}),A.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 bg-muted/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider text-muted-foreground/50",children:"Topic"}),a.jsx("span",{className:"font-inter text-[11px] leading-relaxed text-muted-foreground/70",children:A.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] text-muted-foreground/40 transition-transform duration-150 ${ne?"rotate-90 text-primary/60":"group-hover:text-muted-foreground/60"}`,children:"▸"})]}),ne&&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] text-muted-foreground/50",children:"Type:"}),rm.map(P=>a.jsx("button",{onClick:()=>E(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${x===P.key?P.activeCls:P.cls}`,...P.tooltip?{"data-tooltip":P.tooltip}:{},children:P.label},P.key))]}),a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:"Severity:"}),Yg.map(P=>a.jsx("button",{onClick:()=>H(P.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${w===P.key?P.activeCls:P.cls}`,children:P.label},P.key))]}),A.coverageDegraded&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Coverage degraded — ",A.coverageDegraded.received," of ",A.coverageDegraded.expected," agents responded"]}),A.coverageDegraded.droppedAgents.length>0&&a.jsxs("p",{className:"mt-0.5 font-mono text-[9px] text-muted-foreground/70",children:["Dropped: ",A.coverageDegraded.droppedAgents.join(", ")]})]}),A.relayCrossReviewSkipped&&A.relayCrossReviewSkipped.length>0&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Cross-review skipped: ",A.relayCrossReviewSkipped.length," relay agent",A.relayCrossReviewSkipped.length===1?"":"s"," failed Phase 2"]}),a.jsx("p",{className:"mt-0.5 font-mono text-[9px] text-muted-foreground/70",children:A.relayCrossReviewSkipped.map(P=>P.agentId).join(", ")})]}),(A.crossReviewAssignments||A.crossReviewCoverage)&&(()=>{const P=A.crossReviewAssignments||{},Ue=Object.entries(P),Fe=A.crossReviewCoverage||[],et=Fe.length,kt=Fe.filter(ke=>ke.assigned<ke.targetK);return a.jsxs("details",{className:"mb-3 rounded-md border border-border/30 bg-card/30",children:[a.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground select-none",children:["Cross-Review Assignments",A.partialReview&&a.jsx("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-unverified",children:"partial"}),a.jsxs("span",{className:"ml-auto font-mono text-[9px] font-normal normal-case tracking-normal text-muted-foreground/50",children:[Ue.length," reviewers · ",et," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[Ue.map(([ke,Qn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:ke,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background",style:{backgroundColor:$a(ke)},children:Gu(ke)}),a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:ke}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/40",children:["(",Qn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:Qn.map(Vn=>a.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:Vn.length>12?Vn.slice(0,12)+"…":Vn},Vn))})]},ke)),et>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:kt.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:["⚠ ",kt.length," of ",et," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",et," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:L.length===0?a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No findings match this filter."}):L.map((P,Ue)=>a.jsx(Vg,{f:P,reviewInfo:P.id?g[P.id]:void 0,diagnostics:ce(P)},Ue))})]})]})]},A.id)}),f&&Se>1&&a.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4 font-mono text-[11px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>oe(A=>Math.max(0,A-1)),disabled:J===0,className:"rounded-sm border border-border/40 bg-card px-3 py-1 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:["Page ",J+1," of ",Se]}),a.jsx("button",{onClick:()=>oe(A=>Math.min(Se-1,A+1)),disabled:J>=Se-1,className:"rounded-sm border border-border/40 bg-card px-3 py-1 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}):j.length===0?a.jsx(Bn,{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:j.map((A,S)=>{const q=A.counts,$=(q.agreement||0)+(q.disagreement||0)+(q.hallucination||0)+(q.unverified||0)+(q.unique||0)+(q.new||0),R=$||1,I=v===A.taskId,g=[{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"}],D=A.signals.filter(L=>{if(L.signal==="signal_retracted")return!1;if(x==="all")return!!Bu[L.signal];const ne=Bu[L.signal];return ne&&ne.filter===x}),Y=!!A.retracted;return a.jsxs("div",{className:`rounded-md border bg-card transition ${I?"border-primary/25":"border-border"} ${Y?"opacity-60":""}`,"data-retracted":Y?"true":void 0,title:Y&&A.retractionReason?`Retracted: ${A.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"}),A.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",A.retractedAt.slice(0,10)]}),A.retractionReason&&a.jsxs("span",{className:"ml-2 text-muted-foreground/80",children:["— ",A.retractionReason]})]}),a.jsxs("button",{"aria-expanded":I,onClick:()=>{const L=!I;b(L?A.taskId:null),L&&(E("all"),H("all"))},className:"flex w-full items-center p-3 text-left transition hover:bg-accent/50",children:[a.jsx("span",{className:`mr-3 font-mono text-xs text-muted-foreground transition ${I?"text-primary":""}`,children:I?"▾":"▸"}),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] text-primary/50",children:A.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold text-foreground ${Y?"line-through decoration-disputed/40":""}`,children:[$," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[A.agents.slice(0,4).map(L=>a.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:L.split("-").map(ne=>ne[0]).join("").toUpperCase().slice(0,2)},L)),A.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",A.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:He(A.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:g.map(L=>L.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${L.text} ${Y?"line-through decoration-disputed/40":""}`,children:[L.count," ",L.label]},L.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:g.map(L=>L.count>0&&a.jsx("div",{className:`${L.color} transition-all`,style:{width:`${L.count/R*100}%`}},L.key))})]})]}),I&&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:rm.map(L=>a.jsx("button",{onClick:()=>E(L.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${x===L.key?L.activeCls:L.cls} hover:opacity-80`,...L.tooltip?{"data-tooltip":L.tooltip}:{},children:L.label},L.key))}),D.length===0?a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"No findings match this filter."}):a.jsx("div",{className:"space-y-2",children:D.map((L,ne)=>{const ce=Bu[L.signal];return ce?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 ${ce.cls}`,children:ce.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:ps(L.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[L.agentId,L.counterpartId?` + ${L.counterpartId}`:""]})]})]},ne):null})})]})]},A.taskId+S)})})]})}const Zg={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"text-muted-foreground bg-muted/30"},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function Kg({task:c,onClose:u}){if(C.useEffect(()=>{if(!c)return;const d=h=>{h.key==="Escape"&&u()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[c,u]),!c)return null;const f=Zg[c.status],o=(c.inputTokens||0)+(c.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:u,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border bg-card shadow-2xl",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 ${f.cls}`,children:f.label}),a.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-amber-400",children:c.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"truncate font-mono text-xs text-muted-foreground transition hover:text-primary",children:c.agentId})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px] text-muted-foreground",children:[a.jsx("span",{children:He(c.timestamp)}),c.duration!=null&&a.jsxs("span",{children:["· ",dg(c.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(c.inputTokens||0).toLocaleString()," in / ",(c.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:u,className:"shrink-0 rounded-md border border-border/40 bg-card px-2 py-1 font-mono text-xs text-muted-foreground transition hover:bg-accent/50 hover:text-foreground","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 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Task"}),a.jsx("div",{className:"task-md rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90 overflow-x-auto",dangerouslySetInnerHTML:{__html:vm(c.task)}})]}),c.result?a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),a.jsx("div",{className:"finding-md rounded-md border border-border/40 bg-background/40 p-3 font-mono text-xs leading-relaxed text-foreground/90 whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted/40 [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/30 [&_.inline-code-block]:p-2",dangerouslySetInnerHTML:{__html:ps(c.result)}})]}):a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),a.jsx("div",{className:"rounded-md border border-border/40 bg-background/40 p-3 text-center font-mono text-xs text-muted-foreground",children:c.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}const $g=new Set(["shipped","closed"]);function Cm(c){var d,h,j,v;if(c.filename==="MEMORY.md")return"record";const u=c.filename.split("_")[0].toLowerCase(),f=(h=(d=c.frontmatter)==null?void 0:d.type)==null?void 0:h.toLowerCase(),o=(v=(j=c.frontmatter)==null?void 0:j.status)==null?void 0:v.toLowerCase();return u==="session"?"session":u==="feedback"||u==="user"?"rule":u==="project"?o&&$g.has(o)?"record":"backlog":u==="gossip"?"record":f==="session"?"session":f==="feedback"||f==="user"?"rule":f==="reference"?"record":"backlog"}const zm=[{type:"backlog",label:"Backlog",blurb:"Open work, pending decisions"},{type:"record",label:"Record",blurb:"Shipped & closed reference"},{type:"session",label:"Session",blurb:"Per-session recaps"},{type:"rule",label:"Rule",blurb:"Feedback & user preferences"}];function Jg(c){return c.origin?`${c.origin}/${c.filename}`:c.filename}function Fg(c){const u=new Set,f=[];for(const o of c){const d=Jg(o);u.has(d)||(u.add(d),f.push(o))}return f}const Wg={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},Ig={backlog:"border-primary/30 bg-primary/[0.06]",record:"border-text-dim/30 bg-text-dim/[0.08]",session:"border-confirmed/30 bg-confirmed/[0.06]",rule:"border-unverified/30 bg-unverified/[0.06]"};function Pg({folder:c,memories:u,onBack:f,onOpen:o}){const d=zm.find(b=>b.type===c),h=Wg[c],j=Ig[c],v=C.useMemo(()=>[...u].sort((b,x)=>b.filename<x.filename?1:-1),[u]);return a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center gap-2 font-mono text-xs",children:[a.jsx("button",{onClick:f,className:"font-bold uppercase tracking-widest text-muted-foreground transition hover:text-primary",children:"Memory"}),a.jsx("span",{className:"text-muted-foreground/40",children:"›"}),a.jsx("span",{className:`font-bold uppercase tracking-widest ${h}`,children:d.label}),a.jsx("span",{className:"ml-1 text-muted-foreground/60",children:v.length})]}),v.length===0?a.jsx("div",{className:"flex-1",children:a.jsx(Bn,{title:`No ${d.label.toLowerCase()} memories`,hint:d.blurb})}):a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:v.map(b=>{const x=ep(b),E=tp(b),w=np(b.frontmatter);return a.jsxs("button",{onClick:()=>o(b),className:"group flex flex-col gap-1.5 rounded-md border border-border/40 bg-muted p-3 text-left transition hover:border-primary/30 hover:bg-accent/40",children:[a.jsx("span",{className:`inline-block w-fit rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-bold uppercase tracking-[0.14em] ${j} ${h}`,children:d.label}),a.jsx("span",{className:"line-clamp-2 text-[13px] font-medium leading-snug text-foreground group-hover:text-primary",children:x}),a.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[10px] text-muted-foreground/70",children:[a.jsx("span",{className:"min-w-0 truncate",children:E}),w&&a.jsx("span",{className:"shrink-0",children:He(w)})]})]},`${b.agentId||""}/${b.filename}`)})})]})}function ep(c){var o;const u=(o=c.frontmatter)==null?void 0:o.name;if(u)return u;const f=c.content.split(`
69
+ `).find(d=>d.trim().length>0);if(f){const d=f.replace(/^#+\s*/,"").trim();if(d)return d.slice(0,80)}return c.filename.replace(/\.md$/,"")}function tp(c){const u=c.filename.replace(/\.md$/,"");return u||(c.agentId==="_project"?"project":c.agentId||"unknown")}function np(c){if(c)for(const u of["timestamp","updated","updatedAt","modified","created","date"]){const f=c[u];if(f&&!isNaN(new Date(f).getTime()))return f}}function lp({memory:c,onClose:u}){if(C.useEffect(()=>{if(!c)return;const v=b=>{b.key==="Escape"&&u()};return document.addEventListener("keydown",v),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}},[c,u]),!c)return null;const f=Cm(c),o=c.agentId==="_project"?"project":c.agentId||"unknown",d=`.gossip/agents/${c.agentId||"_project"}/memory/knowledge/${c.filename}`,h=ap(c.frontmatter),j=Object.entries(c.frontmatter||{});return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:u,children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-xl flex-col overflow-hidden rounded-lg border border-primary/30 bg-card",style:{boxShadow:"0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(139, 92, 246, 0.06)"},onClick:v=>v.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4 py-3.5",children:[a.jsx("span",{className:"shrink-0 rounded-sm border border-primary/30 bg-primary/[0.06] px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-[0.14em] text-primary",children:f}),a.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs font-medium text-foreground",children:c.filename}),a.jsx("button",{onClick:u,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition hover:bg-muted hover:text-foreground","aria-label":"Close",children:a.jsx("span",{className:"text-base leading-none",children:"✕"})})]}),a.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto px-4 py-4 text-[13px] leading-relaxed text-foreground",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Owner"}),a.jsxs("div",{className:"flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground",children:[a.jsx("span",{children:o}),h&&a.jsxs("span",{children:["· updated ",He(h)]})]}),a.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground/60",children:d})]}),j.length>0&&a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Frontmatter"}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-background/40",children:a.jsx("table",{className:"w-full text-left font-mono text-[11px]",children:a.jsx("tbody",{children:j.map(([v,b])=>a.jsxs("tr",{className:"border-b border-border/20 last:border-b-0",children:[a.jsx("td",{className:"w-32 px-3 py-1.5 text-muted-foreground/70",children:v}),a.jsx("td",{className:"px-3 py-1.5 break-all text-foreground/90",children:b})]},v))})})})]}),a.jsxs("section",{children:[a.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Content"}),a.jsx("div",{className:"task-md overflow-x-auto rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90",dangerouslySetInnerHTML:{__html:vm(c.content)}})]})]})]})})}function ap(c){if(c)for(const u of["timestamp","updated","updatedAt","modified","created","date"]){const f=c[u];if(f&&!isNaN(new Date(f).getTime()))return f}}const ip=new Set(["shipped","closed"]),sp={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},cp={backlog:{bg:"bg-primary",glow:"rgba(139, 92, 246, 0.6)"},record:{bg:"bg-text-dim",glow:"rgba(102, 102, 116, 0.55)"},session:{bg:"bg-confirmed",glow:"rgba(52, 211, 153, 0.55)"},rule:{bg:"bg-unverified",glow:"rgba(251, 191, 36, 0.55)"}},up={backlog:"bg-primary/[0.06] border-primary/30",record:"bg-text-dim/[0.08] border-text-dim/20",session:"bg-confirmed/[0.06] border-confirmed/25",rule:"bg-unverified/[0.06] border-unverified/25"},rp={backlog:a.jsx("path",{d:"M20 7h-7L10.3 4.3A1 1 0 0 0 9.6 4H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"}),record:a.jsxs(a.Fragment,{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"})]}),session:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),rule:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})},op=1440*60*1e3;function dp({memories:c,heading:u="Memory",statusFilter:f=!1}){const[o,d]=C.useState(null),[h,j]=C.useState(null),[v,b]=C.useState("all"),x=C.useMemo(()=>Fg(c),[c]),E=C.useMemo(()=>!f||v==="all"?x:x.filter(H=>{var F;const Q=(((F=H.frontmatter)==null?void 0:F.status)||"").toLowerCase();return v==="shipped"?ip.has(Q):Q==="open"||!Q}),[x,f,v]),w=C.useMemo(()=>{const H={backlog:[],record:[],session:[],rule:[]},Q={backlog:!1,record:!1,session:!1,rule:!1},F=Date.now();for(const W of E){const X=Cm(W);H[X].push(W),!Q[X]&&fp(W,F)&&(Q[X]=!0)}return{buckets:H,recent:Q}},[E]);return o?a.jsxs(a.Fragment,{children:[a.jsx(Pg,{folder:o,memories:w.buckets[o],onBack:()=>d(null),onOpen:j}),a.jsx(lp,{memory:h,onClose:()=>j(null)})]}):a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:[u," ",a.jsx("span",{className:"text-primary",children:E.length})]}),f&&a.jsx("div",{className:"flex gap-1 font-mono text-[10px]",role:"tablist","aria-label":"Status filter",children:["all","open","shipped"].map(H=>a.jsx("button",{role:"tab","aria-selected":v===H,onClick:()=>b(H),className:`rounded-sm border px-2 py-0.5 uppercase tracking-widest transition ${v===H?"border-primary/50 bg-primary/10 text-primary":"border-border/30 text-muted-foreground hover:border-primary/30 hover:text-foreground"}`,children:H},H))})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:zm.map(({type:H,label:Q,blurb:F})=>{const W=w.buckets[H].length,X=w.recent[H],de=sp[H],Z=cp[H],K=up[H],V=W===0;return a.jsxs("button",{onClick:()=>d(H),disabled:V,className:`group relative grid grid-cols-[auto_1fr_auto] grid-rows-[auto_auto] items-center gap-x-3 gap-y-1 rounded-md border bg-muted p-3.5 text-left transition ${V?"cursor-default border-border/20 opacity-55":"border-border/40 hover:border-primary/30 hover:bg-accent/40"}`,children:[a.jsxs("span",{className:`relative row-span-2 flex h-9 w-9 items-center justify-center rounded-sm border ${K} ${de}`,"aria-hidden":!0,children:[X&&a.jsx("span",{className:`pointer-events-none absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full ${Z.bg}`,style:{boxShadow:`0 0 8px ${Z.glow}`},"data-tooltip":"Activity in the last 24h","aria-label":"Activity in the last 24h"}),a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:rp[H]})]}),a.jsx("span",{className:"self-end font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:Q}),a.jsx("span",{className:`row-span-2 self-center font-mono text-sm font-bold tabular-nums ${V?"text-muted-foreground/40":de}`,children:W}),a.jsx("span",{className:"self-start font-mono text-[10px] leading-snug text-muted-foreground/70",children:F})]},H)})})]})}function fp(c,u){const f=c.frontmatter;if(!f)return!1;for(const o of["lastAccessed","updated","timestamp","updatedAt","modified","created","date"]){const d=f[o];if(!d)continue;const h=new Date(d).getTime();if(!isNaN(h)&&u-h<=op)return!0}return!1}function mp(c){const u=new Map;for(const o of c){const d=u.get(o.agentId)??[];d.push(o),u.set(o.agentId,d)}const f=[];for(const[o,d]of u){d.sort((j,v)=>j.day.localeCompare(v.day));const h=d.length>0?d[d.length-1].accuracy:0;f.push({agentId:o,points:d,latest:h})}return f.sort((o,d)=>d.latest-o.latest),f}function hp({values:c,className:u}){if(c.length===0)return a.jsx("svg",{width:120,height:20});if(c.length===1){const j=20-c[0]*20;return a.jsx("svg",{width:120,height:20,className:u,children:a.jsx("circle",{cx:120/2,cy:j,r:2,fill:"currentColor"})})}const d=120/(c.length-1),h=c.map((j,v)=>`${(v*d).toFixed(1)},${(20-j*20).toFixed(1)}`).join(" ");return a.jsx("svg",{width:120,height:20,className:u,children:a.jsx("polyline",{points:h,fill:"none",stroke:"currentColor",strokeWidth:1.5})})}function xp(){const[c,u]=C.useState(null),[f,o]=C.useState(null);C.useEffect(()=>{Qe("fleet-trend?days=30").then(u).catch(h=>o(String((h==null?void 0:h.message)??h)))},[]);const d=C.useMemo(()=>c?mp(c.points):[],[c]);return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Fleet Health Trend"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"last 30d"})]}),!c&&!f&&a.jsx(Bn,{title:"Loading…",compact:!0}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"failed to load trend data"}),!f&&c&&d.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"no recent consensus signals"}),!f&&d.length>0&&a.jsx("ul",{className:"space-y-1.5",children:d.map(h=>{const j=h.latest===0;return a.jsxs("li",{className:`flex items-center justify-between gap-3 text-xs${j?" opacity-40":""}`,children:[a.jsx("span",{className:"truncate font-mono text-foreground",children:h.agentId}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(hp,{values:h.points.map(v=>v.accuracy),className:h.latest>=.7?"text-confirmed":h.latest>=.4?"text-unverified":"text-disputed"}),a.jsxs("span",{className:"w-10 text-right tabular-nums text-muted-foreground",children:[Math.round(h.latest*100),"%"]})]})]},h.agentId)})})]})}function gp(){var v;const[c,u]=C.useState(null),[f,o]=C.useState(null);C.useEffect(()=>{let b=!1;return Qe("violations?pageSize=1").then(x=>{b||u(x)}).catch(x=>{b||o(String((x==null?void 0:x.message)??x))}),()=>{b=!0}},[]);const d=(c==null?void 0:c.total)??0,h=((v=c==null?void 0:c.items)==null?void 0:v[0])??null,j=d>0;return a.jsxs("div",{className:`rounded-lg border ${j?"border-destructive/30 bg-destructive/10":"border-border bg-muted/20"}`,children:[a.jsxs("div",{className:`flex items-center justify-between border-b px-3.5 py-3 ${j?"border-destructive/20 bg-destructive/[0.06]":"border-border/40"}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-sm font-mono text-[11px] font-bold ${j?"bg-destructive/15 text-destructive":"bg-muted text-muted-foreground"}`,children:"!"}),a.jsx("span",{className:`min-w-0 truncate font-mono text-[11px] font-bold uppercase tracking-widest ${j?"text-destructive":"text-muted-foreground"}`,children:"Process Violations"})]}),j&&a.jsx("span",{className:"shrink-0 rounded-full border border-destructive/20 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:d})]}),a.jsxs("div",{className:"min-h-[52px] px-3.5 py-3",children:[f&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground",children:"failed to load violation data"}),!f&&!c&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground/60",children:"Loading…"}),!f&&c&&!j&&a.jsx("p",{className:"font-mono text-[10px] text-muted-foreground/70",children:"No violations detected"}),!f&&c&&j&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"font-mono text-[11px] text-foreground",children:[d," direct master push",d===1?"":"es"," detected"]}),h&&a.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("span",{className:"shrink-0",children:"Most recent:"}),a.jsx("span",{className:"truncate text-foreground",children:h.agentId}),a.jsx("span",{className:"shrink-0 text-muted-foreground/50",children:He(h.detectedAt)})]})]}),!f&&c&&a.jsx("div",{className:"mt-2 text-right",children:a.jsx("a",{href:fl("/violations"),className:`font-mono text-[10px] transition hover:underline ${j?"text-destructive":"text-muted-foreground hover:text-foreground"}`,children:"View all →"})})]})]})}const xs=25;function pp({commits:c}){const[u,f]=C.useState(!1);if(c.length===0)return a.jsx("span",{className:"text-muted-foreground/50",children:"—"});const o=c[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,h=c.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{className:"text-foreground",children:d}),h>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":u,onClick:()=>f(j=>!j),className:"font-mono text-[10px] text-muted-foreground/70 underline hover:text-foreground",children:u?"(collapse)":`(+${h} more)`}),u&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:c.slice(1).map((j,v)=>{const b=j.includes(" ")?j.slice(j.indexOf(" ")+1):j;return a.jsx("li",{className:"font-mono text-[10px] text-muted-foreground/80",children:b},v)})})]})]})}function bp({row:c}){const u=c.preSha.slice(0,8),f=c.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] text-muted-foreground/80",children:He(c.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"font-mono text-[11px] text-foreground hover:text-primary hover:underline",children:c.agentId})}),a.jsxs("td",{className:"whitespace-nowrap py-3 pr-4 font-mono text-[10px]",children:[a.jsx("span",{className:"text-muted-foreground/70",children:u}),a.jsx("span",{className:"mx-1 text-muted-foreground/40",children:"→"}),a.jsx("span",{className:"text-foreground",children:f})]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(pp,{commits:c.commits})})]})}function vp(){const[c,u]=C.useState([]),[f,o]=C.useState(0),[d,h]=C.useState(1),[j,v]=C.useState(!1),[b,x]=C.useState(null);C.useEffect(()=>{let w=!1;return v(!0),x(null),Qe(`violations?page=${d}&pageSize=${xs}`).then(H=>{w||(u(H.items??[]),o(H.total??0))}).catch(H=>{w||x(String((H==null?void 0:H.message)??H))}).finally(()=>{w||v(!1)}),()=>{w=!0}},[d]);const E=Math.max(1,Math.ceil(f/xs));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Process Violations"}),f>0&&a.jsx("span",{className:"rounded-full border border-destructive/30 bg-destructive/10 px-2 py-0.5 font-mono text-xs font-bold text-destructive",children:f})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:"Direct master pushes detected by the ref-allowlist enforcer"})]}),a.jsxs("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:[b&&a.jsx("div",{className:"border-b border-border/60 bg-destructive/10 px-3 py-2 font-mono text-[10px] text-destructive",children:b}),!b&&a.jsxs("table",{className:"w-full table-fixed text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",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:[!j&&c.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[11px] text-muted-foreground/50",children:"No violations recorded"})}),j&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[10px] text-muted-foreground/50",children:"Loading…"})}),!j&&c.map(w=>a.jsx(bp,{row:w},`${w.taskId}-${w.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] text-muted-foreground/60",children:j?"loading…":f===0?"no violations":`${(d-1)*xs+1}–${Math.min(d*xs,f)} of ${f}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] text-muted-foreground ${E<=1?"invisible":""}`,children:[a.jsx("button",{type:"button",onClick:()=>h(w=>Math.max(1,w-1)),disabled:d===1||j,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",E]}),a.jsx("button",{type:"button",onClick:()=>h(w=>Math.min(E,w+1)),disabled:d>=E||j,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]})}const Lu=[{key:"passed",label:"passed",bar:"bg-emerald-400",dot:"bg-emerald-400",text:"text-emerald-400"},{key:"pending",label:"pending",bar:"bg-sky-400",dot:"bg-sky-400",text:"text-sky-400"},{key:"insufficient_evidence",label:"insufficient",bar:"bg-yellow-400",dot:"bg-yellow-400",text:"text-yellow-400"},{key:"inconclusive",label:"inconclusive",bar:"bg-orange-400",dot:"bg-orange-400",text:"text-orange-400"},{key:"silent_skill",label:"silent",bar:"bg-zinc-500",dot:"bg-zinc-500",text:"text-zinc-400"},{key:"failed",label:"failed",bar:"bg-red-400",dot:"bg-red-400",text:"text-red-400"}];function yp({overview:c}){const u=c==null?void 0:c.skillVerdictSummary,f=u?Lu.reduce((o,d)=>o+(u[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:[f," total"]})]}),!u||f===0?a.jsx("p",{className:"font-mono text-[11px] text-muted-foreground/60",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 bg-muted/40",children:Lu.map(o=>{const d=u[o.key]??0;if(d===0)return null;const h=d/f*100;return a.jsx("div",{className:o.bar,style:{width:`${h}%`},title:`${o.label}: ${d}`},o.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:Lu.map(o=>{const d=u[o.key]??0,h=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${h?"opacity-40":""}`,children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o.dot}`}),a.jsx("span",{className:"text-muted-foreground",children:o.label}),a.jsx("span",{className:`ml-auto tabular-nums ${h?"text-muted-foreground/50":o.text}`,children:d})]},o.key)})})]})]})}const om=["bg-primary/70","bg-cyan-500/60","bg-unique","bg-muted-foreground/60","bg-primary/50","bg-confirmed/70"];function dm(c){let u=0;for(let f=0;f<c.length;f++)u=u*31+c.charCodeAt(f)>>>0;return om[u%om.length]}function jp({overview:c}){const u=c==null?void 0:c.droppedFindingTypeCounts,f=u?Object.entries(u).sort((d,h)=>h[1]-d[1]):[],o=f.reduce((d,[,h])=>d+h,0);return a.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Invalid Output Types",a.jsx("span",{className:"text-muted-foreground/50 font-normal normal-case ml-2",children:"agent_finding tags rejected by the parser"})]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"last 20 rounds"})]}),o===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"all clean — no invalid types"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-3 w-full overflow-hidden rounded",children:f.map(([d,h])=>{const j=h/o*100;return a.jsx("div",{className:dm(d),style:{width:`${j}%`},title:`invalid type "${d}" emitted ${h} times in last 20 consensus rounds`},d)})}),a.jsx("ul",{className:"space-y-1 text-xs",children:f.map(([d,h])=>a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`h-2 w-2 rounded-sm ${dm(d)}`}),a.jsx("span",{className:"truncate font-mono text-foreground",children:d}),a.jsx("span",{className:"ml-auto tabular-nums text-muted-foreground",children:h})]},d))})]})]})}function Np({categoryAccuracy:c,categoryCorrect:u,categoryHallucinated:f}){const o=Object.keys(c??{});if(o.length===0)return a.jsx(Bn,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(h=>{const j=Math.max(0,Math.min(1,c[h]??0)),v=(u==null?void 0:u[h])??0,b=(f==null?void 0:f[h])??0;return{key:h,acc:j,c:v,h:b,n:v+b}}).sort((h,j)=>j.acc-h.acc);return a.jsx("div",{className:"space-y-2",children:d.map(h=>{const j=h.acc>=.7?"bg-confirmed":h.acc>=.4?"bg-unverified":"bg-disputed",v=h.n>0?`${h.c} correct / ${h.h} hallucinated / ${h.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${h.n>0&&h.n<10?"opacity-50":""}`,title:h.n>0&&h.n<10?`${v} — low sample (n<10)`:v,children:[a.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:h.key.replace(/_/g," ")}),a.jsx("div",{className:"h-2 overflow-hidden rounded-sm bg-muted/30",children:a.jsx("div",{className:`h-full rounded-sm transition-all ${j}`,style:{width:`${h.acc*100}%`}})}),a.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums text-muted-foreground/60 w-16",children:h.n>0?a.jsxs(a.Fragment,{children:[h.c,"/",h.n,h.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",h.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(h.acc*100),"%"]})]},h.key)})})}const Sp={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 120 post-bind signals — verdict pending more data",inconclusive:"Mixed signals — needs further evaluation",passed:"Skill verified effective",failed:"Skill verified ineffective",pending:"Awaiting evidence",flagged_for_manual_review:"Manual review required"},_p={pending:"border-border/50 bg-muted/30 text-muted-foreground",passed:"border-confirmed/40 bg-confirmed/10 text-confirmed",failed:"border-disputed/40 bg-disputed/10 text-disputed",silent_skill:"border-unverified/40 bg-unverified/10 text-unverified",insufficient_evidence:"border-unverified/40 bg-unverified/10 text-unverified",inconclusive:"border-orange-400/40 bg-orange-500/10 text-orange-400",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function Tp(c){const u=Math.round(c*100),f=u>0?"+":"",o=u>0?"text-confirmed":u<0?"text-disputed":"text-muted-foreground";return{text:`${f}${u}pp`,cls:o}}function Ep({slot:c}){const u=c.status,f=u?_p[u]:"border-border/50 bg-muted/30 text-muted-foreground",o=u==="inconclusive"&&(c.inconclusiveStrikes??0)>0,d=c.forcedDevelops??[],h=d.length>0?d[d.length-1]:null,j=typeof c.effectiveness=="number"?Tp(c.effectiveness):null;return a.jsxs("div",{className:`rounded-md border bg-card/80 p-3 ${c.enabled?"border-border/50":"border-border/30 opacity-60"}`,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 ${c.enabled?"text-foreground":"text-muted-foreground line-through"}`,children:[c.mode==="contextual"&&"⚡ ",c.name]}),a.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:c.source}),c.mode==="contextual"&&a.jsx("span",{className:"rounded-sm border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] text-amber-400",children:"contextual"})]}),a.jsxs("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:["bound ",He(c.boundAt)]})]}),u&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${f}`,title:Sp[u],children:u.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[j&&a.jsx("span",{className:j.cls,title:"Effectiveness: change in hallucination rate pre/post",children:j.text}),o&&a.jsxs("span",{className:"text-unique",title:c.inconclusiveAt?`last strike ${He(c.inconclusiveAt)}`:void 0,children:[c.inconclusiveStrikes," strike",c.inconclusiveStrikes===1?"":"s"]})]}),d.length>0&&a.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px] text-muted-foreground",title:h!=null&&h.reason?`latest: ${h.reason}`:void 0,children:["forced ",d.length," time",d.length===1?"":"s",h&&` · last ${He(h.timestamp)}`]})]})}function Ap({open:c,onOpenChange:u,children:f}){return C.useEffect(()=>{if(!c)return;const o=h=>{h.key==="Escape"&&u(!1)};document.addEventListener("keydown",o);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=d}},[c,u]),c?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-sm",onClick:()=>u(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:f})})]}):null}function Mp({side:c="right",className:u="",children:f,...o}){return a.jsx("div",{className:`h-full border-l border-border/60 bg-card shadow-xl p-6 ${u}`,...o,children:f})}function Cp({className:c="",...u}){return a.jsx("div",{className:`mb-2 ${c}`,...u})}function zp({className:c="",...u}){return a.jsx("h2",{className:`font-semibold ${c}`,...u})}function wp({citation:c}){const u=c.snippet.split(`
70
+ `);return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/60 overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/40",children:a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[c.file,":",c.line]})}),a.jsx("pre",{className:"px-3 py-2 font-mono text-[11px] leading-relaxed overflow-x-auto",children:u.map((f,o)=>a.jsx("div",{className:"whitespace-pre",children:f||" "},o))})]})}const Dp={critical:"text-red-400 bg-red-500/10",high:"text-orange-400 bg-orange-500/10",medium:"text-yellow-400 bg-yellow-500/10",low:"text-muted-foreground bg-muted/50"},Op={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-muted-foreground bg-muted border border-border/40",newFinding:"text-unique bg-unique/10 border border-unique/20"};function bs({open:c,onOpenChange:u,consensusId:f,findingId:o}){const[d,h]=C.useState(null),[j,v]=C.useState(null);return C.useEffect(()=>{if(!c||!f||!o){h(null),v(null);return}h(null),v(null),Qe(`finding/${encodeURIComponent(f)}/${encodeURIComponent(o)}`).then(h).catch(b=>v(b.message||"failed to load finding"))},[c,f,o]),a.jsx(Ap,{open:c,onOpenChange:u,children:a.jsxs(Mp,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",children:[a.jsx(Cp,{children:a.jsx(zp,{className:"font-mono text-sm",children:"Finding detail"})}),j&&a.jsx("div",{className:"mt-4 text-[11px] text-disputed",children:j}),!j&&!d&&a.jsx("div",{className:"mt-4 text-[11px] text-muted-foreground",children:"Loading…"}),d&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${Op[d.finding.tag]||"bg-muted"}`,children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${Dp[d.finding.severity]||"bg-muted"}`,children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground",children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"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-widest text-muted-foreground",children:"Citations"}),d.citations.map((b,x)=>a.jsx(wp,{citation:b},x))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",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((b,x)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",b.agentId,": ",a.jsx("span",{className:"text-muted-foreground",children:b.reason})]},x)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px] text-muted-foreground",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-widest text-muted-foreground",children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((b,x)=>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:b.signal}),a.jsx("span",{className:"text-muted-foreground",children:"·"}),a.jsx("span",{children:b.agentId}),b.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted-foreground",children:"→"}),a.jsx("span",{children:b.counterpartId})]}),a.jsx("span",{className:"text-muted-foreground ml-auto",children:He(b.timestamp)})]}),b.evidence&&a.jsx("div",{className:"text-muted-foreground mt-0.5",children:b.evidence.slice(0,200)})]},x))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:`#/consensus/${d.consensusId}`,className:"font-mono text-[10px] text-primary hover:underline",children:["→ consensus round ",d.consensusId]})})]})]})})}const Rp={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 Up({agentId:c}){const[u,f]=C.useState([]),[o,d]=C.useState(!0),[h,j]=C.useState("all"),[v,b]=C.useState(null);C.useEffect(()=>{let H=!1;return d(!0),Qe(`signals?agent=${encodeURIComponent(c)}&limit=100`).then(Q=>{H||(f(Q.items||[]),d(!1))}).catch(()=>{H||(f([]),d(!1))}),()=>{H=!0}},[c]);const x=[...u].sort((H,Q)=>(Q.timestamp||"").localeCompare(H.timestamp||"")),E=h==="all"||h==="signals"?x:[],w=({k:H,label:Q,enabled:F})=>a.jsx("button",{type:"button",onClick:()=>F&&j(H),disabled:!F,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${h===H?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"} ${F?"":"opacity-40 cursor-not-allowed"}`,children:Q});return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Activity"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(w,{k:"all",label:"All",enabled:!0}),a.jsx(w,{k:"signals",label:"Signals",enabled:!0}),a.jsx(w,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(w,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?a.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"Loading…"}):E.length===0?a.jsx(Bn,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:E.map((H,Q)=>{const F=Rp[H.signal]||"text-muted-foreground bg-muted",W=!!(H.consensusId&&H.findingId),X=a.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[a.jsx("span",{className:"shrink-0 font-mono text-[9px] text-muted-foreground/60 tabular-nums w-16",children:He(H.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${F}`,children:H.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px] text-muted-foreground",children:[H.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:["→ ",H.counterpartId," · "]}),H.evidence&&a.jsx("span",{children:H.evidence.length>160?H.evidence.slice(0,160)+"…":H.evidence})]})]});return W?a.jsx("button",{type:"button",onClick:()=>b({consensusId:H.consensusId,findingId:H.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/40",children:X},Q):a.jsx("div",{children:X},Q)})}),a.jsx(bs,{open:!!v,onOpenChange:H=>{H||b(null)},consensusId:(v==null?void 0:v.consensusId)??null,findingId:(v==null?void 0:v.findingId)??null})]})}function kp(){const c=C.useRef(null),[u,f]=C.useState(0);return C.useEffect(()=>{const o=c.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(h=>{for(const j of h)f(j.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[c,u]}const qp={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"},Hp={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"},Bp=6,Lp=500,wm=100,Yp=150;function Gp(c){if(c<=0)return wm;const u=Math.floor(c/Bp);return Math.max(1,Math.min(u,Lp))}function Xp({agentId:c}){const[u,f]=C.useState([]),[o,d]=C.useState(0),[h,j]=C.useState(!1),[v,b]=C.useState(null),[x,E]=kp(),[w,H]=C.useState(wm),Q=C.useRef(null);C.useEffect(()=>{if(E<=0)return;const Z=Gp(E);return Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{H(K=>K===Z?K:Z)},Yp),()=>{Q.current&&clearTimeout(Q.current)}},[E]),C.useEffect(()=>{Qe(`signals?agent=${encodeURIComponent(c)}&limit=${w}`).then(Z=>{f(Z.items||[]),d(Z.total||0)}).catch(()=>{})},[c,w]);const F=C.useMemo(()=>[...u].reverse(),[u]),W={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const Z of u)Z.signal==="agreement"||Z.signal==="consensus_verified"?W.confirmed++:Z.signal==="disagreement"||Z.signal==="hallucination_caught"?W.disputed++:Z.signal==="unique_confirmed"||Z.signal==="unique_unconfirmed"||Z.signal==="new_finding"?W.unique++:Z.signal==="unverified"?W.unverified++:Z.signal==="citation_fabricated"&&W.fabricated++;const X=u.length,de=o>X;return u.length===0?a.jsx("div",{ref:x,className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:a.jsx(Bn,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:x,className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",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:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/50",children:de?`last ${X} of ${o}`:`${o} total`})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[a.jsxs("span",{className:"text-confirmed",children:[W.confirmed," confirmed"]}),W.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[W.disputed," disputed"]}),W.unique>0&&a.jsxs("span",{className:"text-unique",children:[W.unique," unique"]}),W.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[W.unverified," unverified"]}),W.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[W.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:F.map((Z,K)=>{const V=!!(Z.consensusId&&Z.findingId);return a.jsx("button",{type:"button",disabled:!V,onClick:()=>{Z.consensusId&&Z.findingId&&(b({consensusId:Z.consensusId,findingId:Z.findingId}),j(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${qp[Z.signal]||"bg-muted"} ${V?"cursor-pointer":"cursor-default"}`,title:`${Hp[Z.signal]||Z.signal} — ${He(Z.timestamp)}${V?" (click for detail)":""}`},K)})}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-3",children:[{color:"bg-confirmed",label:"Confirmed"},{color:"bg-disputed",label:"Disputed"},{color:"bg-unique",label:"Unique (confirmed)"},{color:"bg-unique/50",label:"Unique (unconfirmed)"},{color:"bg-unverified",label:"Unverified"},{color:"bg-amber-500",label:"Fabricated citation"}].map(Z=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${Z.color}`}),a.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/60",children:Z.label})]},Z.label))}),a.jsx(bs,{open:h,onOpenChange:j,consensusId:(v==null?void 0:v.consensusId)??null,findingId:(v==null?void 0:v.findingId)??null})]})}function Qp(c){const u=c.toLowerCase();return u==="completed"||u==="done"||u==="success"||u==="succeeded"?"completed":u==="running"||u==="active"||u==="in_progress"||u==="pending"?"running":u==="failed"||u==="error"||u==="errored"||u==="timeout"||u==="timed_out"?"failed":u==="cancelled"||u==="canceled"||u==="queued"||u==="waiting"?"cancelled":"unknown"}const Vp={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},Zp={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function Kp(c){if(!c)return"—";if(c<1e3)return"< 1s";if(c<6e4)return Math.floor(c/1e3)+"s";if(c<36e5){const o=Math.floor(c/6e4),d=Math.floor(c%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const u=Math.floor(c/36e5),f=Math.floor(c%36e5/6e4);return f>0?`${u}h ${f}m`:`${u}h`}function Dm({task:c,onClick:u}){const f=Qp(c.status),o=Vp[f];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/30 transition-colors ${u?"cursor-pointer":""}`,onClick:u?d=>{d.target.closest("a")||u(c)}:void 0,children:[a.jsx("td",{className:"py-2.5 pl-4 pr-2",children:a.jsxs("span",{className:"inline-flex items-center gap-2","aria-label":`Status: ${o.label}`,children:[a.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${o.iconBox} ${o.text} ${o.pulse?"animate-pulse":""}`,"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:Zp[f]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,children:o.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"rounded border border-amber-500/25 bg-amber-500/8 px-2 py-1 font-mono text-[10px] font-semibold text-amber-400",children:c.taskId.slice(0,8)})}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(c.agentId)}`,className:"inline-flex items-center gap-1.5 transition hover:text-primary",children:[a.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:$a(c.agentId)}}),c.agentId]})}),a.jsx("td",{className:"py-2.5 pr-3 font-inter text-sm text-foreground/80",children:(()=>{const d=c.task.replace(/\n.*/s,"");return d.length>100?d.slice(0,100)+"…":d})()}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:f==="running"?"running":Kp(c.duration)}),a.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs text-muted-foreground/50",children:He(c.timestamp)})]})}const $p=3,Jp=720*60*60*1e3;function Fp({agentId:c,agents:u,tasks:f,consensus:o}){const d=u.find(R=>R.id===c),[h,j]=C.useState([]),[v,b]=C.useState([]),[x,E]=C.useState(null),[w,H]=C.useState(null),[Q,F]=C.useState(null),[W,X]=C.useState(0),[de,Z]=C.useState(0);C.useEffect(()=>{Qe(`memory/${c}`).then(R=>{j(R.knowledge||[])}).catch(()=>j([]))},[c]),C.useEffect(()=>{let R=!1;return Qe("consensus-reports?page=1&pageSize=200").then(I=>{R||b(I.reports||[])}).catch(()=>{R||b([])}),()=>{R=!0}},[]);const K=C.useMemo(()=>{var D;const R=Date.now(),I=new Map;for(const Y of v){const L=Date.parse(Y.timestamp);if(Number.isNaN(L)||R-L>Jp)continue;const ne=(D=Y.authorDiagnostics)==null?void 0:D[c];if(ne)for(const ce of ne)I.set(ce.code,(I.get(ce.code)??0)+1)}const g=[];for(const[Y,L]of I)L>=$p&&g.push({code:Y,count:L});return g},[v,c]);if(!d)return a.jsxs("div",{className:"py-20 text-center text-muted-foreground",children:["Agent not found: ",c]});const V=d.scores,O=(f==null?void 0:f.items.filter(R=>R.agentId===c))||[],ae=(o==null?void 0:o.runs.filter(R=>R.agents.includes(c)))||[],G=[{label:"accuracy",value:V.accuracy,fill:V.accuracy>=.7?"bg-confirmed":V.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"reliability",value:V.taskCompletionRate??0,fill:"bg-chart",tooltip:"Task completion rate — fraction of dispatched tasks that finished without pipeline error or timeout"},{label:"unique",value:V.uniqueness,fill:"bg-unique"},{label:"impact",value:V.impactScore,fill:"bg-[var(--color-impact)]"}],te=V.unverifiedsEmitted??0,ue=V.unverifiedsReceived??0,oe=te+ue,Se=[{label:"Signals",value:String(V.signals),color:"text-foreground"},{label:"Agreements",value:String(V.agreements),color:"text-confirmed"},{label:"Disagreements",value:String(V.disagreements),color:"text-disputed"},{label:"Hallucinations",value:String(V.hallucinations),color:V.hallucinations>0?"text-disputed":"text-muted-foreground"},{label:"Unverified",value:oe>0?`${te}↑ ${ue}↓`:"0",color:oe>0?"text-unverified":"text-muted-foreground",title:oe>0?`${te} emitted (as reviewer) · ${ue} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"text-foreground"}],J=10,ie=Math.max(1,Math.ceil(O.length/J)),he=Math.min(W,ie-1),A=O.slice(he*J,(he+1)*J),S=C.useMemo(()=>{const R=new Map;for(const I of h){const g=I.filename.match(/^(\d{4}-\d{2}-\d{2})/),D=g?g[1]:"undated",Y=R.get(D)||[];Y.push(I),R.set(D,Y)}return Array.from(R.entries()).sort(([I],[g])=>I==="undated"?1:g==="undated"?-1:g.localeCompare(I)).map(([I,g])=>({day:I,items:g}))},[h]),q=Math.min(de,Math.max(0,S.length-1)),$=S[q];return a.jsxs(a.Fragment,{children:[(()=>{const R=$u(V);return R==="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 (",V.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):R==="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:[V.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):R==="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 (",V.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),K.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:K.map(({code:R,count:I})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":R,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:Qu(R)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",I," fires in 30d"]})]}),a.jsxs("div",{className:"mt-1 text-xs text-muted-foreground/80",children:["This agent's raw output has repeatedly tripped ",a.jsx("span",{className:"font-mono",children:R}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},R))}),a.jsx("div",{className:"relative mb-6 rounded-xl border border-border bg-card p-5",children:a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("div",{className:"relative shrink-0",children:a.jsx(Ku,{agentId:d.id,size:120,signals:V.signals,accuracy:V.accuracy,uniqueness:V.uniqueness,impact:V.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold text-foreground",children:d.id}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",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-primary bg-primary/10":"text-confirmed bg-confirmed/10"}`,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:[V.signals," signals",d.lastTask?` · ${He(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border bg-background/60 px-3 py-2","data-tooltip":`Dispatch weight ${V.dispatchWeight.toFixed(2)}
71
+ Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[a.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none text-foreground",children:V.dispatchWeight.toFixed(2)}),a.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase text-muted-foreground/50",children:"weight"})]})]})}),a.jsx("section",{className:"mb-6",children:a.jsx(Xp,{agentId:c})}),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 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 bg-card/80 p-4 shadow-[inset_0_1px_3px_rgba(0,0,0,0.35)]",children:[a.jsx("div",{className:"space-y-2.5",children:G.map(R=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",...R.tooltip?{"data-tooltip":R.tooltip}:{},children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:R.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-background/80",children:a.jsx("div",{className:`h-full rounded-full transition-all ${R.fill}`,style:{width:`${Math.max(0,Math.min(100,R.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(R.value*100),"%"]})]},R.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:Se.map(R=>a.jsxs("div",{className:"bg-background/60 px-2 py-2 text-center",title:R.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${R.color}`,children:R.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/70",children:R.label})]},R.label))})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"mb-1 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Category Competency"}),a.jsx("p",{className:"mb-3 mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty."}),a.jsx(Np,{categoryAccuracy:V.categoryAccuracy,categoryCorrect:V.categoryCorrect,categoryHallucinated:V.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Skills ",a.jsx("span",{className:"text-primary",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(R=>a.jsx(Ep,{slot:R},R.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(R=>a.jsx("span",{className:"rounded-sm border border-border bg-card px-2.5 py-1 font-mono text-xs text-muted-foreground",children:R},R))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"text-primary",children:O.length})]}),ie>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>X(R=>Math.max(0,R-1)),disabled:he===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:[he+1," / ",ie]}),a.jsx("button",{onClick:()=>X(R=>Math.min(ie-1,R+1)),disabled:he>=ie-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),O.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 bg-card",children:[a.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"ID"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"py-2 pr-3 text-xs font-medium text-muted-foreground",children:"Description"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Duration"}),a.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium text-muted-foreground",children:"When"})]})}),a.jsx("tbody",{children:A.map(R=>a.jsx(Dm,{task:R},R.taskId))})]})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tasks recorded."})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Runs ",a.jsx("span",{className:"text-primary",children:ae.length})]}),ae.length>0?a.jsx("div",{className:"space-y-2",children:ae.slice(0,20).map((R,I)=>{const g=R.counts,D=(g.agreement||0)+(g.disagreement||0)+(g.hallucination||0)+(g.unverified||0)+(g.unique||0)+(g.new||0),Y=D||1,L=[{key:"confirmed",count:g.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(g.disagreement||0)+(g.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:g.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(g.unique||0)+(g.new||0),color:"bg-unique",text:"text-unique"}],ne={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"}},ce=R.signals.filter(fe=>fe.signal!=="signal_retracted"&&ne[fe.signal]),pe=R.taskId+":"+I,Be=w===pe;return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card",children:[a.jsx("button",{type:"button",onClick:()=>H(Be?null:pe),disabled:ce.length===0,className:`flex w-full items-center p-3 text-left transition ${ce.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 text-foreground",children:[ce.length>0&&a.jsx("span",{className:"mr-1.5 inline-block text-muted-foreground",children:Be?"▾":"▸"}),D," findings"]}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:He(R.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:L.map(fe=>fe.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${fe.text}`,children:[fe.count," ",fe.key]},fe.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:L.map(fe=>fe.count>0&&a.jsx("div",{className:fe.color,style:{width:`${fe.count/Y*100}%`}},fe.key))})]})}),Be&&ce.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:ce.map((fe,Lt)=>{const Zt=ne[fe.signal],Ln=!!(fe.findingId&&R.taskId),Yn=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 ${Zt.cls}`,children:Zt.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"finding-md text-xs text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",dangerouslySetInnerHTML:{__html:ps(fe.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[fe.agentId,fe.counterpartId?` + ${fe.counterpartId}`:""]})]})]});return Ln?a.jsx("button",{type:"button",onClick:()=>F({consensusId:R.taskId,findingId:fe.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/40",children:Yn},Lt):a.jsx("div",{children:Yn},Lt)})})})]},pe)})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No consensus participation recorded."})]}),a.jsx("section",{className:"mb-8",children:a.jsx(Up,{agentId:c})}),a.jsx(bs,{open:!!Q,onOpenChange:R=>{R||F(null)},consensusId:(Q==null?void 0:Q.consensusId)??null,findingId:(Q==null?void 0:Q.findingId)??null}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Memory ",a.jsxs("span",{className:"text-primary",children:[h.length," files"]}),$&&a.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground",children:["· ",$.day," (",$.items.length,")"]})]}),S.length>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{onClick:()=>Z(R=>Math.max(0,R-1)),disabled:q===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Newer"}),a.jsxs("span",{children:[q+1," / ",S.length]}),a.jsx("button",{onClick:()=>Z(R=>Math.min(S.length-1,R+1)),disabled:q>=S.length-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Older ▸"})]})]}),$&&$.items.length>0?a.jsx("div",{className:"space-y-1.5",children:$.items.map(R=>{var Y,L;const I=x===R.filename,g=((Y=R.frontmatter)==null?void 0:Y.type)||"memory",D=((L=R.frontmatter)==null?void 0:L.name)||R.filename.replace(/\.md$/,"");return a.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80",children:[a.jsxs("button",{onClick:()=>E(I?null:R.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/50",children:[a.jsx("span",{className:`font-mono text-xs ${I?"text-primary":"text-muted-foreground"}`,children:I?"▾":"▸"}),a.jsx("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase text-muted-foreground",children:g}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:D}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground",children:R.filename})]}),I&&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 text-muted-foreground",children:R.content})})]},R.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No memory files."})]})]})}const fm={dispatch:"text-muted-foreground/80",consensus:"text-primary/70",error:"text-disputed",timeout:"text-unverified",worker:"text-muted-foreground/70",gemini:"text-muted-foreground/70",skill:"text-muted-foreground/80",boot:"text-muted-foreground/50",relay:"text-muted-foreground/80",gossip:"text-muted-foreground/80",utility:"text-muted-foreground/60",memory:"text-muted-foreground/80",persist:"text-muted-foreground/50",toolserver:"text-muted-foreground/50",other:"text-muted-foreground/70"},Wp=[[/^\[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 Ip(c){for(const[u,f]of Wp)if(u.test(c))return f;return"other"}const Pp=[{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"}],mm=1e3;function e0(){const[c,u]=C.useState([]),[f,o]=C.useState(0),[d,h]=C.useState(0),[j,v]=C.useState("all"),[b,x]=C.useState(!0),[E,w]=C.useState(!0),H=C.useRef(null),Q=C.useRef(0);C.useEffect(()=>{let X=!1;return(async()=>{try{const Z=await Qe("logs?tail=500");if(X)return;u(Z.entries),o(Z.totalLines),h(Z.fileSize),Q.current=Z.totalLines+1}catch{}})(),()=>{X=!0}},[]),C.useEffect(()=>{if(E)return Am(X=>{var Z;if(X.type!=="log_lines")return;const de=(Z=X.data)==null?void 0:Z.lines;de!=null&&de.length&&u(K=>{const V=de.map((ae,G)=>({line:Q.current+G,text:ae,category:Ip(ae)}));Q.current+=de.length,o(ae=>ae+de.length);const O=[...K,...V];return O.length>mm?O.slice(-mm):O})})},[E]),C.useEffect(()=>{b&&H.current&&H.current.scrollIntoView({behavior:"smooth"})},[c,b]);const F=j==="all"?c:c.filter(X=>X.category===j),W=C.useCallback(X=>X<1024?`${X} B`:X<1048576?`${(X/1024).toFixed(1)} KB`:`${(X/1048576).toFixed(1)} MB`,[]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[a.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["MCP Log ",a.jsxs("span",{className:"text-primary",children:[f," lines"]})]}),a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:W(d)}),E&&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:[Pp.map(X=>a.jsx("button",{onClick:()=>v(X.key),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${j===X.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:X.label},X.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>w(!E),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${E?"bg-confirmed/10 text-confirmed":"text-muted-foreground"}`,children:E?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>x(!b),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${b?"bg-primary/10 text-primary":"text-muted-foreground"}`,children:b?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border bg-card",children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[F.map(X=>a.jsxs("div",{className:"flex gap-2 hover:bg-muted/30",children:[a.jsx("span",{className:"w-10 shrink-0 select-none text-right text-muted-foreground/30",children:X.line}),a.jsx("span",{className:fm[X.category]||fm.other,children:X.text})]},X.line)),F.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs text-muted-foreground",children:c.length===0?"Loading...":"No matching log entries."}),a.jsx("div",{ref:H})]})})]})}const t0=["critical","high","medium","low"],n0=["manual","impl","meta","auto-provisional"];function hm(c,u){return c.includes(u)?c.filter(f=>f!==u):[...c,u]}const Vt="mb-1 block font-mono text-[9px] font-semibold uppercase tracking-widest text-muted-foreground/70",Hn="w-full rounded border border-border bg-background px-2 py-1 font-mono text-[10px] text-foreground focus:border-primary focus:outline-none";function l0({filters:c,onChange:u,agents:f,signalTypes:o}){const d=h=>j=>{const v=j.target.value;u({[h]:v===""?void 0:v})};return a.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 bg-card/70 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-widest text-primary",children:"Filters"}),a.jsx("button",{type:"button",className:"font-mono text-[9px] text-muted-foreground/70 hover:text-foreground",onClick:()=>u({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:Vt,children:["Agents (",c.agents.length," selected)"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[f.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no agents"}),f.map(h=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:c.agents.includes(h),onChange:()=>u({agents:hm(c.agents,h)})}),a.jsx("span",{children:h})]},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Counterpart"}),a.jsxs("select",{className:Hn,value:c.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),f.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Vt,children:["Signal types (",c.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[o.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no signals"}),o.map(h=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:c.signals.includes(h),onChange:()=>u({signals:hm(c.signals,h)})}),a.jsx("span",{children:h})]},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Severity"}),a.jsxs("select",{className:Hn,value:c.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),t0.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:Hn,value:c.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),n0.map(h=>a.jsx("option",{value:h,children:h},h))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Category"}),a.jsx("input",{type:"text",className:Hn,value:c.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:Vt,children:"Since"}),a.jsx("input",{type:"datetime-local",className:Hn,value:c.since?c.since.slice(0,16):"",onChange:h=>u({since:h.target.value?new Date(h.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Until"}),a.jsx("input",{type:"datetime-local",className:Hn,value:c.until?c.until.slice(0,16):"",onChange:h=>u({until:h.target.value?new Date(h.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:Hn,value:c.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Vt,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:Hn,value:c.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const xm={agents:[],signals:[]},a0=["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"],i0={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"},s0={agreement:"text-confirmed",consensus_verified:"text-confirmed",impl_test_pass:"text-confirmed",impl_typecheck_pass:"text-confirmed",impl_peer_approved:"text-confirmed",disagreement:"text-disputed",hallucination_caught:"text-disputed",impl_test_fail:"text-disputed",impl_typecheck_fail:"text-disputed",impl_peer_rejected:"text-disputed",boundary_escape:"text-disputed",unique_confirmed:"text-unique",new_finding:"text-unique",unique_unconfirmed:"text-unique/70",unverified:"text-unverified"},c0={critical:"text-red-400 bg-red-500/10",high:"text-orange-400 bg-orange-500/10",medium:"text-yellow-400 bg-yellow-500/10",low:"text-muted-foreground bg-muted/50"},Ka=100;function u0(){if(typeof window>"u")return{filters:xm,hadAny:!1};const c=new URLSearchParams(window.location.search),u=c.getAll("signal").filter(Boolean),f=c.get("agent"),o=c.get("counterpart")??void 0,d=c.get("category")??void 0,h=c.get("severity"),j=h==="critical"||h==="high"||h==="medium"||h==="low"?h:void 0,v=c.get("since")??void 0,b=c.get("until")??void 0,x=c.get("consensus_id")??void 0,E=c.get("finding_id")??void 0,w=c.get("source"),H=w==="manual"||w==="impl"||w==="meta"||w==="auto-provisional"?w:void 0;return u.length>0||f||o||d||j||v||b||x||E||H?{filters:{agents:f?[f]:[],signals:u,counterpart:o,category:d,severity:j,since:v,until:b,consensusId:x,findingId:E,source:H},hadAny:!0}:{filters:xm,hadAny:!1}}function r0(c,u,f=Ka){const o=new URLSearchParams;o.set("limit",String(f)),o.set("offset",String(u)),c.agents.length===1&&o.set("agent",c.agents[0]),c.counterpart&&o.set("counterpart",c.counterpart);for(const d of c.signals)o.append("signal",d);return c.category&&o.set("category",c.category),c.severity&&o.set("severity",c.severity),c.since&&o.set("since",c.since),c.until&&o.set("until",c.until),c.consensusId&&o.set("consensus_id",c.consensusId),c.findingId&&o.set("finding_id",c.findingId),c.source&&o.set("source",c.source),o}function Yu(c,u){return c?c.length>u?c.slice(0,u)+"…":c:""}function o0(){const[{filters:c,hadAny:u}]=C.useState(u0),[f,o]=C.useState(c),[d,h]=C.useState([]),[j,v]=C.useState(0),[b,x]=C.useState(0),[E,w]=C.useState(!1),[H,Q]=C.useState(null),[F,W]=C.useState([]),[X,de]=C.useState(!1),[Z,K]=C.useState(null),[V,O]=C.useState(null),ae=C.useRef(null),G=C.useRef(0),te=C.useCallback(async(A,S)=>{const q=++G.current;w(!0),Q(null);try{const $=r0(A,S*Ka),R=await Qe(`signals?${$.toString()}`);if(q!==G.current)return;h(R.items??[]),x(R.total??0)}catch($){if(q!==G.current)return;Q($ instanceof Error?$.message:"fetch failed")}finally{q===G.current&&w(!1)}},[]);C.useEffect(()=>{Qe("agents").then(A=>{const S=(A??[]).map(q=>q.id).filter(Boolean).sort();S.length>0&&W(S)}).catch(()=>{})},[]),C.useEffect(()=>{v(0)},[f]),C.useEffect(()=>(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{te(f,j)},250),()=>{ae.current&&clearTimeout(ae.current)}),[f,j,te]);const ue=C.useCallback(A=>{o(S=>({...S,...A}))},[]),oe=Math.max(1,Math.ceil(b/Ka)),Se=Math.min(j,oe-1),J=b>0||u||E,ie=(A,S)=>{!A||!S||(K(A),O(S),de(!0))},he=C.useMemo(()=>{const A=[];return f.agents.length&&A.push(`${f.agents.length} agents`),f.signals.length&&A.push(`${f.signals.length} signals`),f.severity&&A.push(f.severity),f.source&&A.push(f.source),(f.since||f.until)&&A.push("time window"),A.length?A.join(" · "):"all signals"},[f]);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:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Signals"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Scored events emitted by agents during consensus review."}),a.jsxs("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:[he," — showing ",d.length," of ",b]})]})}),u&&a.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/30 px-3 py-2 font-mono text-[10px] text-muted-foreground",children:["Filtered view — ",f.signals.length," signal type",f.signals.length!==1?"s":"",f.agents.length>0?` · ${f.agents.length} agent${f.agents.length!==1?"s":""}`:"",f.severity?` · severity: ${f.severity}`:"",f.source?` · source: ${f.source}`:"",". ",a.jsx("a",{href:fl("/signals"),className:"text-primary hover:text-foreground",children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${J?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[J&&a.jsx("div",{className:u?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(l0,{filters:f,onChange:ue,agents:F,signalTypes:a0})}),a.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60 bg-card/70",children:[H&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:H}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse font-mono text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/60 text-left text-muted-foreground/70",children:[a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Time"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Agent"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Signal"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest","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 font-semibold uppercase tracking-widest","data-tooltip":"Severity of the associated finding (critical / high / medium / low)",children:"Sev"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest","data-tooltip":"Finding ID — click row to open finding detail",children:"Finding"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Consensus"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Evidence"})]})}),a.jsxs("tbody",{children:[d.length===0&&!E&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center text-muted-foreground/50",children:"no signals match these filters"})}),d.map((A,S)=>{const q=!!(A.consensusId&&A.findingId);return a.jsxs("tr",{className:`border-b border-border/30 ${q?"cursor-pointer hover:bg-muted/30":""}`,onClick:()=>q&&ie(A.consensusId,A.findingId),children:[a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",title:A.timestamp,children:He(A.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-foreground",children:A.agentId}),a.jsx("td",{className:`whitespace-nowrap px-2 py-1 ${s0[A.signal]??"text-foreground"}`,children:i0[A.signal]??A.signal}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",children:A.counterpartId??"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:A.severity?a.jsx("span",{className:`rounded border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${c0[A.severity]??"bg-muted"}`,children:A.severity}):a.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:A.findingId,children:A.findingId?Yu(A.findingId,24):"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:A.consensusId,children:A.consensusId?Yu(A.consensusId,16):"—"}),a.jsx("td",{className:"max-w-[300px] truncate px-2 py-1 text-muted-foreground/80",title:A.evidence,children:Yu(A.evidence,80)})]},`${A.timestamp}-${A.agentId}-${S}`)})]})]})}),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] text-muted-foreground/60",children:E?"loading…":`${Se*Ka+1}–${Se*Ka+d.length} of ${b}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[a.jsx("button",{type:"button",onClick:()=>v(A=>Math.max(0,A-1)),disabled:Se===0||E,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[Se+1," / ",oe]}),a.jsx("button",{type:"button",onClick:()=>v(A=>Math.min(oe-1,A+1)),disabled:Se>=oe-1||E,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]}),a.jsx(bs,{open:X,onOpenChange:de,consensusId:Z,findingId:V})]})}function d0(){const[c,u]=C.useState(null),[f,o]=C.useState(!1);C.useEffect(()=>{xg().then(u)},[]);const d=C.useCallback(async h=>{o(!1),await hg(h)?u(!0):o(!0)},[]);return{authed:c,login:d,error:f}}function f0(c){C.useEffect(()=>(Em(),Am(c)),[c])}const m0=5e3;function h0(){const[c,u]=C.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),f=C.useRef(!1),o=C.useCallback(async()=>{if(!f.current){f.current=!0;try{const[d,h,j,v,b,x,E]=await Promise.all([Qe("overview"),Qe("agents"),Qe("tasks?limit=2000"),Qe("consensus?pageSize=500"),Qe("consensus-reports?page=1&pageSize=5").catch(()=>({reports:[]})),Qe("native-memory").catch(()=>({knowledge:[]})),Qe("gossip-memory").catch(()=>({knowledge:[]}))]),w=[...x.knowledge||[]].map(Q=>({...Q,origin:"native"})).sort((Q,F)=>F.filename>Q.filename?1:-1),H=[...E.knowledge||[]].map(Q=>({...Q,origin:"gossip"})).sort((Q,F)=>F.filename>Q.filename?1:-1);u({overview:d,agents:h,tasks:j,consensus:v,consensusReports:b,nativeMemories:w,gossipMemories:H,memories:w,loading:!1,error:null})}catch(d){u(h=>({...h,loading:!1,error:d.message}))}finally{f.current=!1}}},[]);return C.useEffect(()=>{o()},[o]),C.useEffect(()=>{const d=setInterval(()=>{o()},m0);return()=>clearInterval(d)},[o]),{...c,refresh:o}}function x0({agents:c,tasks:u}){const[f,o]=C.useState("weight"),[d,h]=C.useState("desc"),[j,v]=C.useState(""),b=C.useMemo(()=>{const K=new Map;if(u)for(const V of u.items){const O=K.get(V.agentId);(!O||V.timestamp>O.timestamp)&&K.set(V.agentId,V)}return K},[u]),x=c.filter(Nm).length,E=c.filter(K=>K.scores.accuracy>=.5).length,w=c.reduce((K,V)=>K+V.scores.signals,0),H=c.reduce((K,V)=>K+V.totalTokens,0),Q=j.trim().toLowerCase(),F=Q?c.filter(K=>K.id.toLowerCase().includes(Q)||K.provider.toLowerCase().includes(Q)||K.model.toLowerCase().includes(Q)):c,W=K=>{const V=K.scores;switch(f){case"weight":return V.dispatchWeight;case"accuracy":return V.accuracy;case"uniqueness":return V.uniqueness;case"impact":return V.impactScore;case"signals":return V.signals;case"agreements":return V.agreements;case"hallucinations":return V.hallucinations;case"lastTask":{const O=b.get(K.id);return O?new Date(O.timestamp).getTime():0}}},X=[...F].sort((K,V)=>{const O=W(K),ae=W(V);return d==="desc"?ae-O:O-ae}),de=K=>{f===K?h(V=>V==="desc"?"asc":"desc"):(o(K),h("desc"))},Z=K=>f===K?d==="desc"?"▾":"▴":"";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",a.jsx("span",{className:"ml-2 text-primary",children:c.length})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",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 border-border/40 bg-border/30 sm:grid-cols-4",children:[{label:"Healthy",value:E,color:"text-confirmed"},{label:"Benched",value:x,color:x>0?"text-destructive":"text-muted-foreground"},{label:"Total Signals",value:w.toLocaleString(),color:"text-foreground"},{label:"Tokens Used",value:H.toLocaleString(),color:"text-foreground"}].map(K=>a.jsxs("div",{className:"bg-card/80 px-4 py-3",children:[a.jsx("div",{className:`font-mono text-lg font-bold tabular-nums ${K.color}`,children:K.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:K.label})]},K.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:j,onChange:K=>v(K.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"})}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",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-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",children:[a.jsx("th",{className:"py-2.5 pl-5 pr-2 text-center",children:"#"}),a.jsx("th",{className:"py-2.5 pr-3 text-left",children:"Agent"}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("weight"),children:["Weight ",Z("weight")]}),a.jsx("th",{className:"py-2.5 pr-4 text-left align-top",children:a.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[a.jsxs("button",{onClick:()=>de("accuracy"),className:"flex items-center gap-1 hover:text-foreground","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",Z("accuracy")]}),a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),a.jsxs("button",{onClick:()=>de("uniqueness"),className:"flex items-center gap-1 hover:text-foreground","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",Z("uniqueness")]}),a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),a.jsxs("button",{onClick:()=>de("impact"),className:"flex items-center gap-1 hover:text-foreground","data-tooltip":"Impact — severity-weighted finding score",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--color-impact)]"}),"Imp",Z("impact")]})]})}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("signals"),children:["Signals ",Z("signals")]}),a.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>de("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",Z("hallucinations")]}),a.jsxs("th",{className:"py-2.5 pr-5 text-left cursor-pointer select-none hover:text-foreground",onClick:()=>de("lastTask"),children:["Last Task ",Z("lastTask")]})]})}),a.jsx("tbody",{children:X.map((K,V)=>{const O=K.scores,ae=b.get(K.id),G=O.dispatchWeight>=1.2?"text-confirmed":O.dispatchWeight>=.8?"text-foreground":"text-disputed",te=V+1;return a.jsxs("tr",{className:"group border-t border-border/20 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 ${te===1?"font-bold text-primary":te===2||te===3?"font-semibold text-foreground/80":"text-muted-foreground/40"}`,children:te})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(K.id)}`,className:"flex items-center gap-3",children:[a.jsx(Ku,{agentId:K.id,size:32,signals:O.signals,accuracy:O.accuracy,uniqueness:O.uniqueness,impact:O.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 text-foreground group-hover:text-primary",children:K.id}),(()=>{const ue=$u(O);return ue==="benched"?a.jsx("span",{className:"shrink-0 rounded bg-destructive/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-destructive","data-tooltip":`Benched (${O.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):ue==="struggling"?a.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","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 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":`Would bench (${O.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] text-muted-foreground/50",children:[K.provider,"/",K.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 ${G}`,children:O.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(gs,{label:"A",value:O.accuracy,fillClass:O.accuracy>=.7?"bg-confirmed":O.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(gs,{label:"Rel",value:O.taskCompletionRate??0,fillClass:"bg-chart",tooltip:"Reliability — fraction of dispatched tasks that finished without pipeline error or timeout"}),a.jsx(gs,{label:"U",value:O.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(gs,{label:"I",value:O.impactScore,fillClass:"bg-[var(--color-impact)]",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 text-foreground",children:O.signals.toLocaleString()}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:a.jsx("span",{className:O.hallucinations>0?"font-bold text-disputed":"text-muted-foreground/40","data-tooltip":`Agreements ${O.agreements} · Disagreements ${O.disagreements} · Hallucinations ${O.hallucinations}`,children:O.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:ae?a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] font-semibold text-amber-400",children:ae.taskId.slice(0,8)}),a.jsx("span",{className:"truncate font-inter text-[11px] text-muted-foreground/80",style:{maxWidth:260},children:ae.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground/50",children:He(ae.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/30",children:"no tasks"})})]},K.id)})})]})})]})}function gs({label:c,value:u,fillClass:f,tooltip:o}){return a.jsxs("div",{className:"flex items-center gap-2","data-tooltip":o,"data-tooltip-pos":"top",children:[a.jsx("span",{className:"w-6 font-mono text-[8px] uppercase text-muted-foreground/50",children:c}),a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-background/60",children:a.jsx("div",{className:`h-full rounded-full ${f}`,style:{width:`${Math.max(0,Math.min(100,u*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums text-foreground/80",children:[Math.round(u*100),"%"]})]})}function g0({tasks:c}){const[u,f]=C.useState(""),[o,d]=C.useState(0),[h,j]=C.useState(null),v=100,b=c.items.filter(X=>X.status==="completed").length,x=c.items.filter(X=>X.status==="failed").length,E=c.items.filter(X=>X.status==="running").length,w=u.trim().toLowerCase(),H=w?c.items.filter(X=>{var de,Z,K,V;return((de=X.task)==null?void 0:de.toLowerCase().includes(w))||((Z=X.agentId)==null?void 0:Z.toLowerCase().includes(w))||((K=X.taskId)==null?void 0:K.toLowerCase().includes(w))||((V=X.status)==null?void 0:V.toLowerCase().includes(w))}):c.items,Q=Math.max(1,Math.ceil(H.length/v)),F=Math.min(o,Q-1),W=H.slice(F*v,(F+1)*v);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",a.jsx("span",{className:"ml-2 text-primary",children:c.total})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-confirmed",children:b})," completed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-destructive",children:x})," failed"]}),E>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:E})," running"]}),a.jsxs("span",{children:["showing ",W.length," of ",H.length,w&&` (filtered from ${c.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:u,onChange:X=>{f(X.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground ${Q<=1?"invisible":""}`,children:[a.jsx("button",{onClick:()=>d(X=>Math.max(0,X-1)),disabled:F===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),a.jsxs("span",{children:[F+1," / ",Q]}),a.jsx("button",{onClick:()=>d(X=>Math.min(Q-1,X+1)),disabled:F>=Q-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:W.length===0?a.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:w?"No tasks match your search.":"No tasks yet."}):a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 bg-muted/30",children:[a.jsx("th",{className:"py-2.5 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"ID"}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-3 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Description"}),a.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),a.jsx("th",{className:"py-2.5 pr-4 text-right font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"When"})]})}),a.jsx("tbody",{children:W.map(X=>a.jsx(Dm,{task:X,onClick:j},X.taskId))})]})}),a.jsx(Kg,{task:h,onClose:()=>j(null)})]})}function p0({consensus:c,consensusReports:u}){const[f,o]=C.useState(!1),d=f?c.runs:c.runs.filter(x=>!x.retracted),h=c.runs.filter(x=>x.retracted).length,j=d.reduce((x,E)=>x+(E.counts.agreement||0),0),v=d.reduce((x,E)=>x+((E.counts.disagreement||0)+(E.counts.hallucination||0)),0),b=d.reduce((x,E)=>x+(E.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Rounds ",a.jsx("span",{className:"ml-2 text-primary",children:d.length}),!f&&h>0&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal text-muted-foreground/60",children:["/ ",c.totalRuns??c.runs.length," total"]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Multi-agent review rounds — findings confirmed when ≥2 agents agree."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-confirmed",children:j})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-disputed",children:v})," disputed"]}),b>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:b})," unverified"]}),a.jsxs("span",{children:[c.totalSignals," total signals"]})]}),h>0&&a.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px] text-muted-foreground/70",children:[a.jsx("span",{children:f?`${h} retracted run${h===1?"":"s"} shown`:`${h} retracted run${h===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>o(x=>!x),className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 text-[10px] transition hover:bg-accent/50 hover:text-foreground",children:f?"hide":"show"})]})]}),a.jsx(Mm,{consensus:c,filteredRuns:d,reports:u,showAll:!0,hideHeader:!0})]})}function b0(){const c=pm(),u=bm(),{overview:f,agents:o,tasks:d,consensus:h,consensusReports:j,nativeMemories:v,gossipMemories:b,loading:x,refresh:E}=h0(),[w,H]=C.useState(0),Q=C.useCallback(Z=>{Z.type!=="log_lines"&&E()},[E]);if(f0(Q),x||!f||!h)return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(um,{}),a.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"Loading dashboard..."})]});let F;const W=c.match(/^\/agent\/(.+)$/);if(W&&o){const Z=decodeURIComponent(W[1]);F=a.jsx(Fp,{agentId:Z,agents:o,tasks:d,consensus:h})}else c==="/team"&&o?F=a.jsx(x0,{agents:o,tasks:d}):c==="/tasks"&&d?F=a.jsx(g0,{tasks:d}):c==="/debates"&&h?F=a.jsx(p0,{consensus:h,consensusReports:j}):c==="/logs"?F=a.jsx(e0,{}):c==="/signals"?F=a.jsx(o0,{}):c==="/violations"?F=a.jsx(vp,{}):c==="/"&&!u||c==="/overview"?F=a.jsx(Og,{overview:f,agents:o,tasks:d,activeTaskCount:w,setActiveTaskCount:H}):F=a.jsxs("div",{className:"space-y-6",children:[a.jsxs("header",{children:[a.jsx("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Dashboard"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/60",children:"Multi-agent code review with grounded reward signals. Live activity, agent scores, and consensus rounds."})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[280px_1fr] lg:items-start",children:[a.jsxs("aside",{className:"space-y-4 lg:sticky lg:top-4",children:[a.jsx(ym,{overview:f,activeTasks:w}),o&&a.jsx(Lg,{agents:o}),a.jsx(gp,{})]}),a.jsxs("main",{className:"min-w-0 space-y-6",children:[a.jsx(jm,{onCountChange:H}),a.jsx(Mm,{consensus:h,reports:j}),d&&a.jsx(_m,{tasks:d,limit:5}),o&&a.jsx(Sm,{agents:o}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[a.jsx(xp,{}),a.jsx(yp,{overview:f})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[a.jsx(Tm,{}),a.jsx(jp,{overview:f})]}),(b||v)&&a.jsx(dp,{memories:[...b??[],...v??[]],heading:"Memory",statusFilter:!0})]})]})]});const de=c==="/"&&!u||c==="/overview"?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6";return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(um,{}),a.jsx("main",{className:de,children:F})]})}function v0(){const{authed:c,login:u,error:f}=d0();return c===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center text-muted-foreground",children:"Loading..."}):c?a.jsx(b0,{}):a.jsx(Rg,{onLogin:u,error:f})}rg.createRoot(document.getElementById("root")).render(a.jsx(C.StrictMode,{children:a.jsx(v0,{})}));