gossipcat 0.6.8 → 0.6.10

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,34 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return ee(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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&&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)},F={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){_(E,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function I(e,t){ie++,re[ie]=e.current,e.current=t}var se=ae(null),ce=ae(null),le=ae(null),ue=ae(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}oe(se),I(se,e)}function fe(){oe(se),oe(ce),oe(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(oe(se),oe(ce)),ue.current===e&&(oe(ue),Qf._currentValue=ne)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,L=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Be,ze=Math.log,R=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(ze(e)/R|0)|0}var Ve=256,He=262144,Ue=4194304;function We(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 Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(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 Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(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 nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function it(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var z=Math.random().toString(36).slice(2),at=`__reactFiber$`+z,ot=`__reactProps$`+z,st=`__reactContainer$`+z,ct=`__reactEvents$`+z,lt=`__reactListeners$`+z,ut=`__reactHandles$`+z,dt=`__reactResources$`+z,ft=`__reactMarker$`+z;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[at])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=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]*$`),wt={},Tt={};function Et(e){return Se.call(Tt,e)?!0:Se.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ot(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 kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ft(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var It=/[\n"\\]/g;function Lt(e){return e.replace(It,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,At(n)):Bt(e,o,At(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+At(s):e.removeAttribute(`name`)}function zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Nt(e)}function Bt(e,t,n){t===`number`&&Ft(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(e,t,n,r){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&&r&&(e[n].defaultSelected=!0)}else{for(n=``+At(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ht(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=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 Kt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Kt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function Jt(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 Yt=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`]]),Xt=/^[\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 Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Rt(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="`+Lt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ot]||null;if(!a)throw Error(i(90));Rt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Pt(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(bu(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return pn=i.slice(e,1<r?1-r:void 0)}function hn(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 gn(){return!0}function _n(){return!1}function vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?gn:_n,this.isPropagationStopped=_n,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=gn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=gn)},persist:function(){},isPersistent:gn}),t}var yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bn=vn(yn),xn=h({},yn,{view:0,detail:0}),Sn=vn(xn),Cn,wn,Tn,En=h({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,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!==Tn&&(Tn&&e.type===`mousemove`?(Cn=e.screenX-Tn.screenX,wn=e.screenY-Tn.screenY):wn=Cn=0,Tn=e),Cn)},movementY:function(e){return`movementY`in e?e.movementY:wn}}),Dn=vn(En),On=vn(h({},En,{dataTransfer:0})),kn=vn(h({},xn,{relatedTarget:0})),An=vn(h({},yn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=vn(h({},yn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=vn(h({},yn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={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`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function Ln(){return In}var Rn=vn(h({},xn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(e){return e.type===`keypress`?hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),zn=vn(h({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=vn(h({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln})),Vn=vn(h({},yn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=vn(h({},En,{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})),Un=vn(h({},yn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=cn&&`CompositionEvent`in window,Kn=null;cn&&`documentMode`in document&&(Kn=document.documentMode);var qn=cn&&`TextEvent`in window&&!Kn,Jn=cn&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=mn(),pn=fn=dn=null,$n=!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 Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=Ed(t,`onChange`),0<t.length&&(n=new bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){yd(e,0)}function cr(e){if(Pt(gt(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(cn){var dr;if(cn){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,en(e)),on(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Se.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(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=Ft(e.document)}return t}function Dr(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 Or=cn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Ft(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=Ed(Ar,`onSelect`),0<r.length&&(t=new bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};cn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),xt(t,[e])}var Yr=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&&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)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(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 ui(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 di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=si(31,n,t,a),e.elementType=O,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=si(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Re(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,B=null,V=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Ut(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Qt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Mi=Mi.return}}function zi(e){if(e!==Mi)return!1;if(!V)return Ri(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&B&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));B=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));B=uf(e)}else t===27?(t=B,Zd(e.type)?(e=lf,lf=null,B=e):B=t):B=Mi?cf(e.stateNode.nextSibling):null;return!0}function Bi(){B=Mi=null,V=!1}function Vi(){var e=Ni;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=ae(null),Wi=null,Gi=null;function Ki(e,t,n){I(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,oe(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=dd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=P.S;P.S=function(e,t){eu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=ae(null);function _a(){var e=ga.current;return e===null?q.pooledCache:e}function H(e,t){t===null?I(ga,ga.current):I(ga,t.pool)}function va(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ya=Error(i(460)),ba=Error(i(474)),xa=Error(i(542)),Sa={then:function(){}};function Ca(e){return e=e.status,e===`fulfilled`||e===`rejected`}function wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e}throw Ea=t,ya}}function Ta(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ea=e,ya):e}}var Ea=null;function Da(){if(Ea===null)throw Error(i(459));var e=Ea;return Ea=null,e}function Oa(e){if(e===ya||e===xa)throw Error(i(483))}var ka=null,Aa=0;function ja(e){var t=Aa;return Aa+=1,ka===null&&(ka=[]),wa(ka,e,t)}function Ma(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Na(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Pa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&Ta(i)===t.type)?(t=a(t,n.props),Ma(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Ma(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),Ma(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case D:return t=Ta(t),f(e,t,n)}if(te(t)||j(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ja(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Na(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=Ta(n),p(e,t,n,r)}if(te(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ja(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Na(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Ta(r),m(e,t,n,r,i)}if(te(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ja(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Na(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return V&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Di(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),V&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ta(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ma(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Ma(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ta(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ja(o),c);if(o.$$typeof===C)return b(e,r,ea(e,o),c);Na(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Aa=0;var i=b(e,t,n,r);return ka=null,i}catch(t){if(t===ya||t===xa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Fa=Pa(!0),Ia=Pa(!1),La=!1;function Ra(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function za(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Va(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ha(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wa=!1;function Ga(){if(Wa){var e=da;if(e!==null)throw e}}function Ka(e,t,n,r){Wa=!1;var i=e.updateQueue;La=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ua&&(Wa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:La=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var Ya=ae(null),Xa=ae(0);function Za(e,t){e=Ul,I(Xa,e),I(Ya,t),Ul=e|t.baseLanes}function Qa(){I(Xa,Ul),I(Ya,Ya.current)}function $a(){Ul=Xa.current,oe(Ya),oe(Xa)}var eo=ae(null),to=null;function no(e){var t=e.alternate;I(so,so.current&1),I(eo,e),to===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){I(so,so.current),I(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(I(so,so.current),I(eo,e),to===null&&(to=e)):ao(e)}function ao(){I(so,so.current),I(eo,eo.current)}function oo(e){oe(eo),to===e&&(to=null),oe(so)}var so=ae(0);function co(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(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)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 lo=0,U=null,W=null,uo=null,fo=!1,po=!1,mo=!1,ho=0,go=0,_o=null,vo=0;function yo(){throw Error(i(321))}function bo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function xo(e,t,n,r,i,a){return lo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Rs:zs,mo=!1,a=n(r,i),mo=!1,po&&(a=Co(t,n,r,i)),So(e),a}function So(e){P.H=Ls;var t=W!==null&&W.next!==null;if(lo=0,uo=W=U=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||nc||(e=e.dependencies,e!==null&&Zi(e)&&(nc=!0))}function Co(e,t,n,r){U=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,uo=W=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Bs,o=t(n,r)}while(po);return o}function wo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(W===null?null:W.memoizedState)!==e&&(U.flags|=1024),t}function To(){var e=ho!==0;return ho=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Do(e){if(fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fo=!1}lo=0,uo=W=U=null,po=!1,go=ho=0,_o=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return uo===null?U.memoizedState=uo=e:uo=uo.next=e,uo}function ko(){if(W===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=W.next;var t=uo===null?U.memoizedState:uo.next;if(t!==null)uo=t,W=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));W=e,e={memoizedState:W.memoizedState,baseState:W.baseState,baseQueue:W.baseQueue,queue:W.queue,next:null},uo===null?U.memoizedState=uo=e:uo=uo.next=e}return uo}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=go;return go+=1,_o===null&&(_o=[]),e=wa(_o,e,t),t=U,(uo===null?t.memoizedState:uo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Rs:zs),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return $i(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ao(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),W,e)}function Io(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((lo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,Gl|=p;f=u.action,mo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(nc=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Lo(e){var t=ko(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);xr(o,t.memoizedState)||(nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=U,a=ko(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((W||a).memoizedState,n);if(s&&(a.memoizedState=n,nc=!0),a=a.queue,ls(Vo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||uo!==null&&uo.memoizedState.tag&1){if(r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||lo&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=Ao(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bo(e,t,n,r){t.value=n,t.getSnapshot=r,Ho(t)&&Uo(e)}function Vo(e,t,n){return n(function(){Ho(t)&&Uo(e)})}function Ho(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Uo(e){var t=ni(e,2);t!==null&&hu(t,e,2)}function Wo(e){var t=Oo();if(typeof e==`function`){var n=e;if(e=n(),mo){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t}function Go(e,t,n,r){return e.baseState=n,Io(e,W,typeof r==`function`?r:Po)}function Ko(e,t,n,r,a){if(Ps(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Jo(e,t,s)}catch(n){Xo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Xo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Yo(e,t,n)},function(n){return Xo(e,t,n)}):Yo(e,t,n)}function Yo(e,t,n){t.status=`fulfilled`,t.value=n,Zo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qo(e,n)))}function Xo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Zo(t),t=t.next;while(t!==r)}e.action=null}function Zo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qo(e,t){return t}function $o(e,t){if(V){var n=q.formState;if(n!==null){a:{var r=U;if(V){if(B){b:{for(var i=B,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){B=cf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Oo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:t},n.queue=r,n=js.bind(null,U,r),r.dispatch=n,r=Wo(!1),a=Ns.bind(null,U,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function es(e){return ts(ko(),W,e)}function ts(e,t,n){if(t=Io(e,t,Qo)[0],e=Fo(Po)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=jo(t)}catch(e){throw e===ya?xa:e}else r=t;t=ko();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,is(9,{destroy:void 0},ns.bind(null,i,n),null)),[r,a,e]}function ns(e,t){e.action=t}function rs(e){var t=ko(),n=W;if(n!==null)return ts(t,n,e);ko(),t=t.memoizedState,n=ko();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=Ao(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function as(){return ko().memoizedState}function os(e,t,n,r){var i=Oo();U.flags|=e,i.memoizedState=is(1|t,{destroy:void 0},n,r===void 0?null:r)}function ss(e,t,n,r){var i=ko();r=r===void 0?null:r;var a=i.memoizedState.inst;W!==null&&r!==null&&bo(r,W.memoizedState.deps)?i.memoizedState=is(t,a,n,r):(U.flags|=e,i.memoizedState=is(1|t,a,n,r))}function cs(e,t){os(8390656,8,e,t)}function ls(e,t){ss(2048,8,e,t)}function us(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=Ao(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ds(e){var t=ko().memoizedState;return us({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function fs(e,t){return ss(4,2,e,t)}function ps(e,t){return ss(4,4,e,t)}function ms(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 hs(e,t,n){n=n==null?null:n.concat([e]),ss(4,4,ms.bind(null,t,e),n)}function gs(){}function _s(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&bo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vs(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&bo(t,r[1]))return r[0];if(r=e(),mo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||lo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),U.lanes|=e,Gl|=e,n)}function bs(e,t,n,r){return xr(n,t)?n:Ya.current===null?!(lo&42)||lo&1073741824&&!(Y&261930)?(nc=!0,e.memoizedState=n):(e=mu(),U.lanes|=e,Gl|=e,t):(e=ys(e,n,r),xr(e,t)||(nc=!0),e)}function xs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ns(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,ma(c,r),pu(e)):Ms(e,t,r,pu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,ne,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},pu())}function Es(){return $i(Qf)}function Ds(){return ko().memoizedState}function Os(){return ko().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ba(n);var r=Va(t,e,n);r!==null&&(hu(r,t,n),Ha(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=ti(e,t,n,r),n!==null&&(hu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,pu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),q===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return hu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&hu(t,e,2)}function Ps(e){var t=e.alternate;return e===U||t!==null&&t===U}function Fs(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ls={readContext:$i,use:Mo,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useLayoutEffect:yo,useInsertionEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useSyncExternalStore:yo,useId:yo,useHostTransitionStatus:yo,useFormState:yo,useActionState:yo,useOptimistic:yo,useMemoCache:yo,useCacheRefresh:yo};Ls.useEffectEvent=yo;var Rs={readContext:$i,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,U,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=Oo();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=q.identifierPrefix;if(V){var n=Ei,r=Ti;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Es,useFormState:$o,useActionState:$o,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ns.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=ks.bind(null,U)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},zs={readContext:$i,use:Mo,useCallback:_s,useContext:$i,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Fo,useRef:as,useState:function(){return Fo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){return bs(ko(),W.memoizedState,e,t)},useTransition:function(){var e=Fo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:es,useActionState:es,useOptimistic:function(e,t){return Go(ko(),W,e,t)},useMemoCache:No,useCacheRefresh:Os};zs.useEffectEvent=ds;var Bs={readContext:$i,use:Mo,useCallback:_s,useContext:$i,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Lo,useRef:as,useState:function(){return Lo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){var n=ko();return W===null?ys(n,e,t):bs(n,W.memoizedState,e,t)},useTransition:function(){var e=Lo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){var n=ko();return W===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,W,e,t)},useMemoCache:No,useCacheRefresh:Os};Bs.useEffectEvent=ds;function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ba(r);i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(hu(t,e,r),Ha(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ba(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(hu(t,e,r),Ha(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ba(n);r.tag=2,t!=null&&(r.callback=t),t=Va(e,r,n),t!==null&&(hu(t,e,n),Ha(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function Gs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ks(e){Yr(e)}function qs(e){console.error(e)}function Js(e){Yr(e)}function Ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){Ys(e,t)},n}function Qs(e){return e=Ba(e),e.tag=3,e}function $s(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Xs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Xs(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(V)return t=eo.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=Zs(e.stateNode,r,a),Ua(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zs(n.stateNode,r,e),Ua(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qs(a),$s(a,e,n,r),Ua(n,a),!1}n=n.return}while(n!==null);return!1}var tc=Error(i(461)),nc=!1;function rc(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=xo(e,t,n,o,a,i),s=To(),e!==null&&!nc?(Eo(e,t,i),Oc(e,t,i)):(V&&s&&ki(t),t.flags|=1,rc(e,t,r,i),t.child)}function ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,oc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return Oc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if(nc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(nc=!0);else return t.lanes=e.lanes,Oc(e,t,i)}return mc(e,t,n,r,i)}function sc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&H(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&H(t,null),Qa(),ao(t)):(H(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return rc(e,t,i,n),t.child}function cc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&H(t,null),Qa(),io(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function uc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dc(e,t,n){return Fa(t,e.child,null,n),e=uc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function fc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=uc(t,r),t.lanes=536870912,cc(null,e);if(ro(t),(e=B)?(e=rf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,B=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),a)if(t.flags&256)t.flags&=-257,t=dc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(nc||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,nc||a){if(r=q,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),hu(r,e,s),tc;Du(),t=dc(e,t,n)}else e=o.treeContext,B=cf(s.nextSibling),Mi=t,V=!0,Ni=null,Pi=!1,e!==null&&ji(t,e),t=uc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function mc(e,t,n,r,i){return Qi(t),n=xo(e,t,n,r,void 0,i),r=To(),e!==null&&!nc?(Eo(e,t,i),Oc(e,t,i)):(V&&r&&ki(t),t.flags|=1,rc(e,t,n,i),t.child)}function hc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=Co(t,r,n,i),So(e),r=To(),e!==null&&!nc?(Eo(e,t,a),Oc(e,t,a)):(V&&r&&ki(t),t.flags|=1,rc(e,t,n,a),t.child)}function gc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ra(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Vs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),Ka(t,r,a,i),Ga(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Gs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ws(t,a,r,o),La=!1;var f=t.memoizedState;a.state=f,Ka(t,r,a,i),Ga(),l=t.memoizedState,s||f!==l||La?(typeof d==`function`&&(Vs(t,n,d,r),l=t.memoizedState),(c=La||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,za(e,t),o=t.memoizedProps,u=Gs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ws(t,a,r,c),La=!1,f=t.memoizedState,a.state=f,Ka(t,r,a,i),Ga();var p=t.memoizedState;o!==d||f!==p||La||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Vs(t,n,s,r),p=t.memoizedState),(u=La||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,pc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Fa(t,e.child,null,i),t.child=Fa(t,null,n,i)):rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Oc(e,t,i),e}function _c(e,t,n,r){return Bi(),t.flags|=256,rc(e,t,n,r),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yc(e){return{baseLanes:e,cachePool:va()}}function bc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function xc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(so.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(V){if(a?no(t):ao(t),(e=B)?(e=rf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,B=null)):e=null,e===null)throw Ii(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ao(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(null,r)):(no(t),Sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Fa(t,e.child,null,n),r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,t=cc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(nc||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,nc||s){if(s=q,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),hu(s,e,r),tc;af(c)||Du(),t=wc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,B=cf(c.nextSibling),Mi=t,V=!0,Ni=null,Pi=!1,e!==null&&ji(t,e),t=Sc(t,r.children),t.flags|=4096);return t}return a?(ao(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,cc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=yc(n):(a=c.cachePool,a===null?a=va():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Sc(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Fa(t,e.child,null,n),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function Ec(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(so,o),rc(e,t,r,n),r=V?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;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&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ec(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ec(t,!0,n,null,a,r);break;case`together`:Ec(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function Ac(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=Oc(e,t,n),e===null?null:e.sibling):xc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(so,so.current),r)break;return null;case 22:return t.lanes=0,sc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Oc(e,t,n)}function jc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)nc=!0;else{if(!kc(e,n)&&!(t.flags&128))return nc=!1,Ac(e,t,n);nc=!!(e.flags&131072)}else nc=!1,V&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ta(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Gs(e,r),t.tag=1,t=gc(null,t,e,r,n)):(t.tag=0,t=mc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ic(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=ac(null,t,e,r,n);break a}}throw t=N(e)||e,Error(i(306,t,``))}}return t;case 0:return mc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Gs(r,t.pendingProps),gc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,za(e,t),Ka(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ga(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=_c(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Hi(a),t=_c(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(B=cf(e.firstChild),Mi=t,V=!0,Ni=null,Pi=!0,n=Ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Oc(e,t,n);break a}rc(e,t,r,n)}t=t.child}return t;case 26:return pc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(n=t.type,e=t.pendingProps,r=Bd(le.current).createElement(n),r[at]=t,r[ot]=e,Pd(r,n,e),vt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&V&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Mi=t,Pi=!0,a=B,Zd(t.type)?(lf=a,B=cf(r.firstChild)):B=a),rc(e,t,t.pendingProps.children,n),pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=B)&&(r=tf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Mi=t,B=cf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=xo(e,t,wo,null,null,n),Qf._currentValue=a),pc(e,t),rc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=B)&&(n=nf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Mi=t,B=null,e=!0)),e||Ii(t)),null;case 13:return xc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):rc(e,t,r,n),t.child;case 11:return ic(e,t,t.type,t.pendingProps,n);case 7:return rc(e,t,t.pendingProps,n),t.child;case 8:return rc(e,t,t.pendingProps.children,n),t.child;case 12:return rc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),rc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,rc(e,t,r,n),t.child;case 14:return ac(e,t,t.type,t.pendingProps,n);case 15:return oc(e,t,t.type,t.pendingProps,n);case 19:return Dc(e,t,n);case 31:return fc(e,t,n);case 22:return sc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=q,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ra(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(za(e,t),Ka(t,null,null,n),Ga()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),rc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,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(wu())e.flags|=8192;else throw Ea=Sa,ba}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Ea=Sa,ba}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Yl|=t)}function Ic(e,t){if(!V)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function G(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return G(t),null;case 1:return G(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),G(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(G(t),Nc(t,a,null,r,n)):(G(t),Pc(t,o))):o?o===e.memoizedState?(G(t),t.flags&=-16777217):(Mc(t),G(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),G(t),Nc(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return G(t),null}e=se.current,zi(t)?Li(t,e):(e=ff(a,r,n),t.stateNode=e,Mc(t))}return G(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return G(t),null}if(o=se.current,zi(t))Li(t,o);else{var s=Bd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return G(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ii(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return G(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[at]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;G(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(i(558))}return G(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[at]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;G(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),G(t),null);case 4:return fe(),e===null&&Sd(t.stateNode.containerInfo),G(t),null;case 10:return qi(t.type),G(t),null;case 19:if(oe(so),r=t.memoizedState,r===null)return G(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ic(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return I(so,so.current&1|2),V&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>tu&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}else{if(!a)if(e=co(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return G(t),null}else 2*De()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(G(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=so.current,I(so,a?n&1|2:n&1),V&&Di(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(G(t),t.subtreeFlags&6&&(t.flags|=8192)):G(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&oe(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),G(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(so),null;case 4:return fe(),null;case 10:return qi(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&oe(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function zc(e,t){switch(Ai(t),t.tag){case 3:qi(aa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:oe(so);break;case 10:qi(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&oe(ga);break;case 24:qi(aa)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===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=Qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[at]=e,t[ot]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Gs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Gs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&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{Ja(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(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 sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ft]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[at]=e,vt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Wt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)qa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(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&&sa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(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 Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:P.T===null?rt():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||V){var e=He;He<<=1,!(He&3932160)&&(He=262144),Jl=e}else Jl=536870912;return e=eo.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),Xe(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-De(),10<a)){if(yu(r,t,Jl,!Bl),Ge(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},jl(t,a,d);var m=(a&62914560)===a?$l-De():(a&4194048)===a?eu-De():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),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 yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Gi=Wi=null,Do(e),ka=null,Aa=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=li(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Ke(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,$r(),n}function Cu(e,t){U=null,P.H=Ls,t===ya||t===xa?(t=Da(),X=3):t===ba?(t=Da(),X=4):X=t===tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Ys(e,_i(t,e.current)))}function wu(){var e=eo.current;return e===null?!0:(Y&4194048)===Y?to===null:(Y&62914560)===Y||Y&536870912?e===to:!1}function Tu(){var e=P.H;return P.H=Ls,e===null?Ls:e}function Eu(){var e=P.A;return P.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&eo.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,K=r,P.H=i,P.A=a,J===null&&(q=null,Y=0,$r()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=De()+500,Su(e,t)):Vl=Ke(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Ca(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Ca(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Gi=Wi=null,P.H=r,P.A=a,K=n,J===null?(q=null,Y=0,$r(),Wl):0}function ju(){for(;J!==null&&!Te();)Mu(J)}function Mu(e){var t=jc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=hc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Do(t);default:zc(n,t),t=J=ui(t,Ul),t=jc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Gi=Wi=null,Do(t),ka=null,Aa=0;var i=t.return;try{if(ec(e,i,t,n,Y)){Wl=1,Ys(e,_i(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Ys(e,_i(n,e.current)),J=null;return}t.flags&32768?(V||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,Ze(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(je,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,F.p=a,P.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,F.p=r,P.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,F.p=r,P.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Ee();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),nt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=nt(su),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{F.p=a,P.T=r,Vu(e,t)}}function Wu(e,t,n){t=_i(n,t),t=Zs(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(Xe(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=_i(n,e),n=Qs(2),r=Va(t,n,2),r!==null&&($s(n,r,t,e),Xe(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>De()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=Je()),e=ni(e,t),e!==null&&(Xe(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ce(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Ge(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=De(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),nt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=L;break;default:n=je}return r=cd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Ge(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,De()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Ce(ke,ad):od()})}function dd(){if(nd===0){var e=ua;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Zt(``+e)}function pd(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 md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Cs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<qr.length;hd++){var gd=qr[hd];Jr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,yt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=mt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}on(function(){var r=a,i=en(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=bn,u=e;switch(e){case`keypress`:if(hn(n)===0)break a;case`keydown`:case`keyup`:l=Rn;break;case`focusin`:u=`focus`,l=kn;break;case`focusout`:u=`blur`,l=kn;break;case`beforeblur`:case`afterblur`:l=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Bn;break;case zr:case Br:case Vr:l=An;break;case Gr:l=Vn;break;case`scroll`:case`scrollend`:l=Sn;break;case`wheel`:l=Hn;break;case`copy`:case`cut`:case`paste`:l=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=zn;break;case`toggle`:case`beforetoggle`:l=Un}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=sn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:gt(l),h=u==null?c:gt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?gt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c))if(ur)v=yr;else{v=_r;var y=gr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Jt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Bt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(s,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(s,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=mn()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,$n=!0)),y=Ed(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=sn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=sn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=sn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
9
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Dt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Ut(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=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||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(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`:ef(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==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(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=_t(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);vt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=le.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=_t(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=_t(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=_t(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Lt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),vt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Lt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,vt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),vt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[at]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ra(a),e}function tp(e){return e?(e=ai,e):ai}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ba(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Va(e,r,t),n!==null&&(hu(n,e,t),Ha(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=tt(t);var n=ni(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=De()+500,id(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=en(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=mt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 fp=e,null}function mp(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case L:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=mt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=ht(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[st]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Fe=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ks,s=qs,c=Js;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[st]=t.current,Sd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}))(),_=c(u(),1),v=`/dashboard`;function y(){let e=window.location.pathname;return e===v||e===`/dashboard/`?`/`:e.startsWith(`/dashboard/`)?e.slice(10):e||`/`}function b(e){return e===`/`||e===``?`/dashboard/`:v+(e.startsWith(`/`)?e:`/`+e)}function x(e){let t=b(e);t!==window.location.pathname+window.location.search&&window.history.pushState({},``,t),window.dispatchEvent(new Event(`dashboard:navigate`))}typeof document<`u`&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener(`click`,e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target?.closest?.(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(t.hasAttribute(`target`)||t.hasAttribute(`download`)||n.startsWith(v)&&(e.preventDefault(),n!==window.location.pathname+window.location.search&&window.history.pushState({},``,n),window.dispatchEvent(new Event(`dashboard:navigate`))))}),window.addEventListener(`popstate`,()=>{window.dispatchEvent(new Event(`dashboard:navigate`))}));function S(e,t){let n=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/:\w+/g,`([^/]+)`),r=RegExp(`^${n}$`),i=t.match(r);return i?decodeURIComponent(i[1]):null}function C(){let[e,t]=(0,_.useState)(y());return(0,_.useEffect)(()=>{let e=()=>t(y());return window.addEventListener(`dashboard:navigate`,e),()=>{window.removeEventListener(`dashboard:navigate`,e)}},[]),e}var w=c(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,ee=`[a-zA-Z_]\\w*`,E=`\\b\\d+(\\.\\d+)?`,D=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,O=`\\b(0b[01]+)`,k=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,A=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},M={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},N={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},F=P(`//`,`$`),ne=P(`/\\*`,`\\*/`),re=P(`#`,`$`),ie=Object.freeze({__proto__:null,APOS_STRING_MODE:M,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},BINARY_NUMBER_RE:O,COMMENT:P,C_BLOCK_COMMENT_MODE:ne,C_LINE_COMMENT_MODE:F,C_NUMBER_MODE:{scope:`number`,begin:D,relevance:0},C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:re,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:E,relevance:0},NUMBER_RE:E,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:N,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},RE_STARTERS_RE:k,SHEBANG:A,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:ee,relevance:0}});function ae(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function oe(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function I(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ae,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function se(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ce(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function le(e,t){e.relevance===void 0&&(e.relevance=1)}var ue=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},de=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],fe=`keyword`;function pe(e,t,n=fe){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,pe(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,me(n[0],n[1])]})}}function me(e,t){return t?Number(t):+!he(e)}function he(e){return de.includes(e.toLowerCase())}var ge={},_e=e=>{console.error(e)},ve=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ye=(e,t)=>{ge[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ge[`${e}/${t}`]=!0)},be=Error();function xe(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Se(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _e(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),be;if(typeof e.beginScope!=`object`||e.beginScope===null)throw _e(`beginScope must be object`),be;xe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Ce(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _e(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),be;if(typeof e.endScope!=`object`||e.endScope===null)throw _e(`endScope must be object`),be;xe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function we(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Te(e){we(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Se(e),Ce(e)}function Ee(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[oe,ce,Te,ue].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[I,se,le].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=pe(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Oe(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function De(e){return e?e.endsWithParent||De(e.starts):!1}function Oe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:De(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var ke=`11.11.1`,Ae=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},je=i,Me=a,L=Symbol(`nomatch`),Ne=7,Pe=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=M(n[1]);return t||(ve(s.replace(`{}`,n[1])),ve(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||M(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(ye(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ye(`10.7.0`,`Please use highlight(code, options) instead.
10
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};re(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,re(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!k.keywords){j.addText(N);return}let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(N),n=``;for(;t;){n+=N.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=u(k,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ne&&(te+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(N)}n+=N.substring(e),j.addText(n)}function f(){if(N===``)return;let e=null;if(typeof k.subLanguage==`string`){if(!t[k.subLanguage]){j.addText(N);return}e=v(k.subLanguage,N,!0,A[k.subLanguage]),A[k.subLanguage]=e._top}else e=S(N,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(te+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){k.subLanguage==null?d():f(),N=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=E.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(N=i,d(),N=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(N,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=``):e.beginScope._multi&&(h(e.beginScope,t),N=``)),k=Object.create(e,{parent:{value:k}}),k}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return k.matcher.regexIndex===0?(N+=e[0],1):(ne=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),!n.returnBegin&&!n.excludeBegin&&(N=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(k,e,r);if(!i)return L;let a=k;k.endScope&&k.endScope._wrap?(p(),m(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do k.scope&&j.closeNode(),!k.skip&&!k.subLanguage&&(te+=k.relevance),k=k.parent;while(k!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=k;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function ee(t,r){let a=r&&r[0];if(N+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(N+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(k.scope||`<unnamed>`)+`"`);throw e.mode=k,e}else if(r.type===`end`){let e=C(r);if(e!==L)return e}if(r.type===`illegal`&&a===``)return N+=`
11
+ `,1;if(F>1e5&&F>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return N+=a,a.length}let E=M(e);if(!E)throw _e(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let D=Ee(E),O=``,k=a||D,A={},j=new l.__emitter(l);w();let N=``,te=0,P=0,F=0,ne=!1;try{if(E.__emitTokens)E.__emitTokens(n,j);else{for(k.matcher.considerAll();;){F++,ne?ne=!1:k.matcher.considerAll(),k.matcher.lastIndex=P;let e=k.matcher.exec(n);if(!e)break;let t=ee(n.substring(P,e.index),e);P=e.index+t}ee(n.substring(P))}return j.finalize(),O=j.toHTML(),{language:e,value:O,relevance:te,illegal:!1,_emitter:j,_top:k}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:je(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:P,context:n.slice(P-100,P+100),mode:t.mode,resultSoFar:O},_emitter:j};if(o)return{language:e,value:je(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:k};throw t}}function b(e){let t={value:je(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(M).filter(te).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(M(e.language).supersetOf===t.language)return 1;if(M(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(re(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ae(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),re(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Me(l,e)}let ee=()=>{O(),ye(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function E(){O(),ye(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let D=!1;function O(){function e(){O()}if(document.readyState===`loading`){D||window.addEventListener(`DOMContentLoaded`,e,!1),D=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function k(n,r){let i=null;try{i=r(e)}catch(e){if(_e(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)_e(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function A(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function M(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function te(e){let t=M(e);return t&&!t.disableAutodetect}function P(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function F(e){P(e),a.push(e)}function ne(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function re(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ae(e){return ye(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ye(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:O,highlightElement:w,highlightBlock:ae,configure:T,initHighlighting:ee,initHighlightingOnLoad:E,registerLanguage:k,unregisterLanguage:A,listLanguages:j,getLanguage:M,registerAliases:N,autoDetection:te,inherit:Me,addPlugin:F,removePlugin:ne}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=ke,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ie)typeof ie[e]==`object`&&n(ie[e]);return Object.assign(e,ie),e},Fe=Pe({});Fe.newInstance=()=>Pe({}),t.exports=Fe,Fe.HighlightJS=Fe,Fe.default=Fe}))()).default;function T(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var ee=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),E=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),D=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),O=[...E,...D],k=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),A=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),j=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),M=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function N(e){let t=e.regex,n=ee(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+A.join(`|`)+`)`},{begin:`:(:)?(`+j.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+M.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:k.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+O.join(`|`)+`)\\b`}]}}function te(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function P(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}var F=`[A-Za-z$_][0-9A-Za-z$_]*`,ne=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),re=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],ie=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),ae=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],oe=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],I=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],se=[].concat(oe,ie,ae);function ce(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=F,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:F,keyword:ne,literal:re,built_in:se,"variable.language":I},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...ie,...ae]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function E(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,E([...oe,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,ee,S,k,{match:/\$[(.]/}]}}function le(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function ue(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function de(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var fe=`[A-Za-z$_][0-9A-Za-z$_]*`,pe=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),me=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],he=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),ge=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],_e=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],ve=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],ye=[].concat(_e,he,ge);function be(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=fe,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:fe,keyword:pe,literal:me,built_in:ye,"variable.language":ve},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...he,...ge]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function E(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,E([..._e,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,ee,S,k,{match:/\$[(.]/}]}}function xe(e){let t=e.regex,n=be(e),r=fe,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:fe,keyword:pe.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:me,built_in:ye.concat(i),"variable.language":ve},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function Se(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ce(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}w.registerLanguage(`typescript`,xe),w.registerLanguage(`javascript`,ce),w.registerLanguage(`json`,le),w.registerLanguage(`bash`,T),w.registerLanguage(`diff`,te),w.registerLanguage(`css`,N),w.registerLanguage(`xml`,Se),w.registerLanguage(`python`,ue),w.registerLanguage(`go`,P),w.registerLanguage(`yaml`,Ce),w.registerLanguage(`sql`,de);var we={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,sh:`bash`,shell:`bash`,html:`xml`,yml:`yaml`};function Te(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function Ee(e){if(!e)return``;let t=e.toLowerCase().replace(/[^a-z0-9+-]/g,``);return we[t]??t}function De(e,t){let n=Ee(t);if(n&&w.getLanguage(n))try{return w.highlight(e,{language:n,ignoreIllegals:!0}).value}catch{return Te(e)}return Te(e)}function Oe(e){let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`);t=t.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(e,t,n)=>`<pre class="md-code-block"><code>${n.trimEnd()}</code></pre>`),t=t.replace(/`([^`\n]+)`/g,`<code class="md-inline-code">$1</code>`),t=t.replace(/\*\*([^*\n]+)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,`$1<em>$2</em>`);let n=t.split(`
12
+ `),r=[],i=!1;for(let e=0;e<n.length;e++){let t=n[e],a=t.match(/^###\s+(.+)$/),o=t.match(/^##\s+(.+)$/),s=t.match(/^#\s+(.+)$/);if(a){i&&=(r.push(`</ul>`),!1),r.push(`<h3 class="md-h3">${a[1]}</h3>`);continue}if(o){i&&=(r.push(`</ul>`),!1),r.push(`<h2 class="md-h2">${o[1]}</h2>`);continue}if(s){i&&=(r.push(`</ul>`),!1),r.push(`<h1 class="md-h1">${s[1]}</h1>`);continue}let c=t.match(/^(\s*)[*-]\s+(.+)$/);if(c){i||=(r.push(`<ul class="md-list">`),!0),r.push(`<li>${c[2]}</li>`);continue}if(t.trim()===``){i&&=(r.push(`</ul>`),!1),r.push(``);continue}i&&=(r.push(`</ul>`),!1),r.push(t)}return i&&r.push(`</ul>`),r.join(`
13
+ `)}var ke=`\0`,Ae=new RegExp(ke,`g`),je=RegExp(`${ke}HLJS(\\d+)${ke}`,`g`);function Me(e){let t=[],n=e.replace(Ae,``);n=n.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(e,n,r)=>{let i=t.length;return t.push({lang:n,body:r}),`${ke}HLJS${i}${ke}`});let r=n.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`);r=r.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,``),r=r.replace(/&lt;agent_finding[^&]*&gt;/g,``),r=r.replace(/&lt;\/agent_finding&gt;/g,``),r=r.replace(/&lt;cite\s+tag=&quot;file&quot;&gt;([^&]+)&lt;\/cite&gt;/g,`<code class="cite-file">$1</code>`),r=r.replace(/&lt;cite\s+tag=&quot;fn&quot;&gt;([^&]+)&lt;\/cite&gt;/g,`<code class="cite-fn">$1</code>`),r=r.replace(/&lt;fn&gt;([^&]+)&lt;\/fn&gt;/g,`<code class="cite-fn">$1</code>`),r=r.replace(/`([^`\n]+)`/g,`<code class="md-inline-code">$1</code>`),r=r.replace(/\*\*([^*\n]+)\*\*/g,`<strong class="font-semibold text-foreground">$1</strong>`),r=r.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,`$1<em>$2</em>`);let i=r.split(`
14
+ `),a=[],o=!1;for(let e of i){let t=e.match(/^###\s+(.+)$/),n=e.match(/^##\s+(.+)$/),r=e.match(/^#\s+(.+)$/);if(t){o&&=(a.push(`</ul>`),!1),a.push(`<h3 class="md-h3">${t[1]}</h3>`);continue}if(n){o&&=(a.push(`</ul>`),!1),a.push(`<h2 class="md-h2">${n[1]}</h2>`);continue}if(r){o&&=(a.push(`</ul>`),!1),a.push(`<h1 class="md-h1">${r[1]}</h1>`);continue}let i=e.match(/^(\s*)[*-]\s+(.+)$/);if(i){o||=(a.push(`<ul class="md-list">`),!0),a.push(`<li>${i[2]}</li>`);continue}if(e.trim()===``){o&&=(a.push(`</ul>`),!1),a.push(``);continue}o&&=(a.push(`</ul>`),!1),a.push(e)}return o&&a.push(`</ul>`),r=a.join(`
15
+ `),r=r.replace(je,(e,n)=>{let r=t[Number(n)];if(!r)return``;let i=Ee(r.lang);return`<pre class="md-code-block"><code class="hljs${i?` language-${i}`:``}">${De(r.body.replace(/\n$/,``),r.lang)}</code></pre>`}),r}function L(e){let t=Date.now(),n=typeof e==`string`?new Date(e).getTime():e,r=Math.max(0,Math.floor((t-n)/1e3));return r<60?`just now`:r<3600?Math.floor(r/60)+`m ago`:r<86400?Math.floor(r/3600)+`h ago`:Math.floor(r/86400)+`d ago`}function Ne(e){if(!e)return`—`;let t=Math.round(e/1e3);return t<60?t+`s`:Math.floor(t/60)+`m `+t%60+`s`}function Pe(e){let t=e.split(`-`).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():(t[0]||e).slice(0,2).toUpperCase()}var Fe=[`#3F8B86`,`#8C5E97`,`#B47A2A`,`#2F7D5B`,`#A53A4A`,`#6B6862`,`#C8A45A`],Ie={"sonnet-reviewer":`#8C5E97`,"sonnet-designer":`#C8A45A`,"sonnet-implementer":`#A53A4A`,"opus-implementer":`#C97056`,"gemini-reviewer":`#3F8B86`,"gemini-tester":`#2F7D5B`,"haiku-researcher":`#6B7A85`};function Le(e){if(Ie[e])return Ie[e];let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return Fe[t%Fe.length]}function Re(e){return e.endsWith(`-implementer`)?{label:`IMPL`,cls:`text-unique`}:e.endsWith(`-reviewer`)?{label:`REVIEW`,cls:`text-chart`}:e.endsWith(`-tester`)?{label:`TEST`,cls:`text-unique`}:e.endsWith(`-researcher`)?{label:`RESEARCH`,cls:``,clsStyle:{color:`var(--text-dim)`}}:e.endsWith(`-designer`)?{label:`DESIGN`,cls:`text-chart`}:null}var ze=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=ze()}))();function Be({title:e,hint:t,compact:n=!1}){return(0,R.jsxs)(`div`,{className:`text-center ${n?`py-3`:`py-6`}`,children:[(0,R.jsx)(`div`,{className:`font-mono text-xs`,style:{color:`var(--text-dim)`},children:e}),t&&(0,R.jsx)(`div`,{className:`mt-1 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:t})]})}function Ve(e){return e==null||e<=0?`—`:e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function He({value:e,unit:t,label:n,valueClass:r=``,valueColor:i,pulse:a,tooltip:o}){return(0,R.jsxs)(`div`,{className:`flex flex-col items-center py-4 px-3 text-center`,"data-tooltip":o,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[a&&(0,R.jsxs)(`span`,{className:`relative mr-1 inline-flex h-2 w-2`,children:[(0,R.jsx)(`span`,{className:`absolute inline-flex h-2 w-2 animate-ping rounded-full bg-unverified/60`}),(0,R.jsx)(`span`,{className:`relative inline-flex h-2 w-2 rounded-full bg-unverified`})]}),(0,R.jsx)(`span`,{className:`font-mono text-2xl font-medium leading-none tracking-[-0.025em] ${r}`,style:i?{color:i}:void 0,children:e}),t&&(0,R.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--ink-3)`},children:t})]}),(0,R.jsx)(`div`,{className:`h-section mt-1.5`,style:{color:`var(--ink-3)`,fontSize:`10px`},children:n})]})}function Ue({overview:e,activeTasks:t,mode:n=`dense`,showActivity:r}){let i=e.relayCount+e.nativeCount,a=e.tasksCompleted+e.tasksFailed>0?Math.round(e.tasksCompleted/(e.tasksCompleted+e.tasksFailed)*100):null,o=e.totalFindings>0?Math.round(e.confirmedFindings/e.totalFindings*100):0,s=n===`calm`,c=r??!s;return(0,R.jsxs)(`div`,{className:`rounded-lg border border-border`,style:{background:`var(--surface-elev)`},children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-3.5 py-3`,children:[(0,R.jsx)(`div`,{className:`h-section`,children:`System Pulse`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[10px] text-confirmed`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-confirmed`}),`LIVE`]})]}),s&&i===0?(0,R.jsx)(Be,{title:`No agents registered yet`,hint:"Run `gossip_setup` or see docs/ to get started."}):s?(0,R.jsxs)(`div`,{className:`grid grid-cols-3 border-b border-border`,children:[(0,R.jsx)(`div`,{className:`border-r border-border`,children:(0,R.jsx)(He,{value:e.agentsOnline,label:`Agents Working`,valueColor:e.agentsOnline>0?`var(--ok)`:`var(--text)`})}),(0,R.jsx)(`div`,{className:`border-r border-border`,children:(0,R.jsx)(He,{value:t,label:`Active Tasks`,valueClass:t>0?`text-unverified`:``,valueColor:t>0?void 0:`var(--ink-3)`,pulse:t>0})}),(0,R.jsx)(He,{value:`${o}%`,label:`Confirmed`,valueClass:o>=50?`text-confirmed`:o>0?`text-unverified`:``,valueColor:o===0?`var(--ink-3)`:void 0})]}):(0,R.jsxs)(`div`,{className:`border-b border-border`,children:[(0,R.jsxs)(`div`,{className:`relative grid grid-cols-2`,children:[(0,R.jsx)(`span`,{className:`pointer-events-none absolute left-0 right-0 top-1/2 h-px bg-border`}),(0,R.jsx)(`span`,{className:`pointer-events-none absolute bottom-0 left-1/2 top-0 w-px bg-border`}),(0,R.jsxs)(`div`,{className:`flex flex-col items-stretch justify-center gap-1.5 px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`h-section`,style:{color:`var(--ink-3)`,fontSize:`10px`},"data-tooltip":`Agents currently executing a task`,children:`Dispatched`}),(0,R.jsx)(`span`,{className:`font-mono text-base font-bold leading-none`,style:{color:e.agentsOnline>0?`var(--ok)`:`var(--text)`},children:e.agentsOnline})]}),(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`h-section`,style:{color:`var(--ink-3)`,fontSize:`10px`},"data-tooltip":`Relay agents with an active WebSocket connection`,children:`Connected`}),(0,R.jsx)(`span`,{className:`font-mono text-base font-bold leading-none ${e.relayConnected>0?`text-confirmed`:``}`,style:e.relayConnected>0?void 0:{color:`var(--ink-3)`},children:e.relayConnected})]}),(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`h-section`,style:{color:`var(--ink-3)`,fontSize:`10px`},"data-tooltip":`Total agents in gossipcat config`,children:`Registered`}),(0,R.jsx)(`span`,{className:`font-mono text-base font-bold leading-none`,style:{color:`var(--ink-3)`},children:i})]})]}),(0,R.jsx)(He,{value:t,label:`Active Tasks`,valueClass:t>0?`text-unverified`:``,valueColor:t>0?void 0:`var(--ink-3)`,pulse:t>0}),(0,R.jsx)(He,{value:e.consensusRuns,label:`Consensus`,valueColor:`var(--text)`}),(0,R.jsx)(He,{value:`${o}%`,label:`Confirmed`,valueClass:`text-confirmed`})]}),(0,R.jsx)(`a`,{href:b(`/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding`),className:`block cursor-pointer border-t border-border transition-colors hover:bg-accent/10`,"aria-label":`View actionable findings on Signals page`,children:(0,R.jsx)(He,{value:e.actionableFindings,label:`Actionable`,valueClass:e.actionableFindings>0?`text-unverified`:``,tooltip:`Findings still open and need operator review (disagreements + hallucinations + new findings)`})})]}),!s&&(0,R.jsxs)(`div`,{className:`px-3.5 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-1 font-mono text-[11px]`,children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-3)`},children:`tasks completed`}),(0,R.jsx)(`span`,{className:`font-semibold tabular-nums`,style:{color:`var(--text)`},children:e.tasksCompleted})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-1 font-mono text-[11px]`,children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-3)`},children:`signals total`}),(0,R.jsx)(`span`,{className:`font-semibold tabular-nums`,style:{color:`var(--text)`},children:e.totalSignals})]}),e.tasksFailed>0&&(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-1 font-mono text-[11px]`,children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-3)`},children:`tasks failed`}),(0,R.jsx)(`span`,{className:`font-semibold text-bad tabular-nums`,children:e.tasksFailed})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-1 font-mono text-[11px]`,children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-3)`},children:`avg duration`}),(0,R.jsx)(`span`,{className:`font-semibold tabular-nums`,style:{color:`var(--text)`},children:Ve(e.avgDurationMs)})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-1 font-mono text-[11px]`,children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-3)`},children:`success rate`}),(0,R.jsx)(`span`,{className:`font-semibold tabular-nums ${a!==null&&a>=95?`text-confirmed`:a!==null&&a>=80?`text-unverified`:a===null?``:`text-bad`}`,style:a===null?{color:`var(--ink-3)`}:void 0,children:a===null?`—`:`${a}%`})]})]}),c&&(0,R.jsx)(We,{hourly:e.hourlyActivity||[]}),e.lastConsensusTimestamp&&(0,R.jsxs)(`div`,{className:`border-t border-border px-3.5 py-2 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--ink-3) 60%, transparent)`},children:[`last consensus `,L(e.lastConsensusTimestamp)]})]})}function We({hourly:e}){let t=e.length===12?e:Array(12).fill(0),n=Math.max(1,...t);return(0,R.jsxs)(`div`,{className:`border-t border-border px-3.5 py-3`,style:{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`},children:[(0,R.jsx)(`div`,{className:`h-section mb-2`,style:{color:`color-mix(in oklch, var(--ink-3) 60%, transparent)`,fontSize:`11px`},children:`Activity Last 12h`}),(0,R.jsx)(`div`,{className:`flex h-6 items-end gap-0.5`,children:t.map((e,t)=>{let r=11-t,i=e/n*100,a=t===11,o=r===0?`last hour`:`${r}h ago`;return(0,R.jsx)(`div`,{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${e===0?`opacity-0`:a?`bg-chart opacity-90`:`bg-chart opacity-40`}`,style:{height:e===0?`0%`:`${Math.max(8,i)}%`},"data-tooltip":`${o}\n${e} task${e===1?``:`s`}`,"data-tooltip-pos":`bottom`},t)})}),(0,R.jsxs)(`div`,{className:`mt-1 flex justify-between font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--ink-3) 40%, transparent)`},children:[(0,R.jsx)(`span`,{children:`12h ago`}),(0,R.jsx)(`span`,{children:`now`})]})]})}var Ge=24;function Ke(e,t){let n=new Map;for(let e of t)n.set(e.id,Array(Ge).fill(0));for(let t of e?.agents??[]){let e=n.get(t.id);if(!e)continue;let r=t.buckets??[];for(let t=0;t<Ge;t++)e[t]=r[t]??0}return n}function qe(e,t){if(t<=0||e<=0)return 0;let n=e/t;return n<.18?1:n<.4?2:n<.68?3:4}var Je={0:.18,1:.35,2:.55,3:.78,4:1};function Ye({agents:e,activity:t,loading:n=!1,error:r=null}){let i=(0,_.useMemo)(()=>Ke(t,e),[t,e]),a=(0,_.useMemo)(()=>{let e=new Map;for(let[t,n]of i)e.set(t,n.reduce((e,t)=>e+t,0));return e},[i]),o=(0,_.useMemo)(()=>{let e=0;for(let t of a.values())e+=t;return e},[a]);if(n&&e.length===0)return(0,R.jsx)(Xe,{error:null,fleetTotal:null,children:Array.from({length:4}).map((e,t)=>(0,R.jsx)(Ze,{},t))});if(e.length===0)return(0,R.jsx)(Xe,{error:r,fleetTotal:null,children:(0,R.jsxs)(`div`,{className:`px-5 py-6 font-mono text-xs`,style:{color:`var(--ink-3)`},children:[`No agents registered yet — run `,(0,R.jsx)(`code`,{className:`rounded bg-[var(--surface-sunk)] px-1.5 py-0.5`,children:`gossip_setup`}),` to spin up the fleet.`]})});if(o===0){let n=t==null?`Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.`:`No active dispatches — fleet idle.`;return(0,R.jsxs)(Xe,{error:r,fleetTotal:0,children:[e.map(e=>(0,R.jsx)(Qe,{agent:e},e.id)),(0,R.jsx)(`div`,{className:`px-5 py-3 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:n})]})}return(0,R.jsx)(Xe,{error:r,fleetTotal:o,children:e.map(e=>{let t=i.get(e.id)??Array(Ge).fill(0),n=Math.max(0,...t),r=a.get(e.id)??0,s=o>0?Math.round(r/o*100):0,c=Le(e.id);return(0,R.jsxs)(`div`,{className:`grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0`,style:{gridTemplateColumns:`160px 1fr 110px`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[12px]`,style:{color:`var(--ink)`},children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 flex-shrink-0 rounded-full`,style:{background:c}}),(0,R.jsx)(`span`,{className:`truncate`,children:e.id})]}),(0,R.jsx)(`div`,{className:`grid h-4 gap-px`,style:{gridTemplateColumns:`repeat(${Ge}, 1fr)`},role:`img`,"aria-label":`${e.id} 24h activity — ${r} signals`,children:t.map((e,t)=>{let r=qe(e,n);return(0,R.jsx)(`div`,{className:`rounded-sm`,title:`hour ${t}: ${e} signal${e===1?``:`s`}`,style:{background:r===0?`var(--surface-sunk)`:c,opacity:Je[r]}},t)})}),(0,R.jsxs)(`div`,{className:`text-right font-mono text-[12px] tabular-nums`,style:{color:`var(--ink)`},children:[r,(0,R.jsxs)(`span`,{className:`ml-1.5 text-[11px]`,style:{color:`var(--ink-3)`},children:[s,`%`]})]})]},e.id)})})}function Xe({children:e,error:t,fleetTotal:n}){return(0,R.jsxs)(`div`,{className:`rounded-lg border border-border`,style:{background:`var(--surface-elev)`},children:[(0,R.jsxs)(`div`,{className:`grid items-end gap-3 border-b border-border px-5 py-3`,style:{gridTemplateColumns:`160px 1fr 110px`},children:[(0,R.jsx)(`div`,{className:`h-section`,children:`Agent · 24h activity`}),(0,R.jsx)(`div`,{className:`grid font-mono text-[9px]`,style:{gridTemplateColumns:`repeat(${Ge}, 1fr)`,color:`var(--ink-3)`},children:Array.from({length:Ge}).map((e,t)=>(0,R.jsx)(`span`,{className:`text-center`,children:t%2==0?String(t).padStart(2,`0`):``},t))}),(0,R.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:t?(0,R.jsx)(`span`,{className:`rounded-sm border px-2 py-0.5 font-mono text-[10px]`,style:{borderColor:`var(--danger)`,background:`color-mix(in oklch, var(--danger) 12%, transparent)`,color:`var(--danger)`},children:t}):n===null?null:(0,R.jsxs)(`div`,{className:`h-section`,style:{color:`var(--ink-3)`},children:[`Signals · 24h `,(0,R.jsx)(`span`,{className:`ml-1.5 tabular-nums`,style:{color:`var(--ink)`},children:n})]})})]}),e]})}function Ze(){return(0,R.jsxs)(`div`,{className:`grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0`,style:{gridTemplateColumns:`160px 1fr 110px`},children:[(0,R.jsx)(`div`,{className:`h-3 w-32 rounded`,style:{background:`var(--border)`,opacity:.4}}),(0,R.jsx)(`div`,{className:`grid h-4 gap-px`,style:{gridTemplateColumns:`repeat(${Ge}, 1fr)`},children:Array.from({length:Ge}).map((e,t)=>(0,R.jsx)(`div`,{className:`rounded-sm`,style:{background:`var(--border)`,opacity:.4}},t))}),(0,R.jsx)(`div`,{className:`ml-auto h-3 w-12 rounded`,style:{background:`var(--border)`,opacity:.4}})]})}function Qe({agent:e}){return(0,R.jsxs)(`div`,{className:`grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0`,style:{gridTemplateColumns:`160px 1fr 110px`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[12px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 flex-shrink-0 rounded-full`,style:{background:Le(e.id),opacity:.5}}),(0,R.jsx)(`span`,{className:`truncate`,children:e.id})]}),(0,R.jsx)(`div`,{className:`grid h-4 gap-px`,style:{gridTemplateColumns:`repeat(${Ge}, 1fr)`},children:Array.from({length:Ge}).map((e,t)=>(0,R.jsx)(`div`,{className:`rounded-sm`,style:{background:`var(--surface-sunk)`,opacity:.4}},t))}),(0,R.jsx)(`div`,{className:`text-right font-mono text-[12px]`,style:{color:`var(--ink-3)`},children:`—`})]})}var $e=`/dashboard/api`,et=`unauthorized`;function tt(e){return e instanceof Error&&e.message.includes(`unauthorized`)}var nt=3e4;function rt(e){return`timeout after ${e/1e3}s`}function it(e){if(typeof AbortSignal<`u`&&typeof AbortSignal.timeout==`function`)return{signal:AbortSignal.timeout(e),cleanup:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(Error(rt(e))),e);return{signal:t.signal,cleanup:()=>clearTimeout(n)}}async function z(e,t){let{signal:n,cleanup:r}=it(nt);try{let r=await fetch(`${$e}/${e}`,{credentials:`include`,...t,signal:n});if(r.status===401)throw Error(et);if(!r.ok)throw Error(`API error: ${r.status}`);return r.json()}catch(e){throw e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`)?Error(rt(nt)):e}finally{r()}}async function at(e){let{signal:t,cleanup:n}=it(nt);try{let n=await fetch(`${$e}/auth`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:e}),signal:t});return n.ok?await ot()?{ok:!0}:{ok:!1,kind:`no_cookie`}:n.status===401||n.status===403?{ok:!1,kind:`bad_key`}:{ok:!1,kind:`network`}}catch{return{ok:!1,kind:`network`}}finally{n()}}async function ot(){let{signal:e,cleanup:t}=it(nt);try{return(await fetch(`${$e}/auth/check`,{credentials:`include`,signal:e})).ok}catch{return!1}finally{t()}}var st=7200*1e3;function ct(e){let t=Date.now()-new Date(e).getTime();return t<0?`0s`:t<6e4?`${Math.floor(t/1e3)}s`:t<36e5?`${Math.floor(t/6e4)}m ${Math.floor(t%6e4/1e3)}s`:`${Math.floor(t/36e5)}h ${Math.floor(t%36e5/6e4)}m`}function lt({onCountChange:e}){let[t,n]=(0,_.useState)([]),[,r]=(0,_.useState)(0);(0,_.useEffect)(()=>{let t=!1,r=async()=>{try{let r=await z(`active-tasks`);t||(n(r.tasks||[]),e?.(r.tasks?.length||0))}catch{}};r();let i=setInterval(r,5e3);return()=>{t=!0,clearInterval(i)}},[e]),(0,_.useEffect)(()=>{if(t.length===0)return;let e=setInterval(()=>r(e=>e+1),1e3);return()=>clearInterval(e)},[t.length]);let i=Date.now(),a=t.filter(e=>i-new Date(e.startedAt).getTime()<st),o=t.length-a.length;return a.length===0?o===0?null:(0,R.jsx)(`div`,{className:`rounded-lg border border-border px-4 py-2.5`,style:{background:`color-mix(in oklch, var(--surface-elev) 60%, transparent)`},children:(0,R.jsxs)(`span`,{className:`font-mono text-xs`,style:{color:`var(--text-dim)`},children:[o,` stale task`,o===1?``:`s`,` — likely orphaned (>2h since last update)`]})}):(0,R.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-2.5`,style:{background:`color-mix(in oklch, var(--surface-elev) 60%, transparent)`},children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed`}),(0,R.jsx)(`span`,{className:`h-section`,children:`Live`}),(0,R.jsxs)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--text-dim)`},children:[a.length,` active`]}),o>0&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:[`· `,o,` stale`]})]}),(0,R.jsx)(`div`,{className:`max-h-40 space-y-1 overflow-y-auto`,children:a.map(e=>(0,R.jsxs)(`div`,{className:`grid items-center gap-3`,style:{gridTemplateColumns:`minmax(120px, auto) 1fr auto`},children:[(0,R.jsx)(`span`,{className:`font-mono text-[11px] font-semibold truncate`,style:{color:`var(--text)`},children:e.agentId}),(0,R.jsx)(`span`,{className:`min-w-0 truncate text-[11px]`,style:{color:`var(--text-dim)`},children:e.task}),(0,R.jsx)(`span`,{className:`font-mono text-[11px] whitespace-nowrap tabular-nums`,style:{color:`var(--text-dim)`},children:ct(e.startedAt)})]},e.taskId))})]})}function ut(e,t,n,r){let i=Math.max(0,Math.min(.9999,r)),a=-Math.PI/2,o=a+i*2*Math.PI,s=e+n*Math.cos(a),c=t+n*Math.sin(a),l=e+n*Math.cos(o),u=t+n*Math.sin(o),d=+(i>.5);return`M ${s.toFixed(2)} ${c.toFixed(2)} A ${n} ${n} 0 ${d} 1 ${l.toFixed(2)} ${u.toFixed(2)}`}function dt(e,t,n){return`M ${e} ${t-n} A ${n} ${n} 0 1 1 ${e} ${t+n} A ${n} ${n} 0 1 1 ${e} ${t-n}`}function ft({accuracy:e,size:t=90,color:n=`var(--ink)`}){let r=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=t/2,a=t/2,o=t*.089,s=(t-o)/2-2,c=Math.round(r*100),l=Math.round(t*.22);return(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:2},children:[(0,R.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:`img`,"aria-label":`Accuracy ${c}%`,children:[(0,R.jsx)(`path`,{d:dt(i,a,s),fill:`none`,stroke:`var(--ink)`,strokeOpacity:.08,strokeWidth:o,strokeLinecap:`round`}),r>0&&(0,R.jsx)(`path`,{d:ut(i,a,s,r),fill:`none`,stroke:n,strokeWidth:o,strokeLinecap:`round`}),(0,R.jsxs)(`text`,{x:i,y:a,textAnchor:`middle`,dominantBaseline:`middle`,dy:`0.08em`,fill:`var(--ink)`,style:{fontSize:l,fontFamily:`'Fraunces', serif`,fontVariantNumeric:`tabular-nums`,fontWeight:700},children:[c,`%`]})]}),(0,R.jsx)(`span`,{style:{fontSize:10,color:`var(--ink-3)`,fontFamily:`Geist, Inter, sans-serif`,fontVariant:`small-caps`,letterSpacing:`0.04em`},children:`accuracy`})]})}var pt={critical:`var(--bad)`,high:`var(--warn)`,medium:`var(--severity-medium)`,low:`var(--idle)`},mt=[`critical`,`high`,`medium`,`low`];function ht({counts:e,height:t=10}){let n=e??{critical:0,high:0,medium:0,low:0},r=n.critical+n.high+n.medium+n.low,i=`critical: ${n.critical}, high: ${n.high}, medium: ${n.medium}, low: ${n.low}`;return r===0?(0,R.jsx)(`div`,{role:`img`,"aria-label":`Severity distribution: no findings yet (${i})`,title:`${i} (no findings yet)`,style:{display:`flex`,height:t,borderRadius:t/2,overflow:`hidden`,gap:2,border:`1px solid color-mix(in oklch, var(--border) 60%, transparent)`,width:`100%`},children:mt.map(e=>(0,R.jsx)(`div`,{style:{flex:1,background:pt[e],opacity:.4}},e))}):(0,R.jsx)(`div`,{role:`img`,"aria-label":`Severity distribution — ${i}`,title:i,style:{display:`flex`,height:t,borderRadius:t/2,overflow:`hidden`,width:`100%`},children:mt.map(e=>{let t=n[e];return t===0?null:(0,R.jsx)(`div`,{style:{width:`${(t/r*100).toFixed(2)}%`,background:pt[e],flexShrink:0}},e)})})}function gt(e){return e.map(e=>e.signals)}function _t(e,t,n){if(e.length===0)return{line:`M 0 ${n} L ${t} ${n}`,area:``};if(e.length===1){let e=n/2;return{line:`M 0 ${e} L ${t} ${e}`,area:`M 0 ${n} L 0 ${e} L ${t} ${e} L ${t} ${n} Z`}}let r=Math.max(...e,1),i=t/(e.length-1),a=e.map((e,t)=>`${(t*i).toFixed(2)},${(n-e/r*n).toFixed(2)}`);return{line:`M ${a.join(` L `)}`,area:`M 0,${n} L ${a.join(` L `)} L ${((e.length-1)*i).toFixed(2)},${n} Z`}}var vt=5,yt=999;function bt(e){if(e.length<2)return null;let t=Math.floor(e.length/2),n=e.slice(0,t),r=e.slice(e.length-t),i=e=>e.reduce((e,t)=>e+t.signals,0),a=i(n),o=i(r);if(a<vt)return null;let s=a/n.length,c=o/r.length,l=Math.round((c-s)/s*100);return Math.max(-999,Math.min(yt,l))}function xt({points:e,width:t=80,height:n=20,reducedMotion:r=!1,color:i=`var(--c1)`}){let a=(0,_.useMemo)(()=>gt(e),[e]),{line:o,area:s}=(0,_.useMemo)(()=>_t(a,t,n),[a,t,n]),c=(0,_.useMemo)(()=>bt(e),[e]),l=a.length===0||a.every(e=>e===0);return(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,width:`100%`},children:[(0,R.jsxs)(`svg`,{width:`100%`,height:n,viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:`none`,"aria-hidden":`true`,style:{overflow:`visible`,flex:1,minWidth:0},children:[!r&&!l&&s&&(0,R.jsx)(`path`,{d:s,fill:i,fillOpacity:.3}),(0,R.jsx)(`path`,{d:o,fill:`none`,stroke:l?`var(--idle)`:i,strokeOpacity:l?.3:1,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})]}),c!==null&&!l&&(0,R.jsxs)(`span`,{title:`7d dispatch volume change — neutral indicator, not a quality metric`,style:{fontSize:10,fontFamily:`Geist, Inter, sans-serif`,fontVariantNumeric:`tabular-nums`,fontWeight:600,color:`var(--ink-3)`,flexShrink:0},children:[c>=0?`+`:``,c,`%`,Math.abs(c)>=yt?`+`:``]})]})}function St(e){return e.bench?.state===`benched`?`benched`:e.circuitOpen?`struggling`:e.bench?.state===`kept-for-coverage`?`kept-for-coverage`:null}function Ct(e){return e.scores.bench?.state===`benched`||e.scores.circuitOpen}function wt(e){return`${Math.round(e*100)}%`}function Tt(e){return e.accuracy>=.7&&e.bench?.state===`none`?{label:`healthy`,dotColor:`var(--ok)`,tooltip:`Accuracy ${Math.round(e.accuracy*100)}% — above 70% baseline.`}:{label:`needs skills`,dotColor:`var(--warn)`,tooltip:e.bench?.state===`none`?`Accuracy ${Math.round(e.accuracy*100)}% — below 70% baseline.`:`Benched (${e.bench?.reason??`auto`})`}}function Et({label:e,value:t,color:n,tooltip:r}){let i=Number.isFinite(t)?Math.max(0,Math.min(1,t)):0;return(0,R.jsxs)(`div`,{className:`grid items-center gap-2`,style:{gridTemplateColumns:`56px 1fr 32px`},children:[(0,R.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--ink-3)`,fontFamily:`Geist, Inter, sans-serif`,fontVariant:`small-caps`,letterSpacing:`0.04em`},"data-tooltip":r,children:e}),(0,R.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full`,style:{background:`color-mix(in oklch, var(--ink) 8%, transparent)`},children:(0,R.jsx)(`div`,{className:`h-full rounded-full transition-all`,style:{width:`${Math.round(i*100)}%`,background:n}})}),(0,R.jsx)(`span`,{className:`text-right tabular-nums`,style:{fontFamily:`Geist, Inter, sans-serif`,fontSize:11,color:`var(--ink-2)`},children:wt(i)})]})}function Dt({agent:e,severityCounts:t,trendPoints:n}){let r=e.scores,i=e.lastTask?.timestamp?L(e.lastTask.timestamp):``,a=Le(e.id),o=Tt(r);return(0,R.jsxs)(`a`,{href:`/dashboard/agent/${encodeURIComponent(e.id)}`,className:`group relative block rounded-lg border border-border p-3 transition-all hover:-translate-y-0.5 hover:border-[color-mix(in_oklch,var(--ink)_30%,transparent)]`,style:{background:`var(--surface-elev)`},children:[(0,R.jsx)(`div`,{style:{position:`absolute`,top:10,right:12,zIndex:1},children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-sm border border-border/60 px-2 py-0.5`,style:{background:`color-mix(in oklch, var(--surface) 60%, transparent)`,color:`var(--ink-2)`,fontFamily:`Geist, Inter, sans-serif`,fontSize:11,fontVariant:`small-caps`,letterSpacing:`0.04em`},"data-tooltip":o.tooltip,"data-tooltip-pos":`bottom`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,style:{width:7,height:7,borderRadius:`50%`,background:o.dotColor,flexShrink:0}}),o.label]})}),(0,R.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr`,gap:12,alignItems:`stretch`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`space-between`,gap:8,paddingBottom:2},children:[(0,R.jsx)(ft,{accuracy:r.accuracy,size:90,color:a}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:4,width:`100%`},children:[(0,R.jsx)(ht,{counts:t}),(0,R.jsx)(`span`,{style:{fontSize:10,color:`var(--ink-3)`,fontFamily:`Geist, Inter, sans-serif`,fontVariant:`small-caps`,letterSpacing:`0.04em`},children:`severity mix`})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,minWidth:0},children:[(0,R.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:(0,R.jsx)(`div`,{style:{minWidth:0,flex:1},children:(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{className:`truncate`,style:{fontFamily:`Geist, Inter, sans-serif`,fontSize:14,fontWeight:600,color:`var(--ink)`,minWidth:0,flex:1},children:e.id}),(()=>{let e=St(r);return e===`benched`?(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm bg-bad/10 px-1 py-0.5 font-mono text-[8px] font-bold text-bad`,"aria-label":`Benched (${r.bench.reason??`auto`}). Excluded from dispatch until recovery.`,"data-tooltip":`Benched (${r.bench.reason??`auto`}). Excluded from dispatch until recovery.`,children:`BENCHED`}):e===`struggling`?(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified`,"aria-label":`Struggling: consecutive failures tripped the circuit breaker.`,"data-tooltip":`Struggling: consecutive failures tripped the circuit breaker.`,children:`STRUGGLING`}):e===`kept-for-coverage`?(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm border border-unverified/40 bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified`,"aria-label":`Would bench (${r.bench.reason??`rule`}), but kept as sole provider of a category.`,"data-tooltip":`Would bench (${r.bench.reason??`rule`}), but kept as sole provider of a category.`,children:`KEPT`}):null})()]})})}),(0,R.jsxs)(`div`,{className:`rounded-md border border-border/30 px-2 py-2 space-y-1.5`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`},children:[(0,R.jsx)(Et,{label:`unique`,value:r.uniqueness,color:a,tooltip:`Uniqueness ${wt(r.uniqueness)}\nFindings others missed.`}),(0,R.jsx)(Et,{label:`impact`,value:r.impactScore,color:a,tooltip:`Impact ${wt(r.impactScore)}\nSeverity-weighted findings.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[n&&n.length>0&&(0,R.jsx)(`div`,{style:{width:`100%`},children:(0,R.jsx)(xt,{points:n,width:240,height:28,color:a})}),(0,R.jsxs)(`div`,{style:{fontFamily:`Geist, Inter, sans-serif`,fontSize:11,color:`var(--ink-3)`,display:`flex`,alignItems:`center`,gap:4},children:[(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[r.signals,` signals`]}),i&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{style:{opacity:.5},children:`·`}),(0,R.jsx)(`span`,{children:i})]})]})]})]})]})]})}function Ot({agents:e,highlightedAgentId:t,severityMap:n,trendByAgent:r}){let i=[...e].sort((e,t)=>{let n=e.lastTask?.timestamp??``,r=t.lastTask?.timestamp??``;if(n!==r)return r.localeCompare(n);let i=e.scores?.signals||0,a=t.scores?.signals||0;return i===a?e.id.localeCompare(t.id):a-i}),a=i.slice(0,4),o=i.length>4;return(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`h-section`,children:[`Team `,(0,R.jsx)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:e.length})]}),o&&(0,R.jsx)(`a`,{href:`/dashboard/team`,className:`text-xs transition hover:[color:var(--accent)]`,style:{color:`var(--text-dim)`},children:`view all`})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:a.map(e=>(0,R.jsx)(`div`,{style:{borderRadius:`0.5rem`,outline:e.id===t?`2px solid var(--border-strong)`:void 0,transition:`outline-color 200ms cubic-bezier(0.4,0,0.2,1)`},children:(0,R.jsx)(Dt,{agent:e,severityCounts:n?.get(e.id),trendPoints:r?.get(e.id)})},e.id))})]})}function kt(e){let t=e.toLowerCase();return t===`completed`||t===`done`||t===`success`||t===`succeeded`?`completed`:t===`running`||t===`active`||t===`in_progress`||t===`pending`?`running`:t===`failed`||t===`error`||t===`errored`||t===`timeout`||t===`timed_out`?`failed`:t===`cancelled`||t===`canceled`||t===`queued`||t===`waiting`?`cancelled`:`unknown`}var At={completed:{label:`Done`,iconBox:`bg-confirmed/10 border-confirmed/30`,text:`text-confirmed`,pulse:!1},running:{label:`Running`,iconBox:`bg-unverified/10 border-unverified/30`,text:`text-unverified`,pulse:!0},failed:{label:`Failed`,iconBox:`bg-bad/10 border-bad/30`,text:`text-bad`,pulse:!1},cancelled:{label:`Cancelled`,iconBox:`border-muted-foreground/25`,text:``,textStyle:{color:`var(--text-dim)`,background:`color-mix(in oklch, var(--text-dim) 10%, transparent)`},pulse:!1},unknown:{label:`Unknown`,iconBox:`border-muted-foreground/25`,text:``,textStyle:{color:`var(--text-dim)`,background:`color-mix(in oklch, var(--text-dim) 10%, transparent)`},pulse:!1}},jt={completed:(0,R.jsx)(`polyline`,{points:`5 12 10 17 19 7`}),running:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`,fill:`currentColor`,stroke:`none`}),(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`,opacity:`0.45`})]}),failed:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`}),(0,R.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`})]}),cancelled:(0,R.jsx)(`line`,{x1:`6`,y1:`12`,x2:`18`,y2:`12`}),unknown:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7`}),(0,R.jsx)(`line`,{x1:`12`,y1:`16.5`,x2:`12`,y2:`16.5`})]})},Mt=8;function Nt(e){return e.length>8?e.slice(0,8):e}function Pt({tasks:e,limit:t=Mt}){let n=e.items.slice(0,t),r=e.items.length>t;return(0,R.jsxs)(`section`,{className:`flex h-full flex-col`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`h-section`,children:[`Tasks `,(0,R.jsx)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:e.total})]}),r&&(0,R.jsx)(`a`,{href:`/dashboard/tasks`,className:`font-mono text-xs transition`,style:{color:`var(--text-dim)`},children:`view all`})]}),(0,R.jsx)(`div`,{className:`flex-1 rounded-md border border-border/40`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:n.length===0?(0,R.jsx)(Be,{title:`No tasks yet`,hint:`Dispatch with gossip_run to populate this view.`}):n.map((e,t)=>{let n=kt(e.status),r=At[n],i=Re(e.agentId);return(0,R.jsxs)(`div`,{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${t>0?`border-t border-border/20`:``}`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border ${r.iconBox} ${r.text} ${r.pulse?`animate-pulse motion-reduce:animate-none`:``}`,style:r.textStyle,"aria-label":`Status: ${r.label}`,"data-tooltip":r.label,children:(0,R.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:jt[n]})}),(0,R.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold`,style:{background:`color-mix(in oklch, var(--surface) 60%, transparent)`,color:`var(--text-dim)`},"data-tooltip":e.taskId,children:Nt(e.taskId)}),i&&(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${i.cls}`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,...i.clsStyle},"data-tooltip":e.agentId,children:i.label}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug`,style:{color:`var(--text)`},children:e.task}),(0,R.jsx)(`span`,{className:`mt-0.5 shrink-0 font-mono text-[10px] font-normal`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:e.agentId}),(0,R.jsx)(`span`,{className:`mt-0.5 shrink-0 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:L(e.timestamp)})]},e.taskId)})})]})}function Ft({message:e,className:t}){return(0,R.jsxs)(`span`,{role:`alert`,className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${t??``}`,style:{color:`var(--bad)`,background:`color-mix(in oklch, var(--bad) 12%, transparent)`,border:`1px solid color-mix(in oklch, var(--bad) 30%, transparent)`},children:[(0,R.jsx)(`span`,{"aria-hidden":!0,style:{fontWeight:700},children:`!`}),(0,R.jsxs)(`span`,{children:[`error · `,e]})]})}var It={agreement:`confirmed`,consensus_verified:`confirmed`,unique_confirmed:`unique`,unique_unconfirmed:`unique?`,disagreement:`disputed`,hallucination_caught:`hallucination`,new_finding:`new`,unverified:`unverified`},Lt={agreement:`var(--ok)`,consensus_verified:`var(--ok)`,disagreement:`var(--bad)`,hallucination_caught:`var(--bad)`,unique_confirmed:`var(--unique)`,unique_unconfirmed:`var(--warn)`,new_finding:`var(--unique)`,unverified:`var(--info)`},Rt={critical:`var(--bad)`,high:`var(--warn)`,medium:`var(--severity-medium)`,low:`var(--ink-3)`};function zt(e,t){return e?e.length>t?e.slice(0,t-1)+`…`:e:``}function Bt(e){return e.split(/(`[^`]+`)/g).map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,R.jsx)(`code`,{style:{background:`color-mix(in oklch, var(--ink) 6%, transparent)`,padding:`0 4px`,borderRadius:3,fontFamily:`var(--font-mono)`,fontSize:12,color:`var(--ink)`},children:e.slice(1,-1)},t):(0,R.jsx)(`span`,{children:e},t))}function Vt(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null);(0,_.useEffect)(()=>{z(`signals?limit=7`).then(e=>t(e.items??[])).catch(e=>r(String(e?.message??e)))},[]);let i=e?e.filter(e=>Date.now()-Date.parse(e.timestamp)<36e5).length:0;return(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,R.jsx)(`h3`,{className:`h-section`,children:`Signal stream`}),(0,R.jsxs)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--info)`,visibility:i===0?`hidden`:`visible`},children:[`+`,i,` in last hour`]})]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>x(`/signals`),className:`font-mono text-[11px] hover:underline`,style:{color:`var(--text-dim)`},children:`all signals →`}),n&&(0,R.jsx)(Ft,{message:n,className:`ml-2`})]}),(0,R.jsxs)(`div`,{className:`rounded-lg border border-border`,style:{background:`var(--surface-elev)`},children:[!n&&e===null&&(0,R.jsx)(`div`,{"aria-busy":`true`,children:(0,R.jsxs)(`table`,{className:`w-full`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,R.jsx)(`th`,{className:`py-2 pl-4 pr-3`,style:{width:80},children:(0,R.jsx)(`div`,{className:`h-2 w-8 rounded`,style:{background:`var(--border)`,opacity:.4}})}),(0,R.jsx)(`th`,{className:`py-2 pr-3`,style:{width:160},children:(0,R.jsx)(`div`,{className:`h-2 w-12 rounded`,style:{background:`var(--border)`,opacity:.4}})}),(0,R.jsx)(`th`,{className:`py-2 pr-3`,style:{width:180},children:(0,R.jsx)(`div`,{className:`h-2 w-10 rounded`,style:{background:`var(--border)`,opacity:.4}})}),(0,R.jsx)(`th`,{className:`py-2 pr-4`,children:(0,R.jsx)(`div`,{className:`h-2 w-14 rounded`,style:{background:`var(--border)`,opacity:.4}})})]})}),(0,R.jsx)(`tbody`,{children:Array.from({length:5}).map((e,t)=>(0,R.jsxs)(`tr`,{className:`border-b border-border/40 last:border-b-0`,children:[(0,R.jsx)(`td`,{className:`py-2.5 pl-4 pr-3`,children:(0,R.jsx)(`div`,{className:`h-2.5 w-10 rounded`,style:{background:`var(--border)`,opacity:.4}})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{style:{width:3,height:14,background:`var(--border)`,opacity:.4,borderRadius:1,flexShrink:0}}),(0,R.jsx)(`div`,{className:`h-2.5 w-14 rounded`,style:{background:`var(--border)`,opacity:.4}})]})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,R.jsx)(`div`,{className:`h-2.5 w-24 rounded`,style:{background:`var(--border)`,opacity:.4}})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-4`,children:(0,R.jsx)(`div`,{className:`h-2.5 rounded`,style:{background:`var(--border)`,opacity:.4,width:`75%`}})})]},t))})]})}),!n&&e&&e.length===0&&(0,R.jsx)(`p`,{className:`px-4 py-3 text-xs`,style:{color:`var(--text-dim)`},children:`no signals recorded`}),n&&(!e||e.length===0)&&(0,R.jsx)(`p`,{className:`px-4 py-3 text-xs`,style:{color:`var(--text-dim)`},children:`no cached signals to display`}),e&&e.length>0&&(0,R.jsxs)(`table`,{className:`w-full`,style:n?{opacity:.5}:void 0,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,R.jsx)(`th`,{className:`h-section py-2 pl-4 pr-3 text-left`,style:{fontSize:10,width:80},children:`time`}),(0,R.jsx)(`th`,{className:`h-section py-2 pr-3 text-left`,style:{fontSize:10,width:160},children:`verdict`}),(0,R.jsx)(`th`,{className:`h-section py-2 pr-3 text-left`,style:{fontSize:10,width:180},children:`agent`}),(0,R.jsx)(`th`,{className:`h-section py-2 pr-4 text-left`,style:{fontSize:10},children:`finding`})]})}),(0,R.jsx)(`tbody`,{children:e.map((e,t)=>{let n=e.severity?Rt[e.severity]:`transparent`,r=Lt[e.signal]??`var(--ink-2)`,i=It[e.signal]??e.signal;return(0,R.jsxs)(`tr`,{className:`border-b border-border/40 last:border-b-0`,children:[(0,R.jsx)(`td`,{className:`py-2.5 pl-4 pr-3 align-middle font-mono text-[12px] tabular-nums`,style:{color:`var(--text-dim)`},children:L(e.timestamp)}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3 align-middle`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{role:`img`,"aria-label":e.severity?`severity: ${e.severity}`:`severity: unspecified`,style:{display:`inline-block`,width:3,height:14,background:n,borderRadius:1,flexShrink:0},title:e.severity??``}),(0,R.jsx)(`span`,{className:`h-section truncate`,style:{color:r,fontSize:11},title:i,children:i})]})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3 align-middle font-mono text-[12px]`,style:{color:`var(--text-dim)`},children:(0,R.jsx)(`span`,{className:`truncate`,children:e.agentId})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-4 align-middle text-[12px]`,style:{color:`var(--text)`,lineHeight:1.45},children:Bt(zt(e.evidence??``,120))})]},`${e.timestamp}-${t}`)})})]})]})]})}var Ht=[{key:`passed`,label:`passed`,color:`var(--ok)`},{key:`pending`,label:`pending`,color:`var(--info)`},{key:`insufficient_evidence`,label:`insufficient`,color:`var(--idle)`},{key:`inconclusive`,label:`inconclusive`,color:`var(--warn)`},{key:`silent_skill`,label:`silent`,color:`var(--ink-3)`},{key:`failed`,label:`failed`,color:`var(--bad)`}];function Ut({overview:e}){let t=e?.skillVerdictSummary,n=t?Ht.reduce((e,n)=>e+(t[n.key]??0),0):0;return(0,R.jsxs)(`section`,{className:`rounded-lg border border-border p-4`,style:{background:`var(--surface-elev)`},children:[(0,R.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between`,children:[(0,R.jsx)(`h3`,{className:`h-section`,children:`Skill Verdicts`}),(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:[n,` total`]})]}),!t||n===0?(0,R.jsx)(`p`,{className:`font-mono text-[11px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:`no skill verdicts yet`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`mb-3 flex h-2 w-full gap-px overflow-hidden rounded-sm`,style:{background:`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`},children:Ht.map(e=>{let r=t[e.key]??0;return r===0?null:(0,R.jsx)(`div`,{style:{width:`${r/n*100}%`,background:e.color},title:`${e.label}: ${r}`},e.key)})}),(0,R.jsx)(`ul`,{className:`grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]`,children:Ht.map(e=>{let n=t[e.key]??0,r=n===0;return(0,R.jsxs)(`li`,{className:`flex items-center gap-1.5 ${r?`opacity-40`:``}`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full`,style:{background:e.color}}),(0,R.jsx)(`span`,{style:{color:`var(--text-dim)`},children:e.label}),(0,R.jsx)(`span`,{className:`ml-auto tabular-nums`,style:r?{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`}:{color:e.color},children:n})]},e.key)})})]})]})}var Wt=1,Gt=2,Kt=5;function qt({curve:e,threshold:t,stroke:n,width:r=140,height:i=30}){let a=(0,_.useMemo)(()=>Yt(e),[e]),o=a.reduce((e,t)=>e+t.length,0);if(e.length===0||o<Kt)return(0,R.jsx)(Jt,{width:r,height:i,threshold:t});let s=r-Wt*2,c=i-Gt*2,l=Gt+(1-Xt(t))*c,u=t=>e.length<=1?Wt+s/2:Wt+t/(e.length-1)*s,d=e=>Gt+(1-Xt(e))*c;return(0,R.jsxs)(`svg`,{width:r,height:i,viewBox:`0 0 ${r} ${i}`,"aria-hidden":!0,style:{display:`block`},children:[(0,R.jsx)(`line`,{x1:Wt,x2:r-Wt,y1:l,y2:l,stroke:`var(--ink-4)`,strokeWidth:1,strokeDasharray:`2 3`,opacity:.7}),a.map((e,t)=>{if(e.length===1){let{idx:r,value:i}=e[0];return(0,R.jsx)(`circle`,{className:`skill-spark-curve`,cx:u(r),cy:d(i),r:1.4,fill:n},t)}return(0,R.jsx)(`path`,{className:`skill-spark-curve`,d:e.map((e,t)=>`${t===0?`M`:`L`} ${u(e.idx).toFixed(2)} ${d(e.value).toFixed(2)}`).join(` `),fill:`none`,stroke:n,strokeWidth:1.5,strokeLinejoin:`round`,strokeLinecap:`round`},t)})]})}function Jt({width:e,height:t,threshold:n}){let r=t-Gt*2,i=n===void 0?t/2:Gt+(1-Xt(n))*r;return(0,R.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,"aria-hidden":!0,style:{display:`block`},children:(0,R.jsx)(`line`,{x1:Wt,x2:e-Wt,y1:i,y2:i,stroke:`var(--ok)`,strokeWidth:1,strokeDasharray:`2 2`,opacity:.4})})}function Yt(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r].value;if(i==null||!Number.isFinite(i)){n.length>0&&(t.push(n),n=[]);continue}n.push({idx:r,value:i})}return n.length>0&&t.push(n),t}function Xt(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var Zt={passed:`var(--ok)`,pending:`var(--info)`,insufficient_evidence:`var(--idle)`,inconclusive:`var(--warn)`,silent_skill:`var(--ink-3)`,failed:`var(--bad)`,flagged_for_manual_review:`var(--warn)`},Qt={passed:`passed`,pending:`pending`,insufficient_evidence:`insufficient`,inconclusive:`inconclusive`,silent_skill:`silent`,failed:`failed`,flagged_for_manual_review:`flagged`},$t={failed:0,flagged_for_manual_review:1,inconclusive:2,insufficient_evidence:3,passed:4,pending:5,silent_skill:6},en=`var(--ink-3)`;function tn(e){return e!=null&&e in Zt}function nn({skills:e,loading:t,error:n}){let{known:r,unknown:i,total:a,transitions:o}=(0,_.useMemo)(()=>an(e?.effectiveness),[e]);return(0,R.jsxs)(`section`,{className:`space-y-2`,children:[(0,R.jsxs)(`header`,{className:`flex items-baseline justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`h3`,{className:`h-section`,children:`skill graduation`}),(0,R.jsx)(`span`,{className:`font-mono text-[11px] tabular-nums font-medium`,style:{color:`var(--ink)`,fontFamily:`'JetBrains Mono', monospace`},children:a}),(0,R.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--ink-3)`,fontFamily:`Geist, var(--font-sans)`},children:[`skills · `,o,` transitions /24h`]})]}),(0,R.jsx)(`a`,{href:b(`/`),className:`text-[11px] transition hover:underline`,style:{color:`var(--ink-3)`,fontFamily:`Geist, var(--font-sans)`},children:`skill detail →`}),n&&(0,R.jsx)(Ft,{message:n,className:`ml-2`})]}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-4`,style:{background:`var(--surface-sunk)`,borderColor:`var(--border)`},children:[(0,R.jsx)(`p`,{className:`mb-3 text-[11px]`,style:{color:`var(--ink-3)`,fontFamily:`Geist, var(--font-sans)`},children:`Top: frozen verdict + stored basis. Bottom: live 7d activity. Dashed line = graduation threshold.`}),t&&!e&&(0,R.jsx)(cn,{}),!t&&a===0&&!n&&(0,R.jsx)(`p`,{className:`text-[12px]`,style:{color:`var(--ink-3)`,fontFamily:`Geist, var(--font-sans)`},children:`No skills bound yet — agents need at least one dispatch with a skill match.`}),a>0&&(0,R.jsx)(`ul`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6`,style:n?{opacity:.5}:void 0,children:r.map(e=>(0,R.jsx)(on,{entry:e},rn(e)))}),i.length>0&&(0,R.jsxs)(`details`,{className:`mt-4 group`,children:[(0,R.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 select-none`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`chevron inline-block transition-transform`,style:{fontSize:`10px`,lineHeight:1},children:`▶`}),(0,R.jsxs)(`span`,{className:`text-[11px]`,style:{fontVariant:`small-caps`,letterSpacing:`0.04em`,fontFamily:`Geist, var(--font-sans)`,fontWeight:600},children:[i.length,` unknown`]})]}),(0,R.jsx)(`ul`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6`,children:i.map(e=>(0,R.jsx)(on,{entry:e},rn(e)))}),(0,R.jsx)(`style`,{children:`
16
+ details[open] > summary > .chevron { transform: rotate(90deg); }
17
+ `})]})]})]})}function rn(e){return`${e.agentId}::${e.skill}`}function an(e){if(!e)return{known:[],unknown:[],total:0,transitions:0};let t=[],n=[],r=0;for(let i of e)if(tn(i.status)?t.push(i):n.push(i),i.curve.length>=2){let e=i.curve.slice(-2),t=e.filter(e=>e.value!=null&&e.value>=i.threshold).length,n=e.filter(e=>e.value!=null&&e.value<i.threshold).length;t>=1&&n>=1&&r++}return t.sort((e,t)=>{let n=tn(e.status)?$t[e.status]:99,r=tn(t.status)?$t[t.status]:99;return n===r?e.skill.localeCompare(t.skill):n-r}),n.sort((e,t)=>e.skill.localeCompare(t.skill)),{known:t,unknown:n,total:t.length+n.length,transitions:r}}function on({entry:e}){let t=tn(e.status)?e.status:null,n=t?Zt[t]:en,r=t?Qt[t]:e.status??`unknown`,i=typeof e.storedEffectiveness==`number`?e.storedEffectiveness:null,a=i===null?null:Math.round(i*100),o=e.verdictAt?sn(e.verdictAt):null,s=e.liveRecovered===!0;return(0,R.jsxs)(`li`,{className:`flex flex-col rounded-lg border`,style:{background:`var(--surface-elev)`,borderColor:`var(--border)`},title:`${e.agentId} · ${e.skill} · ${r} · N=${e.n}`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-t-lg px-2.5 pt-2.5 pb-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{className:`truncate text-[12px] font-medium leading-tight`,style:{color:`var(--ink)`,fontFamily:`Geist, var(--font-sans)`},children:e.skill}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full`,style:{backgroundColor:Le(e.agentId)}}),(0,R.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--ink-3)`,fontFamily:`'JetBrains Mono', monospace`},children:e.agentId})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold`,style:{color:n,background:`color-mix(in oklch, ${n} 12%, transparent)`,border:`1px solid color-mix(in oklch, ${n} 25%, transparent)`,fontVariant:`small-caps`,letterSpacing:`0.04em`,fontFamily:`Geist, var(--font-sans)`},children:r}),s&&(0,R.jsx)(`span`,{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium`,style:{color:`var(--ok)`,background:`var(--ok-soft)`,border:`1px solid color-mix(in oklch, var(--ok) 25%, transparent)`,fontFamily:`Geist, var(--font-sans)`,letterSpacing:`0.02em`},title:`Live 7d signals show recovery above threshold — but the stored verdict is frozen. Re-test to graduate.`,children:`recovered · re-test pending`})]}),(a!==null||o)&&(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1.5 flex-wrap`,children:[a!==null&&(0,R.jsxs)(`span`,{className:`text-[10px] tabular-nums`,style:{color:a<0&&(t===`failed`||t===`flagged_for_manual_review`)?`var(--bad)`:a>0?`var(--ok)`:`var(--ink-3)`,fontFamily:`'JetBrains Mono', monospace`},title:`Stored effectiveness delta: ${a>0?`+`:``}${a}pp (basis for this verdict)`,children:[a>0?`+`:``,a,`pp`]}),a!==null&&(0,R.jsxs)(`span`,{className:`text-[10px]`,style:{color:`var(--ink-3)`,fontFamily:`Geist, var(--font-sans)`},children:[`vs `,e.threshold.toFixed(2)]}),o&&(0,R.jsx)(`span`,{className:`text-[10px] tabular-nums`,style:{color:`var(--ink-3)`,fontFamily:`'JetBrains Mono', monospace`},title:`Verdict as of: ${e.verdictAt}`,children:o})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`span`,{className:`text-[10px]`,style:{color:`var(--ink-3)`,fontVariant:`small-caps`,letterSpacing:`0.04em`,fontFamily:`Geist, var(--font-sans)`,fontWeight:600},children:`live 7d`}),(0,R.jsxs)(`span`,{className:`text-[10px] tabular-nums`,style:{color:`var(--ink-3)`,fontFamily:`'JetBrains Mono', monospace`},title:`Total post-bind signals in the 7d window`,children:[`N=`,(0,R.jsx)(`span`,{style:{color:`var(--ink)`},children:e.n})]})]}),(0,R.jsx)(qt,{curve:e.curve,threshold:e.threshold,stroke:Le(e.agentId),width:120,height:28})]})]})}function sn(e){try{let t=new Date(e);if(!Number.isFinite(t.getTime()))return null;let n=new Date,r=t.getFullYear()===n.getFullYear(),i=t.toLocaleString(`en-US`,{month:`short`}),a=t.getDate();return r?`${i} ${a}`:`${i} ${a} '${String(t.getFullYear()).slice(-2)}`}catch{return null}}function cn(){return(0,R.jsx)(`ul`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6`,"aria-hidden":!0,children:Array.from({length:6}).map((e,t)=>(0,R.jsxs)(`li`,{className:`flex flex-col rounded-lg border`,style:{borderColor:`var(--border)`,background:`var(--surface-elev)`,minHeight:`120px`},children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5 px-2.5 pt-2.5 pb-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,R.jsx)(`span`,{className:`h-3 w-3/4 rounded-sm`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`}}),(0,R.jsx)(`span`,{className:`h-2 w-1/3 rounded-sm`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`}}),(0,R.jsx)(`span`,{className:`h-2.5 w-1/2 rounded-sm`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`}}),(0,R.jsx)(`span`,{className:`h-5 w-16 rounded-full`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`}})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5`,children:[(0,R.jsx)(`span`,{className:`h-2.5 w-10 rounded-sm`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`}}),(0,R.jsx)(`span`,{className:`h-7 w-full rounded-sm`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`}})]})]},t))})}function ln(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}var un=class{s;constructor(e){this.s=e}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(e,t){return e+this.next()*(t-e)}};function dn(e,t){return`rgba(${parseInt(e.slice(1,3),16)},${parseInt(e.slice(3,5),16)},${parseInt(e.slice(5,7),16)},${Math.max(0,Math.min(1,t))})`}function fn(e){return Math.min(1.4,(Math.max(0,e)/2e3)**.55)}var pn=class{ctx;size;accuracy;uniqueness;impact;colorHex;time=0;variant;scale;exp;particles=[];baseRotation;armSeeds;binaryCenters;jetAxis;tailAngle;constructor(e,t,n,r,i,a,o=.5){let s=e.getContext(`2d`);if(!s)throw Error(`Canvas 2D context unavailable`);this.ctx=s,this.size=e.width/2,this.accuracy=Math.max(0,Math.min(1,r)),this.uniqueness=Math.max(0,Math.min(1,i)),this.impact=Math.max(0,Math.min(1,o)),this.colorHex=a;let c=ln(t);this.variant=c%12;let l=new un(c),u=fn(n);this.exp=u,this.scale=.2+u*.95;let d=Math.max(3,Math.round(4+u*180));this._buildVariant(l,d),this.baseRotation=l.next()*Math.PI*2}_buildVariant(e,t){let n=this.variant;if(n===0){this.armSeeds=[];for(let t=0;t<2;t++)this.armSeeds.push(e.next()*Math.PI*2);for(let n=0;n<t;n++){let t=n%2,r=e.next(),i=this.armSeeds[t]+r*Math.PI*2.4+e.range(-.04,.04)*Math.PI*2,a=(.08+r*.38)*this.size*this.scale;this.particles.push(this._mkParticle(e,a,i,1,1))}}else if(n===1)for(let n=0;n<t;n++){let t=e.range(.34,.42)*this.size*this.scale,n=e.next()*Math.PI*2;this.particles.push(this._mkParticle(e,t,n,1,1))}else if(n===2){let n=[.16,.28,.42];for(let r=0;r<t;r++){let t=(n[r%3]+e.range(-.015,.015))*this.size*this.scale,i=e.next()*Math.PI*2;this.particles.push(this._mkParticle(e,t,i,1,1))}}else if(n===3){let n=.18*this.size*this.scale;this.binaryCenters=[{x:-n,y:0},{x:n,y:0}];for(let n=0;n<t;n++){let t=n%2,r=e.range(.04,.22)*this.size*this.scale,i=e.next()*Math.PI*2,a=this._mkParticle(e,r,i,1,1);a.binaryCore=t,a.angularVelocity*=t===0?1:-1,this.particles.push(a)}}else if(n===4)for(let n=0;n<t;n++){let t=e.range(.05,.32)*this.size*this.scale,n=e.next()*Math.PI*2,r=e.range(.7,1.3),i=e.range(.7,1.3),a=this._mkParticle(e,t,n,r,i);a.orbitTilt=e.range(0,Math.PI),this.particles.push(a)}else if(n===5){this.jetAxis=e.next()*Math.PI*2;let n=Math.floor(t*.7),r=t-n;for(let t=0;t<n;t++){let n=t%2==0?1:-1,r=e.next(),i=e.range(-.18,.18),a=this._mkParticle(e,r*.44*this.size*this.scale,0,1,1);a.jetSide=n,a.jetProgress=r,a.jetSpread=i,a.jetSpeed=e.range(.15,.35)*.001,a.size=e.range(.6,1.4),this.particles.push(a)}for(let t=0;t<r;t++){let t=e.range(.35,.42)*this.size*this.scale,n=e.next()*Math.PI*2,r=this._mkParticle(e,t,n,1,1);r.isDisk=!0,r.brightness*=.35,this.particles.push(r)}}else if(n===6)for(let n=0;n<t;n++){let t=e.next()*Math.PI*2,n=e.range(.05,.45)*this.size*this.scale,r=this._mkParticle(e,n,t,1,1);r.isNebula=!0,r.driftAngle=e.next()*Math.PI*2,r.driftSpeed=e.range(6e-4,.0014),r.driftPhase=e.next()*Math.PI*2,r.size=e.range(.8,2.2),r.brightness*=.6,this.particles.push(r)}else if(n===7){this.tailAngle=e.next()*Math.PI*2;let n=.1*this.size*this.scale,r=Math.floor(t*.3);for(let t=0;t<r;t++){let t=e.range(0,n),r=e.next()*Math.PI*2,i=this._mkParticle(e,t,r,1,1);i.size=e.range(.8,1.8),this.particles.push(i)}let i=t-r;for(let t=0;t<i;t++){let t=e.next(),r=n+t*.26*this.size*this.scale,i=(1-t*.5)*e.range(-.05,.05)*this.size*this.scale,a=this._mkParticle(e,0,0,1,1);a.isComet=!0,a.cometTailDist=r,a.cometPerp=i,a.cometT=t,a.brightness*=1-t*.6,a.size=(1-t*.5)*e.range(.6,1.2),this.particles.push(a)}}else if(n===8)for(let n=0;n<t;n++){let t=n%3,r=e.range(.3,.42)*this.size*this.scale,i=e.next()*Math.PI*2,a=this._mkParticle(e,r,i,1,1);a.gyroPlane=t,a.gyroAxis=t===0?`z`:t===1?`x`:`y`,this.particles.push(a)}else if(n===9)for(let n=0;n<t;n++){let t=e.range(.06,.42)*this.size*this.scale,n=t/(.42*this.size*this.scale)*4*Math.PI+e.range(-.2,.2),r=this._mkParticle(e,t,n,1,1);r.isMaelstrom=!0,this.particles.push(r)}else if(n===10)for(let n=0;n<t;n++){let r=n/t,i=e.range(.35,.4)*this.size*this.scale,a=r*Math.PI*2+e.range(-.03,.03),o=this._mkParticle(e,i,a,1,1);o.ouroT=r,this.particles.push(o)}else for(let n=0;n<t;n++){let t=n%2,r=e.next(),i=this._mkParticle(e,0,0,1,1);i.isHelix=!0,i.helixStrand=t,i.helixT=r,i.helixSpeed=e.range(.3,.6)*.001,this.particles.push(i)}}_mkParticle(e,t,n,r,i){let a=8e-4+(.42*this.size-t)*4e-5,o=e.next()*Math.PI*2,s=e.range(.05,.3)*this.size;return{baseRadius:t,angle:n,angularVelocity:a*(e.next()>.5?1:.85),size:e.range(.5,1.8),brightness:e.range(.4,1),wobblePhase:e.next()*Math.PI*2,wobbleSpeed:e.range(.5,1.2),ellipX:r,ellipY:i,orbitTilt:0,binaryCore:0,chaosX:Math.cos(o)*s,chaosY:Math.sin(o)*s,chaosDriftPhase:e.next()*Math.PI*2,chaosDriftSpeed:e.range(3e-4,8e-4)}}update(e){this.time+=e}draw(){let{ctx:e,size:t,time:n,accuracy:r,uniqueness:i,impact:a,colorHex:o,variant:s}=this,c=t/2,l=t/2;e.clearRect(0,0,t,t);let u=.4+this.exp*.6,d=r*u,f=i*u,p=a*u,m=.2+d*.8,h=.3+p*1.9,g=f,_=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),v=1-_,y=e.createRadialGradient(c,l,0,c,l,t*.45);if(y.addColorStop(0,dn(o,.05*m)),y.addColorStop(.4,dn(o,.015)),y.addColorStop(1,`transparent`),e.fillStyle=y,e.fillRect(0,0,t,t),s===0&&this.armSeeds){let r=n*5e-4*h;for(let n of this.armSeeds){let i=n+r;e.beginPath();for(let n=0;n<1;n+=.02){let r=i+n*Math.PI*2.4,a=(.08+n*.38)*t*this.scale,o=c+Math.cos(r)*a,s=l+Math.sin(r)*a;n===0?e.moveTo(o,s):e.lineTo(o,s)}e.strokeStyle=dn(o,.12*m),e.lineWidth=1,e.stroke()}}for(let r of this.particles){let i=Math.sin(n*r.wobbleSpeed*.001+r.wobblePhase)*1.2,u=r.baseRadius+i,d=r.angle+n*r.angularVelocity*h,f,p;if(s===3&&this.binaryCenters){let e=this.binaryCenters[r.binaryCore];f=c+e.x+Math.cos(d)*u,p=l+e.y+Math.sin(d)*u}else if(s===4){let e=Math.cos(r.orbitTilt),t=Math.sin(r.orbitTilt),n=Math.cos(d)*u*r.ellipX,i=Math.sin(d)*u*r.ellipY;f=c+n*e-i*t,p=l+n*t+i*e}else if(s===5&&r.jetSide!==void 0&&!r.isDisk&&this.jetAxis!==void 0){let e=(r.jetProgress+n*r.jetSpeed*h)%1,i=e*.44*t*this.scale,a=this.jetAxis+Math.PI/2;f=c+Math.cos(this.jetAxis)*i*r.jetSide+Math.cos(a)*r.jetSpread*i,p=l+Math.sin(this.jetAxis)*i*r.jetSide+Math.sin(a)*r.jetSpread*i,r._fadeMul=Math.sin(e*Math.PI)*.9+.1}else if(s===6&&r.isNebula){let e=n*r.driftSpeed*h,t=Math.sin(e+r.driftPhase)*2;f=c+Math.cos(r.angle+e*.3)*u+Math.cos(r.driftAngle)*t,p=l+Math.sin(r.angle+e*.3)*u+Math.sin(r.driftAngle)*t}else if(s===7&&r.isComet&&this.tailAngle!==void 0){let e=(r.cometT+n*3e-4*h)%1,i=r.cometTailDist+e*.06*t*this.scale,a=this.tailAngle+Math.PI/2;f=c+Math.cos(this.tailAngle)*i+Math.cos(a)*r.cometPerp,p=l+Math.sin(this.tailAngle)*i+Math.sin(a)*r.cometPerp}else if(s===8&&r.gyroAxis){let e=n*1e-4*h;r.gyroAxis===`z`?(f=c+Math.cos(d)*u,p=l+Math.sin(d)*u*.3):r.gyroAxis===`x`?(f=c+Math.cos(d)*u*.3+Math.sin(e)*u*.1,p=l+Math.sin(d)*u):(f=c+Math.sin(d+e)*u*.6,p=l+Math.cos(d+e)*u*.8)}else if(s===9){let e=(n*5e-4*h+r.wobblePhase)%1,t=u*(1-e*.85);f=c+Math.cos(d)*t,p=l+Math.sin(d)*t,r._fadeMul=1-e}else if(s===10&&r.ouroT!==void 0){let e=(r.ouroT+n*3e-4*h)%1,t=e*Math.PI*2;f=c+Math.cos(t)*u,p=l+Math.sin(t)*u,r._fadeMul=.3+(Math.cos(e*Math.PI*2)*.5+.5)*.9}else if(s===11&&r.helixT!==void 0){let e=(r.helixT+n*r.helixSpeed*h)%1,i=(e-.5)*.65*t*this.scale,a=r.helixStrand===0?0:Math.PI,o=.15*t*this.scale;f=c+Math.sin(e*Math.PI*3+a)*o,p=l+i,r._fadeMul=.4+(Math.cos(e*Math.PI*3+a)+1)/2*.6}else f=c+Math.cos(d)*u*r.ellipX,p=l+Math.sin(d)*u*r.ellipY;if(v>.01){let e=n*r.chaosDriftSpeed,t=Math.cos(e+r.chaosDriftPhase)*2,i=Math.sin(e*1.13+r.chaosDriftPhase)*2,a=c+r.chaosX+t,o=l+r.chaosY+i;f=a*v+f*_,p=o*v+p*_}let g=r._fadeMul===void 0?1:r._fadeMul;if(s<=4&&_>.5){let t=2+Math.floor(a*3);for(let n=0;n<t;n++){let i=d-r.angularVelocity*h*(n+1)*80,a,f;if(s===3&&this.binaryCenters){let e=this.binaryCenters[r.binaryCore];a=c+e.x+Math.cos(i)*u,f=l+e.y+Math.sin(i)*u}else if(s===4){let e=Math.cos(r.orbitTilt),t=Math.sin(r.orbitTilt),n=Math.cos(i)*u*r.ellipX,o=Math.sin(i)*u*r.ellipY;a=c+n*e-o*t,f=l+n*t+o*e}else a=c+Math.cos(i)*u*r.ellipX,f=l+Math.sin(i)*u*r.ellipY;let p=(1-n/t)*.3*r.brightness*m*_;e.beginPath(),e.arc(a,f,r.size*(1-n*.25),0,Math.PI*2),e.fillStyle=dn(o,p),e.fill()}}else if(s===6&&r.isNebula){let t=r.size*3,n=e.createRadialGradient(f,p,0,f,p,t);n.addColorStop(0,dn(o,r.brightness*m*.4)),n.addColorStop(1,`transparent`),e.fillStyle=n,e.beginPath(),e.arc(f,p,t,0,Math.PI*2),e.fill()}e.beginPath(),e.arc(f,p,r.size,0,Math.PI*2),e.fillStyle=dn(o,r.brightness*m*g),e.fill()}if(g>.05)for(let r=0;r<3;r++){let i=(n*7e-4*g+r*.33)%1;if(i>.5)continue;let a=(r*1.618*Math.PI+n*1e-4)%(Math.PI*2),s=t*.5*(1-i*1.6);if(s<3)continue;let u=c+Math.cos(a)*s,d=l+Math.sin(a)*s,f=i<.2?i/.2:1-(i-.2)/.3,p=5+(1-i)*4,m=e.createRadialGradient(u,d,0,u,d,p);m.addColorStop(0,dn(`#ffffff`,f*.95)),m.addColorStop(.3,dn(o,f*.7)),m.addColorStop(1,`transparent`),e.fillStyle=m,e.beginPath(),e.arc(u,d,p,0,Math.PI*2),e.fill()}if(s!==3){let i=.9+.1*Math.sin(n*.003),s=(1+this.exp*9+r*2)*this.scale,u=Math.min(s*(3+a*2),t*.4),d=e.createRadialGradient(c,l,0,c,l,u);d.addColorStop(0,dn(`#ffffff`,.95*i*m)),d.addColorStop(.2,dn(o,.75*i*m)),d.addColorStop(.5,dn(o,.2*m)),d.addColorStop(1,`transparent`),e.fillStyle=d,e.beginPath(),e.arc(c,l,u,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(c,l,s*i,0,Math.PI*2),e.fillStyle=dn(`#ffffff`,.95),e.fill()}else if(this.binaryCenters)for(let n of this.binaryCenters){let i=c+n.x,a=l+n.y,s=(.8+this.exp*5+r*1.5)*this.scale,u=Math.min(s*3.5,t*.22),d=e.createRadialGradient(i,a,0,i,a,u);d.addColorStop(0,dn(`#ffffff`,.9*m)),d.addColorStop(.3,dn(o,.6*m)),d.addColorStop(1,`transparent`),e.fillStyle=d,e.beginPath(),e.arc(i,a,u,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(i,a,s,0,Math.PI*2),e.fillStyle=dn(`#ffffff`,.9),e.fill()}}},mn=globalThis,hn=new Set,gn=0,_n=0,vn=100;function yn(e){let t=_n===0?16:Math.min(vn,Math.max(0,e-_n));_n=e;for(let e of hn)try{e(t)}catch(e){console.error(`[AnimationScheduler] subscriber threw, continuing`,e)}hn.size>0?gn=mn.requestAnimationFrame(yn):(gn=0,_n=0)}function bn(){gn===0&&(_n=0,gn=mn.requestAnimationFrame(yn))}function xn(){gn!==0&&(mn.cancelAnimationFrame&&mn.cancelAnimationFrame(gn),gn=0,_n=0)}function Sn(){return mn.matchMedia?mn.matchMedia(`(prefers-reduced-motion: reduce)`).matches:!1}function Cn(e){if(!mn.requestAnimationFrame||Sn())return()=>{};hn.add(e),hn.size===1&&bn();let t=!1;return function(){t||(t=!0,hn.delete(e),hn.size===0&&xn())}}function wn({agentId:e,size:t=64,animate:n=!0,signals:r=0,accuracy:i=.5,uniqueness:a=.5,impact:o=.5}){let s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useRef)(!0),u=(0,_.useRef)(n);return u.current=n,(0,_.useEffect)(()=>{let n=s.current;if(!n)return;n.width=t*2,n.height=t*2;let d=n.getContext(`2d`);if(!d)return;d.scale(2,2);let f=new pn(n,e,r,i,a,Le(e),o);c.current=f,f.draw();let p=Cn(e=>{l.current&&u.current&&(f.update(e),f.draw())});return()=>{p(),c.current=null}},[e,t,r,i,a,o]),(0,_.useEffect)(()=>{let e=s.current;if(!e)return;let t=new IntersectionObserver(([e])=>{l.current=e.isIntersecting},{threshold:.1});return t.observe(e),()=>t.disconnect()},[]),(0,R.jsx)(`canvas`,{ref:s,"aria-hidden":`true`,className:`shrink-0`,style:{width:t,height:t,borderRadius:`50%`}})}function Tn(e){return e.hallucinationsCaught>0?`catch`:e.disputed>0?`mixed`:e.confirmed>0?`trust`:null}function En(e){return Math.max(1,Math.min(2.5,1+e*.15))}function Dn(e,t){return e<=t?`${e}::${t}`:`${t}::${e}`}var On=new Set([`agreement`,`unique_confirmed`,`impl_peer_approved`]),kn=new Set([`disagreement`,`impl_peer_rejected`]),An=new Set([`hallucination_caught`]);function jn(e){let t=new Map,n=new Map;for(let r of e)if(!r.retracted)for(let e of r.signals){if(!e.counterpartId||!e.agentId)continue;let i=On.has(e.signal),a=kn.has(e.signal),o=An.has(e.signal);if(!i&&!a&&!o)continue;let s=Dn(e.agentId,e.counterpartId),c=t.get(s);c||(c={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:r.timestamp},t.set(s,c)),i&&(c.confirmed+=1),a&&(c.disputed+=1),o&&(c.hallucinationsCaught+=1);let l=n.get(s);l||(l=new Set,n.set(s,l)),l.has(r.taskId)||(l.add(r.taskId),c.rounds+=1),r.timestamp>c.lastInteraction&&(c.lastInteraction=r.timestamp)}return t}function Mn(e){return e>=2e3?84:e>=800?72:e>=200?60:48}function Nn(e,t,n){let r={x:t/2,y:n/2},i=Math.max(80,Math.min(t,n)/2-24),a=new Map;if(e.length===0)return a;let o=[...e].sort((e,t)=>{let n=t.scores?.accuracy??0,r=e.scores?.accuracy??0;return n===r?e.id.localeCompare(t.id):r-n}),s=o.length,c=Math.PI*(3-Math.sqrt(5));for(let e=0;e<s;e++){let t=o[e],n=Pn(t.scores?.accuracy??0,0,1),s=Math.max(i*.22,(1-n)*i),l=-Math.PI/2+e*c;a.set(t.id,{x:r.x+s*Math.cos(l),y:r.y+s*Math.sin(l),role:`fleet`,angle:l})}return a}function Pn(e,t,n){return Math.min(Math.max(e,t),n)}function Fn(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function In({width:e,height:t,agentPositions:n}){let r=(0,_.useRef)(null),i=(0,_.useRef)([]),a=(0,_.useRef)([]);(0,_.useEffect)(()=>{if(e<=0||t<=0)return;let n=Fn(7311);i.current=Array.from({length:170},()=>{let r=n(),i,a;return r<.07?(i=2+n()*.6,a=.75+n()*.25):r<.32?(i=1.2+n()*.4,a=.45+n()*.35):(i=.5+n()*.4,a=.25+n()*.3),{x:n()*e,y:n()*t,baseR:i,r:i,baseO:a,o:a,consumed:null,phase:n()*Math.PI*2,twinkleHz:.25+n()*1.4}})},[e,t]),(0,_.useEffect)(()=>{if(e<=0||t<=0)return;let r=Fn(919),o=0,s=Cn(s=>{let c=s/1e3;o+=c;let l=i.current,u=a.current;for(let i=0;i<l.length;i++){let a=l[i];if(a.consumed===null)for(let e=0;e<n.length;e++){let t=n[e].x-a.x,r=n[e].y-a.y;if(t*t+r*r<3600){a.consumed=e;break}}if(a.consumed===null){let e=.8+.35*Math.sin(o*a.twinkleHz*Math.PI*2+a.phase);a.o=Math.min(1,a.baseO*e)}if(a.consumed!==null){let i=n[a.consumed];if(i){let e=i.x-a.x,t=i.y-a.y,n=Math.sqrt(e*e+t*t)||1,r=Math.min(n,90*c);a.x+=e/n*r,a.y+=t/n*r,a.o=Math.max(0,a.o-1.5*c),a.r=Math.max(0,a.r-1.8*c)}if(a.o<=.01||a.r<=.1){let i=0,o=0,s=!1;for(let a=0;a<8;a++){i=r()*e,o=r()*t,s=!0;for(let e of n){let t=e.x-i,n=e.y-o;if(t*t+n*n<3600*1.5){s=!1;break}}if(s)break}a.x=i,a.y=o,a.r=a.baseR,a.o=a.baseO,a.consumed=null}}let s=u[i];s&&(s.setAttribute(`cx`,String(a.x)),s.setAttribute(`cy`,String(a.y)),s.setAttribute(`r`,String(a.r)),s.setAttribute(`opacity`,String(a.o)))}});return()=>s()},[e,t,n]);let o=i.current;return(0,R.jsx)(`svg`,{ref:r,width:`100%`,height:t,style:{position:`absolute`,inset:0,pointerEvents:`none`},"aria-hidden":!0,children:o.map((e,t)=>(0,R.jsx)(`circle`,{ref:e=>{a.current[t]=e},cx:e.x,cy:e.y,r:e.r,fill:`#F2EDE3`,opacity:e.o},t))})}function Ln({variant:e}){return(0,R.jsx)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 56 56`,style:{position:`absolute`,top:0,left:0,animation:`orch-smile-pop 900ms ease-out forwards`,pointerEvents:`none`},"aria-hidden":!0,children:(()=>{switch(e){case 1:return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M 19 24 L 25 24`,stroke:`#F2EDE3`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,R.jsx)(`circle`,{cx:`34`,cy:`24`,r:`1.5`,fill:`#F2EDE3`}),(0,R.jsx)(`path`,{d:`M 20 31 Q 28 36 36 31`,stroke:`#F2EDE3`,strokeWidth:`1.5`,strokeLinecap:`round`,fill:`none`})]});case 2:return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`circle`,{cx:`22`,cy:`23`,r:`1.6`,fill:`#F2EDE3`}),(0,R.jsx)(`circle`,{cx:`34`,cy:`23`,r:`1.6`,fill:`#F2EDE3`}),(0,R.jsx)(`path`,{d:`M 19 30 Q 28 38 37 30 Q 28 33 19 30 Z`,fill:`#F2EDE3`,opacity:`0.92`})]});case 3:return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`circle`,{cx:`22`,cy:`24`,r:`1.4`,fill:`#F2EDE3`}),(0,R.jsx)(`circle`,{cx:`34`,cy:`24`,r:`1.4`,fill:`#F2EDE3`}),(0,R.jsx)(`path`,{d:`M 22 30 Q 26 33 28 30 Q 30 33 34 30`,stroke:`#F2EDE3`,strokeWidth:`1.4`,strokeLinecap:`round`,fill:`none`})]});default:return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`circle`,{cx:`22`,cy:`24`,r:`1.5`,fill:`#F2EDE3`}),(0,R.jsx)(`circle`,{cx:`34`,cy:`24`,r:`1.5`,fill:`#F2EDE3`}),(0,R.jsx)(`path`,{d:`M 20 31 Q 28 36 36 31`,stroke:`#F2EDE3`,strokeWidth:`1.5`,strokeLinecap:`round`,fill:`none`})]})}})()})}function Rn(){return(0,R.jsx)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 56 56`,style:{position:`absolute`,top:0,left:0,animation:`orch-ripple 700ms ease-out forwards`,pointerEvents:`none`},"aria-hidden":!0,children:(0,R.jsx)(`circle`,{cx:`28`,cy:`28`,r:`9`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`1.2`})})}function zn({width:e,height:t,hideLabels:n=!1}){let r=e/2,i=t/2,a=Math.max(80,Math.min(e,t)/2-40);return(0,R.jsx)(`svg`,{width:`100%`,height:t,style:{position:`absolute`,inset:0,pointerEvents:`none`},"aria-hidden":!0,children:[{r:a,accLabel:`0%`},{r:a*.75,accLabel:`25%`},{r:a*.5,accLabel:`50%`},{r:a*.25,accLabel:`75%`}].map(({r:e,accLabel:t})=>(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`circle`,{cx:r,cy:i,r:e,fill:`none`,stroke:`var(--border-strong)`,strokeDasharray:`2 4`,opacity:.5}),!n&&(0,R.jsx)(`text`,{x:r+6,y:i-e-4,fontFamily:`var(--font-mono)`,fontSize:`9`,fill:`var(--ink-3)`,letterSpacing:`0.06em`,children:t})]},t))})}function Bn(e,t,n,r,i){let a={x:r/2,y:i/2},o=new Map;o.set(e,{x:a.x,y:a.y,role:`center`});let s=[];for(let r of t){if(r===e)continue;let t=n.get(Dn(e,r));t&&s.push({id:r,rel:t})}let c=Math.max(1,...s.map(e=>e.rel.rounds)),l=Math.max(120,Math.min(r,i)*.2),u=Math.min(r,i)*.42,d=s.slice().sort((e,t)=>e.id.localeCompare(t.id)),f=d.length;for(let e=0;e<f;e++){let{id:t,rel:n}=d[e],r=e/Math.max(1,f)*Math.PI*2-Math.PI/2,i=u-n.rounds/c*(u-l);o.set(t,{x:a.x+i*Math.cos(r),y:a.y+i*Math.sin(r),role:`peer`})}for(let e of t)o.has(e)||o.set(e,{x:a.x,y:a.y,role:`hidden`});return o}function Vn({agents:e,peerRelationships:t,selectedAgentId:n,onSelectAgent:r,height:i=420}){if(e.length===0)return(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-lg border`,style:{height:i,background:`var(--stage-bg)`,borderColor:`var(--border)`,color:`var(--stage-text-dim)`},children:(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`mb-2 h-section`,children:`No agents configured`}),(0,R.jsxs)(`div`,{className:`font-mono text-xs`,children:[`Run `,(0,R.jsx)(`code`,{children:`gossip_setup`}),` to spin up the fleet.`]})]})});if(e.length===1){let t=e[0];return(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-lg border`,style:{height:i,background:`var(--stage-bg)`,borderColor:`var(--border)`},children:(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`inline-block`,children:(0,R.jsx)(wn,{agentId:t.id,signals:t.scores.signals,accuracy:t.scores.accuracy,uniqueness:t.scores.uniqueness,impact:t.scores.impactScore,size:Mn(t.scores.signals)})}),(0,R.jsx)(`div`,{className:`mt-3 font-mono text-xs`,style:{color:`var(--stage-text-dim)`},children:`Dispatch a task to see the network form.`})]})})}return(0,R.jsx)(Hn,{agents:e,peerRelationships:t,selectedAgentId:n,onSelectAgent:r,height:i})}function Hn({agents:e,peerRelationships:t,selectedAgentId:n,onSelectAgent:r,height:i=420}){let a=(0,_.useRef)(null),[o,s]=(0,_.useState)(800),[c,l]=(0,_.useState)(i),[u,d]=(0,_.useState)(0);(0,_.useEffect)(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(([e])=>{let t=e.contentRect.width,n=e.contentRect.height;t>0&&s(t),n>0&&l(n)});return t.observe(e),()=>t.disconnect()},[]);let f=(0,_.useMemo)(()=>{let r=e.map(e=>e.id);return n&&r.includes(n)?Bn(n,r,t,o,c):Nn(e,o,c)},[e,t,n,o,c]),p=(0,_.useMemo)(()=>{if(!n)return[];let r=f.get(n);if(!r)return[];let i=[];for(let a of e){if(a.id===n)continue;let e=f.get(a.id);if(!e||e.role!==`peer`)continue;let o=t.get(Dn(n,a.id));if(!o)continue;let s=Tn(o);s&&i.push({peerId:a.id,x1:r.x,y1:r.y,x2:e.x,y2:e.y,cls:s,width:En(o.rounds),rounds:o.rounds})}let a={mixed:0,trust:1,catch:2};return i.sort((e,t)=>a[e.cls]-a[t.cls]),i},[e,t,n,f]),m=n?p.length:0,h=(0,_.useMemo)(()=>{let t=[];for(let n of e){let e=f.get(n.id);e&&t.push({x:e.x,y:e.y})}return t},[e,f]);return(0,R.jsxs)(`div`,{ref:a,className:`relative overflow-hidden rounded-lg border`,style:{minHeight:i,height:`100%`,background:`#14120F`,borderColor:`#2B2823`,"--stage-bg":`#14120F`,"--stage-text-dim":`#B8B0A1`,"--stage-grid":`rgba(255,255,255,0.03)`},onClick:()=>r(null),children:[(0,R.jsx)(In,{width:o,height:c,agentPositions:h}),(0,R.jsx)(zn,{width:o,height:c,hideLabels:!!n}),(0,R.jsx)(`div`,{className:`absolute z-10 flex items-center gap-2 h-section`,style:{top:10,left:12,pointerEvents:`none`,color:`var(--stage-text-dim)`,background:`color-mix(in oklch, var(--stage-bg) 70%, transparent)`,padding:`2px 6px`,borderRadius:`3px`},children:n?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:`Focus`}),(0,R.jsx)(`span`,{style:{opacity:.5},children:`·`}),(0,R.jsx)(`span`,{style:{color:`#F2EDE3`},children:n}),(0,R.jsx)(`span`,{style:{opacity:.5},children:`·`}),(0,R.jsx)(`span`,{style:{color:`#F2EDE3`},children:m}),(0,R.jsxs)(`span`,{style:{opacity:.7},children:[`peer`,m===1?``:`s`]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:`Fleet`}),(0,R.jsx)(`span`,{style:{opacity:.5},children:`·`}),(0,R.jsx)(`span`,{style:{color:`#F2EDE3`},children:e.length}),(0,R.jsx)(`span`,{style:{opacity:.7},children:`agents`}),(0,R.jsx)(`span`,{style:{opacity:.5},children:`·`}),(0,R.jsx)(`span`,{style:{opacity:.7},children:`click an avatar to focus`})]})}),!n&&(0,R.jsx)(`div`,{className:`absolute z-10 h-section`,style:{bottom:12,right:12,fontSize:`10px`,color:`var(--stage-text-dim)`,background:`color-mix(in oklch, var(--stage-bg) 70%, transparent)`,padding:`2px 6px`,borderRadius:`3px`,pointerEvents:`none`},children:`closer to center = higher accuracy`}),(0,R.jsx)(`svg`,{width:`100%`,height:c,style:{position:`absolute`,inset:0,pointerEvents:`none`},children:p.map(t=>{let r=e.find(e=>e.id===n),i=e.find(e=>e.id===t.peerId);if(!r||!i)return null;let a=Mn(r.scores.signals)/2,o=Mn(i.scores.signals)/2,s=t.x2-t.x1,c=t.y2-t.y1,l=Math.max(1,Math.hypot(s,c)),u=s/l,d=c/l,f=t.x1+u*a,p=t.y1+d*a,m=t.x2-u*o,h=t.y2-d*o,g=t.cls===`trust`?`var(--success)`:t.cls===`mixed`?`var(--warn)`:`var(--danger)`,_=t.cls===`mixed`?`8,2`:void 0;return(0,R.jsx)(`line`,{x1:f,y1:p,x2:m,y2:h,stroke:g,strokeWidth:t.width,strokeDasharray:_,strokeLinecap:`round`,style:{opacity:.55,transition:`opacity 200ms cubic-bezier(0.4,0,0.2,1)`}},t.peerId)})}),n&&(0,R.jsxs)(`div`,{className:`absolute z-10 flex flex-col gap-1 rounded font-mono text-[10px]`,style:{bottom:10,left:12,color:`var(--stage-text-dim)`,pointerEvents:`none`},children:[(0,R.jsx)(Un,{stroke:`var(--success)`,label:`Trust`}),(0,R.jsx)(Un,{stroke:`var(--warn)`,label:`Mixed`,dash:`8,2`}),(0,R.jsx)(Un,{stroke:`var(--danger)`,label:`Caught`})]}),!n&&c>0&&(0,R.jsxs)(`div`,{className:`absolute z-[1] -translate-x-1/2 -translate-y-1/2`,style:{left:o/2,top:c/2,cursor:`pointer`},onClick:e=>{e.stopPropagation(),d(e=>e+1)},title:u>=10?`♥`:u>=5?`ok ok`:`orchestrator`,children:[(0,R.jsxs)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 56 56`,style:{display:`block`,pointerEvents:`none`},"aria-hidden":!0,children:[(0,R.jsx)(`circle`,{cx:`28`,cy:`28`,r:`26`,fill:`none`,stroke:`var(--border-strong)`,strokeWidth:`0.6`,opacity:`0.35`}),(0,R.jsx)(`circle`,{cx:`28`,cy:`28`,r:`22`,fill:`none`,stroke:`var(--border-strong)`,strokeWidth:`0.4`,opacity:`0.25`}),(0,R.jsx)(`circle`,{cx:`28`,cy:`28`,r:`12`,fill:`none`,stroke:`#F2EDE3`,strokeWidth:`1.1`,opacity:`0.75`}),(0,R.jsx)(`circle`,{cx:`28`,cy:`28`,r:`9`,fill:`#000`}),(0,R.jsx)(`circle`,{cx:`28`,cy:`28`,r:`9`,fill:`none`,stroke:`var(--border-strong)`,strokeWidth:`0.5`,opacity:`0.6`})]}),u>0&&(0,R.jsx)(Ln,{variant:(u-1)%4},u),u>0&&(0,R.jsx)(Rn,{},`ripple-${u}`),(0,R.jsx)(`div`,{className:`font-mono`,style:{position:`absolute`,top:`calc(100% + 4px)`,left:`50%`,transform:`translateX(-50%)`,fontSize:`9px`,letterSpacing:`0.18em`,textTransform:`uppercase`,color:u>=10?`var(--accent)`:`var(--stage-text-dim)`,whiteSpace:`nowrap`,opacity:.7,pointerEvents:`none`,transition:`color 400ms ease-out`},children:u>=10?`♥ orchestrator ♥`:`orchestrator`})]}),e.map(e=>{let i=f.get(e.id);if(!i)return null;let a=Mn(e.scores.signals),o=i.role===`center`,s=i.role===`hidden`,c=i.role===`peer`,l=+!s,u=o?`#F2EDE3`:`var(--stage-text-dim)`,d=i.angle??Math.PI/2,p=a/2+14,m=Math.cos(d)*p,h=Math.sin(d)*p,g=Math.abs(Math.cos(d))>.7?Math.cos(d)>0?`left`:`right`:`center`;return(0,R.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),r(e.id)},className:`absolute -translate-x-1/2 -translate-y-1/2`,style:{left:i.x,top:i.y,opacity:l,pointerEvents:s?`none`:`auto`,border:`none`,background:`transparent`,padding:0,cursor:`pointer`,transition:`left 320ms cubic-bezier(0.4,0,0.2,1), top 320ms cubic-bezier(0.4,0,0.2,1), opacity 200ms cubic-bezier(0.4,0,0.2,1)`},"aria-label":`Select agent ${e.id}`,title:e.id,children:[(0,R.jsx)(`div`,{className:`rounded-full`,style:{width:a,height:a,boxShadow:o?`0 0 0 1.5px rgba(242, 237, 227, 0.45), 0 0 0 6px color-mix(in oklch, var(--border-strong) 18%, transparent), 0 0 28px -4px color-mix(in oklch, var(--border-strong) 35%, transparent)`:void 0,transition:`box-shadow 200ms cubic-bezier(0.4,0,0.2,1)`},children:(0,R.jsx)(wn,{agentId:e.id,signals:e.scores.signals,accuracy:e.scores.accuracy,uniqueness:e.scores.uniqueness,impact:e.scores.impactScore,size:a})}),(0,R.jsx)(`div`,{className:`absolute font-mono text-[10px] font-bold tracking-wider`,style:{left:`50%`,top:`50%`,transform:`translate(calc(-50% + ${m}px), calc(-50% + ${h}px))${g===`left`?` translateX(calc(50% + 4px))`:g===`right`?` translateX(calc(-50% - 4px))`:``}`,color:u,textAlign:g===`right`?`right`:g===`left`?`left`:`center`,whiteSpace:`nowrap`,pointerEvents:`none`,transition:`color 200ms cubic-bezier(0.4,0,0.2,1), transform 320ms cubic-bezier(0.4,0,0.2,1)`},children:e.id}),c&&(0,R.jsx)(`div`,{className:`font-mono text-[9px]`,style:{color:`var(--stage-text-dim)`,textAlign:`center`,whiteSpace:`nowrap`,marginTop:2},children:(()=>{let r=t.get(Dn(n??``,e.id));return r?`${r.rounds} round${r.rounds===1?``:`s`}`:``})()})]},e.id)})]})}function Un({stroke:e,label:t,dash:n}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`svg`,{width:`22`,height:`6`,style:{display:`block`},children:(0,R.jsx)(`line`,{x1:`0`,y1:`3`,x2:`22`,y2:`3`,stroke:e,strokeWidth:`1.5`,strokeDasharray:n})}),(0,R.jsx)(`span`,{children:t})]})}function Wn(e){let t=new URLSearchParams(e).get(`agent`);return t&&t.length>0?t:null}function Gn(e,t,n){let r=new URLSearchParams(t);n===null?r.delete(`agent`):r.set(`agent`,n);let i=r.toString();return i.length>0?`${e}?${i}`:e}function Kn(e){let t=globalThis;if(t.window===void 0)return;let n=t.window,r=Gn(n.location.pathname,n.location.search,e);r!==n.location.pathname+n.location.search&&(n.history.pushState({},``,r),n.dispatchEvent(new Event(`dashboard:navigate`)))}function qn({selectedAgent:e,agents:t,peerRelationships:n,height:r=420}){return(0,R.jsx)(`aside`,{className:`flex-shrink-0 overflow-y-auto rounded-lg border`,style:{width:320,minHeight:r,background:`var(--surface-elev)`,borderColor:`var(--border)`},"aria-label":e?`Agent detail: ${e.id}`:`Fleet summary`,children:e?(0,R.jsx)(Qn,{agent:e,peerRelationships:n,agents:t}):(0,R.jsx)(Jn,{agents:t,peerRelationships:n})})}function Jn({agents:e,peerRelationships:t}){let n=[...e].filter(e=>e.scores.signals>0).sort((e,t)=>t.scores.accuracy-e.scores.accuracy).slice(0,3),r=[];for(let[e,n]of t.entries())if(n.hallucinationsCaught>0){let[t,i]=e.split(`::`);r.push({pair:[t,i],catches:n.hallucinationsCaught,ts:n.lastInteraction})}r.sort((e,t)=>new Date(t.ts).getTime()-new Date(e.ts).getTime());let i=r.slice(0,5);return(0,R.jsxs)(`div`,{className:`flex h-full flex-col p-4`,children:[(0,R.jsx)(`div`,{className:`mb-2 h-section`,children:`Fleet at a glance`}),(0,R.jsx)(`p`,{className:`mb-4 font-mono text-[12px]`,style:{color:`var(--ink-4)`},children:`Click a node to see detail.`}),(0,R.jsx)(Yn,{label:`Top performers`,tone:`success`,children:n.length===0?(0,R.jsx)(Xn,{text:`No agent has logged a signal yet.`}):n.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>Kn(e.id),className:`group flex w-full items-center gap-2 rounded px-2 py-2 text-left transition hover:[background:color-mix(in_oklch,var(--accent)_8%,transparent)]`,style:{cursor:`pointer`},children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`truncate font-mono text-[12px] font-semibold`,style:{color:`var(--text)`},children:e.id}),(0,R.jsxs)(`div`,{className:`mt-0.5 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[Math.round(e.scores.accuracy*100),`% accuracy · `,e.scores.signals,` signals`]})]}),(0,R.jsx)(`span`,{className:`opacity-0 transition group-hover:opacity-100 font-mono text-[11px]`,style:{color:`var(--accent)`},children:`→`})]},e.id))}),(0,R.jsx)(Yn,{label:`Recent hallucination catches`,tone:`danger`,children:i.length===0?(0,R.jsx)(Xn,{text:`No catches in the active window.`}):i.map(e=>(0,R.jsxs)(`div`,{className:`rounded px-2 py-2`,children:[(0,R.jsxs)(`div`,{className:`font-mono text-[12px]`,style:{color:`var(--text)`},children:[(0,R.jsx)(`span`,{style:{color:`var(--danger)`},children:`◆`}),` `,e.pair[0],` ↔ `,e.pair[1]]}),(0,R.jsxs)(`div`,{className:`mt-0.5 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[e.catches,` caught · `,Zn(e.ts)]})]},`${e.pair[0]}::${e.pair[1]}`))})]})}function Yn({label:e,tone:t,children:n}){return(0,R.jsxs)(`section`,{className:`mb-4`,children:[(0,R.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 h-section`,children:[(0,R.jsx)(`span`,{style:{width:4,height:4,borderRadius:`50%`,background:t===`success`?`var(--success)`:t===`danger`?`var(--danger)`:`var(--ink-4)`,display:`inline-block`,flexShrink:0}}),e]}),(0,R.jsx)(`div`,{className:`space-y-1`,children:n})]})}function Xn({text:e}){return(0,R.jsx)(`div`,{className:`px-2 py-1.5 font-mono text-[11px]`,style:{color:`var(--ink-4)`},children:e})}function Zn(e){let t=new Date(e).getTime(),n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function Qn({agent:e,peerRelationships:t,agents:n}){let r=e.scores.bench.state===`benched`?{label:`BENCHED`,color:`var(--danger)`}:e.native?{label:`READY`,color:`var(--success)`}:e.online?{label:`ONLINE`,color:`var(--success)`}:{label:`OFFLINE`,color:`var(--ink-3)`},i=[];for(let r of n){if(r.id===e.id)continue;let n=t.get(Dn(e.id,r.id));if(!n)continue;let a=n.confirmed+n.disputed+n.hallucinationsCaught;i.push({other:r.id,rel:n,total:a})}i.sort((e,t)=>t.total-e.total);let a=i.slice(0,3);return(0,R.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-4 py-2 h-section`,style:{color:r.color,borderBottom:`1px solid var(--border)`,background:`color-mix(in oklch, ${r.color} 6%, transparent)`},children:[(0,R.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:r.color,display:`inline-block`}}),r.label]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 px-4 pt-4`,children:[(0,R.jsx)(wn,{agentId:e.id,signals:e.scores.signals,accuracy:e.scores.accuracy,uniqueness:e.scores.uniqueness,impact:e.scores.impactScore,size:48}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`truncate font-mono text-[14px] font-semibold`,style:{color:`var(--ink)`},children:e.id}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:e.model})]})]}),(0,R.jsxs)(`div`,{className:`mx-4 mt-4 grid grid-cols-2 gap-2`,children:[(0,R.jsx)($n,{label:`Accuracy`,value:`${Math.round(e.scores.accuracy*100)}%`}),(0,R.jsx)($n,{label:`Reliability`,value:e.scores.taskCompletionRate==null?`—`:`${Math.round(e.scores.taskCompletionRate*100)}%`}),(0,R.jsx)($n,{label:`Signals`,value:e.scores.signals.toLocaleString()}),(0,R.jsx)($n,{label:`Impact`,value:`${Math.round(e.scores.impactScore*100)}%`})]}),(0,R.jsxs)(`div`,{className:`mt-4 px-4`,children:[(0,R.jsx)(`div`,{className:`mb-1.5 h-section`,children:`Top peers`}),a.length===0?(0,R.jsx)(Xn,{text:`No cross-review history yet.`}):(0,R.jsx)(`div`,{className:`space-y-1`,children:a.map(({other:e,rel:t})=>(0,R.jsxs)(`div`,{className:`rounded px-2 py-1.5`,style:{background:`color-mix(in oklch, var(--surface) 50%, transparent)`},children:[(0,R.jsx)(`div`,{className:`truncate font-mono text-[12px]`,style:{color:`var(--ink)`},children:e}),(0,R.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[t.confirmed>0&&(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--success)`},children:`✓`}),` `,t.confirmed]}),t.disputed>0&&(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--warn)`},children:`≠`}),` `,t.disputed]}),t.hallucinationsCaught>0&&(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--danger)`},children:`◆`}),` `,t.hallucinationsCaught]}),(0,R.jsxs)(`span`,{style:{opacity:.6},children:[`· `,t.rounds,` rounds`]})]})]},e))})]}),e.skills.length>0&&(0,R.jsxs)(`div`,{className:`mt-4 px-4`,children:[(0,R.jsxs)(`div`,{className:`mb-1.5 h-section`,children:[`Skills `,(0,R.jsx)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:e.skills.length})]}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.skills.slice(0,6).map(e=>(0,R.jsx)(`span`,{className:`rounded-sm border px-1.5 py-0.5 font-mono text-[11px]`,style:{borderColor:`var(--border)`,color:`var(--ink-3)`},children:e},e))})]}),(0,R.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1.5 border-t p-3`,style:{borderColor:`var(--border)`},children:[(0,R.jsx)(er,{label:`Open dispatch log`,kbd:`⏎`,href:`/agent/${encodeURIComponent(e.id)}`}),(0,R.jsx)(er,{label:`View skill graph`,kbd:`G`,href:`/agent/${encodeURIComponent(e.id)}#skills`,disabled:e.skills.length===0}),(0,R.jsx)(er,{label:`Dispatch consensus`,kbd:`⌘D`,href:`#`,disabled:!0})]})]})}function $n({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`rounded px-2 py-1.5`,style:{background:`color-mix(in oklch, var(--surface) 50%, transparent)`},children:[(0,R.jsx)(`div`,{className:`h-section`,children:e}),(0,R.jsx)(`div`,{className:`mt-0.5 font-mono text-[16px] font-medium tabular-nums`,style:{color:`var(--text)`},children:t})]})}function er({label:e,kbd:t,href:n,disabled:r}){return(0,R.jsxs)(`a`,{href:r?void 0:`/dashboard${n}`,"aria-disabled":r,tabIndex:r?-1:void 0,className:`flex items-center justify-between rounded px-2 py-2 font-mono text-[12px] transition`,style:{background:r?`transparent`:`color-mix(in oklch, var(--surface) 50%, transparent)`,color:r?`var(--ink-4)`:`var(--text)`,pointerEvents:r?`none`:`auto`,opacity:r?.5:1},children:[(0,R.jsx)(`span`,{children:e}),(0,R.jsx)(`kbd`,{className:`rounded border px-1 py-0.5 font-mono text-[10px]`,style:{borderColor:`var(--border)`,background:`var(--surface-sunk)`,color:`var(--ink-3)`},children:t})]})}var tr=null,nr=3e3,rr=null,ir=new Set;function ar(){if(tr?.readyState===WebSocket.OPEN||tr?.readyState===WebSocket.CONNECTING)return;let e=location.protocol===`https:`?`wss:`:`ws:`;tr=new WebSocket(`${e}//${location.host}/dashboard/ws`),tr.onopen=()=>{nr=3e3},tr.onmessage=e=>{try{let t=JSON.parse(e.data);ir.forEach(e=>e(t))}catch{}},tr.onclose=()=>{tr=null,rr&&clearTimeout(rr),rr=setTimeout(()=>{nr=Math.min(nr*1.5,3e4),ar()},nr)},tr.onerror=()=>{}}function or(e){return ir.add(e),()=>ir.delete(e)}function sr(e){let t=(0,_.useRef)(e);t.current=e,(0,_.useEffect)(()=>(ar(),or(e=>t.current(e))),[])}var cr=6e4;function lr(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(null),a=()=>{t(null),r(null),i.current!=null&&(window.clearTimeout(i.current),i.current=null)};if(sr(n=>{if(n.type===`task_dispatched`){t(n.taskId),r(n.agentId),i.current!=null&&window.clearTimeout(i.current),i.current=window.setTimeout(a,cr);return}if(n.type===`consensus_complete`||n.type===`task_completed`||n.type===`task_failed`){if(n.taskId!==e)return;a()}}),(0,_.useEffect)(()=>()=>a(),[]),e===null)return null;let o=e.slice(0,8);return(0,R.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex items-center gap-3 rounded-md border px-3 py-2 font-mono text-[11px]`,style:{background:`color-mix(in oklch, var(--info) 8%, transparent)`,borderColor:`color-mix(in oklch, var(--info) 30%, transparent)`,color:`var(--text)`,animation:`beat-pulse-narrative calc(var(--beat) * 2) ease-in-out infinite`},children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full`,style:{background:`var(--info)`,boxShadow:`0 0 6px var(--info)`}}),(0,R.jsx)(`span`,{style:{color:`var(--text-dim)`},children:`Round in flight`}),(0,R.jsx)(`span`,{className:`font-bold`,style:{color:`var(--info)`},children:o}),n&&(0,R.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[`→ `,(0,R.jsx)(`span`,{style:{color:`var(--text)`},children:n})]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{let e=document.getElementById(`consensus-rounds-section`);e&&e.scrollIntoView({behavior:`smooth`,block:`start`})},className:`ml-auto rounded px-1.5 py-0.5 font-mono text-[10px] transition hover:[background:color-mix(in_oklch,var(--info)_12%,transparent)]`,style:{color:`var(--ink-3)`,cursor:`pointer`},children:`watch ↓`})]})}var ur={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function dr(e){return ur[e]}function fr(e,t,n){let r=dr(t),i=r/24,a=n-r,o=Array(24).fill(0);for(let t of e){let e=new Date(t).getTime();if(!Number.isFinite(e)||e<a||e>n)continue;let r=e-a,s=Math.floor(r/i);s>=24&&(s=23),o[s]+=1}return o}var pr=[`1h`,`24h`,`7d`,`30d`],mr={"1h":`1h ago`,"24h":`24h ago`,"7d":`7d ago`,"30d":`30d ago`};function hr({runs:e,range:t,onRangeChange:n,height:r=52}){let[i,a]=(0,_.useState)(()=>Date.now());(0,_.useEffect)(()=>{let e=dr(t)/24,n=window.setInterval(()=>a(Date.now()),e);return()=>window.clearInterval(n)},[t]);let o=(0,_.useMemo)(()=>{let n=[];for(let t of e){let e=t.signals?.length??0;for(let r=0;r<e;r++)n.push(t.timestamp)}return fr(n,t,i)},[e,t,i]),s=Math.max(1,...o);return(0,R.jsxs)(`div`,{className:`rounded-md border px-3 py-2`,style:{background:`var(--surface-elev)`,borderColor:`var(--border)`},children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsx)(`div`,{className:`h-section`,children:`Signal volume`}),(0,R.jsx)(`div`,{className:`flex gap-1`,children:pr.map(e=>{let r=e===t;return(0,R.jsx)(`button`,{type:`button`,onClick:()=>n(e),"aria-pressed":r,className:`rounded px-2 py-0.5 font-mono text-[10px] transition`,style:{background:r?`var(--surface-sunk)`:`transparent`,color:r?`var(--text)`:`var(--text-dim)`,border:`1px solid`,borderColor:r?`var(--border-strong)`:`transparent`},children:e},e)})})]}),(0,R.jsxs)(`svg`,{viewBox:`0 0 24 1`,preserveAspectRatio:`none`,style:{width:`100%`,height:r,color:`var(--c1)`,display:`block`},children:[(0,R.jsx)(`rect`,{x:0,y:.985,width:24,height:.015,fill:`var(--ink)`,opacity:.08}),o.map((e,t)=>{let n=e===0?0:e/s,r=1-n;return(0,R.jsx)(`rect`,{x:t+.15,y:r,width:.7,height:Math.max(n,e>0?.04:0),rx:.06,ry:.06,fill:`currentColor`,opacity:e===0?0:.9},t)})]}),(0,R.jsxs)(`div`,{className:`mt-1 flex items-center justify-between font-mono text-[10px] tabular-nums`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{children:mr[t]}),(0,R.jsx)(`span`,{children:`now`})]})]})}function gr(e){let t=[];for(let[n,r]of e.entries())t.push(`${n}:${r.rounds}:${r.confirmed}:${r.disputed}:${r.hallucinationsCaught}`);return t.sort(),t.join(`|`)}function _r(e){let t=(0,_.useRef)(``),n=(0,_.useRef)(new Map);return(0,_.useMemo)(()=>{let r=jn(e??[]),i=gr(r);return i===t.current?n.current:(t.current=i,n.current=r,r)},[e])}function vr(e){let t=[];for(let[n,r]of e.entries())t.push(`${n}:${r.critical}:${r.high}:${r.medium}:${r.low}`);return t.sort(),t.join(`|`)}function yr(e){let t=(0,_.useRef)(``),n=(0,_.useRef)(new Map);return(0,_.useMemo)(()=>{let r=new Map;if(e)for(let t of e){let e=[...t.confirmed??[],...t.disputed??[],...t.unique??[],...t.unverified??[]];for(let t of e){let e=t.originalAgentId;if(!e)continue;let n=r.get(e)??{critical:0,high:0,medium:0,low:0},i=t.severity??`low`;i===`critical`?n.critical+=1:i===`high`?n.high+=1:i===`medium`?n.medium+=1:n.low+=1,r.set(e,n)}}let i=vr(r);return i===t.current?n.current:(t.current=i,n.current=r,r)},[e])}function br(){let[e,t]=(0,_.useState)(()=>typeof window>`u`?null:Wn(window.location.search));return(0,_.useEffect)(()=>{let e=()=>{let e=typeof window>`u`?null:Wn(window.location.search);t(t=>t===e?t:e)};return window.addEventListener(`dashboard:navigate`,e),()=>{window.removeEventListener(`dashboard:navigate`,e)}},[]),[e,Kn]}var xr=[`1h`,`24h`,`7d`,`30d`];function Sr(e){return typeof e==`string`&&xr.includes(e)}function Cr(e){let t=new URLSearchParams(e).get(`range`);return Sr(t)?t:null}function wr(e,t,n){let r=new URLSearchParams(t);n===null?r.delete(`range`):r.set(`range`,n);let i=r.toString();return i.length>0?`${e}?${i}`:e}function Tr(e){let t=globalThis;if(!t.window)return;let n=t.window,r=wr(n.location.pathname,n.location.search,e);r!==n.location.pathname+n.location.search&&(n.history.pushState({},``,r),n.dispatchEvent(new Event(`dashboard:navigate`)))}function Er(){let[e,t]=(0,_.useState)(()=>typeof window>`u`?`7d`:Cr(window.location.search)??`7d`);return(0,_.useEffect)(()=>{typeof window<`u`&&Cr(window.location.search)===null&&Tr(e);let n=()=>{let e=typeof window>`u`?`7d`:Cr(window.location.search)??`7d`;t(t=>t===e?t:e)};return window.addEventListener(`dashboard:navigate`,n),()=>window.removeEventListener(`dashboard:navigate`,n)},[]),[e,Tr]}var Dr=new Set([`textbox`,`combobox`,`listbox`,`spinbutton`,`searchbox`]);function Or(e){if(!(e instanceof Element))return!1;let t=e.tagName;if(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable===!0)return!0;let n=e.getAttribute(`role`);return n!==null&&Dr.has(n)}function kr(e){(0,_.useEffect)(()=>{if(!e)return;function t(t){Or(t.target)||(t.metaKey||t.ctrlKey)&&(t.key===`d`||t.key===`D`)||t.metaKey||t.ctrlKey||t.altKey||(t.key===`Enter`?(t.preventDefault(),x(`/agent/`+encodeURIComponent(e))):(t.key===`g`||t.key===`G`)&&(t.preventDefault(),x(`/agent/`+encodeURIComponent(e)+`#skills`)))}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function Ar(e){let t=globalThis.window,n=e??(t==null?``:t.location.search);return new URLSearchParams(n).get(`graph`)===`0`}function jr({overview:e,agents:t,tasks:n,consensus:r,consensusReports:i,fleetTrend:a,signalActivity:o,skills:s,activeTaskCount:c,setActiveTaskCount:l}){let u=e.actionableFindings,d=Ar(),f=_r(r?.runs),p=yr(i?.reports),m=(0,_.useMemo)(()=>{let e=new Map;if(a){for(let t of a.points){let n=e.get(t.agentId)??[];n.push(t),e.set(t.agentId,n)}for(let t of e.values())t.sort((e,t)=>e.day.localeCompare(t.day))}return e},[a]),[h,g]=br(),[v,y]=Er();kr(h);let x=t&&h?t.find(e=>e.id===h)??null:null,[S,C]=(0,_.useState)(!d);function w(){let e=!S;C(e);let t=new URL(window.location.href);e?t.searchParams.delete(`graph`):t.searchParams.set(`graph`,`0`),window.history.replaceState(null,``,t.toString())}return(0,R.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-6`,children:[(0,R.jsxs)(`header`,{children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,R.jsx)(`h1`,{className:`h-route h-route--lg`,children:`Overview`}),(0,R.jsxs)(`div`,{className:`flex items-baseline gap-4`,children:[u>0&&(0,R.jsxs)(`a`,{href:b(`/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding`),className:`font-mono text-[11px] transition hover:underline`,style:{color:`var(--warn)`},"data-tooltip":`Findings open for operator review`,children:[u,` actionable →`]}),t&&(0,R.jsx)(`button`,{type:`button`,onClick:w,className:`font-mono text-[10px] transition hover:underline`,style:{color:`var(--text-dim)`},children:S?`[hide graph]`:`[show graph]`})]})]}),(0,R.jsx)(`p`,{className:`mt-1 font-mono text-[13px]`,style:{color:`var(--text-dim)`},children:`What your agents are doing right now.`})]}),S&&t&&(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsx)(lr,{}),(0,R.jsxs)(`div`,{className:`flex items-stretch gap-3`,children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(Vn,{agents:t,peerRelationships:f,selectedAgentId:h,onSelectAgent:g})}),(0,R.jsx)(qn,{selectedAgent:x,agents:t,peerRelationships:f})]}),r&&(0,R.jsx)(hr,{runs:r.runs,range:v,onRangeChange:y})]}),(0,R.jsx)(Ue,{overview:e,activeTasks:c,mode:`calm`}),(0,R.jsx)(lt,{onCountChange:l}),t&&(0,R.jsx)(Ye,{agents:t,activity:o}),(0,R.jsx)(Vt,{}),n&&(0,R.jsx)(Pt,{tasks:n,limit:3}),t&&(0,R.jsx)(Ot,{agents:t,highlightedAgentId:S?h:null,severityMap:p,trendByAgent:m}),(0,R.jsx)(Ut,{overview:e}),(0,R.jsx)(nn,{skills:s??null})]})}var Mr={confirmed:`var(--ok)`,disputed:`var(--bad)`,unverified:`var(--info)`,unique:`var(--ink-3)`},Nr={confirmed:`confirmed`,disputed:`disputed`,unverified:`unverified`,unique:`unique`},Pr={sonnet:`Sonnet`,gemini:`Gemini`,opus:`Opus`,haiku:`Haiku`,other:`Other`},Fr=[`confirmed`,`disputed`,`unverified`,`unique`],Ir=.01;function Lr({consensusId:e,data:t,onError:n}){let[r,i]=(0,_.useState)(t?{kind:`full`,data:t}:e?{kind:`loading`}:{kind:`empty`});return(0,_.useEffect)(()=>{if(t)return;let r=!1;return i(e=>e.kind===`error`?e:{kind:`loading`}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(e)}`).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok){let n=typeof t?.error==`string`?t.error:`HTTP ${e.status}`;throw Error(n)}return t}).then(e=>{r||i({kind:`full`,data:e})}).catch(e=>{r||(i(t=>({kind:`error`,error:e.message,stale:t.kind===`full`?t.data:void 0})),n?.(e))}),()=>{r=!0}},[e,t,n]),r.kind===`loading`?(0,R.jsx)(Qr,{}):r.kind===`empty`?(0,R.jsx)($r,{}):r.kind===`error`?(0,R.jsx)(ei,{error:r.error,stale:r.stale}):(0,R.jsx)(Rr,{data:r.data})}function Rr({data:e}){return(0,R.jsxs)(`div`,{className:`rounded-md border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface-elev)`},children:[(0,R.jsxs)(`header`,{className:`mb-4 flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`h-section`,style:{color:`var(--ink)`},children:`Consensus flow`}),(0,R.jsxs)(`p`,{className:`mt-0.5 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[e.summary.totalFindings,` findings across `,e.agentCount,` agents`]})]}),e.coverageDegraded&&(0,R.jsx)(zr,{degraded:e.coverageDegraded})]}),(0,R.jsx)(`div`,{className:`hidden lg:block`,children:(0,R.jsx)(qr,{data:e})}),(0,R.jsx)(`div`,{className:`block lg:hidden`,children:(0,R.jsx)(Yr,{data:e})}),(0,R.jsx)(Zr,{data:e})]})}function zr({degraded:e}){return(0,R.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 font-mono text-[10px]`,style:{background:`var(--warn-soft)`,color:`var(--warn)`,border:`1px solid var(--warn)`},"data-tooltip":`Coverage degraded: expected ${e.expected}, received ${e.received}. Dropped: ${e.droppedAgents.join(`, `)||`none`}`,children:`coverage degraded`})}var Br=720,Vr=320,Hr=120,Ur=0,Wr=(Br-Hr)/2,Gr=Br-Hr,Kr=8;function qr({data:e}){let t=(0,_.useMemo)(()=>Jr(e),[e]),n=(0,_.useMemo)(()=>t.edges,[t.edges]),r=ti();return(0,R.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,R.jsxs)(`svg`,{viewBox:`0 0 ${Br} ${Vr}`,width:`100%`,height:Vr,role:`img`,"aria-label":`Consensus flow: ${e.summary.confirmed} confirmed, ${e.summary.disputed} disputed, ${e.summary.unverified} unverified, ${e.summary.unique} unique of ${e.summary.totalFindings} findings across ${e.agentCount} agents`,style:{display:`block`},children:[(0,R.jsx)(`g`,{children:n.map((e,t)=>(0,R.jsx)(`path`,{d:e.path,fill:e.color,fillOpacity:.55,stroke:`none`,style:r?void 0:{animation:`consensus-flow-ribbon-in 480ms ease-out ${t*40}ms both`},children:(0,R.jsx)(`title`,{children:e.tooltip})},`${e.fromFamily}-${e.toVerdict}`))}),(0,R.jsx)(`g`,{children:t.left.map(e=>(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`rect`,{x:Ur,y:e.y,width:Hr,height:e.h,fill:`var(--ink-4)`,fillOpacity:.18}),(0,R.jsxs)(`text`,{x:114,y:e.y+e.h/2,textAnchor:`end`,dominantBaseline:`middle`,fontSize:11,fill:`var(--ink)`,style:{fontFamily:`var(--font-mono)`},children:[Pr[e.family],` · `,e.agentCount]})]},e.family))}),(0,R.jsx)(`g`,{children:t.right.map(e=>(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`rect`,{x:Wr,y:e.y,width:Hr,height:e.h,fill:Mr[e.verdict],fillOpacity:.16}),(0,R.jsxs)(`text`,{x:360,y:e.y+e.h/2,textAnchor:`middle`,dominantBaseline:`middle`,fontSize:11,fill:`var(--ink)`,style:{fontFamily:`var(--font-mono)`,fontVariant:`small-caps`,letterSpacing:`0.04em`},children:[Nr[e.verdict],` · `,e.count]})]},e.verdict))}),(0,R.jsx)(`g`,{children:t.right.map(t=>{let n=e.summary.totalFindings>0?Math.round(t.count/e.summary.totalFindings*100):0;return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`rect`,{x:Gr,y:t.y,width:Hr,height:t.h,fill:Mr[t.verdict],fillOpacity:.32}),(0,R.jsxs)(`text`,{x:714,y:t.y+t.h/2,textAnchor:`end`,dominantBaseline:`middle`,fontSize:11,fill:`var(--ink)`,style:{fontFamily:`var(--font-mono)`},children:[t.count,` · `,n,`%`]})]},t.verdict)})})]}),(0,R.jsx)(`style`,{children:`
18
+ @keyframes consensus-flow-ribbon-in {
19
+ from { opacity: 0; }
20
+ to { opacity: 1; }
21
+ }
22
+ @media (prefers-reduced-motion: reduce) {
23
+ svg * { animation: none !important; }
24
+ }
25
+ `})]})}function Jr(e){let t=e.summary.totalFindings,n=Vr-Kr*2,r=new Map;for(let t of e.familyToOutcome)r.set(t.from.family,(r.get(t.from.family)??0)+t.to.count);let i=e.modelFamilyToFindings.reduce((e,t)=>e+(r.get(t.family)??0),0)||1,a=Kr,o=e.modelFamilyToFindings.map(e=>{let t=r.get(e.family)??0,o=Math.max(20,t/i*n),s={family:e.family,y:a,h:o,agentCount:e.agentCount};return a+=o,s}),s=Kr,c=Fr.map(r=>{let i=e.summary[r],a=t>0?i/t:0,o=Math.max(24,a*n),c={verdict:r,y:s,h:o,count:i};return s+=o,c}),l=new Map,u=new Map,d=[],f=[...e.familyToOutcome].sort((e,t)=>e.from.family===t.from.family?Fr.indexOf(e.to.verdict)-Fr.indexOf(t.to.verdict):e.from.family.localeCompare(t.from.family));for(let t of f){let n=o.find(e=>e.family===t.from.family),i=c.find(e=>e.verdict===t.to.verdict);if(!n||!i)continue;let a=r.get(t.from.family)??0,s=a>0?t.to.count/a*n.h:0,f=i.count||1,p=t.to.count/f*i.h,m=l.get(t.from.family)??0,h=u.get(t.to.verdict)??0;if(l.set(t.from.family,m+s),u.set(t.to.verdict,h+p),t.weight<Ir)continue;let g=n.y+m,_=g+s,v=i.y+h,y=v+p,b=Wr,x=b-(b-120)*.5,S=`M 120 ${g} C 210 ${g}, ${x} ${v}, ${b} ${v} L ${b} ${y} C ${x} ${y}, 210 ${_}, 120 ${_} Z`,C=e.modelFamilyToFindings.find(e=>e.family===t.from.family)?.agentCount??0;d.push({path:S,color:Mr[t.to.verdict],tooltip:`${C} ${Pr[t.from.family]} agent${C===1?``:`s`} → ${t.to.count} ${Nr[t.to.verdict]} finding${t.to.count===1?``:`s`} (${Math.round(t.weight*100)}%)`,fromFamily:t.from.family,toVerdict:t.to.verdict})}return{left:o,right:c,edges:d}}function Yr({data:e}){let t=e.summary.totalFindings||1;return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(Xr,{label:`Model families`,items:e.modelFamilyToFindings.map(e=>({key:e.family,label:`${Pr[e.family]} (${e.agentCount})`,value:e.agentCount,color:`var(--ink-4)`}))}),(0,R.jsx)(Xr,{label:`Findings reviewed`,items:Fr.map(t=>({key:t,label:`${Nr[t]} (${e.summary[t]})`,value:e.summary[t],color:Mr[t]}))}),(0,R.jsx)(Xr,{label:`Outcome verdicts`,items:Fr.map(n=>({key:n,label:`${e.summary[n]} · ${Math.round(e.summary[n]/t*100)}%`,value:e.summary[n],color:Mr[n]}))})]})}function Xr({label:e,items:t}){let n=t.reduce((e,t)=>e+t.value,0)||1;return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-1 text-[10px]`,style:{color:`var(--ink-3)`,fontFamily:`var(--font-sans)`,fontVariant:`small-caps`,letterSpacing:`0.04em`},children:e}),(0,R.jsx)(`div`,{className:`flex h-6 overflow-hidden rounded-sm border`,style:{borderColor:`var(--border)`},children:t.map(e=>{let t=e.value/n*100;return t<.5?null:(0,R.jsx)(`div`,{title:e.label,style:{width:`${t}%`,background:e.color,opacity:.7,color:`var(--surface)`,fontFamily:`var(--font-mono)`,fontSize:`10px`,display:`flex`,alignItems:`center`,justifyContent:`center`,whiteSpace:`nowrap`,overflow:`hidden`},children:t>12?e.label:``},e.key)})})]})}function Zr({data:e}){return(0,R.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t pt-3 font-mono text-[10px]`,style:{borderColor:`var(--border)`,color:`var(--ink-3)`},children:[Fr.map(t=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-sm`,style:{background:Mr[t]}}),Nr[t],` · `,e.summary[t]]},t)),e.summary.newFindings>0&&(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-sm`,style:{background:`var(--warn)`}}),`new · `,e.summary.newFindings]})]})}function Qr(){return(0,R.jsxs)(`div`,{className:`rounded-md border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface-elev)`},"aria-busy":`true`,"aria-label":`Loading consensus flow`,children:[(0,R.jsxs)(`div`,{className:`mb-4 space-y-2`,children:[(0,R.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded-sm`,style:{background:`var(--border)`}}),(0,R.jsx)(`div`,{className:`h-2 w-48 animate-pulse rounded-sm`,style:{background:`var(--border)`}})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-3 gap-3`,style:{height:Vr},children:[0,1,2].map(e=>(0,R.jsx)(`div`,{className:`flex flex-col gap-2`,children:[0,1,2,3].map(e=>(0,R.jsx)(`div`,{className:`flex-1 animate-pulse rounded-sm`,style:{background:`var(--border)`,opacity:.6}},e))},e))}),(0,R.jsx)(`style`,{children:`
26
+ @media (prefers-reduced-motion: reduce) {
27
+ .animate-pulse { animation: none !important; }
28
+ }
29
+ `})]})}function $r(){return(0,R.jsx)(`div`,{className:`rounded-md border p-10 text-center`,style:{borderColor:`var(--border)`,background:`var(--surface-elev)`},children:(0,R.jsx)(`p`,{className:`font-mono text-[12px]`,style:{color:`var(--ink-3)`},children:`No consensus rounds yet — dispatch your first review to see the consensus flow.`})})}function ei({error:e,stale:t}){return(0,R.jsxs)(`div`,{className:`relative rounded-md border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface-elev)`},children:[(0,R.jsx)(`div`,{className:`absolute right-3 top-3`,children:(0,R.jsxs)(`span`,{className:`rounded-sm px-1.5 py-0.5 font-mono text-[10px]`,style:{background:`var(--bad-soft)`,color:`var(--bad)`,border:`1px solid var(--bad)`},title:e,children:[`error · `,e]})}),t?(0,R.jsx)(`div`,{style:{opacity:.5,pointerEvents:`none`},children:(0,R.jsx)(Rr,{data:t})}):(0,R.jsx)(`p`,{className:`py-10 text-center font-mono text-[12px]`,style:{color:`var(--ink-3)`},children:`Failed to load consensus flow.`})]})}function ti(){let[e,t]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);t(e.matches);let n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function ni({consensusId:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsxs)(`nav`,{className:`mb-2 flex items-center gap-2 font-mono text-[11px]`,style:{color:`var(--ink-3)`},"aria-label":`Breadcrumb`,children:[(0,R.jsx)(`a`,{href:b(`/`),className:`hover:underline`,style:{color:`var(--ink-3)`},children:`Overview`}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,R.jsx)(`span`,{style:{color:`var(--ink)`},children:e})]}),(0,R.jsx)(`h1`,{className:`h-route`,children:`Consensus flow`}),(0,R.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:`Model families on the left, findings reviewed in the middle, verdicts on the right.`})]}),(0,R.jsx)(Lr,{consensusId:e})]})}function ri({status:e}){let t=kt(e),n=At[t];return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 font-mono text-[11px] font-semibold ${n.iconBox} ${n.text}`,style:n.textStyle,children:[(0,R.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,className:n.pulse?`animate-pulse motion-reduce:animate-none`:``,children:jt[t]}),n.label]})}function ii({taskId:e}){return(0,R.jsxs)(`nav`,{className:`mb-4 flex items-center gap-1.5 font-mono text-[11px]`,style:{color:`var(--ink-3)`},"aria-label":`Breadcrumb`,children:[(0,R.jsx)(`button`,{onClick:()=>x(`/tasks`),className:`transition hover:underline`,style:{color:`var(--ink-2)`},children:`Tasks`}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`›`}),(0,R.jsx)(`span`,{style:{color:`var(--ink-3)`},children:e.slice(0,8)})]})}function ai({task:e}){let t=kt(e.status),n=new Date(e.createdAt??e.timestamp),r=t===`running`,i=r?null:new Date(e.timestamp).getTime(),a=e=>e.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),o=t===`failed`,s=o?`Failed`:r?`Running…`:`Completed`,c=o?`var(--bad)`:r?`var(--info)`:`var(--ok)`,l=o?`var(--bad)`:r?`var(--info)`:`var(--ok)`;return(0,R.jsxs)(`div`,{className:`flex items-start gap-0`,"aria-label":`Task lifecycle timeline`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col items-center`,style:{minWidth:120},children:[(0,R.jsx)(`div`,{className:`h-3 w-3 rounded-full border-2`,style:{borderColor:`var(--ink-3)`,background:`var(--surface)`}}),(0,R.jsx)(`div`,{className:`mt-1 font-mono text-[10px] font-semibold`,style:{color:`var(--ink-2)`},children:`Dispatched`}),(0,R.jsx)(`div`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:a(n)})]}),(0,R.jsx)(`div`,{className:`mt-1.5 flex-1`,style:{height:2,background:o?`color-mix(in oklch, var(--bad) 30%, transparent)`:`var(--border)`,minWidth:40},"aria-hidden":!0}),(0,R.jsxs)(`div`,{className:`flex flex-col items-center`,style:{minWidth:120},children:[(0,R.jsx)(`div`,{className:`h-3 w-3 rounded-full border-2`,style:{borderColor:l,background:o?`color-mix(in oklch, var(--bad) 15%, transparent)`:`var(--surface)`}}),(0,R.jsx)(`div`,{className:`mt-1 font-mono text-[10px] font-semibold`,style:{color:c},children:s}),(0,R.jsx)(`div`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:i?a(new Date(i)):`—`})]})]})}function oi({children:e}){return(0,R.jsx)(`h3`,{className:`mb-3 h-section pb-2`,style:{borderBottom:`1px solid var(--border)`},children:e})}function si({label:e,children:t,dimmed:n=!1}){return(0,R.jsxs)(`div`,{className:`flex items-start gap-4 py-1.5 border-b border-border/20 last:border-0`,children:[(0,R.jsx)(`span`,{className:`w-32 shrink-0 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:e}),(0,R.jsx)(`span`,{className:`flex-1 font-mono text-[11px]`,style:{color:n?`color-mix(in oklch, var(--ink-3) 60%, transparent)`:`var(--ink-2)`},children:t})]})}function ci({taskId:e}){return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(ii,{taskId:e}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-8 text-center`,style:{borderColor:`var(--border)`,background:`var(--surface)`},children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,style:{color:`var(--ink-2)`},children:`Task not found`}),(0,R.jsx)(`div`,{className:`mt-2 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:(0,R.jsx)(`code`,{className:`rounded px-1`,style:{fontFamily:`JetBrains Mono, monospace`,background:`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`},children:e})}),(0,R.jsxs)(`div`,{className:`mt-4 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[`No task with this ID exists in task-graph.jsonl.`,` `,(0,R.jsx)(`button`,{onClick:()=>x(`/tasks`),className:`underline transition hover:opacity-80`,style:{color:`var(--info)`},children:`Back to Tasks list`})]})]})]})}function li({taskId:e}){return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(ii,{taskId:e}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-8 text-center`,style:{borderColor:`var(--bad)`,background:`color-mix(in oklch, var(--bad) 6%, var(--surface))`},children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,style:{color:`var(--bad)`},children:`Failed to load task`}),(0,R.jsx)(`div`,{className:`mt-2 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:(0,R.jsx)(`code`,{className:`rounded px-1`,style:{fontFamily:`JetBrains Mono, monospace`,background:`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`},children:e})}),(0,R.jsxs)(`div`,{className:`mt-4 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[`The server returned an error or the response was malformed.`,` `,(0,R.jsx)(`button`,{onClick:()=>x(`/tasks`),className:`underline transition hover:opacity-80`,style:{color:`var(--info)`},children:`Back to Tasks list`})]})]})]})}function ui(){return(0,R.jsx)(`span`,{style:{color:`color-mix(in oklch, var(--ink-3) 50%, transparent)`},children:`○ none`})}function di({detail:e,loading:t}){if(t)return(0,R.jsx)(`div`,{className:`space-y-0`,children:[`consensus round`,`sibling tasks`,`round findings`,`signals`].map(e=>(0,R.jsx)(si,{label:e,dimmed:!0,children:(0,R.jsx)(`span`,{className:`inline-block h-3 w-24 rounded animate-pulse`,style:{background:`color-mix(in oklch, var(--border) 60%, transparent)`},"aria-label":`loading`})},e))});let n=e?.consensusId,r=e?.siblingTaskIds??[],i=e?.siblingsTruncated??!1,a=e?.signalCount??0,o=e?.findingCount??0;return(0,R.jsxs)(`div`,{className:`space-y-0`,children:[(0,R.jsx)(si,{label:`consensus round`,children:n?(0,R.jsx)(`a`,{href:b(`/consensus/${encodeURIComponent(n)}`),className:`transition hover:underline`,style:{color:`var(--info)`,fontFamily:`JetBrains Mono, monospace`},children:n}):(0,R.jsx)(ui,{})}),(0,R.jsx)(si,{label:`sibling tasks`,children:r.length>0?(0,R.jsxs)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-0.5`,children:[(0,R.jsxs)(`span`,{style:{color:`var(--ink-2)`},children:[r.length,i?`+`:``]}),r.slice(0,5).map(e=>(0,R.jsx)(`a`,{href:b(`/tasks/${encodeURIComponent(e)}`),className:`transition hover:underline`,style:{color:`var(--info)`,fontFamily:`JetBrains Mono, monospace`},children:e.slice(0,8)},e)),r.length>5&&(0,R.jsxs)(`span`,{style:{color:`var(--ink-3)`},children:[`+`,r.length-5,` more`]})]}):(0,R.jsx)(ui,{})}),(0,R.jsx)(si,{label:`round findings`,children:o>0?(0,R.jsx)(`span`,{style:{color:`var(--ink-2)`},children:o}):(0,R.jsx)(ui,{})}),(0,R.jsx)(si,{label:`signals`,children:a>0?(0,R.jsx)(`a`,{href:b(`/signals`),className:`transition hover:underline`,style:{color:`var(--info)`},children:a}):(0,R.jsx)(ui,{})})]})}function fi({taskId:e,tasks:t}){let n=t?.items.find(t=>t.taskId===e),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let t=!1;return o(!0),c(!1),u(!1),i(null),fetch(`/dashboard/api/tasks/${encodeURIComponent(e)}`).then(async e=>{if(e.status===404){t||c(!0);return}if(!e.ok){t||u(!0);return}let n=await e.json().catch(()=>null);t||(n&&typeof n==`object`&&`taskId`in n?i(n):u(!0))}).catch(()=>{t||u(!0)}).finally(()=>{t||o(!1)}),()=>{t=!0}},[e]);let d=r??n;if(!a&&s&&!d)return(0,R.jsx)(ci,{taskId:e});if(!a&&l&&!d)return(0,R.jsx)(li,{taskId:e});if(!a&&!d)return(0,R.jsx)(ci,{taskId:e});if(a&&!d)return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(ii,{taskId:e}),(0,R.jsx)(`div`,{className:`rounded-lg border p-8 text-center font-mono text-[11px]`,style:{borderColor:`var(--border)`,background:`var(--surface)`,color:`var(--ink-3)`},children:(0,R.jsx)(`span`,{className:`inline-block h-3 w-32 rounded animate-pulse`,style:{background:`color-mix(in oklch, var(--border) 60%, transparent)`}})})]});let f=d,p=kt(f.status),m=Re(f.agentId),h=(f.inputTokens??0)+(f.outputTokens??0);return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(ii,{taskId:e}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface)`},children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,R.jsx)(ri,{status:f.status}),m&&(0,R.jsx)(`span`,{className:`rounded-sm border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wider ${m.cls}`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,...m.clsStyle},children:m.label}),(0,R.jsx)(`code`,{className:`rounded px-2 py-0.5 text-[11px]`,style:{fontFamily:`JetBrains Mono, monospace`,color:`var(--ink-2)`,background:`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`},children:f.taskId})]}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-4`,children:[(0,R.jsxs)(`a`,{href:b(`/agent/${encodeURIComponent(f.agentId)}`),className:`inline-flex items-center gap-2 font-mono text-xs transition hover:opacity-80`,style:{color:`var(--ink-2)`},children:[(0,R.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:Le(f.agentId)}}),f.agentId]}),h>0&&(0,R.jsxs)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-2)`},children:(f.inputTokens??0).toLocaleString()}),` `,`in /`,` `,(0,R.jsx)(`span`,{style:{color:`var(--ink-2)`},children:(f.outputTokens??0).toLocaleString()}),` `,`out tokens`]}),f.duration!=null&&(0,R.jsx)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:Ne(f.duration)}),(0,R.jsx)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:L(f.timestamp)})]}),(0,R.jsx)(`div`,{className:`mt-5`,children:(0,R.jsx)(ai,{task:f})})]}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface)`},children:[(0,R.jsx)(oi,{children:`context`}),(0,R.jsx)(di,{detail:r,loading:a})]}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface)`},children:[(0,R.jsx)(oi,{children:`task`}),(0,R.jsx)(`div`,{className:`task-md rounded-md border border-border/40 p-3 text-xs leading-relaxed overflow-x-auto`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,color:`color-mix(in oklch, var(--ink) 90%, transparent)`},dangerouslySetInnerHTML:{__html:Oe(f.task)}})]}),(0,R.jsxs)(`div`,{className:`rounded-lg border p-5`,style:{borderColor:`var(--border)`,background:`var(--surface)`},children:[(0,R.jsx)(oi,{children:`result`}),f.result?(0,R.jsx)(`div`,{className:`finding-md rounded-md border border-border/40 p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:bg-[color-mix(in_oklch,var(--surface-sunk)_40%,transparent)] [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-[color-mix(in_oklch,var(--surface-sunk)_30%,transparent)] [&_.inline-code-block]:p-2`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,color:`color-mix(in oklch, var(--ink) 90%, transparent)`},dangerouslySetInnerHTML:{__html:Me(f.result)}}):(0,R.jsx)(`div`,{className:`rounded-md border border-border/40 p-5 text-center font-mono text-xs`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,color:`var(--ink-3)`},children:p===`running`?(0,R.jsx)(`span`,{style:{color:`var(--info)`},children:`Task is still running…`}):p===`failed`?(0,R.jsx)(`span`,{style:{color:`var(--bad)`},children:`Task failed — no result recorded.`}):(0,R.jsx)(`span`,{children:`No result recorded.`})})]})]})}function pi({onLogin:e,error:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),o=async t=>{if(t.preventDefault(),!(!n.trim()||i)){a(!0);try{await e(n.trim())}finally{a(!1)}}},s=t===`bad_key`?`Invalid key. Check your terminal for the correct key.`:t===`network`?`Connection error — relay may be offline.`:t===`no_cookie`?`Your browser did not store the session cookie. Disable private/incognito mode or allow cookies for this site, then try again.`:null;return(0,R.jsx)(`div`,{className:`min-h-screen flex items-center justify-center`,style:{background:`var(--surface)`},children:(0,R.jsxs)(`div`,{className:`w-full max-w-sm rounded-xl border [border-color:var(--border)] p-8 text-center`,style:{background:`var(--surface-elev)`},children:[(0,R.jsx)(`div`,{className:`crt-logo mx-auto mb-4`,style:{width:`fit-content`},children:(0,R.jsx)(`img`,{src:`/dashboard/assets/gossip-mini.png`,alt:`gossipcat`,className:`crt-logo-img h-56 w-56 object-contain`,style:{filter:`drop-shadow(0 0 28px var(--accent))`}})}),(0,R.jsx)(`p`,{className:`mb-1 font-semibold`,style:{fontFamily:`'Geist', var(--font-sans)`,fontSize:26,lineHeight:1.1,letterSpacing:`-0.02em`,color:`var(--ink)`,textShadow:`0 0 24px var(--accent)`},children:`Gossipcat`}),(0,R.jsx)(`p`,{className:`mb-6 text-[13px]`,style:{color:`var(--ink-3)`},children:`Authenticate to access the dashboard`}),(0,R.jsxs)(`form`,{onSubmit:o,children:[(0,R.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),placeholder:`Dashboard key`,autoFocus:!0,disabled:i,className:`w-full rounded-lg border [border-color:var(--border)] px-4 py-3 font-mono text-sm outline-none focus:[border-color:var(--ink-3)] focus:ring-2 focus:[--tw-ring-color:color-mix(in_oklch,var(--ink-3)_20%,transparent)] disabled:opacity-50`,style:{background:`var(--surface)`,color:`var(--ink)`}}),(0,R.jsx)(`button`,{type:`submit`,disabled:i,className:`mt-4 w-full rounded-lg px-4 py-3 text-sm font-semibold transition hover:opacity-90 disabled:opacity-60`,style:{background:`var(--accent)`,color:`#fff`},children:i?`Unlocking…`:`Unlock`})]}),s&&(0,R.jsx)(`p`,{className:`mt-3 text-sm`,style:{color:`var(--bad)`},children:s})]})})}var mi=`dashboard:theme`,hi=[`light`,`dark`];function gi(e){return e===`light`||e===`dark`?e:e===`editorial`?`light`:e==="default"?`dark`:null}function _i(e,t){let n=gi(e);return n===null?t?`dark`:`light`:n}function vi(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-color-scheme: dark)`).matches}function yi(){if(typeof window>`u`)return`light`;let e=null;try{e=window.localStorage.getItem(mi)}catch{}return _i(e,vi())}function bi(){let[e,t]=(0,_.useState)(yi);(0,_.useEffect)(()=>{typeof document>`u`||(e===`light`?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e)},[e]);function n(e){if(hi.includes(e)&&(t(e),typeof window<`u`))try{window.localStorage.setItem(mi,e)}catch{}}return{theme:e,setTheme:n,toggle:()=>{n(e===`light`?`dark`:`light`)}}}var xi=[{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.`}],Si={background:`var(--surface-elev)`,borderRadius:`16px`,boxShadow:`var(--shadow-overlay)`,border:`1px solid var(--border)`,color:`var(--text)`,fontFamily:`var(--font-sans)`};function Ci({open:e,onClose:t}){let n=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!e)return;let r=requestAnimationFrame(()=>{n.current?.focus()}),i=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,i),document.body.style.overflow=`hidden`,()=>{cancelAnimationFrame(r),document.removeEventListener(`keydown`,i),document.body.style.overflow=``}},[e,t]),e?(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-6 backdrop-blur-sm`,style:{background:`color-mix(in oklch, var(--surface) 80%, transparent)`},onClick:t,role:`presentation`,children:(0,R.jsxs)(`div`,{className:`relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden`,style:Si,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`glossary-title`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border/60 px-5 py-3.5`,children:[(0,R.jsx)(`h2`,{id:`glossary-title`,className:`font-mono text-sm font-semibold`,style:{color:`var(--text)`},children:`Gossipcat Glossary`}),(0,R.jsx)(`button`,{ref:n,onClick:t,"aria-label":`Close glossary`,className:`flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 font-mono text-xs transition hover:[color:var(--text)] hover:[background:var(--surface-sunk)]`,style:{background:`var(--surface-elev)`,color:`var(--text-dim)`},children:`×`})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4`,children:(0,R.jsx)(`dl`,{className:`space-y-5`,children:xi.map(({term:e,definition:t,seeAlso:n})=>(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40 px-4 py-3`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`},children:[(0,R.jsx)(`dt`,{className:`h-section`,children:e}),(0,R.jsx)(`dd`,{className:`mt-1.5 font-mono text-xs leading-relaxed`,style:{color:`color-mix(in oklch, var(--text) 80%, transparent)`},children:t}),n&&(0,R.jsxs)(`dd`,{className:`mt-1.5 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:[`See also: `,n]})]},e))})}),(0,R.jsx)(`div`,{className:`shrink-0 border-t border-border/60 px-5 py-3`,children:(0,R.jsx)(`a`,{href:`https://github.com/gossipcat-ai/gossipcat-ai/blob/master/docs/HANDBOOK.md`,target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-xs transition hover:underline`,style:{color:`var(--accent)`},children:`Read the full HANDBOOK →`})})]})}):null}var wi=[{to:`/`,label:`Dashboard`,match:e=>e===`/`||e===`/overview`},{to:`/chat`,label:`Chat`,match:e=>e===`/chat`},{to:`/team`,label:`Team`,match:e=>e===`/team`||e.startsWith(`/agent/`)},{to:`/debates`,label:`Consensus Rounds`,match:e=>e===`/debates`},{to:`/tasks`,label:`Tasks`,match:e=>e===`/tasks`},{to:`/signals`,label:`Signals`,match:e=>e===`/signals`},{to:`/logs`,label:`Logs`,match:e=>e===`/logs`}];function Ti(){let[e,t]=(0,_.useState)(!1),n=C(),{theme:r,toggle:i}=bi();return(0,R.jsxs)(`nav`,{className:`relative flex items-center justify-between border-b border-border px-6 py-3.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,R.jsxs)(`a`,{href:b(`/`),className:`flex items-center gap-3 leading-none`,children:[(0,R.jsx)(`img`,{src:`/dashboard/assets/gossip-mini.png`,alt:``,className:`h-10 w-10 object-contain`}),(0,R.jsx)(`span`,{className:`text-[17px] font-bold`,style:{color:`var(--accent)`},children:`gossipcat`})]}),(0,R.jsx)(`div`,{className:`flex gap-1`,children:wi.map(e=>{let t=e.match(n);return(0,R.jsx)(`a`,{href:b(e.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${t?`font-semibold`:`hover:bg-accent/10`}`,style:t?{background:`color-mix(in oklch, var(--accent) 10%, transparent)`,color:`var(--accent)`}:{color:`var(--ink-3)`},children:e.label},e.to)})})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,title:`Search — coming soon`,style:{display:`inline-flex`,alignItems:`center`,gap:`8px`,height:`32px`,padding:`0 12px`,minWidth:`220px`,background:`var(--surface-elev)`,border:`1px solid var(--border)`,borderRadius:`8px`,color:`var(--ink-3)`,fontFamily:`var(--font-sans)`,fontSize:`13px`,cursor:`default`},children:[(0,R.jsx)(`span`,{style:{opacity:.7},children:`Search…`}),(0,R.jsx)(`kbd`,{style:{marginLeft:`auto`,padding:`1px 6px`,borderRadius:`4px`,background:`var(--surface-sunk)`,border:`1px solid var(--border)`,fontFamily:`var(--font-mono)`,fontSize:`11px`,color:`var(--ink-3)`},children:`⌘K`})]}),(0,R.jsx)(`button`,{type:`button`,onClick:i,title:`Switch to ${r===`light`?`dark`:`light`} theme`,"aria-label":`Switch to ${r===`light`?`dark`:`light`} theme`,style:{width:`32px`,height:`32px`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`var(--surface-elev)`,border:`1px solid var(--border)`,borderRadius:`8px`,color:`var(--ink)`,cursor:`pointer`,fontSize:`16px`,lineHeight:1},children:r===`light`?`◐`:`◑`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(!0),"aria-label":`Open glossary`,title:`Glossary`,style:{width:`32px`,height:`32px`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`var(--surface-elev)`,border:`1px solid var(--border)`,borderRadius:`8px`,color:`var(--ink)`,cursor:`pointer`,lineHeight:1},children:(0,R.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,R.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,R.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`})]})})]}),(0,R.jsx)(Ci,{open:e,onClose:()=>t(!1)})]})}var Ei={completed:{label:`COMPLETED`,cls:`text-confirmed bg-confirmed/10`},failed:{label:`FAILED`,cls:`text-destructive bg-destructive/10`},cancelled:{label:`CANCELLED`,cls:``,clsStyle:{color:`var(--text-dim)`,background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`}},running:{label:`RUNNING`,cls:`text-unverified bg-unverified/10 animate-pulse`}};function Di({task:e,onClose:t}){if((0,_.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,n),document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,n),document.body.style.overflow=``}},[e,t]),!e)return null;let n=Ei[e.status],r=(e.inputTokens||0)+(e.outputTokens||0);return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 backdrop-blur-sm`,style:{background:`color-mix(in oklch, var(--surface) 80%, transparent)`},onClick:t,children:(0,R.jsxs)(`div`,{className:`relative mt-12 w-full max-w-3xl rounded-lg border border-border`,style:{background:`var(--surface-elev)`,boxShadow:`var(--shadow-overlay)`},onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border/60 px-5 py-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${n.cls}`,style:n.clsStyle,children:n.label}),(0,R.jsx)(`span`,{className:`warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold`,children:e.taskId.slice(0,8)}),(0,R.jsx)(`a`,{href:`/dashboard/agent/${encodeURIComponent(e.agentId)}`,className:`truncate font-mono text-xs transition`,style:{color:`var(--text-dim)`},children:e.agentId})]}),(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3 font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[(0,R.jsx)(`span`,{children:L(e.timestamp)}),e.duration!=null&&(0,R.jsxs)(`span`,{children:[`· `,Ne(e.duration)]}),r>0&&(0,R.jsxs)(`span`,{children:[`· `,r.toLocaleString(),` tokens (`,(e.inputTokens||0).toLocaleString(),` in / `,(e.outputTokens||0).toLocaleString(),` out)`]})]})]}),(0,R.jsx)(`button`,{onClick:t,className:`shrink-0 rounded-md border border-border/40 px-2 py-1 font-mono text-xs transition hover:bg-accent/10`,style:{background:`var(--surface-elev)`,color:`var(--text-dim)`},"aria-label":`Close`,children:`✕`})]}),(0,R.jsxs)(`div`,{className:`max-h-[calc(100vh-220px)] space-y-5 overflow-y-auto px-5 py-4`,children:[(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 h-section`,children:`Task`}),(0,R.jsx)(`div`,{className:`task-md rounded-md border border-border/40 p-3 text-xs leading-relaxed overflow-x-auto`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,color:`color-mix(in oklch, var(--text) 90%, transparent)`},dangerouslySetInnerHTML:{__html:Oe(e.task)}})]}),e.result?(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 h-section`,children:`Result`}),(0,R.jsx)(`div`,{className:`finding-md rounded-md border border-border/40 p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:bg-[color-mix(in_oklch,var(--surface-sunk)_40%,transparent)] [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-[color-mix(in_oklch,var(--surface-sunk)_30%,transparent)] [&_.inline-code-block]:p-2`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,color:`color-mix(in oklch, var(--text) 90%, transparent)`},dangerouslySetInnerHTML:{__html:Me(e.result)}})]}):(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 h-section`,children:`Result`}),(0,R.jsx)(`div`,{className:`rounded-md border border-border/40 p-3 text-center font-mono text-xs`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,color:`var(--text-dim)`},children:e.status===`running`?`Task is still running...`:`No result recorded.`})]})]})]})})}function Oi(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var ki=5,Ai={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`}},ji=[{key:`all`,label:`All`,cls:`border-border/40 hover:border-border/60`,activeCls:`border-border`,activeStyle:{color:`var(--text)`,background:`var(--surface-sunk)`},inactiveStyle:{color:`var(--text-dim)`}},{key:`confirmed`,label:`Confirmed`,cls:`text-confirmed/50 border-confirmed/20 hover:border-confirmed/40`,activeCls:`text-confirmed bg-confirmed/10 border-confirmed/40`},{key:`unique`,label:`Unique`,cls:`text-unique/50 border-unique/20 hover:border-unique/40`,activeCls:`text-unique bg-unique/10 border-unique/40`},{key:`disputed`,label:`Disputed`,cls:`text-disputed/50 border-disputed/20 hover:border-disputed/40`,activeCls:`text-disputed bg-disputed/10 border-disputed/40`},{key:`unverified`,label:`Unverified`,cls:`text-unverified/50 border-unverified/20 hover:border-unverified/40`,activeCls:`text-unverified bg-unverified/10 border-unverified/40`},{key:`insight`,label:`Insight`,cls:`text-insight/60 border-insight/20 hover:border-insight/40`,activeCls:`text-insight bg-insight/10 border-insight/40`,tooltip:`Observations without a specific file:line anchor. Not scored — cannot be confirmed or disputed by peers.`}],Mi=[{key:`all`,label:`All`,cls:`border-border/40 hover:border-border/60`,activeCls:`border-border`,activeStyle:{color:`var(--text)`,background:`var(--surface-sunk)`},inactiveStyle:{color:`var(--text-dim)`}},{key:`critical`,label:`Critical`,cls:`text-bad/50 border-bad/20 hover:border-bad/40`,activeCls:`text-bad bg-bad/10 border-bad/40`},{key:`high`,label:`High`,cls:`text-severity-high/50 border-severity-high/20 hover:border-severity-high/40`,activeCls:`text-severity-high bg-severity-high/10 border-severity-high/40`},{key:`medium`,label:`Medium`,cls:`text-severity-medium/50 border-severity-medium/20 hover:border-severity-medium/40`,activeCls:`text-severity-medium bg-severity-medium/10 border-severity-medium/40`},{key:`low`,label:`Low`,cls:`border-border/40 hover:border-border/60`,activeCls:`border-border`,activeStyle:{color:`var(--text-dim)`,background:`color-mix(in oklch, var(--surface-sunk) 50%, transparent)`},inactiveStyle:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`}}],B={critical:`text-bad bg-bad/10`,high:`text-severity-high bg-severity-high/10`,medium:`text-severity-medium bg-severity-medium/10`,low:``},V={color:`var(--text-dim)`,background:`color-mix(in oklch, var(--surface-sunk) 50%, transparent)`},Ni=`[&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:[background:var(--surface-sunk)] [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:[color:color-mix(in_oklch,var(--text)_80%,transparent)] [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:[background:color-mix(in_oklch,var(--surface-sunk)_70%,transparent)] [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:[color:color-mix(in_oklch,var(--text)_70%,transparent)] [&_.inline-code-block]:overflow-x-auto`,Pi={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 Fi({f:e,reviewInfo:t,diagnostics:n}){let r=e.tag===`confirmed`?`text-confirmed bg-confirmed/10 border-confirmed/20`:e.tag===`disputed`?`text-disputed bg-disputed/10 border-disputed/20`:e.tag===`unverified`?`text-unverified bg-unverified/10 border-unverified/20`:`text-unique bg-unique/10 border-unique/20`,i=e.severity&&B[e.severity]||``,a=e.severity===`low`?V:void 0,o=e.findingType===`suggestion`?`SUGGESTION`:e.findingType===`insight`?`INSIGHT`:null,s=e.findingType===`suggestion`?`text-info bg-info/10`:e.findingType===`insight`?`text-text-dim bg-text-dim/10`:``,c=e.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),l=c?c[1]:null;return(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40 hover:border-border/60 transition-colors px-4 py-3.5`,style:{background:`color-mix(in oklch, var(--surface-elev) 30%, transparent)`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,R.jsx)(`span`,{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${r}`,children:e.tag.toUpperCase()}),e.severity&&(0,R.jsx)(`span`,{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${i}`,style:a,children:e.severity.toUpperCase()}),o&&(0,R.jsx)(`span`,{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${s}`,children:o}),l&&(0,R.jsx)(`span`,{className:`bg-info/10 px-2 py-1 font-mono text-[10px] text-info border border-info/15 rounded`,children:l}),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 40%, transparent)`},children:e.originalAgentId}),e.confirmedBy&&e.confirmedBy.length>0&&(()=>{let t=[...new Set(e.confirmedBy)];return(0,R.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:\n${t.join(`, `)}`,"data-tooltip-pos":`left`,children:[`+`,t.length,` ✓`]})})(),e.disputedBy&&e.disputedBy.length>0&&(0,R.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:\n${e.disputedBy.map(e=>e.agentId).join(`, `)}`,"data-tooltip-pos":`left`,children:[e.disputedBy.length,` ⚡`]}),e.unverifiedBy&&e.unverifiedBy.length>0&&(0,R.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:\n${e.unverifiedBy.map(e=>e.agentId).join(`, `)}`,"data-tooltip-pos":`left`,children:[e.unverifiedBy.length,` ◇`]})]}),n&&n.length>0&&(0,R.jsx)(`div`,{className:`mt-1.5 mb-1 space-y-1`,children:n.map((e,t)=>(0,R.jsxs)(`div`,{className:`rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5`,"data-diagnostic-code":e.code,children:[(0,R.jsxs)(`div`,{className:`font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80`,children:[`⚠ `,e.code]}),(0,R.jsx)(`div`,{className:`mt-0.5 text-[11px]`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},dangerouslySetInnerHTML:{__html:Oi(Pi[e.code])+` — `+Oi(e.message)}})]},t))}),e.disputedBy&&e.disputedBy.length>0&&(0,R.jsx)(`div`,{className:`mt-1.5 mb-1 rounded border border-disputed/10 bg-disputed/5 px-2.5 py-1.5`,children:e.disputedBy.map((e,t)=>(0,R.jsxs)(`div`,{className:`text-[11px]`,children:[(0,R.jsx)(`span`,{className:`font-mono font-bold text-disputed/70`,children:e.agentId}),(0,R.jsxs)(`span`,{style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:[` — `,e.reason||e.evidence||`No reason given`]})]},t))}),(0,R.jsx)(`div`,{className:`finding-md font-inter text-xs leading-relaxed ${Ni}`,style:{color:`var(--text-dim)`},dangerouslySetInnerHTML:{__html:Me(e.finding)}}),t&&(0,R.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.reviewers.map(e=>(0,R.jsx)(`span`,{title:e,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:Le(e)},children:Pe(e)},e)),(0,R.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${t.assigned>=t.targetK?`text-confirmed/70 bg-confirmed/5`:`text-unverified/70 bg-unverified/5`}`,children:[t.assigned>=t.targetK?`✓`:`⚠`,` `,t.assigned,`/`,t.targetK]})]})]})}function Ii({consensus:e,reports:t,showAll:n=!1,hideHeader:r=!1,filteredRuns:i}){let a=i??e.runs,o=n?a:a.slice(0,ki);!n&&a.length;let[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)({}),[d,f]=(0,_.useState)({}),[p,m]=(0,_.useState)(1),[h,g]=(0,_.useState)([]),[v,y]=(0,_.useState)(0),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)({});(0,_.useEffect)(()=>{if(!n&&t?.reports&&(g(t.reports),y(t.totalReports??t.reports.length),m(1)),t?.roundRetractions){let e={};for(let n of t.roundRetractions)e[n.consensus_id]={reason:n.reason,retracted_at:n.retracted_at};C(e)}},[t,n]),(0,_.useEffect)(()=>{if(!n)return;let e=!1;return(async()=>{try{let t=await z(`consensus-reports?page=1&pageSize=200`);if(e)return;if(g(t.reports||[]),y(t.totalReports??(t.reports?.length||0)),m(1),t.roundRetractions){let e={};for(let n of t.roundRetractions)e[n.consensus_id]={reason:n.reason,retracted_at:n.retracted_at};C(e)}}catch{}})(),()=>{e=!0}},[n]);let w=h.slice().sort((e,t)=>t.timestamp.localeCompare(e.timestamp)),[T,ee]=(0,_.useState)(0),E=Math.max(1,Math.ceil(w.length/10)),D=Math.min(T,E-1);(0,_.useEffect)(()=>{T>=E&&ee(0)},[T,E]);let O=n?w.slice(D*10,(D+1)*10):w.slice(0,ki),k=(0,_.useMemo)(()=>{let e=new Map;for(let t of h){let n={};if(t.crossReviewAssignments||t.crossReviewCoverage){let e={};if(t.crossReviewAssignments)for(let[n,r]of Object.entries(t.crossReviewAssignments))for(let t of r)(e[t]??=[]).push(n);if(t.crossReviewCoverage)for(let r of t.crossReviewCoverage)n[r.findingId]={reviewers:e[r.findingId]||[],assigned:r.assigned,targetK:r.targetK};else for(let[t,r]of Object.entries(e))n[t]={reviewers:r,assigned:r.length,targetK:r.length}}e.set(t.id,n)}return e},[h]),A=e=>{let t=new Date,n=new Date(e),r=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),i=Math.round((r(t)-r(n))/864e5);return i<=0?`Today`:i===1?`Yesterday`:i<7?`${i} days ago`:i<30?`${Math.floor(i/7)} weeks ago`:n.toISOString().slice(0,10)};return(0,R.jsxs)(`section`,{children:[!r&&(0,R.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`h-section`,children:[`Consensus Rounds `,(0,R.jsx)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:e.totalRuns??e.runs.length})]}),!n&&(0,R.jsx)(`a`,{href:`/dashboard/debates`,className:`font-mono text-xs transition`,style:{color:`var(--text-dim)`},children:`view all`})]}),O.length>0?(0,R.jsxs)(`div`,{className:`space-y-2`,children:[O.map((e,t)=>{let r=t>0?O[t-1]:null,i=n?A(e.timestamp):null,a=n&&r?A(r.timestamp):null,o=n&&i!==a,p=l[e.id]??`all`,m=d[e.id]??`all`,h=k.get(e.id)??{},g=[...e.confirmed,...e.disputed,...e.unverified,...e.unique,...e.insights||[]],_=p===`all`?g:p===`insight`?g.filter(e=>e.findingType===`insight`||e.findingType===`suggestion`):g.filter(e=>e.tag===p),v=m===`all`?_:_.filter(e=>e.severity===m),y=s===e.id,b=(()=>{let t=new Set;return n=>{let r=e.authorDiagnostics?.[n.originalAgentId];if(!r||r.length===0)return;let i=r.filter(e=>{let r=`${n.originalAgentId}:${e.code}`;return t.has(r)?!1:(t.add(r),!0)});return i.length>0?i:void 0}})(),x=g.length||1,C=e.confirmed.length,w=e.disputed.length,T=e.unverified.length,ee=e.unique.length,E=(e.insights||[]).length,D=(()=>{if(x===0)return`border-l-border/40`;let e=C/x,t=w/x;return e>=.5?`border-l-confirmed/60`:t>=.4?`border-l-disputed/60`:`border-l-unverified/50`})(),j=[{count:C,textCls:`text-confirmed`,label:`confirmed`},{count:w,textCls:`text-disputed`,label:`disputed`},{count:T,textCls:`text-unverified`,label:`unverified`},{count:ee,textCls:`text-unique`,label:`unique`},{count:E,textCls:`text-zinc-400`,label:`insights`}].filter(e=>e.count>0),M=[...new Set(g.map(e=>e.originalAgentId).filter(Boolean))],N=M.slice(0,5),te=S[e.id],P=!!te;return(0,R.jsxs)(`div`,{children:[o&&(0,R.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 ${t>0?`mt-4`:``}`,children:[(0,R.jsx)(`span`,{className:`h-section`,children:i}),(0,R.jsx)(`div`,{className:`h-px flex-1 bg-border/30`})]}),(0,R.jsxs)(`div`,{className:`group rounded-md border-l-2 border border-border/40 transition-all duration-150
30
+ ${D}
31
+ ${P?`opacity-60 line-through decoration-disputed/40`:``}
32
+ ${y?`border-r-border/60 border-t-border/60 border-b-border/60`:`hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:-translate-y-px`}`,style:{background:y?`var(--surface-elev)`:`color-mix(in oklch, var(--surface-elev) 50%, transparent)`},"data-retracted":P?`true`:void 0,children:[P&&(0,R.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:[(0,R.jsx)(`span`,{className:`font-bold`,children:`⚠ RETRACTED`}),te.retracted_at&&(0,R.jsxs)(`span`,{className:`ml-2 text-disputed/70`,children:[`on `,te.retracted_at.slice(0,10)]}),te.reason&&(0,R.jsxs)(`span`,{className:`ml-2`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:[`— `,te.reason]})]}),(0,R.jsxs)(`button`,{className:`flex w-full items-start gap-3 px-3 py-2.5 text-left`,"aria-expanded":y,onClick:()=>{let t=!y;c(t?e.id:null),t&&(u(t=>({...t,[e.id]:`all`})),f(t=>({...t,[e.id]:`all`})))},children:[(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-sm font-bold`,style:{color:`var(--text)`},children:g.length}),(0,R.jsx)(`span`,{className:`text-[11px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:`findings`}),(0,R.jsx)(`span`,{className:`text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 30%, transparent)`},children:`·`}),(0,R.jsxs)(`span`,{className:`text-[11px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:[e.rounds,`r`]}),N.length>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1 ml-1`,children:[N.map(e=>(0,R.jsx)(`span`,{title:e,className:`inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold`,style:{color:`var(--surface)`,backgroundColor:Le(e)},children:Pe(e)},e)),M.length>5&&(0,R.jsxs)(`span`,{className:`font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 40%, transparent)`},children:[`+`,M.length-5]})]}),(0,R.jsx)(`span`,{className:`shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[10px] font-semibold`,style:{background:`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`,color:`var(--text-dim)`},title:e.id,children:e.id.slice(0,8)}),e.zeroTagAgents&&e.zeroTagAgents.length>0&&(()=>{let t=e.zeroTagAgents,n=e.zeroTagOverflow??0,r=t.length+n;return(0,R.jsxs)(`span`,{className:`shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified`,title:`Zero-tag agents — emitted no parseable <agent_finding> tags (likely paraphrased relay or HTML-entity encoding). See HANDBOOK invariant #12. Agents: ${n>0?`${t.join(`, `)} (+${n} more)`:t.join(`, `)}`,children:[r,` zero-tag`]})})(),e.droppedFindingsByType&&Object.keys(e.droppedFindingsByType).length>0&&(()=>{let t=Object.entries(e.droppedFindingsByType),n=t.reduce((e,[,t])=>e+t,0);return(0,R.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=: ${t.map(([e,t])=>`${e}:${t}`).join(`, `)}. These never reach the dashboard, scores, or signals.`,children:[n,` dropped`]})})(),e.warnings&&e.warnings.length>0&&(()=>{let t=new Map;for(let n of e.warnings){let e=t.get(n.code)??[];e.push(n.agentId?`${n.agentId}: ${n.message}`:n.message),t.set(n.code,e)}return Array.from(t.entries()).map(([e,t])=>(0,R.jsxs)(`span`,{className:`shrink-0 rounded border border-warn/30 bg-warn/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-warn`,title:t.join(`
33
+ `),children:[e,t.length>1?` ×${t.length}`:``]},e))})(),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[10px] shrink-0`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:L(e.timestamp)})]}),(0,R.jsx)(`div`,{className:`mt-1.5 flex items-center gap-3`,children:j.map(e=>(0,R.jsxs)(`span`,{className:`font-mono text-[10px] font-semibold ${e.textCls}`,children:[e.count,` `,e.label]},e.label))}),e.topic&&(0,R.jsxs)(`div`,{className:`mt-1.5 flex items-start gap-2`,children:[(0,R.jsx)(`span`,{className:`shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider`,style:{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`,color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`Topic`}),(0,R.jsx)(`span`,{className:`font-inter text-[11px] leading-relaxed`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:e.topic})]})]}),(0,R.jsx)(`span`,{className:`mt-1 shrink-0 font-mono text-[10px] transition-transform duration-150 ${y?`rotate-90`:``}`,style:{color:y?`color-mix(in oklch, var(--ink) 60%, transparent)`:`color-mix(in oklch, var(--text-dim) 40%, transparent)`},children:`▸`})]}),y&&(0,R.jsxs)(`div`,{className:`border-t border-border/20 px-4 pb-4 pt-3`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`Type:`}),ji.map(t=>(0,R.jsx)(`button`,{onClick:()=>u(n=>({...n,[e.id]:t.key})),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${p===t.key?t.activeCls:t.cls}`,style:p===t.key?t.activeStyle:t.inactiveStyle,...t.tooltip?{"data-tooltip":t.tooltip}:{},children:t.label},t.key))]}),(0,R.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`Severity:`}),Mi.map(t=>(0,R.jsx)(`button`,{onClick:()=>f(n=>({...n,[e.id]:t.key})),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${m===t.key?t.activeCls:t.cls}`,style:m===t.key?t.activeStyle:t.inactiveStyle,children:t.label},t.key))]}),(e.warnings??[]).filter(e=>e.code===`coverage_degraded`).map((e,t)=>(0,R.jsx)(`div`,{className:`mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2`,children:(0,R.jsxs)(`p`,{className:`font-mono text-[10px] font-semibold text-warn`,children:[`⚠ `,e.message]})},`cd-${t}`)),e.zeroTagAgents&&e.zeroTagAgents.length>0&&(0,R.jsxs)(`div`,{className:`mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2`,children:[(0,R.jsxs)(`p`,{className:`font-mono text-[10px] font-semibold text-unverified`,children:[`⚠ Zero-tag agents — `,e.zeroTagAgents.length+(e.zeroTagOverflow??0),` agent`,e.zeroTagAgents.length+(e.zeroTagOverflow??0)===1?``:`s`,` emitted no parseable <agent_finding> tags`]}),(0,R.jsxs)(`p`,{className:`mt-0.5 font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:[e.zeroTagAgents.join(`, `),e.zeroTagOverflow&&e.zeroTagOverflow>0?` (+${e.zeroTagOverflow} more)`:``]}),(0,R.jsx)(`p`,{className:`mt-1 font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`Likely a paraphrased relay or HTML-entity-encoded tags. See HANDBOOK invariant #12.`})]}),(()=>{let t=(e.warnings??[]).filter(e=>e.code===`cross_review_skipped`);if(t.length===0)return null;let n=t.map(e=>e.agentId).filter(Boolean);return(0,R.jsxs)(`div`,{className:`mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2`,children:[(0,R.jsxs)(`p`,{className:`font-mono text-[10px] font-semibold text-warn`,children:[`⚠ Cross-review skipped: `,t.length,` relay agent`,t.length===1?``:`s`,` failed Phase 2`]}),n.length>0&&(0,R.jsx)(`p`,{className:`mt-0.5 font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:n.join(`, `)})]})})(),(e.crossReviewAssignments||e.crossReviewCoverage)&&(()=>{let t=e.crossReviewAssignments||{},n=Object.entries(t),r=e.crossReviewCoverage||[],i=r.length,a=r.filter(e=>e.assigned<e.targetK);return(0,R.jsxs)(`details`,{className:`mb-3 rounded-md border border-border/30`,style:{background:`color-mix(in oklch, var(--surface-elev) 30%, transparent)`},children:[(0,R.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-2 px-3 py-2 h-section select-none`,children:[`Cross-Review Assignments`,(e.warnings??[]).some(e=>e.code===`partial_review`)&&(0,R.jsx)(`span`,{className:`rounded border border-warn/20 bg-warn/10 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-warn`,children:`partial`}),(0,R.jsxs)(`span`,{className:`ml-auto font-mono text-[9px] font-normal normal-case tracking-normal`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:[n.length,` reviewers · `,i,` findings`]})]}),(0,R.jsxs)(`div`,{className:`border-t border-border/20 px-3 pb-3 pt-2 space-y-2`,children:[n.map(([e,t])=>(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{title:e,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold`,style:{color:`var(--surface)`,backgroundColor:Le(e)},children:Pe(e)}),(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:e}),(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 40%, transparent)`},children:[`(`,t.length,`)`]}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1 ml-1`,children:t.map(e=>(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[9px]`,style:{background:`color-mix(in oklch, var(--surface-sunk) 50%, transparent)`,color:`var(--text-dim)`},children:e.length>12?e.slice(0,12)+`…`:e},e))})]},e)),i>0&&(0,R.jsx)(`div`,{className:`mt-1 pt-1.5 border-t border-border/15`,children:a.length>0?(0,R.jsxs)(`span`,{className:`rounded border border-unverified/15 bg-unverified/5 px-2 py-1 font-mono text-[10px] font-semibold text-unverified`,children:[`⚠ `,a.length,` of `,i,` findings under-reviewed`]}):(0,R.jsxs)(`span`,{className:`font-mono text-[10px] font-semibold text-confirmed/60`,children:[`✓ All `,i,` findings fully covered`]})})]})]})})(),(0,R.jsx)(`div`,{className:`space-y-3`,children:v.length===0?(0,R.jsx)(`div`,{className:`py-4 text-center text-xs`,style:{color:`var(--text-dim)`},children:`No findings match this filter.`}):v.map((e,t)=>(0,R.jsx)(Fi,{f:e,reviewInfo:e.id?h[e.id]:void 0,diagnostics:b(e)},t))})]})]})]},e.id)}),n&&E>1&&(0,R.jsxs)(`div`,{className:`flex items-center justify-center gap-3 pt-4 font-mono text-[11px]`,style:{color:`var(--text-dim)`},children:[(0,R.jsx)(`button`,{onClick:()=>ee(e=>Math.max(0,e-1)),disabled:D===0,className:`rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`◂ Prev`}),(0,R.jsxs)(`span`,{children:[`Page `,D+1,` of `,E]}),(0,R.jsx)(`button`,{onClick:()=>ee(e=>Math.min(E-1,e+1)),disabled:D>=E-1,className:`rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`Next ▸`})]})]}):o.length===0?(0,R.jsx)(Be,{title:`No consensus runs yet`,hint:`Dispatch a consensus round with gossip_dispatch to populate this view.`}):(0,R.jsx)(`div`,{className:`space-y-2`,children:o.map((e,t)=>{let n=e.counts,r=(n.agreement||0)+(n.disagreement||0)+(n.hallucination||0)+(n.unverified||0)+(n.unique||0)+(n.new||0),i=r||1,a=s===e.taskId,o=[{key:`confirmed`,count:n.agreement||0,color:`bg-confirmed`,text:`text-confirmed`,label:`confirmed`},{key:`disputed`,count:(n.disagreement||0)+(n.hallucination||0),color:`bg-disputed`,text:`text-disputed`,label:`disputed`},{key:`unverified`,count:n.unverified||0,color:`bg-unverified`,text:`text-unverified`,label:`unverified`},{key:`unique`,count:(n.unique||0)+(n.new||0),color:`bg-unique`,text:`text-unique`,label:`unique`}],d=l[e.taskId]??`all`,f=e.signals.filter(e=>{if(e.signal===`signal_retracted`)return!1;if(d===`all`)return!!Ai[e.signal];let t=Ai[e.signal];return t&&t.filter===d}),p=!!e.retracted;return(0,R.jsxs)(`div`,{className:`rounded-md border transition ${a?`border-primary/25`:`border-border`} ${p?`opacity-60`:``}`,style:{background:`var(--surface-elev)`},"data-retracted":p?`true`:void 0,title:p&&e.retractionReason?`Retracted: ${e.retractionReason}`:void 0,children:[p&&(0,R.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:[(0,R.jsx)(`span`,{className:`font-bold uppercase tracking-wider`,children:`⚠ Retracted`}),e.retractedAt&&(0,R.jsxs)(`span`,{className:`ml-2 text-disputed/70`,children:[`on `,e.retractedAt.slice(0,10)]}),e.retractionReason&&(0,R.jsxs)(`span`,{className:`ml-2`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:[`— `,e.retractionReason]})]}),(0,R.jsxs)(`button`,{"aria-expanded":a,onClick:()=>{let t=!a;c(t?e.taskId:null),t&&u(t=>({...t,[e.taskId]:`all`}))},className:`flex w-full items-center p-3 text-left transition hover:bg-accent/10`,children:[(0,R.jsx)(`span`,{className:`mr-3 font-mono text-xs transition`,style:{color:a?`var(--ink)`:`var(--text-dim)`,fontWeight:a?600:400},children:a?`▾`:`▸`}),(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:e.taskId}),(0,R.jsxs)(`span`,{className:`font-mono text-sm font-semibold ${p?`line-through decoration-disputed/40`:``}`,style:{color:`var(--text)`},children:[r,` findings`]}),(0,R.jsxs)(`div`,{className:`flex gap-1.5`,children:[e.agents.slice(0,4).map(e=>(0,R.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 font-mono text-[10px]`,style:{background:`var(--surface-sunk)`,color:`var(--text-dim)`},children:e.split(`-`).map(e=>e[0]).join(``).toUpperCase().slice(0,2)},e)),e.agents.length>4&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[`+`,e.agents.length-4]})]})]}),(0,R.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--text-dim)`},children:L(e.timestamp)})]}),(0,R.jsx)(`div`,{className:`mt-2 flex gap-2`,children:o.map(e=>e.count>0&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px] font-semibold ${e.text} ${p?`line-through decoration-disputed/40`:``}`,children:[e.count,` `,e.label]},e.key))}),(0,R.jsx)(`div`,{className:`mt-2 flex h-1.5 overflow-hidden rounded-sm`,children:o.map(e=>e.count>0&&(0,R.jsx)(`div`,{className:`${e.color} transition-all`,style:{width:`${e.count/i*100}%`}},e.key))})]})]}),a&&(0,R.jsxs)(`div`,{className:`border-t border-border px-4 pb-3 pt-3`,children:[(0,R.jsx)(`div`,{className:`mb-3 flex gap-1.5`,children:ji.map(t=>(0,R.jsx)(`button`,{onClick:()=>u(n=>({...n,[e.taskId]:t.key})),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${d===t.key?t.activeCls:t.cls} hover:opacity-80`,style:d===t.key?t.activeStyle:t.inactiveStyle,...t.tooltip?{"data-tooltip":t.tooltip}:{},children:t.label},t.key))}),f.length===0?(0,R.jsx)(`div`,{className:`py-4 text-center text-xs`,style:{color:`var(--text-dim)`},children:`No findings match this filter.`}):(0,R.jsx)(`div`,{className:`space-y-2`,children:f.map((e,t)=>{let n=Ai[e.signal];return n?(0,R.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${n.cls}`,children:n.label}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]`,style:{color:`var(--text-dim)`},children:(0,R.jsx)(`span`,{className:`finding-md`,dangerouslySetInnerHTML:{__html:Me(e.evidence||``)}})}),(0,R.jsxs)(`span`,{className:`ml-2 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:[e.agentId,e.counterpartId?` + ${e.counterpartId}`:``]})]})]},t):null})})]})]},e.taskId+t)})})]})}var Li=25;function Ri({commits:e}){let[t,n]=(0,_.useState)(!1);if(e.length===0)return(0,R.jsx)(`span`,{style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`—`});let r=e[0],i=r.includes(` `)?r.slice(r.indexOf(` `)+1):r,a=e.length-1;return(0,R.jsxs)(`span`,{className:`font-mono text-[11px]`,children:[(0,R.jsx)(`span`,{style:{color:`var(--text)`},children:i}),a>0&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`font-mono text-[10px] underline`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:t?`(collapse)`:`(+${a} more)`}),t&&(0,R.jsx)(`ul`,{className:`mt-1 space-y-0.5 pl-2`,children:e.slice(1).map((e,t)=>(0,R.jsx)(`li`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:e.includes(` `)?e.slice(e.indexOf(` `)+1):e},t))})]})]})}function zi({row:e}){let t=e.preSha.slice(0,8),n=e.postSha.slice(0,8);return(0,R.jsxs)(`tr`,{className:`border-t border-border/20 align-top transition-colors hover:bg-accent/20`,children:[(0,R.jsx)(`td`,{className:`whitespace-nowrap py-3 pl-4 pr-4 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:L(e.detectedAt)}),(0,R.jsx)(`td`,{className:`max-w-[160px] truncate whitespace-nowrap py-3 pr-4`,children:(0,R.jsx)(`a`,{href:`/dashboard/agent/${encodeURIComponent(e.agentId)}`,className:`font-mono text-[11px] hover:underline`,style:{color:`var(--text)`},onMouseEnter:e=>e.currentTarget.style.color=`var(--accent)`,onMouseLeave:e=>e.currentTarget.style.color=`var(--text)`,children:e.agentId})}),(0,R.jsxs)(`td`,{className:`whitespace-nowrap py-3 pr-4 font-mono text-[10px]`,children:[(0,R.jsx)(`span`,{style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:t}),(0,R.jsx)(`span`,{className:`mx-1`,style:{color:`color-mix(in oklch, var(--text-dim) 40%, transparent)`},children:`→`}),(0,R.jsx)(`span`,{style:{color:`var(--text)`},children:n})]}),(0,R.jsx)(`td`,{className:`py-3 pr-4`,children:(0,R.jsx)(Ri,{commits:e.commits})})]})}function Bi(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(0),[i,a]=(0,_.useState)(1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=!1;return s(!0),l(null),z(`violations?page=${i}&pageSize=${Li}`).then(n=>{e||(t(n.items??[]),r(n.total??0))}).catch(t=>{e||l(String(t?.message??t))}).finally(()=>{e||s(!1)}),()=>{e=!0}},[i]);let u=Math.max(1,Math.ceil(n/Li));return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,R.jsx)(`h1`,{className:`h-route`,children:`Process Violations`}),n>0&&(0,R.jsx)(`span`,{className:`font-mono text-sm tabular-nums`,style:{color:`var(--ink-3)`},children:n})]}),(0,R.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:`Direct master pushes detected by the ref-allowlist enforcer`})]}),(0,R.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-border/40`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:[c&&(0,R.jsx)(`div`,{className:`border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed`,children:c}),!c&&(0,R.jsxs)(`table`,{className:`w-full table-fixed text-left`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`border-b border-border/40 font-mono text-[10px] uppercase tracking-wider`,style:{background:`color-mix(in oklch, var(--surface-sunk) 20%, transparent)`,color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:[(0,R.jsx)(`th`,{className:`py-2.5 pl-4 pr-4`,children:`When`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-4`,children:`Agent`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-4`,children:`Commit Range`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-4`,children:`Commits`})]})}),(0,R.jsxs)(`tbody`,{children:[!o&&e.length===0&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:4,className:`px-4 py-6 text-center font-mono text-[11px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`No violations recorded`})}),o&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:4,className:`px-4 py-6 text-center font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`Loading…`})}),!o&&e.map(e=>(0,R.jsx)(zi,{row:e},`${e.taskId}-${e.detectedAt}`))]})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border/60 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:o?`loading…`:n===0?`no violations`:`${(i-1)*Li+1}–${Math.min(i*Li,n)} of ${n}`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[10px] ${u<=1?`invisible`:``}`,style:{color:`var(--text-dim)`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.max(1,e-1)),disabled:i===1||o,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`◂ Prev`}),(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[i,` / `,u]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.min(u,e+1)),disabled:i>=u||o,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`Next ▸`})]})]})]})]})}function Vi({categoryAccuracy:e,categoryCorrect:t,categoryHallucinated:n}){let r=Object.keys(e??{});return r.length===0?(0,R.jsx)(Be,{title:`No category data yet`,hint:`Accuracy accrues after ≥5 signals per category.`,compact:!0}):(0,R.jsx)(`div`,{className:`space-y-2`,children:r.map(r=>{let i=Math.max(0,Math.min(1,e[r]??0)),a=t?.[r]??0,o=n?.[r]??0;return{key:r,acc:i,c:a,h:o,n:a+o}}).sort((e,t)=>t.acc-e.acc).map(e=>{let t=e.acc>=.7?`bg-confirmed`:e.acc>=.4?`bg-unverified`:`bg-disputed`,n=e.n>0?`${e.c} correct / ${e.h} hallucinated / ${e.n} total`:void 0;return(0,R.jsxs)(`div`,{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${e.n>0&&e.n<10?`opacity-50`:``}`,title:e.n>0&&e.n<10?`${n} — low sample (n<10)`:n,children:[(0,R.jsx)(`span`,{className:`truncate font-mono text-[11px]`,style:{color:`var(--text-dim)`},children:e.key.replace(/_/g,` `)}),(0,R.jsx)(`div`,{className:`h-2 overflow-hidden rounded-sm`,style:{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`},children:(0,R.jsx)(`div`,{className:`h-full rounded-sm transition-all ${t}`,style:{width:`${e.acc*100}%`}})}),(0,R.jsx)(`span`,{className:`shrink-0 text-right font-mono text-[10px] tabular-nums w-16`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:e.n>0?(0,R.jsxs)(R.Fragment,{children:[e.c,`/`,e.n,e.h>0&&(0,R.jsxs)(`span`,{className:`ml-1 text-disputed/70`,children:[`·`,e.h,`✗`]})]}):`—`}),(0,R.jsxs)(`span`,{className:`text-right font-mono text-[11px] font-bold tabular-nums`,style:{color:`var(--text)`},children:[Math.round(e.acc*100),`%`]})]},e.key)})})}var Hi=new Set([`passed`,`failed`,`silent_skill`,`insufficient_evidence`,`flagged_for_manual_review`]);function Ui(e,t,n){return(!e||!Hi.has(e))&&t!==void 0&&n!==void 0&&n>0}var Wi={silent_skill:`No signals recorded after bind — skill may not be injecting correctly`,insufficient_evidence:`Fewer than 80 post-bind signals — verdict pending more data`,inconclusive:`Mixed signals — needs further evaluation`,passed:`Skill verified effective`,failed:`Skill verified ineffective`,pending:`Awaiting evidence`,flagged_for_manual_review:`Manual review required`},Gi={pending:`border-border/50`,passed:`border-confirmed/40 bg-confirmed/10 text-confirmed`,failed:`border-disputed/40 bg-disputed/10 text-disputed`,silent_skill:`border-unverified/40 bg-unverified/10 text-unverified`,insufficient_evidence:`border-unverified/40 bg-unverified/10 text-unverified`,inconclusive:`border-[color:var(--warn)]/40 bg-[color:var(--warn)]/10 text-[color:var(--warn)]`,flagged_for_manual_review:`border-disputed/40 bg-disputed/10 text-disputed`};function Ki(e){let t=Math.round(e*100),n=t>0?`+`:``;return t>0?{text:`${n}${t}pp`,cls:`text-confirmed`}:t<0?{text:`${n}${t}pp`,cls:`text-disputed`}:{text:`${n}${t}pp`,cls:``,clsStyle:{color:`var(--text-dim)`}}}function qi({slot:e}){let t=e.status,n=t?Gi[t]:`border-border/50`,r=!t||t===`pending`?{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`,color:`var(--text-dim)`}:void 0,i=t===`inconclusive`&&(e.inconclusiveStrikes??0)>0,a=e.forcedDevelops??[],o=a.length>0?a[a.length-1]:null,s=typeof e.effectiveness==`number`?Ki(e.effectiveness):null,c=Ui(t,e.postBindSignals,e.minEvidence);return(0,R.jsxs)(`div`,{className:`rounded-md border p-3 ${e.enabled?`border-border/50`:`border-border/30 opacity-60`}`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,R.jsxs)(`span`,{className:`font-mono text-xs font-semibold ${e.enabled?``:`line-through`}`,style:{color:e.enabled?`var(--text)`:`var(--text-dim)`},children:[e.mode===`contextual`&&`⚡ `,e.name]}),(0,R.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 font-mono text-[9px]`,style:{background:`var(--surface-sunk)`,color:`var(--text-dim)`},children:e.source}),e.mode===`contextual`&&(0,R.jsx)(`span`,{className:`warn-badge rounded-sm px-1.5 py-0.5 font-mono text-[9px]`,children:`contextual`})]}),(0,R.jsxs)(`div`,{className:`mt-1 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:[`bound `,L(e.boundAt)]}),c&&(()=>{let t=e.postBindSignals,n=e.minEvidence,r=Math.round(t/n*100),i=Math.min(t/n,1)*100;return(0,R.jsxs)(`div`,{className:`mt-1.5`,title:`MIN_EVIDENCE gate: ${t} of ${n} post-bind signals (${r}%)`,children:[(0,R.jsxs)(`div`,{className:`mb-0.5 font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:[`post-bind: `,t,` / `,n]}),(0,R.jsx)(`div`,{className:`relative h-1 w-full overflow-hidden rounded-full border border-border/40`,style:{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`},children:(0,R.jsx)(`div`,{className:`absolute inset-y-0 left-0 rounded-full border-r border-confirmed/40 bg-confirmed/20`,style:{width:`${i}%`}})})]})})()]}),t&&(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${n}`,style:r,title:Wi[t],children:t.replace(/_/g,` `)})]}),(0,R.jsxs)(`div`,{className:`mt-2 flex items-center gap-3 font-mono text-[10px]`,children:[s&&(0,R.jsx)(`span`,{className:s.cls,style:s.clsStyle,title:`Effectiveness: change in hallucination rate pre/post`,children:s.text}),i&&(0,R.jsxs)(`span`,{className:`text-unique`,title:e.inconclusiveAt?`last strike ${L(e.inconclusiveAt)}`:void 0,children:[e.inconclusiveStrikes,` strike`,e.inconclusiveStrikes===1?``:`s`]})]}),a.length>0&&(0,R.jsxs)(`div`,{className:`mt-2 border-t border-border/40 pt-2 font-mono text-[10px]`,style:{color:`var(--text-dim)`},title:o?.reason?`latest: ${o.reason}`:void 0,children:[`forced `,a.length,` time`,a.length===1?``:`s`,o&&` · last ${L(o.timestamp)}`]})]})}function Ji({open:e,onOpenChange:t,children:n}){return(0,_.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t(!1)};document.addEventListener(`keydown`,n);let r=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,n),document.body.style.overflow=r}},[e,t]),e?(0,R.jsxs)(`div`,{className:`fixed inset-0 z-50`,children:[(0,R.jsx)(`div`,{className:`absolute inset-0 backdrop-blur-sm`,style:{background:`color-mix(in oklch, var(--surface) 70%, transparent)`},onClick:()=>t(!1)}),(0,R.jsx)(`div`,{className:`absolute inset-y-0 right-0 flex`,children:(0,R.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`contents`,children:n})})]}):null}function Yi({side:e=`right`,className:t=``,children:n,style:r,...i}){return(0,R.jsx)(`div`,{className:`h-full p-6 ${t}`,style:{background:`var(--surface-elev)`,...r},...i,children:n})}function Xi({className:e=``,...t}){return(0,R.jsx)(`div`,{className:`mb-2 ${e}`,...t})}function Zi({className:e=``,...t}){return(0,R.jsx)(`h2`,{className:`font-semibold ${e}`,...t})}function Qi({citation:e}){let t=e.snippet.split(`
34
+ `);return(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40 overflow-hidden`,style:{background:`color-mix(in oklch, var(--surface-elev) 60%, transparent)`},children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between px-3 py-1 border-b border-border/40`,style:{background:`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`},children:(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[e.file,`:`,e.line]})}),(0,R.jsx)(`pre`,{className:`overflow-x-auto`,style:{background:`var(--surface-sunk)`,borderLeft:`3px solid var(--border-strong)`,padding:`12px 16px`,borderRadius:`6px`,fontFamily:`var(--font-mono)`,fontSize:`12px`,color:`var(--text)`},children:t.map((e,t)=>(0,R.jsx)(`div`,{className:`whitespace-pre`,children:e||`\xA0`},t))})]})}var $i={critical:`text-red-400 bg-red-500/10`,high:`text-severity-high bg-severity-high/10`,medium:`text-yellow-400 bg-yellow-500/10`,low:``},ea={color:`var(--text-dim)`,background:`color-mix(in oklch, var(--surface-sunk) 50%, transparent)`},ta={confirmed:`text-confirmed bg-confirmed/10 border border-confirmed/20`,disputed:`text-disputed bg-disputed/10 border border-disputed/20`,unverified:`text-unverified bg-unverified/10 border border-unverified/20`,unique:`text-unique bg-unique/10 border border-unique/20`,insight:`text-insight bg-insight/10 border border-insight/20`,newFinding:`text-unique bg-unique/10 border border-unique/20`},na={background:`var(--surface-elev)`,borderRadius:`16px 0 0 16px`,boxShadow:`var(--shadow-overlay)`,border:`1px solid var(--border)`,color:`var(--text)`,fontFamily:`var(--font-sans)`};function ra(){let e=(e,t)=>(0,R.jsx)(`div`,{className:`${e} ${t} rounded`,style:{background:`var(--border)`,opacity:.4}});return(0,R.jsxs)(`div`,{className:`mt-4 space-y-4`,"aria-busy":`true`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e(`h-3.5`,`w-12`),e(`h-3.5`,`w-14`),e(`h-3.5`,`w-16`)]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[e(`h-2`,`w-full`),e(`h-2`,`w-[92%]`),e(`h-2`,`w-[70%]`)]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[e(`h-2`,`w-16`),e(`h-12`,`w-full`)]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[e(`h-2`,`w-16`),e(`h-2`,`w-[60%]`),e(`h-2`,`w-[45%]`)]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[e(`h-2`,`w-20`),e(`h-2`,`w-full`),e(`h-2`,`w-[80%]`)]})]})}function ia({open:e,onOpenChange:t,consensusId:n,findingId:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!e||!n||!r){a(null),s(null);return}a(null),s(null),z(`finding/${encodeURIComponent(n)}/${encodeURIComponent(r)}`).then(a).catch(e=>s(e.message||`failed to load finding`))},[e,n,r]),(0,R.jsx)(Ji,{open:e,onOpenChange:t,children:(0,R.jsxs)(Yi,{side:`right`,className:`w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto`,style:na,children:[(0,R.jsx)(Xi,{children:(0,R.jsx)(Zi,{className:`font-mono text-sm`,style:{color:`var(--text)`},children:`Finding detail`})}),o&&(0,R.jsx)(`div`,{className:`mt-4`,children:(0,R.jsx)(Ft,{message:o})}),!o&&!i&&(0,R.jsx)(ra,{}),i&&(0,R.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${ta[i.finding.tag]||``}`,style:ta[i.finding.tag]?void 0:{background:`var(--surface-sunk)`},children:i.finding.tag}),i.finding.severity&&(0,R.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${$i[i.finding.severity]||``}`,style:i.finding.severity===`low`?ea:$i[i.finding.severity]?void 0:{background:`var(--surface-sunk)`},children:i.finding.severity}),(0,R.jsxs)(`span`,{className:`font-mono text-[9px]`,style:{color:`var(--text-dim)`},children:[`by `,i.finding.originalAgentId]}),i.retracted&&(0,R.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded bg-disputed/50`,children:`retracted`})]}),(0,R.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed whitespace-pre-wrap`,children:i.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,``).trim()}),i.citations.length>0&&(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider`,style:{color:`var(--text-dim)`},children:`Citations`}),i.citations.map((e,t)=>(0,R.jsx)(Qi,{citation:e},t))]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider`,style:{color:`var(--text-dim)`},children:`Coverage`}),i.finding.confirmedBy.length>0&&(0,R.jsxs)(`div`,{className:`text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-confirmed`,children:`✓`}),` confirmed by `,i.finding.confirmedBy.join(`, `)]}),i.finding.disputedBy.map((e,t)=>(0,R.jsxs)(`div`,{className:`text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-disputed`,children:`✗`}),` disputed by `,e.agentId,`: `,(0,R.jsx)(`span`,{style:{color:`var(--text-dim)`},children:e.reason})]},t)),i.finding.confirmedBy.length===0&&i.finding.disputedBy.length===0&&(0,R.jsx)(`div`,{className:`text-[11px]`,style:{color:`var(--text-dim)`},children:`No peer review`})]}),i.signals.length>0&&(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider`,style:{color:`var(--text-dim)`},children:[`Signals (`,i.signals.length,`)`]}),(0,R.jsx)(`div`,{className:`space-y-1`,children:i.signals.map((e,t)=>(0,R.jsxs)(`div`,{className:`text-[11px] border-l-2 border-border/40 pl-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono font-semibold`,children:e.signal}),(0,R.jsx)(`span`,{style:{color:`var(--text-dim)`},children:`·`}),(0,R.jsx)(`span`,{children:e.agentId}),e.counterpartId&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{style:{color:`var(--text-dim)`},children:`→`}),(0,R.jsx)(`span`,{children:e.counterpartId})]}),(0,R.jsx)(`span`,{className:`ml-auto`,style:{color:`var(--text-dim)`},children:L(e.timestamp)})]}),e.evidence&&(0,R.jsx)(`div`,{className:`mt-0.5`,style:{color:`var(--text-dim)`},children:e.evidence.slice(0,200)})]},t))})]}),(0,R.jsx)(`div`,{className:`pt-2 border-t border-border/40`,children:(0,R.jsxs)(`a`,{href:b(`/consensus/${i.consensusId}`),className:`font-mono text-[10px] hover:underline`,style:{color:`var(--accent)`},children:[`→ consensus round `,i.consensusId]})})]})]})})}var aa={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 oa({agentId:e}){let[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(`all`),[s,c]=(0,_.useState)(null);(0,_.useEffect)(()=>{let t=!1;return i(!0),z(`signals?agent=${encodeURIComponent(e)}&limit=100`).then(e=>{t||(n(e.items||[]),i(!1))}).catch(()=>{t||(n([]),i(!1))}),()=>{t=!0}},[e]);let l=[...t].sort((e,t)=>(t.timestamp||``).localeCompare(e.timestamp||``)),u=a===`all`||a===`signals`?l:[],d=({k:e,label:t,enabled:n})=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>n&&o(e),disabled:!n,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${n?``:`opacity-40 cursor-not-allowed`}`,style:a===e?{background:`var(--surface-sunk)`,color:`var(--text)`}:{color:`var(--text-dim)`},children:t});return(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40 px-4 py-3`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsx)(`span`,{className:`h-section`,children:`Activity`}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(d,{k:`all`,label:`All`,enabled:!0}),(0,R.jsx)(d,{k:`signals`,label:`Signals`,enabled:!0}),(0,R.jsx)(d,{k:`tasks`,label:`Tasks (none yet)`,enabled:!1}),(0,R.jsx)(d,{k:`skills`,label:`Skills (none yet)`,enabled:!1})]})]}),r?(0,R.jsx)(`div`,{className:`py-6 text-center text-xs`,style:{color:`var(--text-dim)`},children:`Loading…`}):u.length===0?(0,R.jsx)(Be,{title:`No activity yet`,hint:`Signals, task completions, and skill binds will appear here.`,compact:!0}):(0,R.jsx)(`div`,{className:`space-y-1`,children:u.map((e,t)=>{let n=aa[e.signal]||`text-text-dim`,r=!!(e.consensusId&&e.findingId),i=(0,R.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,R.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] tabular-nums w-16`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:L(e.timestamp)}),(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${n}`,children:e.signal}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 text-[11px]`,style:{color:`var(--text-dim)`},children:[e.counterpartId&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:[`→ `,e.counterpartId,` · `]}),e.evidence&&(0,R.jsx)(`span`,{children:e.evidence.length>160?e.evidence.slice(0,160)+`…`:e.evidence})]})]});return r?(0,R.jsx)(`button`,{type:`button`,onClick:()=>c({consensusId:e.consensusId,findingId:e.findingId}),className:`w-full rounded-sm text-left transition hover:bg-accent/10`,children:i},t):(0,R.jsx)(`div`,{children:i},t)})}),(0,R.jsx)(ia,{open:!!s,onOpenChange:e=>{e||c(null)},consensusId:s?.consensusId??null,findingId:s?.findingId??null})]})}function sa(){let e=(0,_.useRef)(null),[t,n]=(0,_.useState)(0);return(0,_.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(e=>{for(let t of e)n(t.contentRect.width)});return r.observe(t),()=>r.disconnect()},[]),[e,t]}var ca={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`},la={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`},ua=6,da=500,fa=100,pa=150;function ma(e){if(e<=0)return fa;let t=Math.floor(e/ua);return Math.max(1,Math.min(t,da))}function ha({agentId:e}){let[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=sa(),[d,f]=(0,_.useState)(fa),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(u<=0)return;let e=ma(u);return p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{f(t=>t===e?t:e)},pa),()=>{p.current&&clearTimeout(p.current)}},[u]),(0,_.useEffect)(()=>{z(`signals?agent=${encodeURIComponent(e)}&limit=${d}`).then(e=>{n(e.items||[]),i(e.total||0)}).catch(()=>{})},[e,d]);let m=(0,_.useMemo)(()=>[...t].reverse(),[t]),h={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(let e of t)e.signal===`agreement`||e.signal===`consensus_verified`?h.confirmed++:e.signal===`disagreement`||e.signal===`hallucination_caught`?h.disputed++:e.signal===`unique_confirmed`||e.signal===`unique_unconfirmed`||e.signal===`new_finding`?h.unique++:e.signal===`unverified`?h.unverified++:e.signal===`citation_fabricated`&&h.fabricated++;let g=t.length,v=r>g;return t.length===0?(0,R.jsx)(`div`,{ref:l,className:`rounded-md border border-border/40 px-4 py-3`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:(0,R.jsx)(Be,{title:`No signal history yet`,hint:`Signals are recorded during consensus rounds.`,compact:!0})}):(0,R.jsxs)(`div`,{ref:l,className:`rounded-md border border-border/40 px-4 py-3`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`h-section`,children:`Signal Timeline`}),(0,R.jsx)(`span`,{className:`font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:v?`last ${g} of ${r}`:`${r} total`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 font-mono text-[10px]`,children:[(0,R.jsxs)(`span`,{className:`text-confirmed`,children:[h.confirmed,` confirmed`]}),h.disputed>0&&(0,R.jsxs)(`span`,{className:`text-disputed`,children:[h.disputed,` disputed`]}),h.unique>0&&(0,R.jsxs)(`span`,{className:`text-unique`,children:[h.unique,` unique`]}),h.unverified>0&&(0,R.jsxs)(`span`,{className:`text-unverified`,children:[h.unverified,` unverified`]}),h.fabricated>0&&(0,R.jsxs)(`span`,{className:`text-amber-500`,children:[h.fabricated,` fabricated`]})]})]}),(0,R.jsx)(`div`,{className:`flex items-center gap-0.5`,children:m.map((e,t)=>{let n=!!(e.consensusId&&e.findingId);return(0,R.jsx)(`button`,{type:`button`,disabled:!n,onClick:()=>{e.consensusId&&e.findingId&&(c({consensusId:e.consensusId,findingId:e.findingId}),o(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${ca[e.signal]||``} ${n?`cursor-pointer`:`cursor-default`}`,style:ca[e.signal]?void 0:{background:`var(--surface-sunk)`},title:`${la[e.signal]||e.signal} — ${L(e.timestamp)}${n?` (click for detail)`:``}`},t)})}),(0,R.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(e=>(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`div`,{className:`h-2 w-2 rounded-sm ${e.color}`}),(0,R.jsx)(`span`,{className:`font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:e.label})]},e.label))}),(0,R.jsx)(ia,{open:a,onOpenChange:o,consensusId:s?.consensusId??null,findingId:s?.findingId??null})]})}function ga(e){if(!e)return`—`;if(e<1e3)return`< 1s`;if(e<6e4)return Math.floor(e/1e3)+`s`;if(e<36e5){let t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return n>0?`${t}m ${n}s`:`${t}m`}let t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return n>0?`${t}h ${n}m`:`${t}h`}function _a({task:e,onClick:t}){let n=kt(e.status),r=At[n],i=Re(e.agentId);return(0,R.jsxs)(`tr`,{className:`border-b border-border hover:bg-accent/10 transition-colors cursor-pointer`,onClick:n=>{n.target.closest(`a`)||(t?.(e),x(`/tasks/`+e.taskId))},children:[(0,R.jsx)(`td`,{className:`py-2.5 pl-4 pr-2`,children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-2`,"aria-label":`Status: ${r.label}`,children:[(0,R.jsx)(`span`,{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${r.iconBox} ${r.text} ${r.pulse?`animate-pulse motion-reduce:animate-none`:``}`,style:r.textStyle,"aria-hidden":!0,children:(0,R.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:jt[n]})}),(0,R.jsx)(`span`,{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${r.text}`,style:r.textStyle,children:r.label})]})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,R.jsx)(`span`,{className:`rounded border px-2 py-1 font-mono text-[10px] font-semibold`,style:{borderColor:`color-mix(in oklch, var(--border) 40%, transparent)`,color:`var(--ink-3)`,background:`color-mix(in oklch, var(--surface) 60%, transparent)`},title:e.taskId,children:e.taskId.slice(0,8)})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs`,style:{color:`var(--text-dim)`},children:(0,R.jsxs)(`a`,{href:`/dashboard/agent/${encodeURIComponent(e.agentId)}`,className:`inline-flex items-center gap-1.5 transition`,children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:Le(e.agentId)}}),e.agentId]})}),i&&(0,R.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,R.jsx)(`span`,{className:`rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${i.cls}`,style:{background:`color-mix(in oklch, var(--surface) 40%, transparent)`,...i.clsStyle},children:i.label})}),!i&&(0,R.jsx)(`td`,{className:`py-2.5 pr-3`}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3 text-xs leading-snug`,style:{color:`color-mix(in oklch, var(--text) 80%, transparent)`},children:(()=>{let t=e.task.replace(/\n.*/s,``);return t.length>100?t.slice(0,100)+`…`:t})()}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs`,style:{color:`var(--text-dim)`},children:n===`running`?`running`:ga(e.duration)}),(0,R.jsx)(`td`,{className:`py-2.5 pr-4 text-right font-mono text-xs`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:L(e.timestamp)})]})}function H({className:e=``,style:t}){return(0,R.jsx)(`div`,{className:`rounded ${e}`,style:{background:`color-mix(in oklch, var(--border) 40%, transparent)`,...t}})}function va(){return(0,R.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-6 px-6 py-6`,children:[(0,R.jsx)(H,{className:`h-48 w-full`}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-3`,children:[(0,R.jsx)(H,{className:`h-36`}),(0,R.jsx)(H,{className:`h-36`}),(0,R.jsx)(H,{className:`h-36`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2`,children:[(0,R.jsx)(H,{className:`h-48`}),(0,R.jsx)(H,{className:`h-48`})]})]})}function ya(){return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsx)(H,{className:`mb-2 h-7 w-32`}),(0,R.jsx)(H,{className:`h-3 w-48`})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-2 gap-px sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,R.jsx)(H,{className:`h-16`},t))}),(0,R.jsx)(`div`,{className:`space-y-px overflow-hidden rounded-md`,children:Array.from({length:6}).map((e,t)=>(0,R.jsx)(H,{className:`h-12`},t))})]})}function ba(){return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsx)(H,{className:`mb-2 h-7 w-24`}),(0,R.jsx)(H,{className:`h-3 w-32`})]}),(0,R.jsx)(`div`,{className:`space-y-px overflow-hidden rounded-md`,children:Array.from({length:8}).map((e,t)=>(0,R.jsx)(H,{className:`h-11`},t))})]})}function xa(){return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsx)(H,{className:`mb-2 h-7 w-48`}),(0,R.jsx)(H,{className:`h-3 w-64`})]}),(0,R.jsx)(`div`,{className:`space-y-4`,children:Array.from({length:4}).map((e,t)=>(0,R.jsxs)(`div`,{className:`overflow-hidden rounded-md`,children:[(0,R.jsx)(H,{className:`h-14`}),(0,R.jsx)(`div`,{className:`mt-px space-y-px`,children:Array.from({length:3}).map((e,t)=>(0,R.jsx)(H,{className:`h-10`},t))})]},t))})]})}function Sa(){return(0,R.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:4}).map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-start gap-3 py-2`,children:[(0,R.jsx)(H,{className:`mt-0.5 h-4 w-4 shrink-0 rounded-sm`}),(0,R.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,R.jsx)(H,{className:`h-3 w-3/4`}),(0,R.jsx)(H,{className:`h-3 w-1/2`})]})]},t))})}function Ca(){return(0,R.jsx)(`div`,{className:`space-y-px overflow-hidden rounded-md`,children:Array.from({length:5}).map((e,t)=>(0,R.jsx)(H,{className:`h-10`},t))})}var wa=3,Ta=720*60*60*1e3;function Ea({agentId:e,agents:t,tasks:n,consensus:r}){let i=t.find(t=>t.id===e),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(!0),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(!0),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(0),[S,C]=(0,_.useState)(0),[w,T]=(0,_.useState)(null);(0,_.useEffect)(()=>{c(!0),z(`memory/${e}`).then(e=>{o(e.knowledge||[])}).catch(()=>o([])).finally(()=>c(!1))},[e]),(0,_.useEffect)(()=>{let e=!1;return f(!0),z(`consensus-reports?page=1&pageSize=200`).then(t=>{e||u(t.reports||[])}).catch(()=>{e||u([])}).finally(()=>{e||f(!1)}),()=>{e=!0}},[]);let ee=(0,_.useMemo)(()=>{let t=Date.now(),n=new Map;for(let r of l){let i=Date.parse(r.timestamp);if(Number.isNaN(i)||t-i>Ta)continue;let a=r.authorDiagnostics?.[e];if(a)for(let e of a)n.set(e.code,(n.get(e.code)??0)+1)}let r=[];for(let[e,t]of n)t>=wa&&r.push({code:e,count:t});return r},[l,e]);if(!i)return(0,R.jsxs)(`div`,{className:`py-20 text-center`,style:{color:`var(--text-dim)`},children:[`Agent not found: `,e]});let E=i.scores,D=n?.items.filter(t=>t.agentId===e)||[],O=r?.runs.filter(t=>t.agents.includes(e))||[],k=[{label:`accuracy`,value:E.accuracy,fill:E.accuracy>=.7?`bg-confirmed`:E.accuracy>=.4?`bg-unverified`:`bg-disputed`},{label:`unique`,value:E.uniqueness,fill:`bg-unique`},{label:`impact`,value:E.impactScore,fill:`bg-[var(--c8)]`}],A=E.unverifiedsEmitted??0,j=E.unverifiedsReceived??0,M=A+j,N=[{label:`Signals`,value:String(E.signals),color:``,colorStyle:{color:`var(--text)`}},{label:`Agreements`,value:String(E.agreements),color:`text-confirmed`,colorStyle:void 0},{label:`Disagreements`,value:String(E.disagreements),color:`text-disputed`,colorStyle:void 0},{label:`Hallucinations`,value:String(E.hallucinations),color:E.hallucinations>0?`text-disputed`:``,colorStyle:E.hallucinations>0?void 0:{color:`var(--text-dim)`}},{label:`Unverified`,value:M>0?`${A}↑ ${j}↓`:`0`,color:M>0?`text-unverified`:``,colorStyle:M>0?void 0:{color:`var(--text-dim)`},title:M>0?`${A} emitted (as reviewer) · ${j} received (as author)`:void 0},{label:`Tokens`,value:i.totalTokens.toLocaleString(),color:``,colorStyle:{color:`var(--text)`}}],te=Math.max(1,Math.ceil(D.length/10)),P=Math.min(b,te-1),F=D.slice(P*10,(P+1)*10),ne=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=t.filename.match(/^(\d{4}-\d{2}-\d{2})/),r=n?n[1]:`undated`,i=e.get(r)||[];i.push(t),e.set(r,i)}return Array.from(e.entries()).sort(([e],[t])=>e===`undated`?1:t===`undated`?-1:t.localeCompare(e)).map(([e,t])=>({day:e,items:t}))},[a]),re=Math.min(S,Math.max(0,ne.length-1)),ie=ne[re];return(0,R.jsxs)(R.Fragment,{children:[(()=>{let e=St(E);return e===`benched`?(0,R.jsx)(`div`,{className:`mb-6 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-xs font-bold text-destructive`,children:`BENCHED`}),(0,R.jsxs)(`span`,{className:`text-xs text-destructive/70`,children:[`Auto-bench rule fired (`,E.bench.reason??`unknown`,`). Agent excluded from dispatch until scores recover.`]})]})}):e===`struggling`?(0,R.jsx)(`div`,{className:`mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-xs font-bold text-unverified`,children:`STRUGGLING`}),(0,R.jsxs)(`span`,{className:`text-xs text-unverified/70`,children:[E.consecutiveFailures,`+ consecutive failures. Deprioritized until clean signals recorded.`]})]})}):e===`kept-for-coverage`?(0,R.jsx)(`div`,{className:`mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-xs font-bold text-unverified`,children:`KEPT FOR COVERAGE`}),(0,R.jsxs)(`span`,{className:`text-xs text-unverified/70`,children:[`Would be benched (`,E.bench.reason??`rule`,`), but is the sole provider of a category — kept to preserve coverage.`]})]})}):null})(),ee.length>0&&(0,R.jsx)(`div`,{className:`mb-6 space-y-2`,children:ee.map(({code:e,count:t})=>(0,R.jsxs)(`div`,{className:`rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3`,"data-diagnostic-code":e,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-xs font-bold text-unverified`,children:`PARSE DIAGNOSTIC`}),(0,R.jsx)(`span`,{className:`font-mono text-[11px] text-unverified/80`,dangerouslySetInnerHTML:{__html:Oi(e)}}),(0,R.jsxs)(`span`,{className:`font-mono text-[11px] text-unverified/60`,children:[`· `,t,` fires in 30d`]})]}),(0,R.jsxs)(`div`,{className:`mt-1 text-xs`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:[`This agent's raw output has repeatedly tripped `,(0,R.jsx)(`span`,{className:`font-mono`,children:e}),`. Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding).`]})]},e))}),(0,R.jsx)(`div`,{"data-theme":`dark`,className:`relative mb-6 rounded-xl border border-border p-5`,style:{background:`var(--surface-elev)`,color:`var(--text)`},children:(0,R.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,R.jsx)(`div`,{className:`relative shrink-0`,"data-tooltip":`Accuracy ${Math.round(E.accuracy*100)}% · Uniqueness ${Math.round(E.uniqueness*100)}% · Impact ${Math.round(E.impactScore*100)}%`,children:(0,R.jsx)(wn,{agentId:i.id,size:120,signals:E.signals,accuracy:E.accuracy,uniqueness:E.uniqueness,impact:E.impactScore})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h1`,{className:`truncate font-mono text-2xl font-bold`,style:{color:`var(--text)`},children:i.id}),(0,R.jsxs)(`p`,{className:`mt-1 text-sm`,style:{color:`var(--text-dim)`},children:[i.provider,`/`,i.model]}),(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${i.native?``:`text-confirmed bg-confirmed/10`}`,style:i.native?{color:`var(--idle)`,background:`color-mix(in oklch, var(--idle) 10%, transparent)`}:void 0,children:i.native?`NATIVE`:`RELAY`}),i.preset&&(0,R.jsx)(`span`,{className:`rounded-sm px-2 py-0.5 font-mono text-[10px]`,style:{background:`var(--surface-sunk)`,color:`var(--text-dim)`},children:i.preset}),(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:[E.signals,` signals`,i.lastTask?` · ${L(i.lastTask.timestamp)}`:``]})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end rounded-md border border-border px-3 py-2`,style:{background:`color-mix(in oklch, var(--surface) 60%, transparent)`},"data-tooltip":`Dispatch weight ${E.dispatchWeight.toFixed(2)}\nScale 0.3 → 2.0`,"data-tooltip-pos":`left`,children:[(0,R.jsx)(`span`,{className:`font-mono text-2xl font-bold tabular-nums leading-none`,style:{color:`var(--text)`},children:E.dispatchWeight.toFixed(2)}),(0,R.jsx)(`span`,{className:`mt-1 font-mono text-[9px] uppercase`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`weight`})]})]})}),(0,R.jsx)(`section`,{className:`mb-6`,children:(0,R.jsx)(ha,{agentId:e})}),(0,R.jsxs)(`section`,{className:`mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`mb-3 h-section`,children:`Metrics`}),(0,R.jsxs)(`div`,{className:`rounded-lg border border-border/40 p-4`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:[(0,R.jsx)(`div`,{className:`space-y-2.5`,children:k.map(e=>(0,R.jsxs)(`div`,{className:`grid grid-cols-[72px_1fr_44px] items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`h-section`,style:{color:`var(--text-dim)`,fontSize:`10px`},children:e.label}),(0,R.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full`,style:{background:`color-mix(in oklch, var(--surface) 80%, transparent)`},children:(0,R.jsx)(`div`,{className:`h-full rounded-full transition-all ${e.fill}`,style:{width:`${Math.max(0,Math.min(100,e.value*100))}%`}})}),(0,R.jsxs)(`span`,{className:`text-right font-mono text-[11px] font-bold tabular-nums`,style:{color:`var(--text)`},children:[Math.round(e.value*100),`%`]})]},e.label))}),(0,R.jsx)(`div`,{className:`mt-4 grid grid-cols-6 gap-px overflow-hidden rounded-md border border-border/30 bg-border/30`,children:N.map(e=>(0,R.jsxs)(`div`,{className:`px-2 py-2 text-center`,style:{background:`color-mix(in oklch, var(--surface) 60%, transparent)`},title:e.title,children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-bold tabular-nums ${e.color}`,style:e.colorStyle,children:e.value}),(0,R.jsx)(`div`,{className:`mt-0.5 font-mono text-[9px] uppercase tracking-wider`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:e.label})]},e.label))})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`mb-1 h-section`,children:`Category Competency`}),(0,R.jsx)(`p`,{className:`mb-3 mt-0.5 font-mono text-[11px]`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:`◆ Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty.`}),(0,R.jsx)(Vi,{categoryAccuracy:E.categoryAccuracy,categoryCorrect:E.categoryCorrect,categoryHallucinated:E.categoryHallucinated})]})]}),(i.skillSlots.length>0||i.skills.length>0)&&(0,R.jsxs)(`section`,{className:`mb-8`,children:[(0,R.jsxs)(`h2`,{className:`mb-3 h-section`,children:[`Skills `,(0,R.jsx)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:i.skillSlots.length||i.skills.length})]}),i.skillSlots.length>0?(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3`,children:i.skillSlots.map(e=>(0,R.jsx)(qi,{slot:e},e.name))}):(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.skills.map(e=>(0,R.jsx)(`span`,{className:`rounded-sm border border-border px-2.5 py-1 font-mono text-xs`,style:{background:`var(--surface-elev)`,color:`var(--text-dim)`},children:e},e))})]}),(0,R.jsxs)(`section`,{className:`mb-8`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`h-section`,children:[`Tasks `,(0,R.jsx)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:D.length})]}),te>1&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[(0,R.jsx)(`button`,{onClick:()=>x(e=>Math.max(0,e-1)),disabled:P===0,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`◂ Prev`}),(0,R.jsxs)(`span`,{children:[P+1,` / `,te]}),(0,R.jsx)(`button`,{onClick:()=>x(e=>Math.min(te-1,e+1)),disabled:P>=te-1,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`Next ▸`})]})]}),D.length>0?(0,R.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border/40`,children:(0,R.jsxs)(`table`,{className:`w-full text-left`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`border-b border-border`,style:{background:`var(--surface-elev)`},children:[(0,R.jsx)(`th`,{className:`py-2 pl-4 pr-2 text-xs font-medium`,style:{width:32,color:`var(--text-dim)`}}),(0,R.jsx)(`th`,{className:`py-2 pr-3 font-mono text-xs font-medium`,style:{color:`var(--text-dim)`},children:`ID`}),(0,R.jsx)(`th`,{className:`py-2 pr-3 font-mono text-xs font-medium`,style:{color:`var(--text-dim)`},children:`Agent`}),(0,R.jsx)(`th`,{className:`py-2 pr-3 text-xs font-medium`,style:{color:`var(--text-dim)`},children:`Description`}),(0,R.jsx)(`th`,{className:`py-2 pr-3 font-mono text-xs font-medium`,style:{color:`var(--text-dim)`},children:`Duration`}),(0,R.jsx)(`th`,{className:`py-2 pr-4 text-right font-mono text-xs font-medium`,style:{color:`var(--text-dim)`},children:`When`})]})}),(0,R.jsx)(`tbody`,{children:F.map(e=>(0,R.jsx)(_a,{task:e,onClick:T},e.taskId))})]})}):(0,R.jsx)(`div`,{className:`py-6 text-center text-sm`,style:{color:`var(--text-dim)`},children:`No tasks recorded.`})]}),(0,R.jsxs)(`section`,{className:`mb-8`,children:[(0,R.jsxs)(`h2`,{className:`mb-3 h-section`,children:[`Consensus Runs`,!d&&(0,R.jsxs)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:[` `,O.length]})]}),d?(0,R.jsx)(Ca,{}):O.length>0?(0,R.jsx)(`div`,{className:`space-y-2`,children:O.slice(0,20).map((e,t)=>{let n=e.counts,r=(n.agreement||0)+(n.disagreement||0)+(n.hallucination||0)+(n.unverified||0)+(n.unique||0)+(n.new||0),i=r||1,a=[{key:`confirmed`,count:n.agreement||0,color:`bg-confirmed`,text:`text-confirmed`},{key:`disputed`,count:(n.disagreement||0)+(n.hallucination||0),color:`bg-disputed`,text:`text-disputed`},{key:`unverified`,count:n.unverified||0,color:`bg-unverified`,text:`text-unverified`},{key:`unique`,count:(n.unique||0)+(n.new||0),color:`bg-unique`,text:`text-unique`}],o={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`}},s=e.signals.filter(e=>e.signal!==`signal_retracted`&&o[e.signal]),c=e.taskId+`:`+t,l=h===c;return(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40`,style:{background:`var(--surface-elev)`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>g(l?null:c),disabled:s.length===0,className:`flex w-full items-center p-3 text-left transition ${s.length>0?`hover:bg-accent/20`:`cursor-default`}`,children:(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{className:`font-mono text-sm font-semibold`,style:{color:`var(--text)`},children:[s.length>0&&(0,R.jsx)(`span`,{className:`mr-1.5 inline-block`,style:{color:`var(--text-dim)`},children:l?`▾`:`▸`}),r,` findings`]}),(0,R.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--text-dim)`},children:L(e.timestamp)})]}),(0,R.jsx)(`div`,{className:`mt-1.5 flex gap-2`,children:a.map(e=>e.count>0&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px] font-semibold ${e.text}`,children:[e.count,` `,e.key]},e.key))}),(0,R.jsx)(`div`,{className:`mt-1.5 flex h-1.5 overflow-hidden rounded-sm`,children:a.map(e=>e.count>0&&(0,R.jsx)(`div`,{className:e.color,style:{width:`${e.count/i*100}%`}},e.key))})]})}),l&&s.length>0&&(0,R.jsx)(`div`,{className:`border-t border-border/30 px-3 pb-2 pt-2`,children:(0,R.jsx)(`div`,{className:`space-y-1`,children:s.map((t,n)=>{let r=o[t.signal],i=!!(t.findingId&&e.taskId),a=(0,R.jsxs)(`div`,{className:`flex items-start gap-2 py-1`,children:[(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${r.cls}`,children:r.label}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`finding-md text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]`,style:{color:`var(--text-dim)`},dangerouslySetInnerHTML:{__html:Me(t.evidence||``)}}),(0,R.jsxs)(`span`,{className:`ml-2 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:[t.agentId,t.counterpartId?` + ${t.counterpartId}`:``]})]})]});return i?(0,R.jsx)(`button`,{type:`button`,onClick:()=>y({consensusId:e.taskId,findingId:t.findingId}),className:`block w-full rounded-sm text-left transition hover:bg-accent/10`,children:a},n):(0,R.jsx)(`div`,{children:a},n)})})})]},c)})}):(0,R.jsx)(`div`,{className:`py-6 text-center text-sm`,style:{color:`var(--text-dim)`},children:`No consensus participation recorded.`})]}),(0,R.jsx)(`section`,{className:`mb-8`,children:(0,R.jsx)(oa,{agentId:e})}),(0,R.jsx)(ia,{open:!!v,onOpenChange:e=>{e||y(null)},consensusId:v?.consensusId??null,findingId:v?.findingId??null}),(0,R.jsx)(Di,{task:w,onClose:()=>T(null)}),(0,R.jsxs)(`section`,{className:`mb-8`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`h-section`,children:[`Memory`,!s&&(0,R.jsxs)(`span`,{style:{color:`var(--ink)`,fontWeight:700},children:[` `,a.length,` files`]}),!s&&ie&&(0,R.jsxs)(`span`,{className:`ml-2 font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[`· `,ie.day,` (`,ie.items.length,`)`]})]}),!s&&ne.length>1&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[(0,R.jsx)(`button`,{onClick:()=>C(e=>Math.max(0,e-1)),disabled:re===0,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`◂ Newer`}),(0,R.jsxs)(`span`,{children:[re+1,` / `,ne.length]}),(0,R.jsx)(`button`,{onClick:()=>C(e=>Math.min(ne.length-1,e+1)),disabled:re>=ne.length-1,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`Older ▸`})]})]}),s?(0,R.jsx)(Sa,{}):ie&&ie.items.length>0?(0,R.jsx)(`div`,{className:`space-y-1.5`,children:ie.items.map(e=>{let t=p===e.filename,n=e.frontmatter?.type||`memory`,r=e.frontmatter?.name||e.filename.replace(/\.md$/,``);return(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:[(0,R.jsxs)(`button`,{onClick:()=>m(t?null:e.filename),className:`flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/10`,children:[(0,R.jsx)(`span`,{className:`font-mono text-xs`,style:{color:t?`var(--text)`:`var(--text-dim)`},children:t?`▾`:`▸`}),(0,R.jsx)(`span`,{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase`,style:{background:`var(--surface-sunk)`,color:`var(--text-dim)`},children:n}),(0,R.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,style:{color:`var(--text)`},children:r}),(0,R.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:e.filename})]}),t&&(0,R.jsx)(`div`,{className:`border-t border-border px-4 py-3`,children:(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,style:{color:`var(--text-dim)`},children:e.content})})]},e.filename)})}):(0,R.jsx)(`div`,{className:`py-6 text-center text-sm`,style:{color:`var(--text-dim)`},children:`No memory files.`})]})]})}var Da={dispatch:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},consensus:{color:`color-mix(in oklch, var(--info) 80%, transparent)`},error:{},timeout:{},worker:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},gemini:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},skill:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},boot:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},relay:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},gossip:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},utility:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},memory:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},persist:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},toolserver:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},other:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`}},Oa={error:`text-disputed`,timeout:`text-unverified`},ka=[[/^\[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 Aa(e){for(let[t,n]of ka)if(t.test(e))return n;return`other`}var ja=[{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`}],Ma=1e3;function Na(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(0),[i,a]=(0,_.useState)(0),[o,s]=(0,_.useState)(`all`),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(!0),f=(0,_.useRef)(null),p=(0,_.useRef)(0);(0,_.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await z(`logs?tail=500`);if(e)return;t(n.entries),r(n.totalLines),a(n.fileSize),p.current=n.totalLines+1}catch{}})(),()=>{e=!0}},[]),(0,_.useEffect)(()=>{if(u)return or(e=>{if(e.type!==`log_lines`)return;let n=e.data?.lines;n?.length&&t(e=>{let t=n.map((e,t)=>({line:p.current+t,text:e,category:Aa(e)}));p.current+=n.length,r(e=>e+n.length);let i=[...e,...t];return i.length>Ma?i.slice(-1e3):i})})},[u]),(0,_.useEffect)(()=>{c&&f.current&&f.current.scrollIntoView({behavior:`smooth`})},[e,c]);let m=o===`all`?e:e.filter(e=>e.category===o),h=(0,_.useCallback)(e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`,[]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mb-4 flex items-baseline gap-3`,children:[(0,R.jsx)(`h1`,{className:`h-route`,children:`MCP Log`}),(0,R.jsxs)(`span`,{className:`font-mono text-sm tabular-nums`,style:{color:`var(--ink-3)`},children:[n,` lines`]}),(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:h(i)}),u&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-[10px] text-confirmed`,children:[(0,R.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed`}),`live`]})]}),(0,R.jsxs)(`div`,{className:`mb-3 flex items-center gap-1.5`,children:[ja.map(e=>(0,R.jsx)(`button`,{onClick:()=>s(e.key),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition`,style:o===e.key?{background:`var(--surface-sunk)`,color:`var(--text)`}:{color:`var(--text-dim)`},children:e.label},e.key)),(0,R.jsxs)(`div`,{className:`ml-auto flex gap-1.5`,children:[(0,R.jsx)(`button`,{onClick:()=>d(!u),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${u?`bg-confirmed/10 text-confirmed`:``}`,style:u?void 0:{color:`var(--text-dim)`},children:u?`● Live`:`○ Paused`}),(0,R.jsx)(`button`,{onClick:()=>l(!c),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition`,style:c?{color:`var(--ok)`,background:`color-mix(in oklch, var(--ok) 10%, transparent)`}:{color:`var(--text-dim)`},children:c?`⤓ Auto`:`⤓ Scroll`})]})]}),(0,R.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border`,style:{background:`var(--surface-elev)`},children:(0,R.jsxs)(`div`,{className:`max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed`,children:[m.map(e=>(0,R.jsxs)(`div`,{className:`flex gap-2 hover:bg-accent/10`,children:[(0,R.jsx)(`span`,{className:`w-10 shrink-0 select-none text-right`,style:{color:`color-mix(in oklch, var(--text-dim) 30%, transparent)`},children:e.line}),(0,R.jsx)(`span`,{className:Oa[e.category]??``,style:Da[e.category]??Da.other,children:e.text})]},e.line)),m.length===0&&(0,R.jsx)(`div`,{className:`py-8 text-center font-mono text-xs`,style:{color:`var(--text-dim)`},children:e.length===0?`Loading...`:o===`all`?`No log entries in current tail.`:`No ${o} entries in current tail.`}),(0,R.jsx)(`div`,{ref:f})]})})]})}var Pa=[`critical`,`high`,`medium`,`low`],Fa=[`manual`,`impl`,`meta`,`auto-provisional`];function Ia(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}var La=`mb-1 block h-section`,Ra={},za=`w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none`,Ba={background:`var(--surface)`,color:`var(--text)`};function Va({filters:e,onChange:t,agents:n,signalTypes:r}){let i=e=>n=>{let r=n.target.value;t({[e]:r===``?void 0:r})};return(0,R.jsxs)(`aside`,{className:`space-y-3 rounded-md border border-border/60 p-3`,style:{background:`color-mix(in oklch, var(--surface-elev) 70%, transparent)`},children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`h2`,{className:`h-section`,children:`Filters`}),(0,R.jsx)(`button`,{type:`button`,className:`font-mono text-[9px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},onClick:()=>t({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`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`label`,{className:La,style:Ra,children:[`Agents (`,e.agents.length,` selected)`]}),(0,R.jsxs)(`div`,{className:`max-h-32 overflow-y-auto rounded border border-border/60 p-1`,style:{background:`var(--surface)`},children:[n.length===0&&(0,R.jsx)(`div`,{className:`px-1 py-0.5 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`no agents`}),n.map(n=>(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20`,style:{color:`var(--text)`},children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`h-3 w-3`,checked:e.agents.includes(n),onChange:()=>t({agents:Ia(e.agents,n)})}),(0,R.jsx)(`span`,{children:n})]},n))]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Counterpart`}),(0,R.jsxs)(`select`,{className:za,style:Ba,value:e.counterpart??``,onChange:i(`counterpart`),children:[(0,R.jsx)(`option`,{value:``,children:`any`}),n.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`label`,{className:La,style:Ra,children:[`Signal types (`,e.signals.length,`)`]}),(0,R.jsxs)(`div`,{className:`max-h-32 overflow-y-auto rounded border border-border/60 p-1`,style:{background:`var(--surface)`},children:[r.length===0&&(0,R.jsx)(`div`,{className:`px-1 py-0.5 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`no signals`}),r.map(n=>(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20`,style:{color:`var(--text)`},children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`h-3 w-3`,checked:e.signals.includes(n),onChange:()=>t({signals:Ia(e.signals,n)})}),(0,R.jsx)(`span`,{children:n})]},n))]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Severity`}),(0,R.jsxs)(`select`,{className:za,style:Ba,value:e.severity??``,onChange:i(`severity`),children:[(0,R.jsx)(`option`,{value:``,children:`any`}),Pa.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,"data-tooltip":`manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated`,children:`Source`}),(0,R.jsxs)(`select`,{className:za,style:Ba,value:e.source??``,onChange:i(`source`),children:[(0,R.jsx)(`option`,{value:``,children:`any`}),Fa.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Category`}),(0,R.jsx)(`input`,{type:`text`,className:za,style:Ba,value:e.category??``,onChange:i(`category`),placeholder:`e.g. trust_boundaries`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Since`}),(0,R.jsx)(`input`,{type:`datetime-local`,className:za,style:Ba,value:e.since?e.since.slice(0,16):``,onChange:e=>t({since:e.target.value?new Date(e.target.value).toISOString():void 0})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Until`}),(0,R.jsx)(`input`,{type:`datetime-local`,className:za,style:Ba,value:e.until?e.until.slice(0,16):``,onChange:e=>t({until:e.target.value?new Date(e.target.value).toISOString():void 0})})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Consensus ID (prefix)`}),(0,R.jsx)(`input`,{type:`text`,className:za,style:Ba,value:e.consensusId??``,onChange:i(`consensusId`),placeholder:`e.g. d07eac46`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:La,style:Ra,children:`Finding ID (prefix)`}),(0,R.jsx)(`input`,{type:`text`,className:za,style:Ba,value:e.findingId??``,onChange:i(`findingId`),placeholder:`e.g. d07eac46-5f464e89:sonnet`})]})]})}var Ha={agents:[],signals:[]},Ua=[`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`],Wa={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`},Ga={agreement:`var(--ok)`,consensus_verified:`var(--ok)`,impl_test_pass:`var(--ok)`,impl_typecheck_pass:`var(--ok)`,impl_peer_approved:`var(--ok)`,disagreement:`var(--bad)`,hallucination_caught:`var(--bad)`,impl_test_fail:`var(--bad)`,impl_typecheck_fail:`var(--bad)`,impl_peer_rejected:`var(--bad)`,boundary_escape:`var(--bad)`,unique_confirmed:`var(--unique)`,unique_unconfirmed:`var(--unique)`,new_finding:`var(--unique)`,unverified:`var(--info)`},Ka={critical:`var(--bad)`,high:`var(--warn)`,medium:`var(--severity-medium)`,low:`var(--ink-3)`},qa=100;function Ja(){if(typeof window>`u`)return{filters:Ha,hadAny:!1};let e=new URLSearchParams(window.location.search),t=e.getAll(`signal`).filter(Boolean),n=e.get(`agent`),r=e.get(`counterpart`)??void 0,i=e.get(`category`)??void 0,a=e.get(`severity`),o=a===`critical`||a===`high`||a===`medium`||a===`low`?a:void 0,s=e.get(`since`)??void 0,c=e.get(`until`)??void 0,l=e.get(`consensus_id`)??void 0,u=e.get(`finding_id`)??void 0,d=e.get(`source`),f=d===`manual`||d===`impl`||d===`meta`||d===`auto-provisional`?d:void 0;return t.length>0||n||r||i||o||s||c||l||u||f?{filters:{agents:n?[n]:[],signals:t,counterpart:r,category:i,severity:o,since:s,until:c,consensusId:l,findingId:u,source:f},hadAny:!0}:{filters:Ha,hadAny:!1}}function Ya(e,t,n=qa){let r=new URLSearchParams;r.set(`limit`,String(n)),r.set(`offset`,String(t)),e.agents.length===1&&r.set(`agent`,e.agents[0]),e.counterpart&&r.set(`counterpart`,e.counterpart);for(let t of e.signals)r.append(`signal`,t);return e.category&&r.set(`category`,e.category),e.severity&&r.set(`severity`,e.severity),e.since&&r.set(`since`,e.since),e.until&&r.set(`until`,e.until),e.consensusId&&r.set(`consensus_id`,e.consensusId),e.findingId&&r.set(`finding_id`,e.findingId),e.source&&r.set(`source`,e.source),r}function Xa(e,t){return e?e.length>t?e.slice(0,t)+`…`:e:``}function Za(){let[{filters:e,hadAny:t}]=(0,_.useState)(Ja),[n,r]=(0,_.useState)(e),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)([]),[g,v]=(0,_.useState)(!1),[y,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),w=(0,_.useRef)(null),T=(0,_.useRef)(0),ee=(0,_.useCallback)(async(e,t)=>{let n=++T.current;d(!0),p(null);try{let r=await z(`signals?${Ya(e,t*qa).toString()}`);if(n!==T.current)return;a(r.items??[]),l(r.total??0)}catch(e){if(n!==T.current)return;p(e instanceof Error?e.message:`fetch failed`)}finally{n===T.current&&d(!1)}},[]);(0,_.useEffect)(()=>{z(`agents`).then(e=>{let t=(e??[]).map(e=>e.id).filter(Boolean).sort();t.length>0&&h(t)}).catch(()=>{})},[]),(0,_.useEffect)(()=>{s(0)},[n]),(0,_.useEffect)(()=>(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{ee(n,o)},250),()=>{w.current&&clearTimeout(w.current)}),[n,o,ee]);let E=(0,_.useCallback)(e=>{r(t=>({...t,...e}))},[]),D=Math.max(1,Math.ceil(c/qa)),O=Math.min(o,D-1),k=c>0||t||u,A=(e,t)=>{!e||!t||(x(e),C(t),v(!0))},j=(0,_.useMemo)(()=>{let e=[];return n.agents.length&&e.push(`${n.agents.length} agents`),n.signals.length&&e.push(`${n.signals.length} signals`),n.severity&&e.push(n.severity),n.source&&e.push(n.source),(n.since||n.until)&&e.push(`time window`),e.length?e.join(` · `):`all signals`},[n]);return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(`div`,{className:`flex items-baseline justify-between`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`h-route`,children:`Signals`}),(0,R.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:`Scored events emitted by agents during consensus review.`}),(0,R.jsxs)(`p`,{className:`mt-0.5 font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},children:[j,` — showing `,i.length,` of `,c]})]})}),t&&(0,R.jsxs)(`div`,{className:`rounded-md border border-border/40 px-3 py-2 font-mono text-[10px]`,style:{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`,color:`var(--text-dim)`},children:[`Filtered view — `,n.signals.length,` signal type`,n.signals.length===1?``:`s`,n.agents.length>0?` · ${n.agents.length} agent${n.agents.length===1?``:`s`}`:``,n.severity?` · severity: ${n.severity}`:``,n.source?` · source: ${n.source}`:``,`. `,(0,R.jsx)(`a`,{href:b(`/signals`),style:{color:`var(--accent)`},children:`Clear filters`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 ${k?`lg:grid-cols-[260px_1fr]`:``} lg:items-start`,children:[k&&(0,R.jsx)(`div`,{className:t?`opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100`:void 0,children:(0,R.jsx)(Va,{filters:n,onChange:E,agents:m,signalTypes:Ua})}),(0,R.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-md border border-border/60`,style:{background:`color-mix(in oklch, var(--surface-elev) 70%, transparent)`},children:[f&&(0,R.jsx)(`div`,{className:`border-b border-border/60 px-3 py-2 font-mono text-[10px]`,style:{color:`var(--bad)`,background:`color-mix(in oklch, var(--bad) 10%, transparent)`},children:f}),(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full border-collapse text-[10px]`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`h-section border-b border-border/60 text-left`,style:{color:`color-mix(in oklch, var(--ink-2) 80%, transparent)`},children:[(0,R.jsx)(`th`,{className:`w-[6px] p-0`,"aria-label":`severity`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,children:`time`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,children:`agent`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,children:`verdict`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,children:`finding`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,"data-tooltip":`The other agent in this signal — e.g. the peer who agreed or disputed`,children:`counterpart`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,"data-tooltip":`Finding ID — click row to open finding detail`,children:`id`}),(0,R.jsx)(`th`,{className:`px-2 py-1.5`,children:`consensus`})]})}),(0,R.jsxs)(`tbody`,{children:[i.length===0&&!u&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:8,className:`px-2 py-8 text-center font-mono`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},children:`no signals match these filters`})}),i.map((e,t)=>{let n=!!(e.consensusId&&e.findingId),r=e.severity?Ka[e.severity]:`transparent`,i=Ga[e.signal]??`var(--ink-2)`,a=Wa[e.signal]??e.signal;return(0,R.jsxs)(`tr`,{className:`border-b border-border/30 ${n?`cursor-pointer transition-colors`:``}`,style:n?{"--row-hover-bg":`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`}:void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,"aria-label":n?`View finding ${e.findingId??``}`:void 0,onMouseEnter:e=>{n&&(e.currentTarget.style.background=`color-mix(in oklch, var(--surface-sunk) 40%, transparent)`)},onMouseLeave:e=>{n&&(e.currentTarget.style.background=``)},onClick:()=>n&&A(e.consensusId,e.findingId),onKeyDown:t=>{n&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),A(e.consensusId,e.findingId))},children:[(0,R.jsx)(`td`,{className:`p-0`,style:{background:r,width:6},title:e.severity??`no severity`}),(0,R.jsx)(`td`,{className:`whitespace-nowrap px-2 py-1 font-mono tabular-nums`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},title:e.timestamp,children:L(e.timestamp)}),(0,R.jsx)(`td`,{className:`whitespace-nowrap px-2 py-1 font-mono`,style:{color:`var(--text)`},children:e.agentId}),(0,R.jsx)(`td`,{className:`whitespace-nowrap px-2 py-1`,children:(0,R.jsx)(`span`,{className:`h-section`,style:{color:i,fontSize:11},children:a})}),(0,R.jsx)(`td`,{className:`max-w-[320px] truncate px-2 py-1`,style:{fontFamily:`var(--font-mono)`,fontSize:12,lineHeight:1.45,color:`var(--text)`},title:e.evidence,children:Xa(e.evidence,80)}),(0,R.jsx)(`td`,{className:`whitespace-nowrap px-2 py-1 font-mono`,style:{color:`color-mix(in oklch, var(--text-dim) 80%, transparent)`},children:e.counterpartId??`—`}),(0,R.jsx)(`td`,{className:`whitespace-nowrap px-2 py-1 font-mono`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},title:e.findingId,children:e.findingId?Xa(e.findingId,24):`—`}),(0,R.jsx)(`td`,{className:`whitespace-nowrap px-2 py-1 font-mono`,style:{color:`color-mix(in oklch, var(--text-dim) 70%, transparent)`},title:e.consensusId,children:e.consensusId?Xa(e.consensusId,16):`—`})]},`${e.timestamp}-${e.agentId}-${t}`)})]})]})}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border/60 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`color-mix(in oklch, var(--text-dim) 60%, transparent)`},children:u?`loading…`:`${O*qa+1}–${O*qa+i.length} of ${c}`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[10px]`,style:{color:`var(--text-dim)`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>s(e=>Math.max(0,e-1)),disabled:O===0||u,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`◂ Prev`}),(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[O+1,` / `,D]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>s(e=>Math.min(D-1,e+1)),disabled:O>=D-1||u,className:`rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`Next ▸`})]})]})]})]}),(0,R.jsx)(ia,{open:g,onOpenChange:v,consensusId:y,findingId:S})]})}function Qa(){if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t=e.get(`key`);if(t===null)return null;e.delete(`key`);let n=e.toString(),r=window.location.pathname+(n?`?${n}`:``)+window.location.hash;return window.history.replaceState(null,``,r),t.trim()||null}function $a(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(!1),a=(0,_.useCallback)(async e=>{r(null);let n=await at(e);n.ok?t(!0):(r(n.kind),t(!1))},[]),o=(0,_.useCallback)(async()=>{if(i.current)return e===!0;i.current=!0;try{let e=await ot();return t(e),e}finally{i.current=!1}},[e]);return(0,_.useEffect)(()=>{let e=!1,n=Qa();return i.current=!0,(async()=>{try{if(await ot()){e||t(!0);return}if(n){e||await a(n);return}e||t(!1)}finally{i.current=!1}})(),()=>{e=!0}},[a]),{authed:e,login:a,error:n,recheck:o}}function eo(e,t){let n=t.match(/^API error: (\d+)$/);return`${e}: ${n?`HTTP ${n[1]}`:t}`}var to=5e3;async function no(e,t){try{return await z(t)}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(eo(e,n))}}function ro(e){let[t,n]=(0,_.useState)({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,fleetTrend:null,signalActivity:null,skills:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),r=(0,_.useRef)(!1),i=(0,_.useRef)(e);i.current=e;let a=(0,_.useCallback)(async()=>{if(!r.current){r.current=!0;try{let[e,t,r,i,a,o,s,c,l,u]=await Promise.all([no(`overview`,`overview`),no(`agents`,`agents`),no(`tasks`,`tasks?limit=2000`),no(`consensus`,`consensus?pageSize=500`),z(`consensus-reports?page=1&pageSize=200`).catch(()=>({reports:[]})),z(`fleet-trend?days=7`).catch(()=>({days:7,points:[]})),z(`signal-activity`).catch(()=>({agents:[],total:0,generatedAt:``})),z(`skills`).catch(()=>({index:{},suggestions:[],effectiveness:[]})),z(`native-memory`).catch(()=>({knowledge:[]})),z(`gossip-memory`).catch(()=>({knowledge:[]}))]),d=[...l.knowledge||[]].map(e=>({...e,origin:`native`})).sort((e,t)=>t.filename>e.filename?1:-1),f=[...u.knowledge||[]].map(e=>({...e,origin:`gossip`})).sort((e,t)=>t.filename>e.filename?1:-1);n({overview:e,agents:t,tasks:r,consensus:i,consensusReports:a,fleetTrend:o,signalActivity:s,skills:c,nativeMemories:d,gossipMemories:f,memories:d,loading:!1,error:null})}catch(e){tt(e)?(i.current?.(),n(e=>({...e,loading:!1}))):n(t=>({...t,loading:!1,error:e.message}))}finally{r.current=!1}}},[]);return(0,_.useEffect)(()=>{a()},[a]),(0,_.useEffect)(()=>{let e=setInterval(()=>{a()},to);return()=>clearInterval(e)},[a]),{...t,refresh:a}}var io=`dashboard:lastEventId`;function ao(){if(typeof window>`u`)return 0;let e=window.localStorage.getItem(io);if(!e)return 0;let t=parseInt(e,10);return Number.isFinite(t)?t:0}function oo(e){typeof window>`u`||window.localStorage.setItem(io,String(e))}var so=1e3,co=5e3;function lo(e){(0,_.useEffect)(()=>{if(typeof window>`u`||window.EventSource===void 0)return;let t=null,n=null,r=so,i=!1;function a(){if(i)return;let o=ao();t=new window.EventSource(`/dashboard/api/events?last_id=${o}`),t.onmessage=t=>{try{let n=JSON.parse(t.data);e(n),oo(n.id),r=so}catch{}},t.onerror=()=>{t&&=(t.close(),null),!i&&(n=setTimeout(()=>{a()},r),r=Math.min(r*2,co))}}return a(),()=>{i=!0,n!==null&&clearTimeout(n),t&&=(t.close(),null)}},[])}var U=5,W=6e3;function uo({toast:e,onDismiss:t}){let n=(0,_.useRef)(null),r=(0,_.useCallback)(()=>{n.current&&=(clearTimeout(n.current),null)},[]),i=(0,_.useCallback)(()=>{r(),n.current=setTimeout(()=>t(e.id),W)},[e.id,t,r]);(0,_.useEffect)(()=>(i(),r),[i,r]);let{type:a,payload:o}=e.event,s=a===`task.completed`?(0,R.jsx)(`span`,{style:{color:`var(--text-dim)`},children:`✓`}):o.confirmed>o.disputed?(0,R.jsx)(`span`,{className:`text-confirmed`,children:`◎`}):(0,R.jsx)(`span`,{className:`text-disputed`,children:`◎`}),c;if(a===`task.completed`){let e=String(o.agentId??`agent`),t=typeof o.durationMs==`number`?o.durationMs:null;c=`${e} finished in ${t===null?`—`:`${(t/1e3).toFixed(1)}s`}`}else c=`Consensus done — ${Number(o.confirmed??0)} confirmed · ${Number(o.disputed??0)} disputed`;return(0,R.jsx)(`div`,{className:[`pointer-events-auto border rounded px-4 py-3 max-w-sm cursor-pointer`,`transition-all duration-200`,`motion-reduce:transition-none motion-reduce:transform-none`,`hover:border-border`,e.exiting?`opacity-0 scale-95 opacity-0 translate-y-2`:`opacity-100 scale-100 translate-x-0`].join(` `),style:{background:`var(--surface-elev)`,boxShadow:`var(--shadow-card)`},onClick:()=>{r(),a===`task.completed`&&o.taskId?x(`/tasks`):a===`consensus.completed`&&o.consensusId&&x(`/debates`),t(e.id)},onMouseEnter:r,onMouseLeave:i,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`shrink-0 text-sm font-bold`,children:s}),(0,R.jsx)(`span`,{title:c,className:`font-mono text-[11px] min-w-0 truncate`,style:{color:`var(--text)`},children:c}),(0,R.jsx)(`button`,{className:`ml-auto shrink-0 hover:[color:var(--text-dim)] text-xs leading-none`,style:{color:`color-mix(in oklch, var(--text-dim) 50%, transparent)`},onClick:n=>{n.stopPropagation(),r(),t(e.id)},"aria-label":`Dismiss notification`,children:`×`})]})})}function fo(){let[e,t]=(0,_.useState)([]),n=(0,_.useCallback)(e=>{t(t=>t.map(t=>t.id===e?{...t,exiting:!0}:t)),setTimeout(()=>{t(t=>t.filter(t=>t.id!==e))},250)},[]);return lo((0,_.useCallback)(e=>{t(t=>{let n={id:e.id,event:e,exiting:!1},r=[...t,n];if(r.length>U){let e=r.length-U;return r.slice(e)}return r})},[])),(0,R.jsx)(`div`,{className:`fixed bottom-20 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none`,role:`region`,"aria-label":`Notifications`,"aria-live":`polite`,"aria-atomic":`false`,children:e.map(e=>(0,R.jsx)(uo,{toast:e,onDismiss:n},e.id))})}var po=1e3,mo=5e3,ho=`/dashboard/api/bridge/stream`,go=4,_o=`/dashboard/api/bridge`,vo=3e4;function yo(e){switch(e){case 400:return`message rejected — invalid or empty`;case 429:return`rate limited — slow down`;case 503:return"no live Claude Code session — start `gossipcat code`";case 401:return`session expired — reload to re-authenticate`;default:return`send failed — HTTP ${e}`}}var bo=1;function xo(e,t,n,r){return{id:bo++,role:e,text:t,ts:n??new Date().toISOString(),serverId:r}}function So(e,t){let n=e[e.length-1];if(!n||t.ts>=n.ts)return[...e,t];let r=e.findIndex(e=>e.ts>t.ts);return r<0?[...e,t]:[...e.slice(0,r),t,...e.slice(r)]}function Co(e={}){let{initialChatId:t=null,active:n=!0}=e,[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(`connecting`),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(t),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(0),[h,g]=(0,_.useState)(null),v=(0,_.useRef)(n);v.current=n;let y=(0,_.useCallback)(()=>m(0),[]),b=(0,_.useCallback)(()=>{v.current||m(e=>e+1)},[]),x=(0,_.useRef)(t),S=(0,_.useCallback)(e=>{let t=x.current;x.current=e,u(e),t!==e&&w.current?.()},[]),C=(0,_.useRef)(0),w=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(typeof window>`u`||window.EventSource===void 0)return;let e=null,t=null,n=po,r=!1,a=0;function s(){if(r)return;o(`connecting`);let d=C.current,f=x.current?`&chat_id=${encodeURIComponent(x.current)}`:``;e=new window.EventSource(`${ho}?last_id=${d}${f}`),e.onopen=()=>{r||(a=0,o(`open`),n=po)},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=x.current;!n||t.chat_id!==n||(t.type===`reply`?(c(!1),i(e=>So(e,xo(`assistant`,t.text??``,t.ts))),b()):t.type===`ack`?i(e=>So(e,xo(`ack`,`received — working…`,t.ts))):t.type===`error`?(c(!1),i(e=>So(e,xo(`error`,t.text??`the live session reported an error`,t.ts))),b()):t.type===`question`?u(t):t.type===`mirror`?l(t):t.type===`restart`&&(C.current=0,w.current?.()))},e.onerror=()=>{e&&=(e.close(),null),!r&&(a+=1,o(a>=go?`error`:`connecting`),t=setTimeout(()=>s(),n),n=Math.min(n*2,mo))}}function l(e){let t=e.role;if(t!==`user`&&t!==`assistant`&&t!==`activity`)return;typeof e.id==`number`&&e.id>C.current&&(C.current=e.id),t===`assistant`&&c(!1);let n=typeof e.text==`string`?e.text:``,r=typeof e.ts==`string`&&/^\d{4}-\d{2}-\d{2}T/.test(e.ts)?e.ts:void 0;i(i=>So(i,xo(t,n,r,e.id))),b()}function u(e){if(typeof e.qid!=`string`||e.qid.length===0||!Array.isArray(e.questions)||e.questions.length===0)return;for(let t of e.questions)if(!t||typeof t.questionId!=`string`||typeof t.header!=`string`||typeof t.question!=`string`||!Array.isArray(t.options)||t.options.length===0||t.options.some(e=>!e||typeof e.label!=`string`))return;let t=typeof e.ts==`string`&&/^\d{4}-\d{2}-\d{2}T/.test(e.ts)?e.ts:new Date().toISOString();g({qid:e.qid,questions:e.questions,ts:t}),b()}function d(){r||(t!==null&&(clearTimeout(t),t=null),e&&=(e.close(),null),n=po,s())}return w.current=d,s(),()=>{r=!0,w.current=null,o(`closed`),t!==null&&clearTimeout(t),e&&=(e.close(),null)}},[b]),{messages:r,status:a,awaitingReply:s,chatId:l,unread:p,send:(0,_.useCallback)(async e=>{let t=e.trim();if(t.length===0)return;f(null),i(e=>[...e,xo(`user`,t)]),c(!0);let n=x.current,r={message:t};n&&(r.chat_id=n);let a=new AbortController,o=setTimeout(()=>a.abort(),vo);try{let e=await fetch(_o,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r),signal:a.signal}),t={};try{t=await e.json()}catch{}if(typeof t.chat_id==`string`&&t.chat_id.length>0&&!x.current&&S(t.chat_id),e.status===202)return;c(!1),f(t.error??yo(e.status))}catch(e){c(!1);let t=e instanceof Error&&e.name===`AbortError`;f(t?`send timed out — relay unreachable`:`send failed — relay unreachable`)}finally{clearTimeout(o)}},[S]),sendError:d,markRead:y,pendingQuestion:h,submitAnswer:(0,_.useCallback)(async e=>{let t=h,n=x.current;if(!t||!n)return!1;f(null);let r=e.map(e=>{let n=t.questions.find(t=>t.questionId===e.questionId)?.header??e.questionId,r=[];return e.selected.length>0&&r.push(e.selected.join(`, `)),e.other&&e.other.trim().length>0&&r.push(`other: "${e.other.trim()}"`),`${n}: ${r.join(` · `)}`}).join(` · `);i(e=>[...e,xo(`user`,r)]),c(!0),g(null);let a=new AbortController,o=setTimeout(()=>a.abort(),vo);try{let r=await fetch(_o,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({chat_id:n,answer:{qid:t.qid,responses:e}}),signal:a.signal});if(r.status===202)return!0;let i={};try{i=await r.json()}catch{}return c(!1),f(i.error??yo(r.status)),!1}catch(e){c(!1);let t=e instanceof Error&&e.name===`AbortError`;return f(t?`answer timed out — relay unreachable`:`answer failed — relay unreachable`),!1}finally{clearTimeout(o)}},[h])}}var wo=`gossipcat_chat_tabs`,To=18,Eo=(0,_.createContext)(null),Do=0;function Oo(){return Do+=1,`tab-${Date.now().toString(36)}-${Do}`}function ko(e,t){let n=e.find(e=>e.role===`user`&&e.text.trim().length>0);if(n){let e=n.text.trim().replace(/\s+/g,` `);return e.length>To?`${e.slice(0,To)}…`:e}return t&&t.length>0?t.slice(0,6):`new chat`}function Ao(){try{if(typeof localStorage>`u`)return null;let e=localStorage.getItem(wo);if(!e||e.length>64e3)return null;let t=JSON.parse(e);if(!t||!Array.isArray(t.tabs))return null;let n=[];for(let e of t.tabs){if(!e||typeof e.chatId!=`string`||e.chatId.length===0)continue;let t=typeof e.label==`string`&&e.label.length>0?e.label.slice(0,64):e.chatId.slice(0,6),r=typeof e.customLabel==`string`&&e.customLabel.trim().length>0?e.customLabel.slice(0,40):void 0;if(n.push({key:Oo(),chatId:e.chatId,label:t,customLabel:r}),n.length>=8)break}return n.length===0?null:{tabs:n,activeKey:(n.find(e=>e.chatId===t.activeChatId)??n[0]).key}}catch{return null}}function jo(e,t){try{if(typeof localStorage>`u`)return;let n=e.filter(e=>typeof e.chatId==`string`),r=e.find(e=>e.key===t),i={tabs:n.map(e=>({chatId:e.chatId,label:e.label,...e.customLabel?{customLabel:e.customLabel}:{}})),activeChatId:r?.chatId??null};if(i.tabs.length===0){localStorage.removeItem(wo);return}localStorage.setItem(wo,JSON.stringify(i))}catch{}}function Mo({meta:e,active:t,onState:n,onChatIdMinted:r,registerHandle:i}){let a=Co({initialChatId:e.chatId,active:t});(0,_.useEffect)(()=>(i(e.key,{send:a.send,markRead:a.markRead,submitAnswer:a.submitAnswer}),()=>i(e.key,null)),[e.key,a.send,a.markRead,a.submitAnswer,i]);let o=ko(a.messages,a.chatId),s=e.customLabel??o;(0,_.useEffect)(()=>{n({key:e.key,chatId:a.chatId,label:s,customLabel:e.customLabel,messages:a.messages,status:a.status,awaitingReply:a.awaitingReply,unread:a.unread,sendError:a.sendError,pendingQuestion:a.pendingQuestion})},[e.key,e.customLabel,a.chatId,s,a.messages,a.status,a.awaitingReply,a.unread,a.sendError,a.pendingQuestion,n]);let c=(0,_.useRef)(e.chatId);return(0,_.useEffect)(()=>{a.chatId&&a.chatId!==c.current&&(c.current=a.chatId,r(e.key,a.chatId,o))},[e.key,a.chatId,o,r]),null}function No({children:e}){let t=(0,_.useRef)(void 0);t.current===void 0&&(t.current=Ao()??(()=>{let e={key:Oo(),chatId:null,label:`new chat`};return{tabs:[e],activeKey:e.key}})());let[n,r]=(0,_.useState)(()=>t.current.tabs),[i,a]=(0,_.useState)(()=>t.current.activeKey);(0,_.useEffect)(()=>{!n.some(e=>e.key===i)&&n.length>0&&a(n[0].key)},[n,i]);let[o,s]=(0,_.useState)({}),c=(0,_.useRef)({}),l=(0,_.useCallback)((e,t)=>{t?c.current[e]=t:delete c.current[e]},[]),u=(0,_.useCallback)(e=>{s(t=>{let n=t[e.key];return n&&n.chatId===e.chatId&&n.label===e.label&&n.messages===e.messages&&n.status===e.status&&n.awaitingReply===e.awaitingReply&&n.unread===e.unread&&n.sendError===e.sendError&&n.pendingQuestion===e.pendingQuestion?t:{...t,[e.key]:e}})},[]),d=(0,_.useCallback)((e,t,n)=>{r(r=>r.map(r=>r.key===e?{...r,chatId:t,label:n}:r))},[]);(0,_.useEffect)(()=>{jo(n,i)},[n,i]);let f=(0,_.useCallback)(()=>{r(e=>{if(e.length>=8)return e;let t=Oo();return a(t),[...e,{key:t,chatId:null,label:`new chat`}]})},[]),p=(0,_.useCallback)(e=>{a(e),c.current[e]?.markRead()},[]),m=(0,_.useCallback)((e,t)=>{let n=t.trim().slice(0,40);r(t=>t.map(t=>t.key===e?{...t,customLabel:n.length>0?n:void 0}:t))},[]),h=(0,_.useCallback)(e=>{r(t=>{let n=t.findIndex(t=>t.key===e);if(n<0)return t;let r=t.filter(t=>t.key!==e);if(r.length===0){let e={key:Oo(),chatId:null,label:`new chat`};return a(e.key),[e]}return a(t=>{if(t!==e)return t;let i=r[Math.max(0,n-1)]??r[0];return c.current[i.key]?.markRead(),i.key}),r}),s(t=>{if(!(e in t))return t;let{[e]:n,...r}=t;return r})},[]),g=(0,_.useCallback)(e=>{let t=c.current[i];return t?t.send(e):Promise.resolve()},[i]),v=(0,_.useCallback)(e=>{let t=c.current[i];return t?t.submitAnswer(e):Promise.resolve(!1)},[i]),y=(0,_.useMemo)(()=>n.map(e=>o[e.key]??{key:e.key,chatId:e.chatId,label:e.label,messages:[],status:`connecting`,awaitingReply:!1,unread:0,sendError:null,pendingQuestion:null}),[n,o]),b=y.find(e=>e.key===i)??y[0]??null,x=b?.sendError??null,S=(0,_.useMemo)(()=>({conversations:y,activeId:i,active:b,sendError:x,send:g,submitAnswer:v,newConversation:f,closeConversation:h,switchConversation:p,renameConversation:m,canAddTab:n.length<8}),[y,i,b,x,g,v,f,h,p,m,n.length]);return(0,R.jsxs)(Eo.Provider,{value:S,children:[n.map(e=>(0,R.jsx)(Mo,{meta:e,active:e.key===i,onState:u,onChatIdMinted:d,registerHandle:l},e.key)),e]})}function Po(){let e=(0,_.useContext)(Eo);if(e===null)throw Error(`useBridgeStore must be used inside <BridgeProvider>`);return e}function Fo(){let e=Po(),t=e.active;return{messages:t?.messages??[],status:t?.status??`connecting`,awaitingReply:t?.awaitingReply??!1,chatId:t?.chatId??null,sendError:e.sendError,send:e.send}}function Io({status:e,compact:t=!1}){let n={open:{color:`var(--ok)`,label:`live`},connecting:{color:`var(--warn)`,label:`connecting`},closed:{color:`var(--idle)`,label:`offline`},error:{color:`var(--bad)`,label:`relay down`}},{color:r,label:i}=n[e]??n.closed,a=t?`h-1.5 w-1.5`:`h-2 w-2`,o=t?`font-mono text-[10px]`:`font-mono text-[12px]`;return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-block ${a} rounded-full ${e===`connecting`?`animate-pulse motion-reduce:animate-none`:``}`,style:{background:r},"aria-hidden":!0}),(0,R.jsx)(`span`,{className:o,style:{color:`var(--ink-3)`},children:i})]})}function Lo({compact:e=!1}){let t=e?`h-1.5 w-1.5`:`h-2 w-2`,n=e?`text-[10px]`:`text-[12px]`;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 ${e?`px-1 py-1`:`px-1 py-2`}`,children:[(0,R.jsxs)(`span`,{className:`inline-flex gap-1`,"aria-hidden":!0,children:[(0,R.jsx)(`span`,{className:`${t} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:`var(--ink-4)`}}),(0,R.jsx)(`span`,{className:`${t} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:`var(--ink-4)`,animationDelay:`150ms`}}),(0,R.jsx)(`span`,{className:`${t} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:`var(--ink-4)`,animationDelay:`300ms`}})]}),(0,R.jsx)(`span`,{className:n,style:{color:`var(--ink-3)`},children:`working…`})]})}function Ro({msg:e}){return(0,R.jsxs)(`div`,{className:`cx-turn user`,children:[(0,R.jsx)(`div`,{className:`cx-gutter`,"aria-hidden":!0,children:`›`}),(0,R.jsx)(`div`,{className:`cx-body whitespace-pre-wrap break-words`,children:e.text})]})}function zo({text:e}){return(0,R.jsx)(`div`,{className:`cx-prose finding-md`,dangerouslySetInnerHTML:{__html:Me(e)}})}var Bo=/^([\p{Emoji_Presentation}\p{Extended_Pictographic}🔧📡🗒]+)\s*/u;function Vo(e){let t=``,n=e.trim(),r=n.match(Bo);r&&(t=r[1],n=n.slice(r[0].length).trim());let i=n.indexOf(`→`);if(i>=0){let e=n.slice(0,i+1).trim(),r=n.slice(i+1).trim();return{icon:t,label:e,agent:r}}let a=n.indexOf(`·`);if(a>=0){let e=n.slice(0,a+1).trim(),r=n.slice(a+1).trim();return{icon:t,label:e,cmd:r}}return{icon:t,label:``,cmd:n}}function Ho({text:e}){let{icon:t,label:n,cmd:r,agent:i}=Vo(e);return(0,R.jsxs)(`div`,{className:`cx-activity`,children:[t&&(0,R.jsx)(`span`,{className:`cx-ic`,"aria-hidden":!0,children:t}),n&&(0,R.jsx)(`span`,{className:`cx-label`,children:n}),i&&(0,R.jsx)(`span`,{className:`cx-agent`,children:i}),r&&(0,R.jsx)(`span`,{className:!n&&!i?`cx-cmd cx-cmd-bare`:`cx-cmd`,children:r})]})}function Uo({text:e}){return(0,R.jsx)(`div`,{className:`cx-activity`,children:(0,R.jsx)(`span`,{className:`cx-cmd cx-cmd-bare`,children:e})})}function Wo({text:e}){return(0,R.jsxs)(`div`,{className:`cx-state err`,role:`alert`,children:[(0,R.jsx)(`span`,{className:`cx-chip-bad`,children:`session error`}),(0,R.jsx)(`span`,{children:e})]})}function Go({pending:e,onSubmit:t,submitting:n=!1}){let[r,i]=(0,_.useState)(()=>{let t={};for(let n of e.questions)t[n.questionId]={selected:[],other:``};return t}),[a,o]=(0,_.useState)(!1),s=a||n,c=e=>r[e]??{selected:[],other:``},l=(e,t)=>{i(n=>({...n,[e]:{...c(e),selected:[t]}}))},u=(e,t)=>{i(n=>{let r=n[e]??{selected:[],other:``},i=r.selected.includes(t)?r.selected.filter(e=>e!==t):[...r.selected,t];return{...n,[e]:{...r,selected:i}}})},d=(e,t)=>{i(n=>({...n,[e]:{...c(e),other:t}}))},f=(0,_.useMemo)(()=>e.questions.every(e=>{let t=r[e.questionId]??{selected:[],other:``},n=e.allowOther===!0&&t.other.trim().length>0;return t.selected.length>0||n}),[e.questions,r]);return(0,R.jsxs)(`div`,{className:`cx-qcard`,role:`group`,"aria-label":`Question from the live session`,children:[e.questions.map(t=>{let n=c(t.questionId),r=t.multiSelect===!0,i=`q-${e.qid}-${t.questionId}`;return(0,R.jsxs)(`fieldset`,{className:`cx-qfield`,children:[(0,R.jsx)(`legend`,{className:`cx-qlegend`,children:t.header}),(0,R.jsx)(`p`,{className:`cx-qprompt`,children:t.question}),(0,R.jsx)(`div`,{className:`cx-qoptions`,role:r?`group`:`radiogroup`,"aria-label":t.question,children:t.options.map(e=>{let a=n.selected.includes(e.label);return(0,R.jsxs)(`label`,{className:`cx-qopt${a?` is-selected`:``}`,children:[(0,R.jsx)(`input`,{type:r?`checkbox`:`radio`,name:i,value:e.label,checked:a,disabled:s,onChange:()=>r?u(t.questionId,e.label):l(t.questionId,e.label),className:`cx-qinput`}),(0,R.jsxs)(`span`,{className:`cx-qopt-body`,children:[(0,R.jsx)(`span`,{className:`cx-qopt-label`,children:e.label}),e.description&&(0,R.jsx)(`span`,{className:`cx-qopt-desc`,children:e.description})]})]},e.label)})}),t.allowOther===!0&&(0,R.jsxs)(`label`,{className:`cx-qother`,children:[(0,R.jsx)(`span`,{className:`cx-qother-label`,children:`Other`}),(0,R.jsx)(`input`,{type:`text`,value:n.other,disabled:s,placeholder:`type a different answer…`,onChange:e=>d(t.questionId,e.target.value),className:`cx-qother-input`,"aria-label":`Other answer for ${t.header}`})]})]},t.questionId)}),(0,R.jsx)(`div`,{className:`cx-qactions`,children:(0,R.jsx)(`button`,{type:`button`,className:`cx-qsubmit`,onClick:async()=>{if(!f||s)return;let n=e.questions.map(e=>{let t=r[e.questionId]??{selected:[],other:``},n={questionId:e.questionId,selected:t.selected};return e.allowOther===!0&&t.other.trim().length>0&&(n.other=t.other.trim()),n});o(!0);try{await t(n)}finally{o(!1)}},disabled:!f||s,"aria-label":`Submit answer`,children:s?`submitting…`:`Submit answer`})})]})}function Ko({msg:e}){switch(e.role){case`user`:return(0,R.jsx)(Ro,{msg:e});case`activity`:return(0,R.jsx)(`div`,{className:`cx-turn assistant`,children:(0,R.jsxs)(`div`,{className:`cx-row`,children:[(0,R.jsx)(`div`,{className:`cx-bullet`,"aria-hidden":!0}),(0,R.jsx)(`div`,{className:`cx-body`,children:(0,R.jsx)(Ho,{text:e.text})})]})});case`ack`:return(0,R.jsx)(`div`,{className:`cx-turn assistant`,children:(0,R.jsxs)(`div`,{className:`cx-row`,children:[(0,R.jsx)(`div`,{className:`cx-bullet`,"aria-hidden":!0}),(0,R.jsx)(`div`,{className:`cx-body`,children:(0,R.jsx)(Uo,{text:e.text})})]})});case`error`:return(0,R.jsx)(`div`,{className:`cx-turn assistant`,children:(0,R.jsxs)(`div`,{className:`cx-row`,children:[(0,R.jsx)(`div`,{className:`cx-bullet`,"aria-hidden":!0}),(0,R.jsx)(`div`,{className:`cx-body`,children:(0,R.jsx)(Wo,{text:e.text})})]})});default:return(0,R.jsx)(`div`,{className:`cx-turn assistant`,children:(0,R.jsxs)(`div`,{className:`cx-row`,children:[(0,R.jsx)(`div`,{className:`cx-bullet`,"aria-hidden":!0,children:`●`}),(0,R.jsx)(`div`,{className:`cx-body`,children:(0,R.jsx)(zo,{text:e.text})})]})})}}function qo(){return(0,R.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading transcript`,children:[(0,R.jsx)(`div`,{className:`cx-skel`,style:{width:`46%`}}),(0,R.jsx)(`div`,{className:`cx-skel`,style:{width:`72%`}}),(0,R.jsx)(`div`,{className:`cx-skel`,style:{width:`38%`}})]})}function Jo(){return(0,R.jsxs)(`div`,{className:`cx-state`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,children:`○`}),(0,R.jsx)(`span`,{children:`No activity yet — terminal session idle`})]})}function Yo({messages:e,status:t,pendingQuestion:n,onSubmitAnswer:r}){let i=e.length>0,a=n&&r?(0,R.jsx)(Go,{pending:n,onSubmit:r}):null;if(!i&&t===`connecting`&&!a)return(0,R.jsx)(qo,{});if(!i&&!a)return(0,R.jsx)(Jo,{});let o=t===`error`;return(0,R.jsxs)(`div`,{children:[o&&(0,R.jsxs)(`div`,{className:`cx-state err`,role:`status`,children:[(0,R.jsx)(`span`,{className:`cx-chip-bad`,children:`relay disconnected`}),(0,R.jsx)(`span`,{className:`cx-dimmed`,children:`showing last-known frames`})]}),(0,R.jsx)(`div`,{className:o?`cx-dimmed`:void 0,children:e.map(e=>(0,R.jsx)(Ko,{msg:e},e.id))}),a]})}function Xo(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(``),{messages:i,status:a,awaitingReply:o,chatId:s,send:c,sendError:l}=Fo(),u=(0,_.useRef)(null),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!e)return;let t=u.current;t&&(t.scrollTop=t.scrollHeight)},[i,o,e]),(0,_.useEffect)(()=>{e&&d.current?.focus()},[e]);let f=()=>{let e=n.trim();e&&(c(e),r(``))};return e?(0,R.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 flex w-[360px] max-w-[calc(100vw-2rem)] flex-col rounded-xl`,style:{height:`min(560px, calc(100vh - 6rem))`,background:`var(--surface-elev)`,border:`1px solid var(--border)`,boxShadow:`var(--shadow-card)`},role:`region`,"aria-label":`Live Claude Code session chat`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--border)`},children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`h-section`,children:`live claude code`}),(0,R.jsx)(Io,{status:a,compact:!0})]}),(0,R.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:s?`chat ${s.slice(0,8)}`:`same session as your terminal`})]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{t(!1),x(`/chat`)},className:`shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]`,style:{color:`var(--ink-3)`},"aria-label":`Open full Chat page`,"data-tooltip":`Open full Chat page`,"data-tooltip-pos":`left`,children:`⤢`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]`,style:{color:`var(--ink-3)`},"aria-label":`Minimize chat`,"data-tooltip":`Minimize chat`,"data-tooltip-pos":`left`,children:`–`})]}),(0,R.jsxs)(`div`,{ref:u,className:`chat-surface flex-1 overflow-y-auto px-3 py-3`,children:[(0,R.jsx)(Yo,{messages:i,status:a}),o&&(0,R.jsx)(Lo,{compact:!0})]}),l&&(0,R.jsx)(`div`,{role:`alert`,className:`mx-3 mb-1 rounded-sm px-2 py-1 font-mono text-[10px]`,style:{color:`var(--bad)`,background:`color-mix(in oklch, var(--bad) 10%, transparent)`,border:`1px solid color-mix(in oklch, var(--bad) 30%, transparent)`},children:l}),(0,R.jsxs)(`div`,{className:`flex items-end gap-2 border-t px-3 py-3`,style:{borderColor:`var(--border)`},children:[(0,R.jsx)(`textarea`,{ref:d,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f())},rows:1,placeholder:`Message the live session…`,className:`max-h-28 min-h-[36px] flex-1 resize-none rounded-md border px-3 py-2 text-[13px] focus:outline-none`,style:{background:`var(--surface)`,color:`var(--text)`,borderColor:`var(--border)`}}),(0,R.jsx)(`button`,{type:`button`,onClick:f,disabled:n.trim().length===0,className:`shrink-0 rounded-md px-3 py-2 text-sm font-medium transition-opacity disabled:opacity-40`,style:{background:`var(--accent)`,color:`var(--accent-foreground, #fff)`},"aria-label":`Send message`,children:`Send`})]})]}):(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(!0),className:`fixed bottom-5 right-5 z-50 flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-colors`,style:{position:`fixed`,background:`var(--accent)`,color:`var(--accent-foreground, #fff)`},"aria-label":`Open live Claude Code chat`,"data-tooltip":`Talk to the live Claude Code session`,"data-tooltip-pos":`left`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,children:`◎`}),(0,R.jsx)(`span`,{children:`Live session`})]})}function Zo(e){let t=new Map;for(let n of e)t.set(n.day,(t.get(n.day)??0)+n.signals);return Array.from(t.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({day:e,agentId:`_fleet`,accuracy:0,signals:t}))}function Qo(){let[e,t]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=new AbortController;return z(`fleet-trend?days=7`).then(n=>{e.signal.aborted||t(Zo(n.points))}).catch(()=>{e.signal.aborted||t([])}),()=>e.abort()},[]),e===null?null:e.length<2?(0,R.jsx)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--ink-4)`},"aria-label":`no trend data yet`,children:`—`}):(0,R.jsx)(`div`,{style:{width:`100%`,paddingTop:`4px`,paddingBottom:`4px`},children:(0,R.jsx)(xt,{points:e,width:240,height:28,color:`var(--c1)`})})}var $o=8;function es({agents:e}){let t=e.map(e=>{let t=(e.scores.agreements??0)+(e.scores.uniqueFindings??0),n=(e.scores.hallucinations??0)+(e.scores.disagreements??0),r=t+n;return{id:e.id,pos:t,neg:n,total:r}}).filter(e=>e.total>0).sort((e,t)=>t.total-e.total).slice(0,$o);if(t.length===0)return null;let n=t[0].total;return(0,R.jsxs)(`div`,{style:{marginTop:`6px`},children:[(0,R.jsx)(`span`,{style:{display:`block`,fontSize:`10px`,fontVariant:`small-caps`,letterSpacing:`0.04em`,color:`var(--ink-4)`,marginBottom:`6px`},children:`by agent`}),(0,R.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:`5px`},children:t.map(({id:e,pos:t,neg:r,total:i})=>{let a=n>0?i/n:0,o=i>0?t/i:0,s=i>0?r/i:0;return(0,R.jsxs)(`li`,{style:{display:`flex`,flexDirection:`column`,gap:`3px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`,gap:`6px`,minWidth:0},children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:`1 1 0`,minWidth:0},title:e,children:e}),(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{flexShrink:0,fontVariantNumeric:`tabular-nums`,whiteSpace:`nowrap`},children:[t>0&&(0,R.jsxs)(`span`,{style:{color:`var(--ok)`},children:[`↑`,t]}),t>0&&r>0&&(0,R.jsx)(`span`,{style:{color:`var(--ink-4)`,margin:`0 2px`},children:` `}),r>0&&(0,R.jsxs)(`span`,{style:{color:`var(--bad)`},children:[`↓`,r]})]})]}),(0,R.jsx)(`div`,{style:{height:`3px`,borderRadius:`1.5px`,background:`var(--border)`,overflow:`hidden`},"aria-hidden":!0,children:(0,R.jsxs)(`div`,{style:{height:`100%`,width:`${Math.round(a*100)}%`,display:`flex`,borderRadius:`1.5px`,overflow:`hidden`,transition:`width 200ms ease-out`},children:[t>0&&(0,R.jsx)(`div`,{style:{height:`100%`,width:`${Math.round(o*100)}%`,background:`var(--ok)`,flexShrink:0}}),r>0&&(0,R.jsx)(`div`,{style:{height:`100%`,width:`${Math.round(s*100)}%`,background:`var(--bad)`,flexShrink:0}})]})})]},e)})})]})}var ts=20,ns=7200*1e3,rs={"task.completed":`✓`,"consensus.completed":`◈`};function is(e){let{type:t,payload:n}=e;if(t===`task.completed`){let e=typeof n.agentId==`string`?n.agentId:``;return e?`task · ${e}`:`task completed`}if(t===`consensus.completed`){let e=typeof n.consensusId==`string`?n.consensusId.slice(0,8):``;return e?`consensus ${e}`:`consensus done`}return t}function as(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function os(e){let t=Date.now()-new Date(e).getTime();return t<0?`0s`:t<6e4?`${Math.floor(t/1e3)}s`:t<36e5?`${Math.floor(t/6e4)}m`:`${Math.floor(t/36e5)}h`}function ss({tasks:e}){let t=Date.now(),n=e.filter(e=>t-new Date(e.startedAt).getTime()<ns);return(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h2`,{className:`h-section`,style:{marginBottom:`8px`,borderBottom:`1px solid var(--border)`,paddingBottom:`6px`},children:`agents`}),n.length===0?(0,R.jsx)(`p`,{className:`text-[11px]`,style:{color:`var(--ink-3)`,margin:0,lineHeight:1.5},children:`No agents dispatched — fleet idle`}):(0,R.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:`6px`},children:n.map(e=>(0,R.jsx)(cs,{task:e},e.taskId))})]})}function cs({task:e}){return(0,R.jsxs)(`li`,{className:`agent-working-row`,style:{display:`flex`,alignItems:`flex-start`,gap:`8px`,padding:`6px 8px`,borderRadius:`var(--r-md)`,background:`color-mix(in srgb, var(--surface) 30%, transparent)`,border:`1px solid var(--border)`,transition:`background 100ms ease-out`},children:[(0,R.jsx)(`span`,{className:`agent-working-dot shrink-0 mt-[3px]`,style:{"--dot-color":Le(e.agentId)},"aria-hidden":!0}),(0,R.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:`6px`},children:[(0,R.jsx)(`span`,{className:`font-mono text-[11px] font-medium truncate`,style:{color:`var(--ink-2)`},children:e.agentId}),(0,R.jsx)(`span`,{className:`font-mono text-[10px] shrink-0 tabular-nums`,style:{color:`var(--ink-3)`},children:os(e.startedAt)})]}),e.task&&(0,R.jsx)(`span`,{className:`text-[11px] block truncate`,style:{color:`var(--ink-3)`,marginTop:`1px`,lineHeight:1.4},title:e.task,children:e.task})]})]})}function ls({events:e}){return(0,R.jsxs)(`section`,{style:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,R.jsx)(`h2`,{className:`h-section shrink-0`,style:{borderBottom:`1px solid var(--border)`,paddingBottom:`6px`},children:`activity`}),e.length===0&&(0,R.jsx)(`p`,{className:`text-[11px] shrink-0`,style:{color:`var(--ink-3)`,margin:`0 0 2px`,lineHeight:1.5},children:`No recent activity — fleet idle`}),(0,R.jsx)(`div`,{className:`shrink-0`,children:(0,R.jsx)(Qo,{})}),e.length>0&&(0,R.jsx)(`ul`,{"aria-label":`Recent activity`,style:{flex:1,minHeight:0,overflowY:`auto`,listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:`2px`},children:e.map(e=>(0,R.jsx)(us,{event:e},e.id))})]})}function us({event:e}){let t=rs[e.type]??`·`,n=is(e),r=as(e.ts);return(0,R.jsxs)(`li`,{className:`activity-event-row`,style:{display:`flex`,alignItems:`center`,gap:`6px`,padding:`4px 6px`,borderRadius:`var(--r-sm)`,transition:`background 100ms ease-out`},children:[r&&(0,R.jsx)(`span`,{className:`font-mono text-[10px] shrink-0 tabular-nums`,style:{color:`var(--ink-3)`},"aria-hidden":!0,children:r}),(0,R.jsx)(`span`,{className:`font-mono text-[10px] shrink-0`,style:{color:`var(--info)`,minWidth:`10px`,textAlign:`center`},"aria-hidden":!0,children:t}),(0,R.jsx)(`span`,{className:`text-[11px] truncate`,style:{color:`var(--ink-2)`,lineHeight:1.4},children:n})]})}function ds({status:e,chatId:t}){let[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)({gitBranch:null,projectName:null,activeTasks:0}),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)([]),[,f]=(0,_.useState)(0);(0,_.useEffect)(()=>{let e=new AbortController;return z(`session`).then(t=>{e.signal.aborted||a({gitBranch:t.gitBranch??null,projectName:t.projectName??null,activeTasks:typeof t.activeTasks==`number`?t.activeTasks:0})}).catch(()=>{}),()=>e.abort()},[]),(0,_.useEffect)(()=>{let e=new AbortController;return z(`signal-activity`).then(t=>{e.signal.aborted||typeof t.total==`number`&&s(t.total)}).catch(()=>{}),()=>e.abort()},[]),(0,_.useEffect)(()=>{let e=new AbortController;return z(`agents`).then(t=>{if(!e.signal.aborted&&Array.isArray(t)){let e=t.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.scores==`object`&&e.scores!==null);l(e)}}).catch(()=>{}),()=>e.abort()},[]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await z(`active-tasks`);e||d(t.tasks||[])}catch{}};t();let n=setInterval(()=>{t()},5e3);return()=>{e=!0,clearInterval(n)}},[]),(0,_.useEffect)(()=>{if(u.length===0)return;let e=setInterval(()=>f(e=>e+1),1e3);return()=>clearInterval(e)},[u.length]),lo((0,_.useCallback)(e=>{r(t=>{let n=[e,...t];return n.length>ts?n.slice(0,ts):n})},[]));let p=typeof i.gitBranch==`string`&&i.gitBranch.length>0;return(0,R.jsxs)(`aside`,{className:`chat-surface`,style:{width:`100%`,minWidth:0,border:`1px solid var(--border)`,borderRadius:`var(--r-lg)`,padding:`14px 14px`,display:`flex`,flexDirection:`column`,gap:`14px`,alignSelf:`stretch`,overflow:`hidden`},"aria-label":`Session info and live activity`,children:[(0,R.jsxs)(`section`,{className:`shrink-0`,children:[(0,R.jsx)(`h2`,{className:`h-section`,style:{marginBottom:`8px`,borderBottom:`1px solid var(--border)`,paddingBottom:`6px`},children:`session`}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`5px`},children:[(0,R.jsx)(Io,{status:e,compact:!0}),t&&(0,R.jsx)(`span`,{className:`font-mono text-[10px] truncate`,style:{color:`var(--ink-3)`},title:t,children:t}),p&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px] truncate`,style:{color:`var(--ink-3)`},title:`${i.projectName} · ${i.gitBranch}`,children:[i.projectName,` · `,i.gitBranch]}),(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`10px`,flexWrap:`wrap`},children:[(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-2)`,fontWeight:500},children:i.activeTasks}),` `,`tasks`]}),o!==null&&(0,R.jsxs)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{style:{color:`var(--ink-2)`,fontWeight:500},children:o}),` `,`signals · 24h`]})]}),c!==null&&c.length>0&&(0,R.jsx)(es,{agents:c})]})]}),(0,R.jsx)(`div`,{className:`shrink-0`,children:(0,R.jsx)(ss,{tasks:u})}),(0,R.jsx)(ls,{events:n})]})}function fs({conversations:e,activeId:t,canAddTab:n,onSwitch:r,onClose:i,onNew:a,onRename:o}){let s=(0,_.useRef)({}),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(``),f=(t,n)=>{if(t.key===`F2`){t.preventDefault();let r=e[n];r&&p(r);return}if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let r=e[(n+(t.key===`ArrowRight`?1:-1)+e.length)%e.length];r&&s.current[r.key]?.focus()},p=(0,_.useCallback)(e=>{l(e.key),d(e.customLabel??e.label)},[]),m=(0,_.useCallback)(e=>{o(e,u),l(null),requestAnimationFrame(()=>{s.current[e]?.focus()})},[u,o]),h=(0,_.useCallback)(e=>{l(null),requestAnimationFrame(()=>{s.current[e]?.focus()})},[]),g=(0,_.useCallback)((e,t)=>{e.key===`Enter`?(e.preventDefault(),m(t)):e.key===`Escape`&&(e.preventDefault(),h(t))},[m,h]);return(0,R.jsxs)(`div`,{className:`cx-tabstrip shrink-0`,role:`tablist`,"aria-label":`Conversations`,children:[(0,R.jsx)(`div`,{className:`cx-tabstrip-scroll`,children:e.map((e,n)=>{let a=e.key===t,o=e.key===c,l=!e.customLabel&&!!e.chatId&&e.label===e.chatId.slice(0,6),h=!a&&e.unread>0;return(0,R.jsxs)(`div`,{className:`cx-tab ${a?`is-active`:``}`,children:[o?(0,R.jsx)(`input`,{className:`cx-tab-rename-input`,type:`text`,value:u,maxLength:40,"aria-label":`Rename conversation`,autoFocus:!0,onChange:e=>d(e.target.value),onKeyDown:t=>g(t,e.key),onBlur:()=>m(e.key),onClick:e=>e.stopPropagation()}):(0,R.jsxs)(`button`,{ref:t=>{s.current[e.key]=t},type:`button`,role:`tab`,"aria-selected":a,tabIndex:a?0:-1,className:`cx-tab-btn`,onClick:()=>r(e.key),onDoubleClick:t=>{t.preventDefault(),p(e)},onKeyDown:e=>f(e,n),title:e.chatId??`new conversation`,"aria-label":`${e.label}${h?`, ${e.unread} unread`:``}`,children:[h&&(0,R.jsx)(`span`,{className:`cx-tab-unread`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:l?`cx-tab-label font-mono`:`cx-tab-label`,children:e.label})]}),(0,R.jsx)(`button`,{type:`button`,className:`cx-tab-close`,onClick:t=>{t.stopPropagation(),i(e.key)},"aria-label":`Close conversation ${e.label}`,title:`Close conversation`,children:`×`})]},e.key)})}),(0,R.jsx)(`button`,{type:`button`,className:`cx-tab-new shrink-0`,onClick:a,disabled:!n,"aria-label":`New conversation`,title:n?`New conversation`:`Maximum conversations open`,children:`+`})]})}function ps(){let{conversations:e,activeId:t,active:n,sendError:r,send:i,submitAnswer:a,newConversation:o,closeConversation:s,switchConversation:c,renameConversation:l,canAddTab:u}=Po(),[d,f]=(0,_.useState)(``),p=n?.messages??[],m=n?.status??`connecting`,h=n?.awaitingReply??!1,g=n?.chatId??null,v=n?.pendingQuestion??null,y=(0,_.useRef)(null),b=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=y.current;e&&(e.scrollTop=e.scrollHeight)},[p,h,t,v]),(0,_.useEffect)(()=>{b.current?.focus()},[t]);let x=()=>{let e=d.trim();e&&(i(e),f(``))},S=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())},C={open:{color:`var(--ok)`,label:`live`},connecting:{color:`var(--warn)`,label:`connecting`},closed:{color:`var(--idle)`,label:`offline`},error:{color:`var(--bad)`,label:`down`}},{color:w,label:T}=C[m]??C.closed;return(0,R.jsx)(`div`,{className:`flex flex-col`,style:{height:`100%`,minHeight:0,overflow:`hidden`,padding:`16px 24px`,boxSizing:`border-box`,gap:`0`},children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-4 lg:grid`,style:{flex:1,minHeight:0,gridTemplateColumns:`1fr 288px`,alignItems:`stretch`,height:`100%`},children:[(0,R.jsxs)(`div`,{className:`chat-surface flex flex-col`,style:{minHeight:0,border:`1px solid var(--border)`,borderRadius:`var(--r-lg)`,overflow:`hidden`},children:[(0,R.jsxs)(`div`,{className:`chat-info-bar flex items-center gap-3 shrink-0`,style:{padding:`10px 16px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--surface) 80%, var(--bg))`,minHeight:`44px`,flexWrap:`wrap`,rowGap:`4px`},children:[(0,R.jsx)(`span`,{className:`h-section h-section--lg shrink-0`,children:`chat`}),(0,R.jsx)(`span`,{"aria-hidden":!0,style:{width:`1px`,height:`20px`,background:`var(--border)`,flexShrink:0}}),(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 shrink-0`,children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full shrink-0 ${m===`connecting`?`animate-pulse motion-reduce:animate-none`:``}`,style:{background:w},"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`font-mono text-[11px]`,style:{color:`var(--ink-3)`},"aria-label":`Bridge status: ${T}`,children:T})]}),g&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":!0,style:{width:`1px`,height:`20px`,background:`var(--border)`,flexShrink:0}}),(0,R.jsx)(`span`,{className:`font-mono text-[11px] truncate`,style:{color:`var(--ink-3)`,maxWidth:`160px`},title:g,"aria-label":`Chat ID: ${g}`,children:g})]}),(0,R.jsx)(`span`,{style:{flex:1}}),(0,R.jsx)(`span`,{className:`font-mono text-[10px] shrink-0`,style:{color:`var(--ink-3)`,letterSpacing:`0.03em`},"aria-hidden":!0,children:`cc transcript`})]}),(0,R.jsx)(fs,{conversations:e,activeId:t,canAddTab:u,onSwitch:c,onClose:s,onNew:o,onRename:l}),(0,R.jsxs)(`div`,{ref:y,className:`flex-1 overflow-y-auto`,style:{padding:`16px 16px 8px`,minHeight:0},children:[(0,R.jsx)(Yo,{messages:p,status:m,pendingQuestion:v,onSubmitAnswer:a}),h&&(0,R.jsx)(Lo,{compact:!1})]}),r&&(0,R.jsx)(`div`,{role:`alert`,className:`mx-4 mb-2 rounded px-3 py-1.5 font-mono text-[11px]`,style:{color:`var(--bad)`,background:`color-mix(in oklch, var(--bad) 10%, transparent)`,border:`1px solid color-mix(in oklch, var(--bad) 30%, transparent)`},children:r}),(0,R.jsxs)(`div`,{className:`flex items-end gap-2.5 border-t shrink-0`,style:{borderColor:`var(--border)`,padding:`12px 16px`,background:`color-mix(in srgb, var(--surface) 60%, var(--bg))`},children:[(0,R.jsx)(`textarea`,{ref:b,value:d,onChange:e=>f(e.target.value),onKeyDown:S,rows:2,placeholder:`Message the live session… (Enter to send)`,"aria-label":`Compose message`,className:`flex-1 resize-none text-[13px] focus:outline-none`,style:{background:`color-mix(in srgb, var(--surface) 50%, var(--bg))`,color:`var(--ink)`,border:`1px solid var(--border)`,borderRadius:`var(--r-md)`,padding:`10px 12px`,minHeight:`60px`,maxHeight:`140px`,boxSizing:`border-box`,outline:`none`,transition:`border-color 100ms ease-out, box-shadow 100ms ease-out`,fontFamily:`var(--font-sans)`,lineHeight:`1.5`},onFocus:e=>{e.currentTarget.style.borderColor=`color-mix(in srgb, var(--accent) 60%, var(--border))`,e.currentTarget.style.boxShadow=`0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent)`},onBlur:e=>{e.currentTarget.style.borderColor=`var(--border)`,e.currentTarget.style.boxShadow=`none`}}),(0,R.jsxs)(`button`,{type:`button`,onClick:x,disabled:d.trim().length===0,className:`chat-send-btn shrink-0 rounded-lg flex items-center gap-1.5 font-medium`,style:{padding:`10px 14px`,fontSize:`13px`,minHeight:`40px`},"aria-label":`Send message`,children:[(0,R.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,R.jsx)(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),(0,R.jsx)(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})]}),`Send`]})]})]}),(0,R.jsx)(ds,{status:m,chatId:g})]})})}function ms({agents:e,tasks:t,consensusReports:n,fleetTrend:r}){let[i,a]=(0,_.useState)(`weight`),[o,s]=(0,_.useState)(`desc`),[c,l]=(0,_.useState)(``),u=(0,_.useMemo)(()=>{let e=new Map;if(t)for(let n of t.items){let t=e.get(n.agentId);(!t||n.timestamp>t.timestamp)&&e.set(n.agentId,n)}return e},[t]);yr(n?.reports),(0,_.useMemo)(()=>{let e=new Map;if(r){for(let t of r.points){let n=e.get(t.agentId)??[];n.push(t),e.set(t.agentId,n)}for(let t of e.values())t.sort((e,t)=>e.day.localeCompare(t.day))}return e},[r]);let d=e.filter(Ct).length,f=e.filter(e=>e.scores.accuracy>=.5).length,p=e.reduce((e,t)=>e+t.scores.signals,0),m=e.reduce((e,t)=>e+t.totalTokens,0),h=c.trim().toLowerCase(),g=h?e.filter(e=>e.id.toLowerCase().includes(h)||e.provider.toLowerCase().includes(h)||e.model.toLowerCase().includes(h)):e,v=e=>{let t=e.scores;switch(i){case`weight`:return t.dispatchWeight;case`accuracy`:return t.accuracy;case`uniqueness`:return t.uniqueness;case`impact`:return t.impactScore;case`signals`:return t.signals;case`agreements`:return t.agreements;case`hallucinations`:return t.hallucinations;case`lastTask`:{let t=u.get(e.id);return t?new Date(t.timestamp).getTime():0}}},y=[...g].sort((e,t)=>{let n=v(e),r=v(t);return o===`desc`?r-n:n-r}),b=e=>{i===e?s(e=>e===`desc`?`asc`:`desc`):(a(e),s(`desc`))},x=e=>i===e?o===`desc`?`▾`:`▴`:``;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,R.jsx)(`h1`,{className:`h-route`,children:`Team`}),(0,R.jsx)(`span`,{className:`font-mono text-sm tabular-nums`,style:{color:`var(--ink-3)`},children:e.length})]}),(0,R.jsx)(`p`,{className:`mt-0.5 text-[13px]`,style:{color:`var(--ink-3)`},children:`Per-agent accuracy, signal counts, and dispatch weights.`}),(0,R.jsx)(`div`,{className:`mt-2 grid grid-cols-2 gap-px overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border [background:color-mix(in_oklch,var(--border)_30%,transparent)] sm:grid-cols-4`,children:[{label:`Healthy`,value:f,varColor:`var(--ok)`},{label:`Benched`,value:d,varColor:d>0?`var(--bad)`:`var(--ink-3)`},{label:`Total Signals`,value:p.toLocaleString(),varColor:`var(--ink)`},{label:`Tokens Used`,value:m.toLocaleString(),varColor:`var(--ink)`}].map(e=>(0,R.jsxs)(`div`,{style:{background:`var(--surface-elev)`},className:`px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`font-mono text-lg font-bold tabular-nums`,style:{color:e.varColor},children:e.value}),(0,R.jsx)(`div`,{className:`h-section mt-0.5`,children:e.label})]},e.label))})]}),(0,R.jsx)(`div`,{className:`mb-3`,children:(0,R.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`Search agents by id, provider, or model...`,className:`w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:var(--ink-3)] focus:outline-none`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`,color:`var(--ink)`}})}),(0,R.jsx)(`div`,{className:`overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:(0,R.jsxs)(`table`,{className:`w-full text-left`,children:[(0,R.jsxs)(`colgroup`,{children:[(0,R.jsx)(`col`,{style:{width:44}}),(0,R.jsx)(`col`,{}),(0,R.jsx)(`col`,{style:{width:80}}),(0,R.jsx)(`col`,{style:{width:260}}),(0,R.jsx)(`col`,{style:{width:80}}),(0,R.jsx)(`col`,{style:{width:60}}),(0,R.jsx)(`col`,{})]}),(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]`,style:{background:`color-mix(in oklch, var(--surface-sunk) 20%, transparent)`},children:[(0,R.jsx)(`th`,{className:`h-section py-2.5 pl-5 pr-2 text-center`,children:`#`}),(0,R.jsx)(`th`,{className:`h-section py-2.5 pr-3 text-left`,children:`Agent`}),(0,R.jsxs)(`th`,{className:`h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]`,onClick:()=>b(`weight`),children:[`Weight `,x(`weight`)]}),(0,R.jsx)(`th`,{className:`h-section py-2.5 pr-4 text-left align-top`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`button`,{onClick:()=>b(`accuracy`),className:`flex items-center gap-1 hover:[color:var(--ink)]`,"data-tooltip":`Accuracy — fraction of findings confirmed by cross-review (with hallucination penalty)`,children:[(0,R.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-confirmed`}),`Acc`,x(`accuracy`)]}),(0,R.jsx)(`span`,{style:{color:`color-mix(in oklch, var(--ink-3) 30%, transparent)`},children:`·`}),(0,R.jsxs)(`button`,{onClick:()=>b(`uniqueness`),className:`flex items-center gap-1 hover:[color:var(--ink)]`,"data-tooltip":`Uniqueness — findings this agent surfaced that no peer found`,children:[(0,R.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-unique`}),`Unq`,x(`uniqueness`)]}),(0,R.jsx)(`span`,{style:{color:`color-mix(in oklch, var(--ink-3) 30%, transparent)`},children:`·`}),(0,R.jsxs)(`button`,{onClick:()=>b(`impact`),className:`flex items-center gap-1 hover:[color:var(--ink)]`,"data-tooltip":`Impact — severity-weighted finding score`,children:[(0,R.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-[var(--c8)]`}),`Imp`,x(`impact`)]})]})}),(0,R.jsxs)(`th`,{className:`h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]`,onClick:()=>b(`signals`),children:[`Signals `,x(`signals`)]}),(0,R.jsxs)(`th`,{className:`h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]`,onClick:()=>b(`hallucinations`),"data-tooltip":`Hallucinations — fabricated findings caught by cross-review`,children:[`Halluc `,x(`hallucinations`)]}),(0,R.jsxs)(`th`,{className:`h-section py-2.5 pr-5 text-left cursor-pointer select-none hover:[color:var(--ink)]`,onClick:()=>b(`lastTask`),children:[`Last Task `,x(`lastTask`)]})]})}),(0,R.jsx)(`tbody`,{children:y.map((e,t)=>{let n=e.scores,r=u.get(e.id),i=n.dispatchWeight>=1.2?`var(--ok)`:n.dispatchWeight>=.8?`var(--ink)`:`var(--bad)`,a=t+1;return(0,R.jsxs)(`tr`,{className:`group border-t [border-color:color-mix(in_oklch,var(--border)_20%,transparent)] align-top transition-colors hover:bg-accent/20`,children:[(0,R.jsx)(`td`,{className:`py-3 pl-5 pr-2 text-center align-top`,children:(0,R.jsx)(`span`,{className:`font-mono text-[11px] tabular-nums`,style:{color:a===1?`var(--ink)`:a===2||a===3?`color-mix(in oklch, var(--ink-2) 80%, transparent)`:`var(--ink-3)`,fontWeight:a===1?`bold`:a<=3?600:void 0},children:a})}),(0,R.jsx)(`td`,{className:`py-2.5 pr-3 align-top`,children:(0,R.jsxs)(`a`,{href:`/dashboard/agent/${encodeURIComponent(e.id)}`,className:`flex items-center gap-3`,children:[(0,R.jsx)(wn,{agentId:e.id,size:32,signals:n.signals,accuracy:n.accuracy,uniqueness:n.uniqueness,impact:n.impactScore}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold group-hover:[color:var(--accent)]`,style:{color:`var(--ink)`},children:e.id}),(()=>{let e=St(n);return e===`benched`?(0,R.jsx)(`span`,{className:`shrink-0 rounded px-1 text-[8px] font-bold`,style:{background:`color-mix(in oklch, var(--bad) 15%, transparent)`,color:`var(--bad)`,fontVariant:`small-caps`,letterSpacing:`0.04em`},"data-tooltip":`Benched (${n.bench.reason??`auto`}). Excluded from dispatch until recovery.`,children:`benched`}):e===`struggling`?(0,R.jsx)(`span`,{className:`shrink-0 rounded bg-unverified/15 px-1 text-[8px] font-bold text-unverified`,style:{fontVariant:`small-caps`,letterSpacing:`0.04em`},"data-tooltip":`Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.`,children:`struggling`}):e===`kept-for-coverage`?(0,R.jsx)(`span`,{className:`shrink-0 rounded border border-unverified/40 px-1 text-[8px] font-bold text-unverified`,style:{fontVariant:`small-caps`,letterSpacing:`0.04em`},"data-tooltip":`Would bench (${n.bench.reason??`rule`}), but kept as sole provider of a category.`,children:`kept for coverage`}):null})()]}),(0,R.jsxs)(`div`,{className:`truncate font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:[e.provider,`/`,e.model]})]})]})}),(0,R.jsx)(`td`,{className:`py-3 pr-4 text-right align-top`,children:(0,R.jsx)(`span`,{className:`font-mono text-sm font-bold tabular-nums`,style:{color:i},children:n.dispatchWeight.toFixed(2)})}),(0,R.jsx)(`td`,{className:`py-3 pr-4 align-top`,children:(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(hs,{label:`A`,value:n.accuracy,fillClass:n.accuracy>=.7?`bg-confirmed`:n.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.`}),(0,R.jsx)(hs,{label:`U`,value:n.uniqueness,fillClass:`bg-unique`,tooltip:`Uniqueness — findings this agent surfaced that no other agent found`}),(0,R.jsx)(hs,{label:`I`,value:n.impactScore,fillClass:`bg-[var(--c8)]`,tooltip:`Impact — severity-weighted finding score; critical and high findings count more`})]})}),(0,R.jsx)(`td`,{className:`py-3 pr-4 text-right align-top font-mono text-xs tabular-nums`,style:{color:`var(--ink)`},children:n.signals.toLocaleString()}),(0,R.jsx)(`td`,{className:`py-3 pr-4 text-right align-top font-mono text-xs tabular-nums`,children:(0,R.jsx)(`span`,{style:{color:n.hallucinations>0?`var(--bad)`:`var(--ink-3)`,fontWeight:n.hallucinations>10?`bold`:void 0},"data-tooltip":`Agreements ${n.agreements} · Disagreements ${n.disagreements} · Hallucinations ${n.hallucinations}`,children:n.hallucinations})}),(0,R.jsx)(`td`,{className:`py-3 pr-5 align-top`,children:r?(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] font-semibold`,children:r.taskId.slice(0,8)}),(0,R.jsx)(`span`,{className:`truncate text-[11px]`,style:{maxWidth:260,color:`var(--ink-2)`},children:r.task}),(0,R.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:L(r.timestamp)})]}):(0,R.jsx)(`span`,{className:`font-mono text-[10px]`,style:{color:`var(--ink-3)`},children:`no tasks`})})]},e.id)})})]})})]})}function hs({label:e,value:t,fillClass:n,tooltip:r}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,"data-tooltip":r,"data-tooltip-pos":`top`,children:[(0,R.jsx)(`span`,{className:`w-6 text-[10px]`,style:{color:`var(--ink-3)`,fontVariant:`small-caps`,letterSpacing:`0.04em`},children:e}),(0,R.jsx)(`div`,{className:`h-1 flex-1 overflow-hidden rounded-full`,style:{background:`color-mix(in oklch, var(--surface) 60%, transparent)`},children:(0,R.jsx)(`div`,{className:`h-full rounded-full ${n}`,style:{width:`${Math.max(0,Math.min(100,t*100))}%`}})}),(0,R.jsxs)(`span`,{className:`w-8 text-right font-mono text-[10px] tabular-nums`,style:{color:`var(--ink-2)`},children:[Math.round(t*100),`%`]})]})}function gs({tasks:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(null),s=e.items.filter(e=>e.status===`completed`).length,c=e.items.filter(e=>e.status===`failed`).length,l=e.items.filter(e=>e.status===`running`).length,u=t.trim().toLowerCase(),d=u?e.items.filter(e=>e.task?.toLowerCase().includes(u)||e.agentId?.toLowerCase().includes(u)||e.taskId?.toLowerCase().includes(u)||e.status?.toLowerCase().includes(u)):e.items,f=Math.max(1,Math.ceil(d.length/100)),p=Math.min(r,f-1),m=d.slice(p*100,(p+1)*100);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,R.jsx)(`h1`,{className:`h-route`,children:`Tasks`}),(0,R.jsx)(`span`,{className:`font-mono text-sm tabular-nums`,style:{color:`var(--ink-3)`},children:e.total})]}),(0,R.jsx)(`p`,{className:`mt-0.5 text-[13px]`,style:{color:`var(--ink-3)`},children:`Live dispatched tasks and their relay status.`}),(0,R.jsxs)(`div`,{className:`mt-2 flex gap-4 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--ok)`},children:s}),` completed`]}),c>0&&(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--bad)`},children:c}),` failed`]}),l>0&&(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`text-unverified`,children:l}),` running`]}),(0,R.jsxs)(`span`,{children:[`showing `,m.length,` of `,d.length,u&&` (filtered from ${e.items.length})`]})]})]}),(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,R.jsx)(`input`,{type:`text`,value:t,onChange:e=>{n(e.target.value),i(0)},placeholder:`Search tasks by description, agent, id, status...`,className:`w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:color-mix(in_oklch,var(--accent)_40%,transparent)] focus:outline-none`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`,color:`var(--ink)`}}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] ${f<=1?`invisible`:``}`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`button`,{onClick:()=>i(e=>Math.max(0,e-1)),disabled:p===0,className:`rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`◂ Prev`}),(0,R.jsxs)(`span`,{children:[p+1,` / `,f]}),(0,R.jsx)(`button`,{onClick:()=>i(e=>Math.min(f-1,e+1)),disabled:p>=f-1,className:`rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30`,style:{background:`var(--surface-elev)`},children:`Next ▸`})]})]}),(0,R.jsx)(`div`,{className:`overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border`,style:{background:`color-mix(in oklch, var(--surface-elev) 80%, transparent)`},children:m.length===0?u?(0,R.jsx)(`div`,{className:`py-12 text-center text-sm`,style:{color:`var(--ink-3)`},children:`No tasks match your search.`}):(0,R.jsx)(Be,{title:`No tasks yet`,hint:`Dispatch with gossip_run to populate this view.`}):(0,R.jsxs)(`table`,{className:`w-full text-left`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]`,style:{background:`color-mix(in oklch, var(--surface-sunk) 30%, transparent)`},children:[(0,R.jsx)(`th`,{className:`py-2.5 pl-4 pr-2 h-section`,style:{width:32}}),(0,R.jsx)(`th`,{className:`py-2.5 pr-3 h-section`,children:`ID`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-3 h-section`,children:`Agent`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-3 h-section`,children:`Kind`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-3 h-section`,children:`Description`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-3 h-section`,children:`Duration`}),(0,R.jsx)(`th`,{className:`py-2.5 pr-4 text-right h-section`,children:`When`})]})}),(0,R.jsx)(`tbody`,{children:m.map(e=>(0,R.jsx)(_a,{task:e,onClick:o},e.taskId))})]})}),(0,R.jsx)(Di,{task:a,onClose:()=>o(null)})]})}function _s({consensus:e,consensusReports:t}){let[n,r]=(0,_.useState)(!1),i=n?e.runs:e.runs.filter(e=>!e.retracted),a=e.runs.filter(e=>e.retracted).length,o=i.reduce((e,t)=>e+(t.counts.agreement||0),0),s=i.reduce((e,t)=>e+((t.counts.disagreement||0)+(t.counts.hallucination||0)),0),c=i.reduce((e,t)=>e+(t.counts.unverified||0),0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mb-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,R.jsx)(`h1`,{className:`h-route`,children:`Consensus Rounds`}),(0,R.jsx)(`span`,{className:`font-mono text-sm tabular-nums`,style:{color:`var(--ink-3)`},children:i.length}),!n&&a>0&&(0,R.jsxs)(`span`,{className:`font-mono text-sm tabular-nums`,style:{color:`var(--ink-3)`},children:[`/ `,e.totalRuns??e.runs.length,` total`]})]}),(0,R.jsx)(`p`,{className:`mt-0.5 text-[13px]`,style:{color:`var(--ink-3)`},children:`Multi-agent review rounds — findings confirmed when ≥2 agents agree.`}),(0,R.jsxs)(`div`,{className:`mt-2 flex gap-4 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--ok)`},children:o}),` confirmed`]}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{style:{color:`var(--bad)`},children:s}),` disputed`]}),c>0&&(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`text-unverified`,children:c}),` unverified`]}),(0,R.jsxs)(`span`,{children:[e.totalSignals,` total signals`]})]}),a>0&&(0,R.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 font-mono text-[11px]`,style:{color:`var(--ink-3)`},children:[(0,R.jsx)(`span`,{children:n?`${a} retracted run${a===1?``:`s`} shown`:`${a} retracted run${a===1?``:`s`} hidden`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 text-[10px] transition hover:bg-accent/10 hover:[color:var(--ink)]`,style:{background:`var(--surface-elev)`},children:n?`hide`:`show`})]})]}),(0,R.jsx)(Ii,{consensus:e,filteredRuns:i,reports:t,showAll:!0,hideHeader:!0})]})}function vs({onUnauthorized:e}){let t=C(),{overview:n,agents:r,tasks:i,consensus:a,consensusReports:o,fleetTrend:s,signalActivity:c,skills:l,loading:u,error:d,refresh:f}=ro(e),[p,m]=(0,_.useState)(0);if(sr((0,_.useCallback)(e=>{e.type!==`log_lines`&&f()},[f])),!u&&d&&(!n||!a))return(0,R.jsxs)(`div`,{className:`min-h-screen`,style:{background:`var(--surface)`},children:[(0,R.jsx)(Ti,{}),(0,R.jsx)(`div`,{className:`flex items-center justify-center py-20`,children:(0,R.jsxs)(`div`,{className:`w-full max-w-sm rounded-xl border p-8 text-center`,style:{borderColor:`var(--border)`,background:`var(--surface-elev)`},children:[(0,R.jsx)(`p`,{className:`mb-2 text-sm font-semibold`,style:{color:`var(--bad)`},children:`Dashboard fetch failed`}),(0,R.jsx)(`p`,{className:`mb-4 font-mono text-xs`,style:{color:`var(--bad)`},children:d}),(0,R.jsx)(`p`,{className:`text-xs`,style:{color:`var(--ink-3)`},children:`Relay may be restarting — retrying every 5s. Check the relay terminal if this persists.`})]})})]});if(u||!n||!a)return(0,R.jsxs)(`div`,{className:`min-h-screen`,style:{background:`var(--surface)`},children:[(0,R.jsx)(Ti,{}),(0,R.jsx)(va,{})]});let h,g=t.match(/^\/agent\/(.+)$/),v=t.match(/^\/consensus\/(.+)$/),y=S(`/tasks/:id`,t);h=g&&r?(0,R.jsx)(Ea,{agentId:decodeURIComponent(g[1]),agents:r,tasks:i,consensus:a}):v?(0,R.jsx)(ni,{consensusId:decodeURIComponent(v[1])}):y?(0,R.jsx)(fi,{taskId:y,tasks:i}):t===`/team`?r?(0,R.jsx)(ms,{agents:r,tasks:i,consensusReports:o,fleetTrend:s}):(0,R.jsx)(`div`,{className:`mx-auto max-w-7xl space-y-6 px-6 py-6`,children:(0,R.jsx)(ya,{})}):t===`/tasks`?i?(0,R.jsx)(gs,{tasks:i}):(0,R.jsx)(`div`,{className:`mx-auto max-w-7xl space-y-6 px-6 py-6`,children:(0,R.jsx)(ba,{})}):t===`/debates`?a?(0,R.jsx)(_s,{consensus:a,consensusReports:o}):(0,R.jsx)(`div`,{className:`mx-auto max-w-7xl space-y-6 px-6 py-6`,children:(0,R.jsx)(xa,{})}):t===`/chat`?(0,R.jsx)(ps,{}):t===`/logs`?(0,R.jsx)(Na,{}):t===`/signals`?(0,R.jsx)(Za,{}):t===`/violations`?(0,R.jsx)(Bi,{}):(0,R.jsx)(jr,{overview:n,agents:r,tasks:i,consensus:a,consensusReports:o,fleetTrend:s,signalActivity:c,skills:l,activeTaskCount:p,setActiveTaskCount:m});let b=t===`/`||t===`/overview`||!/^\/(agent\/|consensus\/|tasks\/|team|tasks|debates|logs|signals|violations|chat)/.test(t)?`px-6 py-6`:`mx-auto max-w-7xl space-y-6 px-6 py-6`,x=t===`/chat`;return(0,R.jsxs)(`div`,{className:x?`flex h-screen flex-col overflow-hidden`:`min-h-screen`,style:{background:`var(--surface)`},children:[(0,R.jsx)(Ti,{}),x?(0,R.jsx)(`main`,{className:`min-h-0 flex-1`,children:h}):(0,R.jsx)(`main`,{className:b,children:h})]})}function ys(){let{authed:e,login:t,error:n,recheck:r}=$a();return e===null?(0,R.jsx)(`div`,{className:`flex min-h-screen items-center justify-center`,style:{color:`var(--ink-3)`},children:`Loading...`}):e?(0,R.jsxs)(No,{children:[(0,R.jsx)(vs,{onUnauthorized:r}),(0,R.jsx)(fo,{}),(0,R.jsx)(Xo,{})]}):(0,R.jsx)(pi,{onLogin:t,error:n})}(0,g.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(_.StrictMode,{children:(0,R.jsx)(ys,{})}));