total-recall-brain 3.14.7 → 3.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/dist/assets/{index-L0eEIoBf.css → index-BmUmrNPB.css} +1 -1
- package/frontend/dist/assets/index-Im6FcQHL.js +502 -0
- package/frontend/dist/icon-192.png +0 -0
- package/frontend/dist/icon-512.png +0 -0
- package/frontend/dist/index.html +9 -4
- package/frontend/dist/manifest.json +13 -1
- package/frontend/src/App.tsx +3 -3
- package/frontend/src/components/BrainSelector.spec.tsx +2 -1
- package/frontend/src/components/Graph3D.spec.tsx +1 -1
- package/frontend/src/components/MobilePairing.tsx +1 -1
- package/frontend/src/components/UsageChart.spec.tsx +1 -1
- package/frontend/src/components/UsageChart.tsx +1 -1
- package/frontend/src/components/VoiceInput.tsx +1 -1
- package/frontend/src/pages/ApiKeysPage.spec.tsx +1 -1
- package/frontend/src/pages/AutomationsPage.spec.tsx +1 -0
- package/frontend/src/pages/ChatPage.spec.tsx +12 -12
- package/frontend/src/pages/CollabPage.spec.tsx +1 -0
- package/frontend/src/pages/GraphPage.spec.tsx +4 -5
- package/frontend/src/pages/HealthPage.spec.tsx +1 -1
- package/frontend/src/pages/HelpPage.spec.tsx +18 -18
- package/frontend/src/pages/InstructionsPage.spec.tsx +2 -1
- package/frontend/src/pages/IntegrationsPage.spec.tsx +17 -18
- package/frontend/src/pages/ModelsPage.spec.tsx +1 -0
- package/frontend/src/pages/OnboardingPage.spec.tsx +2 -1
- package/frontend/src/pages/OpenWikiPage.spec.tsx +5 -12
- package/frontend/src/pages/SettingsPage.spec.tsx +13 -11
- package/frontend/src/pages/SettingsPage.tsx +1 -1
- package/frontend/src/pages/SkillsPage.spec.tsx +1 -0
- package/frontend/src/pages/TasksPage.spec.tsx +0 -1
- package/frontend/src/pages/TasksPage.tsx +2 -2
- package/frontend/src/pages/UsagePage.spec.tsx +6 -11
- package/frontend/src/pages/UsagePage.tsx +1 -1
- package/frontend/src/pages/VaultPage.spec.tsx +2 -1
- package/frontend/src/setupTests.ts +1 -1
- package/frontend/vite.config.ts +1 -1
- package/package.json +1 -1
- package/frontend/dist/assets/index-D9-jAOr9.js +0 -502
|
@@ -0,0 +1,502 @@
|
|
|
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,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(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},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(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 u=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 E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+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+j(a,u),c+=N(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+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(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 I=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)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,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 E(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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},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,I)}catch(e){I(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.7`})),d=o(((e,t)=>{t.exports=u()})),f=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,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&E());){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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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.7`})),h=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=m()})),g=o((e=>{var t=p(),n=d(),r=h();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 u(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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=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`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?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 E:return`SuspenseList`;case k: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 D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function re(e){return{current:e}}function ie(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function R(e,t){ne++,te[ne]=e.current,e.current=t}var ae=re(null),oe=re(null),se=re(null),ce=re(null);function le(e,t){switch(R(se,t),R(oe,e),R(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(ae),R(ae,e)}function ue(){ie(ae),ie(oe),ie(se)}function de(e){e.memoizedState!==null&&R(ce,e);var t=ae.current,n=Wd(t,e.type);t!==n&&(R(oe,e),R(ae,n))}function fe(e){oe.current===e&&(ie(ae),ie(oe)),ce.current===e&&(ie(ce),ep._currentValue=ee)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!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{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|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-Le(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-Le(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-Le(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=L.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function it(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[ot])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=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]*$`),Tt={},Et={};function Dt(e){return be.call(Et,e)?!0:be.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(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 kt(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 At(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 jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(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 Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(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 Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(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=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(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=``+jt(s):e.removeAttribute(`name`)}function Bt(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)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(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),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(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=``+jt(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 Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=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 qt(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||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(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&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(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 Xt=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`]]),Zt=/^[\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 Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(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="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(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&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(bu(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||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 ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.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 mn=i.slice(e,1<r?1-r:void 0)}function gn(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 _n(){return!0}function vn(){return!1}function yn(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)?_n:vn,this.isPropagationStopped=vn,this}return m(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=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=m({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=m({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,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!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(m({},Dn,{dataTransfer:0})),An=yn(m({},Sn,{relatedTarget:0})),jn=yn(m({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(m({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(m({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(m({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(m({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(m({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(m({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(m({},Dn,{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})),Wn=yn(m({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,z=ln&&(!Kn||qn&&8<qn&&11>=qn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Gn.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 B=!1;function $n(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 er(e,t){if(B)return e===`compositionend`||!Kn&&Zn(e,t)?(e=hn(),mn=pn=fn=null,B=!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 z&&t.locale!==`ko`?null:t.data;default:return null}}var tr={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 nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!tr[e.type]:t===`textarea`}function rr(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Dd(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ir=null,ar=null;function or(e){bd(e,0)}function sr(e){if(Ft(_t(e)))return e}function cr(e,t){if(e===`change`)return t}var lr=!1;if(ln){var ur;if(ln){var dr=`oninput`in document;if(!dr){var fr=document.createElement(`div`);fr.setAttribute(`oninput`,`return;`),dr=typeof fr.oninput==`function`}ur=dr}else ur=!1;lr=ur&&(!document.documentMode||9<document.documentMode)}function pr(){ir&&(ir.detachEvent(`onpropertychange`,mr),ar=ir=null)}function mr(e){if(e.propertyName===`value`&&sr(ar)){var t=[];rr(t,ar,e,tn(e)),sn(or,t)}}function hr(e,t,n){e===`focusin`?(pr(),ir=t,ar=n,ir.attachEvent(`onpropertychange`,mr)):e===`focusout`&&pr()}function gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return sr(ar)}function _r(e,t){if(e===`click`)return sr(t)}function vr(e,t){if(e===`input`||e===`change`)return sr(t)}function yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var br=typeof Object.is==`function`?Object.is:yr;function xr(e,t){if(br(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(!be.call(t,i)||!br(e[i],t[i]))return!1}return!0}function Sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=Sr(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=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(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=It(e.document)}return t}function Er(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 Dr=ln&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==It(r)||(r=Or,`selectionStart`in r&&Er(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}),Ar&&xr(Ar,r)||(Ar=r,r=Dd(kr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},Fr={},Ir={};ln&&(Ir=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function Lr(e){if(Fr[e])return Fr[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ir)return Fr[e]=t[n];return e}var Rr=Lr(`animationend`),zr=Lr(`animationiteration`),Br=Lr(`animationstart`),Vr=Lr(`transitionrun`),Hr=Lr(`transitionstart`),Ur=Lr(`transitioncancel`),Wr=Lr(`transitionend`),Gr=new Map,Kr=`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(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),St(t,[e])}var Jr=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)},Yr=[],Xr=0,Zr=0;function Qr(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[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&&ni(n,i,a)}}function $r(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ei(e,t,n,r){return $r(e,t,n,r),ri(e)}function ti(e,t){return $r(e,null,null,t),ri(e)}function ni(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-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ri(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 ii={};function ai(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 oi(e,t,n,r){return new ai(e,t,n,r)}function si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ci(e,t){var n=e.alternate;return n===null?(n=oi(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 li(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 ui(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)si(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=oi(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return di(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=oi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=oi(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=oi(19,n,t,a),e.elementType=E,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 D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function di(e,t,n,r){return e=oi(7,e,r,t),e.lanes=n,e}function fi(e,t,n){return e=oi(6,e,null,t),e.lanes=n,e}function pi(e){var t=oi(18,null,null,0);return t.stateNode=e,t}function mi(e,t,n){return t=oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hi=new WeakMap;function gi(e,t){if(typeof e==`object`&&e){var n=hi.get(e);return n===void 0?(t={value:e,source:t,stack:ye(t)},hi.set(e,t),t):n}return{value:e,source:t,stack:ye(t)}}var _i=[],vi=0,yi=null,bi=0,xi=[],Si=0,Ci=null,wi=1,Ti=``;function V(e,t){_i[vi++]=bi,_i[vi++]=yi,yi=e,bi=t}function Ei(e,t,n){xi[Si++]=wi,xi[Si++]=Ti,xi[Si++]=Ci,Ci=e;var r=wi;e=Ti;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wi=1<<32-Le(t)+i|n<<i|r,Ti=a+e}else wi=1<<a|n<<i|r,Ti=e}function Di(e){e.return!==null&&(V(e,1),Ei(e,1,0))}function Oi(e){for(;e===yi;)yi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null;for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,Ti=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null}function ki(e,t){xi[Si++]=wi,xi[Si++]=Ti,xi[Si++]=Ci,wi=t.id,Ti=t.overflow,Ci=e}var Ai=null,ji=null,H=!1,Mi=null,Ni=!1,Pi=Error(i(519));function Fi(e){throw Vi(gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:Z(`cancel`,t),Z(`close`,t);break;case`iframe`:case`object`:case`embed`:Z(`load`,t);break;case`video`:case`audio`:for(n=0;n<vd.length;n++)Z(vd[n],t);break;case`source`:Z(`error`,t);break;case`img`:case`image`:case`link`:Z(`error`,t),Z(`load`,t);break;case`details`:Z(`toggle`,t);break;case`input`:Z(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Z(`invalid`,t);break;case`textarea`:Z(`invalid`,t),Wt(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||Nd(t.textContent,n)?(r.popover!=null&&(Z(`beforetoggle`,t),Z(`toggle`,t)),r.onScroll!=null&&Z(`scroll`,t),r.onScrollEnd!=null&&Z(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Fi(e,!0)}function Li(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Ri(e){if(e!==Ai)return!1;if(!H)return Li(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Gd(e.type,e.memoizedProps)),n=!n),n&&ji&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=ff(e)}else t===27?(t=ji,$d(e.type)?(e=df,df=null,ji=e):ji=t):ji=Ai?uf(e.stateNode.nextSibling):null;return!0}function zi(){ji=Ai=null,H=!1}function Bi(){var e=Mi;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Mi=null),e}function Vi(e){Mi===null?Mi=[e]:Mi.push(e)}var Hi=re(null),Ui=null,Wi=null;function Gi(e,t,n){R(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,ie(Hi)}function qi(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 Ji(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),qi(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),qi(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 Yi(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;br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(i(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var ta=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()})}},na=t.unstable_scheduleCallback,ra=t.unstable_NormalPriority,ia={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aa(){return{controller:new ta,data:new Map,refCount:0}}function oa(e){e.refCount--,e.refCount===0&&na(ra,function(){e.controller.abort()})}var sa=null,ca=0,la=0,ua=null;function da(e,t){if(sa===null){var n=sa=[];ca=0,la=fd(),ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ca++,t.then(fa,fa),t}function fa(){if(--ca===0&&sa!==null){ua!==null&&(ua.status=`fulfilled`);var e=sa;sa=null,la=0,ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pa(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 ma=I.S;I.S=function(e,t){tu=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&da(e,t),ma!==null&&ma(e,t)};var ha=re(null);function ga(){var e=ha.current;return e===null?Bl.pooledCache:e}function _a(e,t){t===null?R(ha,ha.current):R(ha,t.pool)}function va(){var e=ga();return e===null?null:{parent:ia._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($t,$t),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($t,$t);else{if(e=Bl,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=ci(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=fi(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===O&&Ta(i)===t.type)?(t=a(t,n.props),Ma(t,n),t.return=e,t):(t=ui(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=mi(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=di(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=fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ui(t.type,t.key,t.props,null,e.mode,n),Ma(n,t),n.return=e,n;case v:return t=mi(t,e.mode,n),t.return=e,t;case O:return t=Ta(t),f(e,t,n)}if(F(t)||M(t))return t=di(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,$i(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 O:return n=Ta(n),p(e,t,n,r)}if(F(n)||M(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,$i(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 O:return r=Ta(r),m(e,t,n,r,i)}if(F(r)||M(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,$i(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),H&&V(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 H&&V(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)}),H&&V(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),H&&V(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 H&&V(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)}),H&&V(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===O&&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=di(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ui(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=mi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ta(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(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,$i(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=fi(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=oi(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,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ri(e),ni(e,null,n),t}return $r(e,r,t,n),ri(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=ua;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?(q&f)===f:(r&f)===f){f!==0&&f===la&&(Wa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},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),Kl|=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=re(null),Xa=re(0);function Za(e,t){e=Y,R(Xa,e),R(Ya,t),Y=e|t.baseLanes}function Qa(){R(Xa,Y),R(Ya,Ya.current)}function $a(){Y=Xa.current,ie(Ya),ie(Xa)}var U=re(null),eo=null;function to(e){var t=e.alternate;R(oo,oo.current&1),R(U,e),eo===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){R(oo,oo.current),R(U,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(R(oo,oo.current),R(U,e),eo===null&&(eo=e)):io(e)}function io(){R(oo,oo.current),R(U,U.current)}function ao(e){ie(U),eo===e&&(eo=null),ie(oo)}var oo=re(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sf(n)||cf(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 co=0,W=null,lo=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(!br(e[n],t[n]))return!1;return!0}function xo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ls:Rs,mo=!1,a=n(r,i),mo=!1,po&&(a=Co(t,n,r,i)),So(e),a}function So(e){I.H=Is;var t=lo!==null&&lo.next!==null;if(co=0,uo=lo=W=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Xi(e)&&(tc=!0))}function Co(e,t,n,r){W=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,uo=lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=zs,o=t(n,r)}while(po);return o}function wo(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(lo===null?null:lo.memoizedState)!==e&&(W.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}co=0,uo=lo=W=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?W.memoizedState=uo=e:uo=uo.next=e,uo}function ko(){if(lo===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=lo.next;var t=uo===null?W.memoizedState:uo.next;if(t!==null)uo=t,lo=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));lo=e,e={memoizedState:lo.memoizedState,baseState:lo.baseState,baseQueue:lo.baseQueue,queue:lo.queue,next:null},uo===null?W.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=W,(uo===null?t.memoizedState:uo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ls:Rs),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return Qi(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.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(),W.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]=A;return t.index++,n}function Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),lo,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?(co&f)===f:(q&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===la&&(d=!0);else if((co&p)===p){u=u.next,p===la&&(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,W.lanes|=p,Kl|=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,W.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!br(o,e.memoizedState)&&(tc=!0,d&&(n=ua,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);br(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=W,a=ko(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!br((lo||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!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),Bl===null)throw Error(i(349));o||co&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=Ao(),W.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!br(e,n)}catch{return!0}}function Uo(e){var t=ti(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){Ie(!0);try{n()}finally{Ie(!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,lo,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)}};I.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=I.T,o={};I.T=o;try{var s=n(i,r),c=I.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),I.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(H){var n=Bl.formState;if(n!==null){a:{var r=W;if(H){if(ji){b:{for(var i=ji,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=uf(i.nextSibling),r=i.data===`F!`;break a}}Fi(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,W,r),r.dispatch=n,r=Wo(!1),a=Ns.bind(null,W,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function es(e){return ts(ko(),lo,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&&(W.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=lo;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=W.updateQueue,t===null&&(t=Ao(),W.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();W.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;lo!==null&&r!==null&&bo(r,lo.memoizedState.deps)?i.memoizedState=is(t,a,n,r):(W.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){W.flags|=4;var t=W.updateQueue;if(t===null)t=Ao(),W.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(zl&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){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||co&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Kl|=e,n)}function bs(e,t,n,r){return br(n,t)?n:Ya.current===null?!(co&42)||co&1073741824&&!(q&261930)?(tc=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Kl|=e,t):(e=ys(e,n,r),br(e,t)||(tc=!0),e)}function xs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Ns(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,pa(c,r),pu(e)):Ms(e,t,r,pu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.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,ee,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:ee},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 Qi(ep)}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:aa()},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=ei(e,t,n,r),n!==null&&(hu(n,e,r),G(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,br(s,o))return $r(e,t,i,0),Bl===null&&Qr(),!1}catch{}if(n=ei(e,t,i,r),n!==null)return hu(n,e,r),G(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=ei(e,n,r,2),t!==null&&hu(t,e,2)}function Ps(e){var t=e.alternate;return e===W||t!==null&&t===W}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 G(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Is={readContext:Qi,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};Is.useEffectEvent=yo;var Ls={readContext:Qi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,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){Ie(!0);try{e()}finally{Ie(!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){Ie(!0);try{n(t)}finally{Ie(!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,W,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,W,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,W,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Oo();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));q&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=Bl.identifierPrefix;if(H){var n=Ti,r=wi;n=(r&~(1<<32-Le(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,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=ks.bind(null,W)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Qi,use:Mo,useCallback:_s,useContext:Qi,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(),lo.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(),lo,e,t)},useMemoCache:No,useCacheRefresh:Os};Rs.useEffectEvent=ds;var zs={readContext:Qi,use:Mo,useCallback:_s,useContext:Qi,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 lo===null?ys(n,e,t):bs(n,lo.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 lo===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,lo,e,t)},useMemoCache:No,useCacheRefresh:Os};zs.useEffectEvent=ds;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={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 Hs(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?!xr(n,r)||!xr(i,a):!0}function Us(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&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(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=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Jr(e)}function Ks(e){console.error(e)}function qs(e){Jr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(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 Xs(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=Ba(e),e.tag=3,e}function Qs(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(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(X===null?X=new Set([this]):X.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,a,!0),n=U.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Gl===0&&(Gl=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),Ku(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)),Ku(e,r,a)),!1}throw Error(i(435,n.tag))}return Ku(e,r,a),Du(),!1}if(H)return t=U.current,t===null?(r!==Pi&&(t=Error(i(423),{cause:r}),Vi(gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=gi(r,n),a=Xs(e.stateNode,r,a),Ua(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Pi&&(e=Error(i(422),{cause:r}),Vi(gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=gi(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(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`&&(X===null||!X.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ua(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function rc(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 Zi(t),r=xo(e,t,n,o,a,i),s=To(),e!==null&&!tc?(Eo(e,t,i),Dc(e,t,i)):(H&&s&&Di(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=ui(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(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 cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&_a(t,null),Qa(),io(t)):(_a(t,a.cachePool),Za(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ga();return a=a===null?null:{parent:ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&_a(t,null),Qa(),ro(t),e!==null&&Yi(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Fa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=ji)?(e=of(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Yi(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=Bl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ti(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,ji=uf(s.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=lc(t,r),t.flags|=4096;return t}return e=ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(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 pc(e,t,n,r,i){return Zi(t),n=xo(e,t,n,r,void 0,i),r=To(),e!==null&&!tc?(Eo(e,t,i),Dc(e,t,i)):(H&&r&&Di(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=Co(t,r,n,i),So(e),r=To(),e!==null&&!tc?(Eo(e,t,a),Dc(e,t,a)):(H&&r&&Di(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=ii,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,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?Qi(o):ii,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(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&&Vs.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=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ii,typeof u==`object`&&u&&(o=Qi(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)&&Us(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`&&(Bs(t,n,d,r),l=t.memoizedState),(c=La||Hs(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=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ii,typeof l==`object`&&l&&(c=Qi(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)&&Us(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&&Xi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=La||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(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,fc(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)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return zi(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:va()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function bc(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:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(H){if(a?to(t):io(t),(e=ji)?(e=of(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=di(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=di(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=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Vi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=Bl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ti(e,r),hu(s,e,r),ec;sf(c)||Du(),t=Cc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=uf(c.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ci(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=di(c,a,n,null),c.flags|=2):c=ci(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=va():(l=ia._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=ci(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 xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=oi(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Fa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function Tc(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 Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,R(oo,o),nc(e,t,r,n),r=H?bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(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&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(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&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Yi(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=ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Xi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Gi(t,ia,e.memoizedState.cache),zi();break;case 27:case 5:de(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Gi(t,ia,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,H&&t.flags&1048576&&Ei(t,bi,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`)si(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(le(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,Gi(t,ia,r),r!==o.cache&&Ji(t,[ia],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=gc(e,t,r,n);break a}else if(r!==a){a=gi(Error(i(424)),t),Vi(a),t=gc(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(ji=uf(e.firstChild),Ai=t,H=!0,Mi=null,Ni=!0,n=Ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(n=t.type,e=t.pendingProps,r=Hd(se.current).createElement(n),r[ot]=t,r[st]=e,Id(r,n,e),yt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&H&&(r=t.stateNode=mf(t.type,t.pendingProps,se.current),Ai=t,Ni=!0,a=ji,$d(t.type)?(df=a,ji=uf(r.firstChild)):ji=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=ji)&&(r=rf(r,t.type,t.pendingProps,Ni),r===null?a=!1:(t.stateNode=r,Ai=t,ji=uf(r.firstChild),Ni=!1,a=!0)),a||Fi(t)),de(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=xo(e,t,wo,null,null,n),ep._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=ji)&&(n=af(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return bc(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Zi(t),a=Qi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Zi(t),r=Qi(ia),e===null?(a=ga(),a===null&&(a=Bl,o=aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ra(t),Gi(t,ia,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,Gi(t,ia,r),r!==a.cache&&Ji(t,[ia],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gi(t,ia,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(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 Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(wu())e.flags|=8192;else throw Ea=Sa,ba}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Xl|=t)}function Fc(e,t){if(!H)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 Ic(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(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(ia),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(fe(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=ae.current,Ri(t)?Ii(t,e):(e=mf(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(fe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=ae.current,Ri(t))Ii(t,o);else{var s=Hd(se.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[ot]=t,o[st]=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(Id(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&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Fi(t,!0)}else e=Hd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ri(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[ot]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ri(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[ot]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(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),Pc(t,t.updateQueue),Ic(t),null);case 4:return ue(),e===null&&Cd(t.stateNode.containerInfo),Ic(t),null;case 10:return Ki(t.type),Ic(t),null;case 19:if(ie(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)li(n,e),n=n.sibling;return R(oo,oo.current&1|2),H&&V(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>nu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!H)return Ic(t),null}else 2*Te()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Fc(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?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=oo.current,R(oo,a?n&1|2:n&1),H&&V(t,r.treeForkCount),e);case 22:case 23:return ao(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)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(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&&ie(ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(ia),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(ia),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(oo),null;case 4:return ue(),null;case 10:return Ki(t.type),null;case 22:case 23:return ao(t),$a(),e!==null&&ie(ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(ia),null;case 25:return null;default:return null}}function zc(e,t){switch(Oi(t),t.tag){case 3:Ki(ia),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:ie(oo);break;case 10:Ki(t.type);break;case 22:case 23:ao(t),$a(),e!==null&&ie(ha);break;case 24:Ki(ia)}}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){Gu(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){Gu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Gu(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Gu(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Gu(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){Gu(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){Gu(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){Gu(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){Gu(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[st]=t}catch(t){Gu(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(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&&$d(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=$t));else if(r!==4&&(r===27&&$d(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&&$d(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]);Id(t,r,n),t[ot]=e,t[st]=n}catch(t){Gu(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,Bd=lp,e=Tr(e),Er(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(Vd={focusedElem:e,selectionRange:n},lp=!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=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Gu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(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){Gu(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Gu(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){Gu(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=Yu.bind(null,n),lf(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&&mt(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(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,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;$d(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),hf(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){Gu(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Gu(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):ef(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{Pp(e)}catch(e){Gu(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{Pp(e)}catch(e){Gu(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=Xu.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($d(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[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Uf(`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),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`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),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode);else e.stateNode=Rf(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?Wf(a,e.type,e.stateNode):Rf(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{Gt(a,``)}catch(t){Gu(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){Gu(e,e.return,t)}}break;case 3:if(Hf=null,a=gl,gl=vf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Gu(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=vf(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)&&(eu=Te()),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){Gu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Gu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){Gu(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&&(Gt(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){Gu(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:hf(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){Gu(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){Gu(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&&oa(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&&oa(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&&oa(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){Gu(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&&qf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=vf(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:oa(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=Qi(ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qi(ia).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,Bl=null,K=null,q=0,Vl=0,J=null,Hl=!1,Ul=!1,Wl=!1,Y=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,X=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return zl&2&&q!==0?q&-q:I.T===null?rt():fd()}function mu(){if(Yl===0)if(!(q&536870912)||H){var e=He;He<<=1,!(He&3932160)&&(He=262144),Yl=e}else Yl=536870912;return e=U.current,e!==null&&(e.flags|=32),Yl}function hu(e,t,n){(e===Bl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,q,Yl,!1)),Xe(e,n),(!(zl&2)||e!==Bl)&&(e===Bl&&(!(zl&2)&&(ql|=n),Gl===4&&yu(e,q,Yl,!1)),id(e))}function gu(e,t,n){if(zl&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){Ul&&!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=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,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,Yl,!Hl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-Te(),10<a)){if(yu(r,t,Yl,!Hl),Ge(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Jd(_u.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Hl,o,`Throttled`,-0,0),a);break a}_u(r,n,Ql,ru,$l,t,Yl,ql,Xl,Hl,o,null,-0,0)}}break}while(1);id(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:$t},jl(t,a,d);var m=(a&62914560)===a?eu-Te():(a&4194048)===a?tu-Te():0;if(m=Yf(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(!br(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&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function bu(){return zl&6?!0:(ad(0,!1),!1)}function xu(){if(K!==null){if(Vl===0)var e=K.return;else e=K,Wi=Ui=null,Do(e),ka=null,Aa=0,e=K;for(;e!==null;)zc(e.alternate,e),e=e.return;K=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Bl=e,K=n=ci(e.current,null),q=t,Vl=0,J=null,Hl=!1,Ul=Ke(e,t),Wl=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Y=t,Qr(),n}function Cu(e,t){W=null,I.H=Is,t===ya||t===xa?(t=Da(),Vl=3):t===ba?(t=Da(),Vl=4):Vl=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,J=t,K===null&&(Gl=1,Js(e,gi(t,e.current)))}function wu(){var e=U.current;return e===null?!0:(q&4194048)===q?eo===null:(q&62914560)===q||q&536870912?e===eo:!1}function Tu(){var e=I.H;return I.H=Is,e===null?Is:e}function Eu(){var e=I.A;return I.A=Ll,e}function Du(){Gl=4,Hl||(q&4194048)!==q&&U.current!==null||(Ul=!0),!(Kl&134217727)&&!(ql&134217727)||Bl===null||yu(Bl,q,Yl,!1)}function Ou(e,t,n){var r=zl;zl|=2;var i=Tu(),a=Eu();(Bl!==e||q!==t)&&(ru=null,Su(e,t)),t=!1;var o=Gl;a:do try{if(Vl!==0&&K!==null){var s=K,c=J;switch(Vl){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:U.current===null&&(t=!0);var l=Vl;if(Vl=0,J=null,Pu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Vl,Vl=0,J=null,Pu(e,s,c,l)}}ku(),o=Gl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,zl=r,I.H=i,I.A=a,K===null&&(Bl=null,q=0,Qr()),o}function ku(){for(;K!==null;)Mu(K)}function Au(e,t){var n=zl;zl|=2;var r=Tu(),a=Eu();Bl!==e||q!==t?(ru=null,nu=Te()+500,Su(e,t)):Ul=Ke(e,t);a:do try{if(Vl!==0&&K!==null){t=K;var o=J;b:switch(Vl){case 1:Vl=0,J=null,Pu(e,t,o,1);break;case 2:case 9:if(Ca(o)){Vl=0,J=null,Nu(t);break}t=function(){Vl!==2&&Vl!==9||Bl!==e||(Vl=7),id(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:Ca(o)?(Vl=0,J=null,Nu(t)):(Vl=0,J=null,Pu(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Kf(s):c.stateNode.complete){Vl=0,J=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,Fu(u))}break b}}Vl=0,J=null,Pu(e,t,o,5);break;case 6:Vl=0,J=null,Pu(e,t,o,6);break;case 8:xu(),Gl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Wi=Ui=null,I.H=r,I.A=a,zl=n,K===null?(Bl=null,q=0,Qr(),Gl):0}function ju(){for(;K!==null&&!Ce();)Mu(K)}function Mu(e){var t=Ac(e.alternate,e,Y);e.memoizedProps=e.pendingProps,t===null?Fu(e):K=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:Do(t);default:zc(n,t),t=K=li(t,Y),t=Ac(n,t,Y)}e.memoizedProps=e.pendingProps,t===null?Fu(e):K=t}function Pu(e,t,n,r){Wi=Ui=null,Do(t),ka=null,Aa=0;var i=t.return;try{if($s(e,i,t,n,q)){Gl=1,Js(e,gi(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;Gl=1,Js(e,gi(n,e.current)),K=null;return}t.flags&32768?(H||r===1?e=!0:Ul||q&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=U.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,Hl);return}e=t.return;var n=Lc(t.alternate,t,Y);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);Gl===0&&(Gl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);Gl=6,K=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,Ze(e,n,o,s,c,l),e===Bl&&(K=Bl=null,q=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,Zu(ke,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=zl,zl|=4;try{il(e,t,n)}finally{zl=s,L.p=a,I.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=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{_l(t,e);var a=Vd,o=Tr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&wr(s.ownerDocument.documentElement,s)){if(c!==null&&Er(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 _=Cr(s,h),v=Cr(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}}lp=!!Bd,Vd=Bd=null}finally{zl=i,L.p=r,I.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=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{al(e,t.alternate,t)}finally{zl=i,L.p=r,I.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,we();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&&(X=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.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{I.T=t,L.p=i}}su&3&&Hu(),id(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,ad(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,oa(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=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),El(o,o.current,s,n),zl=c,ad(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{L.p=a,I.T=r,Vu(e,t)}}function Wu(e,t,n){t=gi(n,t),t=Xs(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(Xe(e,2),id(e))}function Gu(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`&&(X===null||!X.has(r))){e=gi(n,e),n=Zs(2),r=Va(t,n,2),r!==null&&(Qs(n,r,t,e),Xe(r,2),id(r));break}}t=t.return}}function Ku(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)||(Wl=!0,i.add(n),e=qu.bind(null,e,t,n),t.then(e,e))}function qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(Gl===4||Gl===3&&(q&62914560)===q&&300>Te()-eu?!(zl&2)&&Su(e,0):Jl|=n,Xl===q&&(Xl=0)),id(e)}function Ju(e,t){t===0&&(t=Je()),e=ti(e,t),e!==null&&(Xe(e,t),id(e))}function Yu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function Xu(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),Ju(e,n)}function Zu(e,t){return xe(e,t)}var Qu=null,$u=null,ed=!1,td=!1,nd=!1,rd=0;function id(e){e!==$u&&e.next===null&&($u===null?Qu=$u=e:$u=$u.next=e),td=!0,ed||(ed=!0,dd())}function ad(e,t){if(!nd&&td){nd=!0;do for(var n=!1,r=Qu;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-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ud(r,a))}else a=q,a=Ge(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,ud(r,a));r=r.next}while(n);nd=!1}}function od(){sd()}function sd(){td=ed=!1;var e=0;rd!==0&&qd()&&(e=rd);for(var t=Te(),n=null,r=Qu;r!==null;){var i=r.next,a=cd(r,t);a===0?(r.next=null,n===null?Qu=i:n.next=i,i===null&&($u=n)):(n=r,(e!==0||a&3)&&(td=!0)),r=i}iu!==0&&iu!==5||ad(e,!1),rd!==0&&(rd=0)}function cd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(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=Bl,n=q,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Se(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&&Se(r),nt(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=ld.bind(null,e),n=xe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Se(r),e.callbackPriority=2,e.callbackNode=null,2}function ld(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=q;return r=Ge(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),cd(e,Te()),e.callbackNode!=null&&e.callbackNode===n?ld.bind(null,e):null)}function ud(e,t){if(Hu())return null;gu(e,t,!0)}function dd(){Zd(function(){zl&6?xe(De,od):sd()})}function fd(){if(rd===0){var e=la;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),rd=e}return rd}function pd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function md(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 hd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=pd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?pd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(rd!==0){var e=o?md(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?md(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var gd=0;gd<Kr.length;gd++){var _d=Kr[gd];qr(_d.toLowerCase(),`on`+(_d[0].toUpperCase()+_d.slice(1)))}qr(Rr,`onAnimationEnd`),qr(zr,`onAnimationIteration`),qr(Br,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Vr,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var vd=`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(` `),yd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(vd));function bd(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){Jr(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){Jr(e)}i.currentTarget=null,a=c}}}}function Z(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(yd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!un||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 Td(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=ht(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}sn(function(){var r=a,i=tn(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;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=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Rr:case zr:case Br:l=jn;break;case Wr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}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=cn(m,p),g!=null&&d.push(Ed(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!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))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?ht(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=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(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=Od,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&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=cr;else if(nr(c))if(lr)v=vr;else{v=gr;var y=hr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=cr):v=_r;if(v&&=v(e,r)){rr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(nr(y)||y.contentEditable===`true`)&&(Or=y,kr=r,Ar=null);break;case`focusout`:Ar=kr=Or=null;break;case`mousedown`:jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:jr=!1,Mr(s,n,i);break;case`selectionchange`:if(Dr)break;case`keydown`:case`keyup`:Mr(s,n,i)}var b;if(Kn)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 B?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(z&&n.locale!==`ko`&&(B||x!==`onCompositionStart`?x===`onCompositionEnd`&&B&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,B=!0)),y=Dd(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=Jn?$n(e,n):er(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),hd(s,e,r,n,i)}bd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(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=cn(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=cn(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(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=cn(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
|
|
9
|
+
`).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(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=Qt(``+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`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&Z(`scroll`,e);break;case`onScrollEnd`:r!=null&&Z(`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=Qt(``+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`:Z(`beforetoggle`,e),Z(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(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=Xt.get(n)||n,Ot(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Jt(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`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&Z(`scroll`,e);break;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.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[st]||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,``):Ot(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Z(`error`,e),Z(`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:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:Z(`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:Pd(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Z(`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:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in Z(`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:Pd(e,t,s,c,n,null)}Wt(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:Pd(e,t,l,r,n,null)}return;case`dialog`:Z(`beforetoggle`,e),Z(`toggle`,e),Z(`cancel`,e),Z(`close`,e);break;case`iframe`:case`object`:Z(`load`,e);break;case`video`:case`audio`:for(r=0;r<vd.length;r++)Z(vd[r],e);break;case`image`:Z(`error`,e),Z(`load`,e);break;case`details`:Z(`toggle`,e);break;case`embed`:case`source`:case`link`:Z(`error`,e),Z(`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:Pd(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(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)||Pd(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&&Pd(e,t,p,m,r,f)}}zt(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)||Pd(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&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(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:Pd(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&&Pd(e,t,s,a,r,o)}Ut(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:Pd(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:Pd(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)&&Pd(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:Pd(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(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||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(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||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){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&&Rd(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&&Rd(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 Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(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 Gd(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 Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(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),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Pp(t)}function tf(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 nf(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`:nf(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(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[pt])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=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(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 uf(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 df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(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 mf(e,t,n){switch(t=Hd(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 hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=L.d;L.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=bu();return e||t}function xf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),yt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=vt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);yt(c),Id(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=vt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),yt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=vt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),yt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=se.current)?vf(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=Mf(n.href),n=vt(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=Mf(n.href);var o=vt(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(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.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},gf.set(e,n),o||Ff(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=If(n),n=vt(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 Mf(e){return`href="`+Rt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(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}),Id(t,`link`,n),yt(t),e.head.appendChild(t))}function If(e){return`[src="`+Rt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,yt(a),a):(r=n,(a=gf.get(o))&&(r=m({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Id(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,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[pt]||a[ot]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function tp(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=oi(3,null,null,t),e.current=a,a.stateNode=e,t=aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ra(a),e}function rp(e){return e?(e=ii,e):ii}function ip(e,t,n,r,i,a){i=rp(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 ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=ti(e,67108864);t!==null&&hu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=pu();t=tt(t);var n=ti(e,t);n!==null&&hu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,fp(e,t,n,r)}finally{L.p=a,I.T=i}}function dp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,fp(e,t,n,r)}finally{L.p=a,I.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=gt(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-Le(o);s.entanglements[1]|=c,o&=~c}id(a),!(zl&6)&&(nu=Te()+500,ad(0,!1))}}break;case 31:case 13:s=ti(a,2),s!==null&&hu(s,a,2),bu(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=tn(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=ht(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 mp=e,null}function gp(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(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=gt(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=ht(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(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){cp(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 Q(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Q(e)&&n.delete(t)}function Ap(){_p=!1,vp!==null&&Q(vp)&&(vp=null),yp!==null&&Q(yp)&&(yp=null),bp!==null&&Q(bp)&&(bp=null),xp.forEach(kp),Sp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=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(hp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp!==null&&jp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[st]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){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 Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,pu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),bu(),t[ct]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var Rp=n.version;if(Rp!==`19.2.7`)throw Error(i(527,Rp,`19.2.7`));L.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=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Pe=Bp.inject(zp),Fe=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;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=np(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[ct]=t.current,Cd(e),new Ip(t)}})),_=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=g()})),v=l(d(),1),y=_(),b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=x(t,n),t=s(t),t in S)return;S[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:b,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},w=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,T=/^[\\/]{2}/;function E(e,t){return t+e.replace(/\\/g,`/`)}var D=`popstate`;function O(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function k(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return P(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:F(t)}return L(t,n,null,e)}function A(e,t){if(e===!1||e==null)throw Error(t)}function j(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function M(){return Math.random().toString(36).substring(2,10)}function N(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function P(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||M(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function L(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=O(e)?e:P(h.location,e,t);n&&n(r,e),l=u()+1;let d=N(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=O(e)?e:P(h.location,e,t);n&&n(r,e),l=u();let i=N(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(D,d),c=e,()=>{i.removeEventListener(D,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),A(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&T.test(i)&&(i=r+i),new URL(i,r)}function te(e,t,n=`/`){return ne(e,t,n,!1)}function ne(e,t,n,r,i){let a=xe((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ie(e),s=null,c=be(a);for(let e=0;s==null&&e<o.length;++e)s=ge(o[e],c,r);return s}function re(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ie(e){let t=R(e);return oe(t),t}function R(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;A(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=ke([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(A(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),R(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:me(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=ye(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ae(e.path))a(e,t,!0,n)}),t}function ae(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ae(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function oe(e){e.sort((e,t)=>e.score===t.score?he(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var se=/^:[\w-]+$/,ce=3,le=2,ue=1,de=10,fe=-2,pe=e=>e===`*`;function me(e,t){let n=e.split(`/`),r=n.length;return n.some(pe)&&(r+=fe),t&&(r+=le),n.filter(e=>!pe(e)).reduce((e,t)=>e+(se.test(t)?ce:t===``?ue:de),r)}function he(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ge(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ve(u,l,s.matcher,s.compiledParams):_e(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=_e({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:ke([a,d.pathname]),pathnameBase:je(ke([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=ke([a,d.pathnameBase]))}return o}function _e(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ye(e.path,e.caseSensitive,e.end);return ve(e,t,n,r)}function ve(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ye(e,t=!1,n=!0){j(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function be(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return j(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function xe(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Se(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Oe(n),a=n.startsWith(`/`)?Ce(n.substring(1),`/`):Ce(n,t)):a=t,{pathname:a,search:Me(r),hash:Ne(i)}}function Ce(e,t){let n=Ae(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function we(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Te(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ee(e){let t=Te(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function De(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},A(!i.pathname||!i.pathname.includes(`?`),we(`?`,`pathname`,`search`,i)),A(!i.pathname||!i.pathname.includes(`#`),we(`#`,`pathname`,`hash`,i)),A(!i.search||!i.search.includes(`#`),we(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Se(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Oe=e=>e.replace(/[\\/]{2,}/g,`/`),ke=e=>Oe(e.join(`/`)),Ae=e=>e.replace(/\/+$/,``),je=e=>Ae(e).replace(/^\/*/,`/`),Me=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ne=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Pe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Fe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ie(e){return ke(e.map(e=>e.route.path).filter(Boolean))||`/`}var Le=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Re(e,t){let n=e;if(typeof n!=`string`||!w.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Le)try{let e=new URL(window.location.href),r=T.test(n)?new URL(E(n,e.protocol)):new URL(n),a=xe(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{j(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ze=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ze);var Be=[`GET`,...ze];new Set(Be);var Ve=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function He(e){try{return Ve.includes(new URL(e).protocol)}catch{return!1}}var Ue=v.createContext(null);Ue.displayName=`DataRouter`;var We=v.createContext(null);We.displayName=`DataRouterState`;var Ge=v.createContext(!1);function Ke(){return v.useContext(Ge)}var qe=v.createContext({isTransitioning:!1});qe.displayName=`ViewTransition`;var Je=v.createContext(new Map);Je.displayName=`Fetchers`;var Ye=v.createContext(null);Ye.displayName=`Await`;var Xe=v.createContext(null);Xe.displayName=`Navigation`;var Ze=v.createContext(null);Ze.displayName=`Location`;var Qe=v.createContext({outlet:null,matches:[],isDataRoute:!1});Qe.displayName=`Route`;var $e=v.createContext(null);$e.displayName=`RouteError`;var et=`REACT_ROUTER_ERROR`,tt=`REDIRECT`,nt=`ROUTE_ERROR_RESPONSE`;function rt(e){if(e.startsWith(`${et}:${tt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function it(e){if(e.startsWith(`${et}:${nt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Pe(t.status,t.statusText,t.data)}catch{}}function at(e,{relative:t}={}){A(ot(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(Xe),{hash:i,pathname:a,search:o}=ft(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ke([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ot(){return v.useContext(Ze)!=null}function st(){return A(ot(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(Ze).location}var ct=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function lt(e){v.useContext(Xe).static||v.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=v.useContext(Qe);return e?jt():dt()}function dt(){A(ot(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(Ue),{basename:t,navigator:n}=v.useContext(Xe),{matches:r}=v.useContext(Qe),{pathname:i}=st(),a=JSON.stringify(Ee(r)),o=v.useRef(!1);return lt(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(j(o.current,ct),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=De(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ke([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function ft(e,{relative:t}={}){let{matches:n}=v.useContext(Qe),{pathname:r}=st(),i=JSON.stringify(Ee(n));return v.useMemo(()=>De(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function pt(e,t){return mt(e,t)}function mt(e,t,n){A(ot(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(Xe),{matches:i}=v.useContext(Qe),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Nt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=st(),d;if(t){let e=typeof t==`string`?I(t):t;A(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):te(e,{pathname:p});j(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),j(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=xt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ke([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ke([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(Ze.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ht(){let e=At(),t=Fe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var gt=v.createElement(ht,null),_t=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=it(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(Qe.Provider,{value:this.props.routeContext},v.createElement($e.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(yt,{error:e},t):t}};_t.contextType=Ge;var vt=new WeakMap;function yt({children:e,error:t}){let{basename:n}=v.useContext(Xe);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=rt(t.digest);if(e){let r=vt.get(t);if(r)throw r;let i=Re(e.location,n),a=i.absoluteURL||i.to;if(He(a))throw Error(`Invalid redirect location`);if(Le&&!vt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw vt.set(t,n),n}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function bt({routeContext:e,match:t,children:n}){let r=v.useContext(Ue);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Qe.Provider,{value:e},n)}function xt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);A(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ie(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||gt,o&&(s<0&&c===0?(Nt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(bt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(_t,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function St(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ct(e){let t=v.useContext(Ue);return A(t,St(e)),t}function wt(e){let t=v.useContext(We);return A(t,St(e)),t}function Tt(e){let t=v.useContext(Qe);return A(t,St(e)),t}function Et(e){let t=Tt(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Dt(){return Et(`useRouteId`)}function Ot(){let e=wt(`useNavigation`);return v.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function kt(){let{matches:e,loaderData:t}=wt(`useMatches`);return v.useMemo(()=>e.map(e=>re(e,t)),[e,t])}function At(){let e=v.useContext($e),t=wt(`useRouteError`),n=Et(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jt(){let{router:e}=Ct(`useNavigate`),t=Et(`useNavigate`),n=v.useRef(!1);return lt(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{j(n.current,ct),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mt={};function Nt(e,t,n){!t&&!Mt[e]&&(Mt[e]=!0,j(!1,n))}v.memo(Pt);function Pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return mt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ft({to:e,replace:t,state:n,relative:r}){A(ot(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=v.useContext(Xe);j(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=v.useContext(Qe),{pathname:o}=st(),s=ut(),c=De(e,Ee(a),o,r===`path`),l=JSON.stringify(c);return v.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function It(e){A(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Lt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){A(!ot(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=xe(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return j(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(Xe.Provider,{value:c},v.createElement(Ze.Provider,{children:t,value:h}))}function Rt({children:e,location:t}){return pt(zt(e),t)}v.Component;function zt(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,zt(e.props.children,i));return}A(e.type===It,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=zt(e.props.children,i)),n.push(a)}),n}var Bt=`get`,Vt=`application/x-www-form-urlencoded`;function Ht(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ut(e){return Ht(e)&&e.tagName.toLowerCase()===`button`}function Wt(e){return Ht(e)&&e.tagName.toLowerCase()===`form`}function Gt(e){return Ht(e)&&e.tagName.toLowerCase()===`input`}function Kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qt(e,t){return e.button===0&&(!t||t===`_self`)&&!Kt(e)}function Jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yt(e,t){let n=Jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xt=null;function Zt(){if(Xt===null)try{new FormData(document.createElement(`form`),0),Xt=!1}catch{Xt=!0}return Xt}var Qt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $t(e){return e!=null&&!Qt.has(e)?(j(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vt}"`),null):e}function en(e,t){let n,r,i,a,o;if(Wt(e)){let o=e.getAttribute(`action`);r=o?xe(o,t):null,n=e.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`enctype`))||Vt,a=new FormData(e)}else if(Ut(e)||Gt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?xe(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`formenctype`))||$t(o.getAttribute(`enctype`))||Vt,a=new FormData(o,e),!Zt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ht(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Bt,r=null,i=Vt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var tn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},nn=/[&><\u2028\u2029]/g;function rn(e){return e.replace(nn,e=>tn[e])}function an(e,t){if(e===!1||e==null)throw Error(t)}function on(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&xe(i.pathname,t)===`/`?i.pathname=`${Ae(t)}/_root.${r}`:i.pathname=`${Ae(i.pathname)}.${r}`,i}async function sn(e,t){if(e.id in t)return t[e.id];try{let n=await C(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cn(e){return e!=null&&typeof e.page==`string`}function ln(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function un(e,t,n){return hn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await sn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ln).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function dn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function fn(e,t,{includeHydrateFallback:n}={}){return pn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function pn(e){return[...new Set(e)]}function mn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!cn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(mn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function gn(){let e=v.useContext(Ue);return an(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function _n(){let e=v.useContext(We);return an(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var vn=v.createContext(void 0);vn.displayName=`FrameworkContext`;function yn(){let e=v.useContext(vn);return an(e,`You must render this element inside a <HydratedRouter> element`),e}function bn(e,t){let n=v.useContext(vn),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:xn(s,p),onBlur:xn(c,m),onMouseEnter:xn(l,p),onMouseLeave:xn(u,m),onTouchStart:xn(d,p)}]:[a,f,{}]:[!1,f,{}]}function xn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Sn({page:e,...t}){let n=Ke(),{nonce:r}=yn(),{router:i}=gn(),a=v.useMemo(()=>te(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(wn,{page:e,matches:a,...t}):v.createElement(Tn,{page:e,matches:a,...t})):null}function Cn(e){let{manifest:t,routeModules:n}=yn(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return un(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function wn({page:e,matches:t,...n}){let r=st(),{future:i}=yn(),{basename:a}=gn(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=on(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Tn({page:e,matches:t,...n}){let r=st(),{future:i,manifest:a,routeModules:o}=yn(),{basename:s}=gn(),{loaderData:c,matches:l}=_n(),u=v.useMemo(()=>dn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>dn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=on(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>fn(d,a),[d,a]),m=Cn(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function En(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var Dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Dn&&(window.__reactRouterVersion=`7.18.1`)}catch{}function On({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=k({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),c=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(c),[a,c]),v.createElement(Lt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function kn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=v.useState({action:n.action,location:n.location}),o=v.useCallback(e=>{r===!1?a(e):v.startTransition(()=>a(e))},[r]);return v.useLayoutEffect(()=>n.listen(o),[n,o]),v.createElement(Lt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}kn.displayName=`unstable_HistoryRouter`;var An=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(Xe),y=typeof l==`string`&&w.test(l),b=Re(l,h);l=b.to;let x=at(l,{relative:r}),S=st(),C=null;if(o){let e=De(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:ke([h,e.pathname])),C=g.createHref(e)}let[T,E,D]=bn(n,p),O=Ln(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(b.isExternal||i),j=v.createElement(`a`,{...p,...D,href:(A?C:void 0)||b.absoluteURL||x,onClick:A?k:e,ref:En(m,E),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return T&&!y?v.createElement(v.Fragment,null,j,v.createElement(Sn,{page:x})):j});An.displayName=`Link`;var jn=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ft(a,{relative:c.relative}),d=st(),f=v.useContext(We),{navigator:p,basename:m}=v.useContext(Xe),h=f!=null&&Jn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=xe(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(An,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});jn.displayName=`NavLink`;var Mn=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Bt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(Xe),g=Vn(),_=Hn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&w.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});Mn.displayName=`Form`;function Nn({getKey:e,storageKey:t,...n}){let r=v.useContext(vn),{basename:i}=v.useContext(Xe),a=st(),o=kt();Kn({getKey:e,storageKey:t});let s=v.useMemo(()=>{if(!r||!e)return null;let t=Gn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),v.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${rn(JSON.stringify(t||Un))}, ${rn(JSON.stringify(s))})`}})}Nn.displayName=`ScrollRestoration`;function Pn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fn(e){let t=v.useContext(Ue);return A(t,Pn(e)),t}function In(e){let t=v.useContext(We);return A(t,Pn(e)),t}function Ln(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ut(),d=st(),f=ft(e,{relative:o});return v.useCallback(p=>{if(qt(p,t)){p.preventDefault();let t=n===void 0?F(d)===F(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Rn(e){j(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(Jt(e)),n=v.useRef(!1),r=st(),i=v.useMemo(()=>Yt(r.search,n.current?null:t.current),[r.search]),a=ut();return[i,v.useCallback((e,t)=>{let r=Jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var zn=0,Bn=()=>`__${String(++zn)}__`;function Vn(){let{router:e}=Fn(`useSubmit`),{basename:t}=v.useContext(Xe),n=Dt(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=en(e,t);a.navigate===!1?await r(a.fetcherKey||Bn(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Hn(e,{relative:t}={}){let{basename:n}=v.useContext(Xe),r=v.useContext(Qe);A(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ft(e||`.`,{relative:t})},o=st();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:ke([n,a.pathname])),F(a)}var Un=`react-router-scroll-positions`,Wn={};function Gn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:xe(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Kn({getKey:e,storageKey:t}={}){let{router:n}=Fn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=In(`useScrollRestoration`),{basename:a}=v.useContext(Xe),o=st(),s=kt(),c=Ot();v.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),qn(v.useCallback(()=>{if(c.state===`idle`){let t=Gn(o,s,a,e);Wn[t]=window.scrollY}try{sessionStorage.setItem(t||Un,JSON.stringify(Wn))}catch(e){j(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(v.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Un);e&&(Wn=JSON.parse(e))}catch{}},[t]),v.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Wn,()=>window.scrollY,e?(t,n)=>Gn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),v.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{j(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function qn(e,t){let{capture:n}=t||{};v.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Jn(e,{relative:t}={}){let n=v.useContext(qe);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Fn(`useViewTransitionState`),i=ft(e,{relative:t});if(!n.isTransitioning)return!1;let a=xe(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=xe(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _e(i.pathname,o)!=null||_e(i.pathname,a)!=null}var z=localStorage.getItem(`TOTAL_RECALL_API_BASE`)||``;function Yn(){return z}function Xn(e){z=e,localStorage.setItem(`TOTAL_RECALL_API_BASE`,e),window.location.reload()}var Zn=null;function Qn(e){Zn=e}async function B(e,t={}){let n=localStorage.getItem(`total-recall-active-brain`),r=new Headers(t.headers||{});n&&r.set(`x-total-recall-brain`,n);let i=await fetch(e,{credentials:`include`,...t,headers:r});return i.status===401&&Zn?.(),i}async function $n(){try{return(await fetch(z+`/auth/me`,{credentials:`include`})).ok}catch{return!1}}async function er(e){try{let t=await fetch(z+`/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({password:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0,requiresPasswordReset:n.requiresPasswordReset}:{ok:!1,error:n.error||`Invalid password`}}catch{return{ok:!1,error:`Network error — is the server running?`}}}async function tr(e){try{let t=await fetch(z+`/auth/change-password`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({newPassword:e})});return t.ok?{ok:!0}:{ok:!1,error:(await t.json().catch(()=>({}))).error||`Failed to change password`}}catch{return{ok:!1,error:`Network error`}}}async function nr(){try{let e=await fetch(z+`/auth/status`);return e.ok?await e.json():{configured:!0}}catch{return{configured:!0}}}async function rr(e){try{let t=await fetch(z+`/auth/setup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({newPassword:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0}:{ok:!1,error:n.error||`Failed to setup password`}}catch{return{ok:!1,error:`Network error — is the server running?`}}}async function ir(){await fetch(z+`/auth/logout`,{method:`POST`,credentials:`include`}).catch(()=>{})}async function ar(e,t,n,r,i,a){let o={"Content-Type":`application/json`};n&&(o[`x-session-id`]=n);let s=await B(z+`/v1/chat/completions`,{method:`POST`,signal:t,headers:o,body:JSON.stringify({messages:e,groundingNodes:r,model:i,brainId:a})});if(!s.ok)throw Error(`Chat API error: ${s.status}`);return(await s.json()).choices?.[0]?.message?.content??`(empty response)`}async function or(e){let t={};e&&(t[`x-session-id`]=e);let n=await B(z+`/v1/chat/history`,{headers:t});if(!n.ok)throw Error(`Chat history error: ${n.status}`);return(await n.json()).messages??[]}async function sr(){let e=await B(z+`/v1/chat/threads`);if(!e.ok)throw Error(`Chat threads list error: ${e.status}`);return e.json()}async function cr(e){let t=await B(z+`/v1/chat/threads/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Delete chat thread error: ${t.status}`);return t.json()}async function lr(){try{let e=await B(z+`/api/tts/status`);return e.ok?e.json():{enabled:!1}}catch{return{enabled:!1}}}async function ur(e){let t=await B(z+`/api/tts`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(t.status===503)return null;if(!t.ok)throw Error(`TTS error: ${t.status}`);return t.blob()}async function dr(e,t,n){let r=new URLSearchParams;if(t&&r.set(`category`,t),n&&r.set(`status`,n),!e){let e=await B(`${z}/api/memory?${r}`);if(!e.ok)throw Error(`Memory API error: ${e.status}`);let t=await e.json();return Array.isArray(t)?t:t.nodes||[]}let i=e.split(`,`),a=i.map(async e=>{let t=e===`global`?`${z}/api/memory?${r}`:`${z}/api/brains/${e}/nodes?${r}`;try{let e=await B(t);if(!e.ok)return[];let n=await e.json();return Array.isArray(n)?n:n.nodes||[]}catch{return[]}}),o=await Promise.all(a),s=[],c=new Set,l=o.map((e,t)=>({nodes:e,id:i[t]})).sort((e,t)=>e.id===`global`?1:t.id===`global`?-1:0);for(let{nodes:e}of l)for(let t of e)c.has(t.slug)||(c.add(t.slug),s.push(t));return s}async function fr(e,t){let n=new URLSearchParams({q:e});t&&n.set(`category`,t);let r=await B(`${z}/api/memory?${n}`);if(!r.ok)throw Error(`Memory API error: ${r.status}`);let i=await r.json();return Array.isArray(i)?i:i.nodes||[]}async function pr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await B(`${z}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`);if(i.status===404)return null;if(!i.ok)throw Error(`Memory API error: ${i.status}`);return i.json()}async function mr(e,t,n){let r=new URLSearchParams;n&&r.set(`brain`,n);let i=r.toString(),a=await B(`${z}/api/memory/${encodeURIComponent(e)}${i?`?${i}`:``}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!a.ok)throw Error(`Failed to save memory: ${a.status}`);return a.json()}async function hr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await B(`${z}/api/memory${r?`?${r}`:``}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!i.ok)throw Error(`Failed to create memory: ${i.status}`);return i.json()}async function gr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await B(`${z}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`,{method:`DELETE`});if(!i.ok)throw Error(`Failed to delete memory: ${i.status}`)}async function _r(){let e=await B(`${z}/api/conflicts`);if(!e.ok)throw Error(`Conflicts API error: ${e.status}`);return e.json()}async function vr(e,t,n){let r=await B(`${z}/api/conflicts/resolve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({conflict_id:e,action:t,winner_slug:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Conflict resolution API error: ${r.status}`)}return r.json()}async function yr(e){let t=e||(typeof localStorage<`u`?localStorage.getItem(`total-recall-active-brain`):null)||`global`,n=new URLSearchParams({tag:`openwiki`,limit:`500`}),r=t.split(`,`).map(e=>e.trim()).filter(Boolean);if(r.length===0||r.length===1&&r[0]===`global`){let e=await B(`${z}/api/memory?${n}`);if(!e.ok)throw Error(`OpenWiki nodes error: ${e.status}`);let t=await e.json();return br(Array.isArray(t)?t:t.nodes??[])}let i=r.map(async e=>{try{if(e===`global`){let e=await B(`${z}/api/memory?${n}`);if(!e.ok)return[];let t=await e.json();return Array.isArray(t)?t:t.nodes??[]}let t=await B(`${z}/api/brains/${encodeURIComponent(e)}/nodes`);if(!t.ok){let t=await B(`${z}/api/memory?${n}&brain=${encodeURIComponent(e)}`);if(!t.ok)return[];let r=await t.json();return Array.isArray(r)?r:r.nodes??[]}let r=await t.json();return br(Array.isArray(r)?r:r.nodes??[])}catch{return[]}}),a=await Promise.all(i),o=[],s=new Set,c=a.map((e,t)=>({nodes:e,id:r[t]})).sort((e,t)=>e.id===`global`?1:t.id===`global`?-1:0);for(let{nodes:e}of c)for(let t of br(e))s.has(t.slug)||(s.add(t.slug),o.push(t));return o}function br(e){return e.filter(e=>{let t=(e.tags||[]).map(e=>String(e).toLowerCase()),n=String(e.slug||``).toLowerCase();return t.includes(`openwiki`)||n.startsWith(`openwiki-`)})}async function xr(e,t=5e3){try{let n=await B(`${z}/api/sandbox`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,timeout_ms:t})});if(!n.ok)throw Error(`Sandbox API error: ${n.status}`);let r=await n.json();return{success:r.success,output:r.output||`(no output)`,isError:!r.success}}catch(e){return{success:!1,output:e.message,isError:!0}}}async function Sr(){let e=await B(z+`/api/skills`);if(!e.ok)throw Error(`Skills API error: ${e.status}`);return e.json()}async function Cr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await B(`${z}/api/skills/${encodeURIComponent(e)}${n}`);if(!r.ok)throw Error(`Skill fetch API error: ${r.status}`);return r.json()}async function wr(e,t,n){let r=new URLSearchParams({dir:t});n&&r.set(`repo`,n);let i=await B(`${z}/api/skills/${encodeURIComponent(e)}/files?${r}`);if(!i.ok)throw Error(`Skill files fetch API error: ${i.status}`);return i.json()}async function Tr(e,t,n){let r=n?`?repo=${encodeURIComponent(n)}`:``,i=await B(`${z}/api/skills/${encodeURIComponent(e)}${r}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t,repo:n})});if(!i.ok)throw Error(`Skill save API error: ${i.status}`)}async function Er(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await B(`${z}/api/skills/${encodeURIComponent(e)}${n}`,{method:`DELETE`});if(!r.ok)throw Error(`Skill delete API error: ${r.status}`)}async function Dr(e){let t=await B(`${z}/api/skills/search?${new URLSearchParams({q:e})}`);if(!t.ok)throw Error(`Registry search API error: ${t.status}`);return t.json()}async function Or(e){let t=await B(`${z}/api/skills/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pkg:e})});if(!t.ok)throw Error(`Registry installation API error: ${t.status}`);return t.json()}async function kr(e,t,n){let r=await B(`${z}/api/skills/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,targetRepo:t,enabled:n})});if(!r.ok)throw Error(`API error: ${r.status}`);return r.json()}async function Ar(e,t){let n=await B(`${z}/api/skills/audit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,repoPath:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function jr(){let e=await B(`${z}/api/keys`);if(!e.ok)throw Error(`Keys API error: ${e.status}`);let t=await e.json();return Array.isArray(t)?{keys:t,available_scopes:[`*`]}:t}async function Mr(e,t,n){let r=await B(`${z}/api/keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,scopes:t,expires_at:n||null})});if(!r.ok)throw Error(`Keys API error: ${r.status}`);return r.json()}async function Nr(e){let t=await B(`${z}/api/keys/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Keys API error: ${t.status}`)}async function Pr(){let e=await B(`${z}/api/secrets/scan-env`);if(!e.ok)throw Error(`Env scan failed: ${e.status}`);return e.json()}async function Fr(e){let t=await B(`${z}/api/secrets/parse-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Parse failed: ${t.status}`)}return t.json()}async function Ir(e){let t=await B(`${z}/api/secrets/import-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Import failed: ${t.status}`)}return t.json()}async function Lr(){let e=await B(`${z}/api/secrets`);if(!e.ok)throw Error(`Secrets catalog error: ${e.status}`);return e.json()}async function Rr(e,t){let n=await B(`${z}/api/secrets/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Meta update failed: ${n.status}`)}return n.json()}async function zr(e,t,n={}){let r=await B(`${z}/api/secrets/${encodeURIComponent(e)}/rotate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({value:t,export_env:n.export_env??!0,export_all:n.export_all??!0})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Rotate failed: ${r.status}`)}return r.json()}async function Br(e){let t=await B(`${z}/api/secrets/${encodeURIComponent(e)}`,{method:`DELETE`});if(!t.ok)throw Error(`Delete failed: ${t.status}`)}async function Vr(e){let t=await B(`${z}/api/secrets/usage`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`Usage record failed: ${t.status}`);return t.json()}async function Hr(e){let t=await B(`${z}/api/secrets/export-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`export-env failed: ${t.status}`)}return t.json()}async function Ur(){let e=await B(`${z}/api/secrets/rotation-due/enqueue`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`enqueue failed: ${e.status}`)}return e.json()}async function Wr(e,t){let n=await B(`${z}/api/secrets/${encodeURIComponent(e)}/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({step_up_token:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Reveal failed: ${n.status}`)}return n.json()}async function Gr(){let e=await B(`${z}/api/webauthn/status`);if(!e.ok)throw Error(`WebAuthn status failed: ${e.status}`);return e.json()}async function Kr(){let e=await B(`${z}/api/webauthn/register/options`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`register options failed: ${e.status}`)}return e.json()}async function qr(e,t){let n=await B(`${z}/api/webauthn/register/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({response:e,label:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`register verify failed: ${n.status}`)}return n.json()}async function Jr(){let e=await B(`${z}/api/webauthn/assert/options`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`assert options failed: ${e.status}`)}return e.json()}async function Yr(e){let t=await B(`${z}/api/webauthn/assert/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({response:e,purpose:`secrets:reveal`,ttl_seconds:60})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`assert verify failed: ${t.status}`)}return t.json()}async function Xr(e){let t=await B(`${z}/api/webauthn/step-up/password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:e,purpose:`secrets:reveal`,ttl_seconds:60})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`password step-up failed: ${t.status}`)}return t.json()}async function Zr(e){let t=new URLSearchParams;e&&t.set(`status`,e);let n=await B(`${z}/api/research?${t}`);if(!n.ok)throw Error(`Research API error: ${n.status}`);return n.json()}async function Qr(e,t,n){let r=await B(`${z}/api/research`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({topic:e,priority:t,notes:n})});if(!r.ok)throw Error(`Research API error: ${r.status}`);return r.json()}async function $r(e,t){let n=await B(`${z}/api/research/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(`Research PATCH error: ${n.status}`);return n.json()}async function ei(e){let t=await B(`${z}/api/research/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Research DELETE error: ${t.status}`)}async function ti(){let e=await B(z+`/health`);if(!e.ok)throw Error(`Health API error: ${e.status}`);return e.json()}async function ni(){let e=await B(`${z}/api/usage`);if(!e.ok)throw Error(`Usage API error: ${e.status}`);return e.json()}async function ri(e){let t=await B(`${z}/api/logs/${e}`);if(!t.ok)throw Error(`Logs API error: ${t.status}`);return t.json()}async function ii(){let e=await B(`${z}/api/vault/compile`,{method:`POST`});if(!e.ok)throw Error(`Recompile API error: ${e.status}`);return e.json()}async function ai(){let e=await B(`${z}/api/diagnostics/agents`,{method:`POST`});if(!e.ok)throw Error(`Diagnostics API error: ${e.status}`);return e.json()}async function oi(){return(await B(`${z}/api/brains`)).json()}async function si(){let e=await B(z+`/api/tasks`);if(!e.ok)throw Error(`Tasks API error: ${e.status}`);return e.json()}async function ci(e,t,n,r){let i=await B(z+`/api/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({category:e,target:t,body:n,priority:r})});if(!i.ok)throw Error(`Tasks API error: ${i.status}`);return i.json()}async function li(e){let t=await B(`${z}/api/share`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`Share API error: ${t.status}`);return t.json()}async function ui(){let e=await B(`${z}/api/update/check`);if(!e.ok)throw Error(`Check update API error: ${e.status}`);return e.json()}async function di(){let e=await B(`${z}/api/update/run`,{method:`POST`});if(!e.ok)throw Error(`Run update API error: ${e.status}`);return e.json()}async function fi(){let e=await B(`${z}/api/gemini-models?t=${Date.now()}`);if(!e.ok)throw Error(`Gemini models API error: ${e.status}`);return(await e.json()).models??[]}async function pi(){let e=await B(`${z}/api/claude-models?t=${Date.now()}`);if(!e.ok)throw Error(`Claude models API error: ${e.status}`);return(await e.json()).models??[]}async function mi(){let e=await B(`${z}/api/openai-models?t=${Date.now()}`);if(!e.ok)throw Error(`OpenAI models API error: ${e.status}`);return(await e.json()).models??[]}async function hi(){let e=await B(`${z}/api/openrouter-models?t=${Date.now()}`);if(!e.ok)throw Error(`OpenRouter models API error: ${e.status}`);return(await e.json()).models??[]}async function gi(){let e=await B(`${z}/api/help`);if(!e.ok)throw Error(`Failed to load help topics`);return e.json()}async function _i(e){let t=await B(`${z}/api/help?topic=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Failed to load help content`);return t.json()}async function vi(){let e=await B(`${z}/api/extension/status`);return e.ok?e.json():{available:!1,connected:!1}}async function yi(e=50,t=0){let n=await B(`${z}/api/sessions?${new URLSearchParams({limit:String(e),offset:String(t)})}`);if(!n.ok)throw Error(`Sessions API error: ${n.status}`);return n.json()}async function bi(e){let t=await B(`${z}/api/sessions/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete session: ${t.status}`)}async function xi(e,t){let n=await B(`${z}/api/integrations/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client:e,baseUrl:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Connection error: ${n.status}`)}return n.json()}async function Si(){let e=await B(`${z}/api/integrations/active`,{method:`GET`});if(!e.ok)throw Error(`Integrations API error: ${e.status}`);return e.json()}async function Ci(){let e=await B(`${z}/api/config-json`);if(!e.ok)throw Error(`Config JSON API error: ${e.status}`);return e.json()}async function wi(e){let t=await B(`${z}/api/config-json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`Config JSON API error: ${t.status}`)}var Ti=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})),V=o(((e,t)=>{t.exports=Ti()}))(),Ei={lockup:`/brand/total-recall-lockup.png`,icon:`/brand/total-recall-icon.svg`,badge:`/brand/total-recall-badge.jpg`,mark:`/brand/total-recall-mark.svg`};function Di({variant:e=`lockup`,height:t=40,className:n=``,alt:r=`Total Recall`,plate:i=!1}){let a=e===`icon`||e===`badge`||e===`mark`,o=(0,V.jsx)(`img`,{src:Ei[e],alt:r,height:t,width:a?t:void 0,className:n,style:{height:t,width:a?t:`auto`,maxWidth:`100%`,objectFit:`contain`,display:`block`},draggable:!1});return i?(0,V.jsx)(`div`,{className:`brand-plate`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:e===`lockup`?`10px 14px`:8,borderRadius:e===`lockup`?14:16,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148,163,184,0.25)`},children:o}):o}function Oi({onAuthenticated:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!0),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{async function e(){try{(await nr()).configured||f(!0)}catch{}finally{m(!1)}}e()},[]),(0,v.useEffect)(()=>{h.current?.focus()},[l,d]);async function g(i){if(i.preventDefault(),!s){c(!0),o(``);try{if(d){if(r.length<8){o(`New password must be at least 8 characters`),c(!1);return}let t=await rr(r);if(t.ok){let t=await er(r);t.ok?e():(o(t.error||`Password was set, but automatic sign in failed.`),f(!1))}else o(t.error||`Failed to setup password`)}else if(l){if(r.length<8){o(`New password must be at least 8 characters`),c(!1);return}let t=await tr(r);t.ok?e():o(t.error||`Failed to change password`)}else{let r=await er(t);r.ok?r.requiresPasswordReset?(u(!0),n(``)):e():o(r.error||`Invalid password`)}}catch{o(`Network error — is the server running?`)}finally{c(!1)}}}let _=s||(d||l?!r:!t);return p?(0,V.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,V.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,V.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):(0,V.jsxs)(`div`,{className:`login-shell`,children:[(0,V.jsxs)(`div`,{className:`login-card`,children:[(0,V.jsxs)(`div`,{style:{textAlign:`center`,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:16},children:[l||d?(0,V.jsx)(`div`,{style:{width:56,height:56,borderRadius:16,background:`linear-gradient(135deg, #f59e0b, #d97706)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 12px 32px rgba(245, 158, 11, 0.35)`},children:(0,V.jsxs)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 24 24`,fill:`none`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,V.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}):(0,V.jsx)(`div`,{style:{width:`100%`,maxWidth:280,borderRadius:16,padding:`14px 18px`,background:`linear-gradient(180deg, #f8fafc 0%, #e8eef9 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.75) inset, 0 16px 40px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(148,163,184,0.25)`},children:(0,V.jsx)(Di,{variant:`lockup`,height:56,alt:`Total Recall`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{style:{fontSize:22,fontWeight:700,color:`var(--text-primary)`,margin:0,letterSpacing:`-0.03em`},children:l?`Action Required`:d?`Setup Admin Password`:`Welcome back`}),(0,V.jsx)(`p`,{style:{fontSize:13.5,color:`var(--text-secondary)`,margin:`8px 0 0`,lineHeight:1.5},children:l?`You must change your temporary password to continue.`:d?`Choose a strong password to secure your local memory dashboard.`:`Portable personal memory · any IDE`})]})]}),(0,V.jsxs)(`form`,{onSubmit:g,style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,V.jsx)(`input`,{type:`text`,name:`username`,autoComplete:`username`,style:{display:`none`}}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsx)(`label`,{htmlFor:`login-password`,style:{fontSize:11,fontWeight:600,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.08em`},children:l||d?`New Password`:`Password`}),(0,V.jsx)(`input`,{id:`login-password`,ref:h,type:`password`,value:d||l?r:t,onChange:e=>{d||l?i(e.target.value):n(e.target.value),o(``)},placeholder:d||l?`Minimum 8 characters`:`Enter admin password`,autoComplete:d||l?`new-password`:`current-password`,disabled:s,style:{background:`rgba(7, 11, 20, 0.65)`,border:`1px solid ${a?`rgba(248,113,113,0.55)`:`var(--border)`}`,borderRadius:12,padding:`12px 16px`,color:`var(--text-primary)`,fontSize:14,outline:`none`,transition:`border-color 0.15s, box-shadow 0.15s`,boxShadow:a?`0 0 0 3px rgba(248,113,113,0.12)`:`inset 0 1px 2px rgba(0,0,0,0.25)`},onFocus:e=>{a||(e.currentTarget.style.borderColor=`var(--border-accent)`,e.currentTarget.style.boxShadow=`0 0 0 3px var(--accent-glow)`)},onBlur:e=>{e.currentTarget.style.borderColor=a?`rgba(248,113,113,0.55)`:`var(--border)`,e.currentTarget.style.boxShadow=a?`0 0 0 3px rgba(248,113,113,0.12)`:`inset 0 1px 2px rgba(0,0,0,0.25)`}})]}),a&&(0,V.jsxs)(`div`,{style:{background:`rgba(248,113,113,0.1)`,border:`1px solid rgba(248,113,113,0.3)`,borderRadius:12,padding:`11px 14px`,fontSize:13,color:`#fca5a5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,V.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]}),a]}),(0,V.jsx)(`button`,{id:`login-submit`,type:`submit`,disabled:_,className:_?void 0:`btn btn-primary`,style:{width:`100%`,justifyContent:`center`,padding:`12px 0`,fontSize:14,borderRadius:12,border:`none`,cursor:_?`not-allowed`:`pointer`,background:_?`var(--bg-tertiary)`:void 0,color:_?`var(--text-tertiary)`:void 0,display:`flex`,alignItems:`center`,gap:8},children:s?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),d||l?`Saving…`:`Authenticating…`]}):d?`Create Password & Continue`:l?`Save & Continue`:`Sign In`})]}),!l&&!d&&(0,V.jsxs)(`p`,{style:{textAlign:`center`,fontSize:11,color:`var(--text-tertiary)`,margin:0,lineHeight:1.5},children:[`Local-first vault · credentials in`,` `,(0,V.jsx)(`code`,{style:{color:`#93c5fd`,fontSize:11},children:`~/.agent/config/security.yml`})]})]}),(0,V.jsx)(`style`,{children:`
|
|
12
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
13
|
+
`})]})}function ki(e){if(!e)return[];let t=/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,n=[],r=new Set,i;for(;(i=t.exec(e))!==null;){let e=i[1],t=i[2];r.has(t)||(r.add(t),n.push({text:e,url:t}))}return n}function Ai(e){return e.split(/(\*\*.*?\*\*|`.*?`|\[\[.*?\]\])/g).map((e,t)=>{if(e.startsWith(`**`)&&e.endsWith(`**`))return(0,V.jsx)(`strong`,{style:{color:`var(--text-primary)`,fontWeight:600},children:e.slice(2,-2)},t);if(e.startsWith("`")&&e.endsWith("`"))return(0,V.jsx)(`code`,{style:{background:`var(--bg-elevated)`,padding:`2px 5px`,borderRadius:4,fontFamily:`var(--font-mono)`,fontSize:`11.5px`,color:`#ff79c6`,border:`1px solid var(--border)`},children:e.slice(1,-1)},t);if(e.startsWith(`[[`)&&e.endsWith(`]]`)){let n=e.slice(2,-2),r=n.indexOf(`|`),i=r===-1?n.trim():n.slice(0,r).trim(),a=r===-1?i:n.slice(r+1).trim();return(0,V.jsx)(An,{to:`/memory?slug=${encodeURIComponent(i)}`,style:{color:`var(--accent)`,textDecoration:`none`,fontWeight:500,borderBottom:`1px dashed var(--accent)`,cursor:`pointer`},children:a},t)}return e})}function ji(e){return e?e.split(`
|
|
14
|
+
`).map((e,t)=>{let n=e.trim();if(n.startsWith(`### `))return(0,V.jsx)(`h5`,{style:{margin:`14px 0 6px 0`,color:`var(--success)`,fontSize:13,textTransform:`uppercase`,letterSpacing:`0.05em`,fontWeight:600},children:n.slice(4)},t);if(n.startsWith(`## `))return(0,V.jsx)(`h4`,{style:{margin:`18px 0 8px 0`,color:`var(--accent)`,fontSize:14,fontWeight:600},children:n.slice(3)},t);if(n.startsWith(`# `))return(0,V.jsx)(`h3`,{style:{margin:`22px 0 10px 0`,color:`#fff`,fontSize:16,fontWeight:700},children:n.slice(2)},t);if(n.startsWith(`- `)||n.startsWith(`* `))return(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,margin:`4px 0 4px 12px`,fontSize:13,color:`var(--text-secondary)`},children:[(0,V.jsx)(`span`,{style:{color:`var(--accent)`,userSelect:`none`},children:`•`}),(0,V.jsx)(`span`,{children:Ai(n.slice(2))})]},t);let r=n.match(/^(\d+)\.\s+(.*)$/);return r?(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,margin:`4px 0 4px 12px`,fontSize:13,color:`var(--text-secondary)`},children:[(0,V.jsxs)(`span`,{style:{color:`var(--accent)`,fontWeight:600},children:[r[1],`.`]}),(0,V.jsx)(`span`,{children:Ai(r[2])})]},t):n?(0,V.jsx)(`p`,{style:{margin:`6px 0`,fontSize:13,color:`var(--text-secondary)`,lineHeight:`1.6`},children:Ai(e)},t):(0,V.jsx)(`div`,{style:{height:8}},t)}):null}function H({threads:e,memoryNodes:t,researchItems:n,onOpenThread:r,onGroundMemoryNode:i,selectedGroundingNodes:a,interactive:o=!0}){let s=(0,v.useRef)(null),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(1.2),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)({research:!0,observations:!0,rules:!0,threads:!1}),b=(0,v.useRef)(.3),x=(0,v.useRef)(.5),S=(0,v.useRef)(!1),C=(0,v.useRef)({x:0,y:0}),w=(0,v.useRef)(.002),T=(0,v.useRef)(0),E=(0,v.useMemo)(()=>{let r=[];_.threads&&e.forEach(e=>{r.push({id:`thread-${e.id}`,type:`thread`,title:e.title||`Untitled Thread`,subtitle:`${e.turns} ${e.turns===1?`turn`:`turns`}`,excerpt:`Conversation thread last updated ${new Date(e.lastUpdated).toLocaleDateString()}`,originalData:e,x:0,y:0,z:0})}),t.forEach(e=>{let t=(e.category||`general`).toLowerCase();if([`invariants`,`preferences`,`patterns`,`anti-patterns`].includes(t)){if(!_.rules)return}else if(!_.observations)return;r.push({id:`memory-${e.slug}`,type:`memory`,title:e.title||e.slug,subtitle:`Memory Node • ${e.category||`general`}`,status:e.status||`active`,excerpt:e.excerpt||e.body||`No summary details available.`,originalData:e,x:0,y:0,z:0})}),_.research&&n.forEach(e=>{r.push({id:`research-${e.id}`,type:`research`,title:e.topic,subtitle:`Research Topic • ${e.priority} priority`,status:e.status,excerpt:e.notes||`Research task currently ${e.status}. Created on ${new Date(e.created_at).toLocaleDateString()}`,originalData:e,x:0,y:0,z:0})});let i=r.length;for(let e=0;e<i;e++){let t=Math.acos(1-2*(e+.5)/i),n=Math.PI*(1+Math.sqrt(5))*(e+.5);r[e].x=220*Math.sin(t)*Math.cos(n),r[e].y=220*Math.sin(t)*Math.sin(n),r[e].z=220*Math.cos(t),r[e].type===`thread`?r[e].y+=30:r[e].type===`research`?r[e].x-=30:r[e].z+=20}return r},[e,t,n,_]),D=(0,v.useMemo)(()=>{let e=[];return E.forEach((t,n)=>{if(t.type===`research`){let n=t.originalData;if(n.node_slug){let r=E.find(e=>e.type===`memory`&&e.originalData.slug===n.node_slug);r&&e.push({source:t,target:r,opacity:.8})}}if(t.type===`memory`){let r=t.originalData;if(Array.isArray(r.related)&&r.related.forEach(n=>{let r=E.find(e=>e.type===`memory`&&e.originalData.slug===n);r&&e.push({source:t,target:r,opacity:.7,color:`rgba(96, 165, 250, 0.55)`})}),Array.isArray(r.contradicts)&&r.contradicts.forEach(n=>{let r=E.find(e=>e.type===`memory`&&e.originalData.slug===n);r&&e.push({source:t,target:r,opacity:.9,color:`rgba(239, 68, 68, 0.7)`})}),Array.isArray(r.supersedes)&&r.supersedes.forEach(n=>{let r=E.find(e=>e.type===`memory`&&e.originalData.slug===n);r&&e.push({source:t,target:r,opacity:.8,color:`rgba(245, 158, 11, 0.6)`,dashPattern:[3,3]})}),!r.related?.length&&!r.contradicts?.length&&!r.supersedes?.length){let i=0;for(let a=n+1;a<E.length;a++){let n=E[a];if(n.type===`memory`&&i<2){let a=n.originalData;r.category&&r.category===a.category&&(e.push({source:t,target:n,opacity:.4}),i++)}}}}if(t.type===`thread`){let n=0;for(let r=0;r<E.length;r++){let i=E[r];i.type===`memory`&&n<1&&(e.push({source:t,target:i,opacity:.35}),n++)}}}),e},[E]);(0,v.useEffect)(()=>{let e=c.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;let n,r=()=>{let n=s.current?.getBoundingClientRect();e.width=(n?.width||window.innerWidth)*window.devicePixelRatio,e.height=(n?.height||window.innerHeight)*window.devicePixelRatio,e.style.width=`100%`,e.style.height=`100%`,t.scale(window.devicePixelRatio,window.devicePixelRatio)};r(),window.addEventListener(`resize`,r);let i=()=>{let r=e.width/window.devicePixelRatio,o=e.height/window.devicePixelRatio;t.clearRect(0,0,r,o);let s=r/2,c=o/2;S.current||(x.current+=w.current,b.current+=T.current,w.current*=.98,T.current*=.98,Math.abs(w.current)<.001&&(w.current=.0015));let u=Math.cos(b.current),f=Math.sin(b.current),m=Math.cos(x.current),h=Math.sin(x.current);E.forEach(e=>{let t=e.x*m+e.z*h,n=-e.x*h+e.z*m,r=e.y*u-n*f,i=e.y*f+n*u,a=400/(400+i);e.px=s+t*a*l,e.py=c+r*a*l,e.pz=i,e.scale=a});let g=[...E].sort((e,t)=>(t.pz||0)-(e.pz||0));t.lineWidth=1,D.forEach(e=>{let{source:n,target:r,opacity:i,color:a,dashPattern:o}=e;if(n.px===void 0||n.py===void 0||r.px===void 0||r.py===void 0)return;let s=((n.pz||0)+(r.pz||0))/2,c=Math.max(.1,Math.min(1,1-(s+200)/500)),l=p?.id===n.id||p?.id===r.id||d?.id===n.id||d?.id===r.id;t.beginPath(),t.moveTo(n.px,n.py),t.lineTo(r.px,r.py),o?t.setLineDash(o):t.setLineDash([]),l?(t.strokeStyle=a||(n.type===`memory`?`rgba(96, 165, 250, 0.55)`:n.type===`thread`?`rgba(34, 211, 238, 0.55)`:`rgba(251, 191, 36, 0.55)`),t.lineWidth=1.8):(t.strokeStyle=a?a.replace(/[\d.]+\)$/,`${i*.4*c})`):`rgba(100, 116, 139, ${i*.25*c})`,t.lineWidth=.8),t.stroke(),t.setLineDash([])}),g.forEach(e=>{if(e.px===void 0||e.py===void 0||e.scale===void 0)return;let n=e.type===`memory`&&e.originalData.confidence!==void 0?Math.max(.4,e.originalData.confidence):1,r=Math.max(4,Math.min(22,10*e.scale*l*n)),i=p?.id===e.id,o=d?.id===e.id,s=e.type===`memory`&&a.includes(e.originalData.slug),c=t.createRadialGradient(e.px,e.py,r*.1,e.px,e.py,r*(i||o?2.5:1.5)),u=`#60a5fa`,f=`rgba(96, 165, 250, 0.28)`;if(e.type===`memory`){let t=(e.originalData.category||`general`).toLowerCase(),n={invariants:[`#38bdf8`,`rgba(56, 189, 248, 0.3)`],preferences:[`#818cf8`,`rgba(129, 140, 248, 0.28)`],patterns:[`#34d399`,`rgba(52, 211, 153, 0.28)`],"anti-patterns":[`#f87171`,`rgba(248, 113, 113, 0.28)`],facts:[`#60a5fa`,`rgba(96, 165, 250, 0.28)`],concepts:[`#a78bfa`,`rgba(167, 139, 250, 0.28)`],decisions:[`#fbbf24`,`rgba(251, 191, 36, 0.28)`],lore:[`#c084fc`,`rgba(192, 132, 252, 0.25)`],corrections:[`#fb923c`,`rgba(251, 146, 60, 0.28)`]}[t];n?(u=n[0],f=n[1]):[`invariants`,`preferences`,`patterns`,`anti-patterns`].includes(t)&&(u=`#818cf8`,f=`rgba(129, 140, 248, 0.28)`)}else e.type===`thread`?(u=`#22d3ee`,f=`rgba(34, 211, 238, 0.28)`):e.type===`research`&&(u=`#fbbf24`,f=`rgba(251, 191, 36, 0.28)`);if(c.addColorStop(0,u),c.addColorStop(.4,u),c.addColorStop(1,f),t.globalAlpha=Math.max(.2,Math.min(1,1-(e.pz||200)/450))*(e.type===`memory`&&e.originalData.confidence!==void 0?Math.max(.35,e.originalData.confidence):1),t.beginPath(),t.arc(e.px,e.py,r*(i||o?2.5:1.5),0,Math.PI*2),t.fillStyle=c,t.fill(),t.beginPath(),t.arc(e.px,e.py,r*.7,0,Math.PI*2),t.fillStyle=i||o?`#ffffff`:u,t.fill(),(o||s)&&(t.beginPath(),t.arc(e.px,e.py,r*1.5,0,Math.PI*2),t.strokeStyle=`#ffffff`,t.lineWidth=1.5,t.stroke()),t.globalAlpha=1,i||o||e.scale>1.15&&e.pz&&e.pz<-100){t.font=i||o?`bold 12px var(--font-sans, system-ui)`:`10px var(--font-sans, system-ui)`,t.fillStyle=i||o?`#ffffff`:`rgba(255, 255, 255, 0.75)`,t.shadowColor=`rgba(0, 0, 0, 0.9)`,t.shadowBlur=4;let n=e.title.length>28?e.title.substring(0,26)+`...`:e.title;t.fillText(n,e.px+r*1.6,e.py+r*.4),(i||o)&&(t.font=`9px var(--font-sans, system-ui)`,t.fillStyle=`rgba(255, 255, 255, 0.55)`,t.fillText(e.subtitle,e.px+r*1.6,e.py+r*.4+14)),t.shadowBlur=0}}),n=requestAnimationFrame(i)};return i(),()=>{cancelAnimationFrame(n),window.removeEventListener(`resize`,r)}},[E,D,l,p,d,a]);let O=(e,t)=>{S.current=!0,g(!0),C.current={x:e,y:t},w.current=0,T.current=0},k=(e,t)=>{if(!S.current)return;let n=e-C.current.x,r=t-C.current.y;x.current+=n*.006,b.current+=r*.006,w.current=n*.005,T.current=r*.005,C.current={x:e,y:t}},A=()=>{S.current=!1,g(!1)};return(0,V.jsxs)(`div`,{className:`graph-3d-wrapper`,ref:s,style:{position:`relative`,width:`100%`,height:`100%`,background:`radial-gradient(ellipse at 50% 40%, #0c1a33 0%, #070b14 55%, #030712 100%)`,overflow:`hidden`,isolation:`isolate`},children:[(0,V.jsx)(`canvas`,{ref:c,onMouseDown:o?e=>O(e.clientX,e.clientY):void 0,onMouseMove:o?e=>{let t=c.current;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;if(S.current){k(e.clientX,e.clientY);return}let a=null,o=22;E.forEach(e=>{if(e.px===void 0||e.py===void 0)return;let t=Math.hypot(e.px-r,e.py-i);t<o&&(o=t,a=e)}),m(a)}:void 0,onMouseUp:o?A:void 0,onMouseLeave:o?A:void 0,onClick:o?()=>{S.current&&(Math.abs(w.current)>.02||Math.abs(T.current)>.02)||f(p)}:void 0,onWheel:o?e=>{e.preventDefault();let t=e.deltaY*-.001;u(e=>Math.max(.5,Math.min(3,e+t)))}:void 0,onTouchStart:o?e=>{if(e.touches.length===1){let t=e.touches[0];O(t.clientX,t.clientY)}}:void 0,onTouchMove:o?e=>{if(e.touches.length===1){let t=e.touches[0];S.current&&k(t.clientX,t.clientY);let n=c.current;if(!n)return;let r=n.getBoundingClientRect(),i=t.clientX-r.left,a=t.clientY-r.top,o=null,s=30;E.forEach(e=>{if(e.px===void 0||e.py===void 0)return;let t=Math.hypot(e.px-i,e.py-a);t<s&&(s=t,o=e)}),m(o)}}:void 0,onTouchEnd:o?A:void 0,style:{position:`absolute`,inset:0,zIndex:1,width:`100%`,height:`100%`,display:`block`,pointerEvents:o?`auto`:`none`,cursor:o?h?`grabbing`:p?`pointer`:`grab`:`default`}}),(0,V.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:2,pointerEvents:`none`,background:`radial-gradient(circle at 50% 45%, rgba(59, 130, 246, 0.08) 0%, transparent 55%)`}}),(0,V.jsxs)(`div`,{style:{position:`absolute`,top:16,left:16,zIndex:30,display:`flex`,flexDirection:`column`,gap:6,pointerEvents:`none`,maxWidth:280},children:[(0,V.jsx)(`h3`,{style:{margin:0,fontSize:18,color:`#f1f5f9`,fontWeight:700,letterSpacing:`-0.02em`},children:`Memory Constellation`}),(0,V.jsx)(`p`,{style:{margin:0,fontSize:11,color:`rgba(148,163,184,0.85)`},children:`Vault · sessions · research — use filters to toggle types`})]}),o&&(0,V.jsxs)(`div`,{style:{position:`absolute`,bottom:20,left:20,zIndex:40,display:`flex`,gap:8,pointerEvents:`auto`},children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>u(e=>Math.min(3,e+.2)),style:{width:32,height:32,background:`rgba(15,23,42,0.85)`,border:`1px solid rgba(255,255,255,0.15)`,borderRadius:8,color:`#fff`,fontSize:16,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},title:`Zoom In`,children:`+`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>u(e=>Math.max(.5,e-.2)),style:{width:32,height:32,background:`rgba(15,23,42,0.85)`,border:`1px solid rgba(255,255,255,0.15)`,borderRadius:8,color:`#fff`,fontSize:16,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},title:`Zoom Out`,children:`-`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{b.current=.3,x.current=.5,u(1.2)},style:{width:32,height:32,background:`rgba(15,23,42,0.85)`,border:`1px solid rgba(255,255,255,0.15)`,borderRadius:8,color:`#fff`,fontSize:11,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},title:`Reset Camera`,children:`⟲`})]}),o&&(0,V.jsxs)(`div`,{className:`glass graph-type-filters`,style:{position:`absolute`,top:72,left:16,display:`flex`,flexDirection:`column`,gap:10,background:`rgba(10, 15, 30, 0.92)`,backdropFilter:`blur(20px)`,WebkitBackdropFilter:`blur(20px)`,padding:`12px 16px`,borderRadius:12,border:`1px solid rgba(255, 255, 255, 0.12)`,boxShadow:`0 8px 32px rgba(0,0,0,0.45)`,width:220,zIndex:60,pointerEvents:`auto`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsx)(`span`,{style:{fontSize:9,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:1},children:`Constellation Filters`}),(0,V.jsxs)(`span`,{style:{fontSize:9,background:`rgba(255,255,255,0.08)`,padding:`1px 5px`,borderRadius:4,color:`var(--text-secondary)`},children:[E.length,` visible`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_.research,onChange:()=>y(e=>({...e,research:!e.research})),style:{accentColor:`#fbbf24`,cursor:`pointer`}}),(0,V.jsx)(`span`,{style:{display:`inline-block`,width:6,height:6,borderRadius:`50%`,background:`#fbbf24`,boxShadow:`0 0 6px rgba(251,191,36,0.5)`}}),(0,V.jsx)(`span`,{style:{flex:1},children:`Research`}),(0,V.jsxs)(`span`,{style:{fontSize:9,color:`var(--text-tertiary)`},children:[`(`,n.length,`)`]})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_.observations,onChange:()=>y(e=>({...e,observations:!e.observations})),style:{accentColor:`#60a5fa`,cursor:`pointer`}}),(0,V.jsx)(`span`,{style:{display:`inline-block`,width:6,height:6,borderRadius:`50%`,background:`#60a5fa`,boxShadow:`0 0 6px rgba(96,165,250,0.5)`}}),(0,V.jsx)(`span`,{style:{flex:1},children:`Memory`}),(0,V.jsxs)(`span`,{style:{fontSize:9,color:`var(--text-tertiary)`},children:[`(`,t.filter(e=>![`invariants`,`preferences`,`patterns`,`anti-patterns`].includes((e.category||`general`).toLowerCase())).length,`)`]})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_.rules,onChange:()=>y(e=>({...e,rules:!e.rules})),style:{accentColor:`#38bdf8`,cursor:`pointer`}}),(0,V.jsx)(`span`,{style:{display:`inline-block`,width:6,height:6,borderRadius:`50%`,background:`linear-gradient(90deg,#38bdf8,#f87171)`,boxShadow:`0 0 6px rgba(56,189,248,0.4)`}}),(0,V.jsx)(`span`,{style:{flex:1},children:`Rules`}),(0,V.jsxs)(`span`,{style:{fontSize:9,color:`var(--text-tertiary)`},children:[`(`,t.filter(e=>[`invariants`,`preferences`,`patterns`,`anti-patterns`].includes((e.category||`general`).toLowerCase())).length,`)`]})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_.threads,onChange:()=>y(e=>({...e,threads:!e.threads})),style:{accentColor:`#22d3ee`,cursor:`pointer`}}),(0,V.jsx)(`span`,{style:{display:`inline-block`,width:6,height:6,borderRadius:`50%`,background:`#22d3ee`,boxShadow:`0 0 6px rgba(34,211,238,0.5)`}}),(0,V.jsx)(`span`,{style:{flex:1},children:`Sessions`}),(0,V.jsxs)(`span`,{style:{fontSize:9,color:`var(--text-tertiary)`},children:[`(`,e.length,`)`]})]})]})]}),d&&(0,V.jsxs)(`div`,{className:`node-detail-drawer animate-slide-in`,children:[(0,V.jsxs)(`div`,{className:`drawer-header`,children:[(0,V.jsx)(`span`,{className:`drawer-badge badge-${d.type}`,children:d.type===`memory`?`🧠 Knowledge`:d.type===`thread`?`💬 Thread`:`🕵️ Research`}),(0,V.jsx)(`button`,{className:`drawer-close-btn`,onClick:()=>f(null),children:`×`})]}),(0,V.jsxs)(`div`,{className:`drawer-body`,children:[(0,V.jsx)(`h4`,{className:`drawer-title`,children:d.title}),(0,V.jsx)(`span`,{className:`drawer-subtitle`,children:d.subtitle}),d.type===`memory`&&(0,V.jsxs)(`div`,{className:`drawer-meta-grid`,style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`8px`,margin:`12px 0`,fontSize:`11px`,background:`rgba(255,255,255,0.03)`,padding:`8px`,borderRadius:`6px`,border:`1px solid rgba(255,255,255,0.05)`},children:[d.originalData.confidence!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`},children:`Confidence:`}),` `,(0,V.jsxs)(`strong`,{style:{color:d.originalData.confidence>.7?`#22c55e`:`#f59e0b`},children:[Math.round(d.originalData.confidence*100),`%`]})]}),d.originalData.importance!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`},children:`Importance:`}),` `,(0,V.jsxs)(`strong`,{style:{color:`#a78bfa`},children:[`★ `,d.originalData.importance,`/5`]})]}),d.status&&(0,V.jsxs)(`div`,{style:{gridColumn:`span 2`},children:[(0,V.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`},children:`Status:`}),` `,(0,V.jsx)(`span`,{className:`value status-${d.status.toLowerCase().replace(/_/g,`-`)}`,style:{fontSize:`10px`,padding:`2px 6px`,borderRadius:`10px`,background:`rgba(255,255,255,0.08)`,textTransform:`uppercase`},children:d.status})]})]}),d.type===`memory`&&(d.originalData.related?.length||d.originalData.contradicts?.length||d.originalData.supersedes?.length)&&(0,V.jsxs)(`div`,{className:`drawer-relations`,style:{fontSize:`11px`,margin:`12px 0`},children:[(0,V.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`,display:`block`,marginBottom:`4px`},children:`Ontology Relations:`}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:`4px`},children:[d.originalData.related?.map(e=>(0,V.jsxs)(`span`,{style:{color:`#a78bfa`,background:`rgba(139,92,246,0.1)`,padding:`1px 6px`,borderRadius:`4px`},children:[`🔗 `,e]},e)),d.originalData.contradicts?.map(e=>(0,V.jsxs)(`span`,{style:{color:`#ef4444`,background:`rgba(239,68,68,0.1)`,padding:`1px 6px`,borderRadius:`4px`},children:[`⚠️ contradicts: `,e]},e)),d.originalData.supersedes?.map(e=>(0,V.jsxs)(`span`,{style:{color:`#f59e0b`,background:`rgba(245,158,11,0.1)`,padding:`1px 6px`,borderRadius:`4px`},children:[`✓ supersedes: `,e]},e))]})]}),d.type===`memory`?(0,V.jsx)(`div`,{className:`drawer-markdown-content`,style:{marginTop:12,borderTop:`1px solid rgba(255,255,255,0.06)`,paddingTop:12,fontSize:`13px`,color:`var(--text-secondary)`,lineHeight:`1.6`},children:ji(d.originalData.content||d.originalData.body||d.excerpt||`No content details available.`)}):(0,V.jsx)(`p`,{className:`drawer-excerpt`,style:{whiteSpace:`pre-wrap`},children:d.excerpt})]}),(0,V.jsxs)(`div`,{className:`drawer-footer`,children:[d.type===`thread`&&(0,V.jsx)(`button`,{className:`drawer-action-btn btn-cyan`,onClick:()=>{r(d.originalData.id),f(null)},children:`Open Thread`}),d.type===`memory`&&(0,V.jsx)(`button`,{className:`drawer-action-btn btn-purple`,onClick:()=>{i(d.originalData.slug)},children:a.includes(d.originalData.slug)?`Remove Grounding Context`:`Ground Chat with Node`}),d.type===`research`&&(0,V.jsx)(`div`,{style:{width:`100%`,fontSize:11,color:`rgba(255,255,255,0.4)`,textAlign:`center`,fontStyle:`italic`,padding:`8px 0`},children:`Background intelligence agent running...`})]})]})]})}function Mi({onTranscript:e,isRecording:t=!1}){let[n,r]=(0,v.useState)(t),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{if(typeof window<`u`){let t=window.SpeechRecognition||window.webkitSpeechRecognition;t?(i.current=new t,i.current.continuous=!1,i.current.interimResults=!1,i.current.onresult=t=>{let n=t.results[0][0].transcript;e(n),r(!1)},i.current.onerror=()=>{r(!1)},i.current.onend=()=>{r(!1)}):o(!1)}},[e]),a?(0,V.jsx)(`button`,{onClick:()=>{a&&(n?(i.current?.stop(),r(!1)):(i.current?.start(),r(!0)))},className:`p-2 rounded-full transition-colors ${n?`bg-red-500 text-white animate-pulse`:`bg-blue-500 text-white hover:bg-blue-600`}`,title:n?`Stop recording`:`Start voice input`,children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,V.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,V.jsx)(`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`})]})}):(0,V.jsx)(`button`,{disabled:!0,className:`p-2 bg-gray-200 text-gray-500 rounded-full`,title:`Voice input not supported`,children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,V.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,V.jsx)(`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`})]})})}var Ni=0;function Pi(){return Date.now()}function Fi(e){let t=Pi()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Ii({activeBrainId:e,onBrainChange:t}){let n=ut(),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(()=>localStorage.getItem(`tr-ext-banner-dismissed`)===`true`),[A,j]=(0,v.useState)([]),[M,N]=(0,v.useState)(void 0),[P,F]=(0,v.useState)([]),[I,L]=(0,v.useState)([]),[ee,te]=(0,v.useState)([]),[ne,re]=(0,v.useState)(!1),[ie,R]=(0,v.useState)(``),ae=(0,v.useRef)(null),[oe,se]=(0,v.useState)([]),[ce,le]=(0,v.useState)(()=>{let e=localStorage.getItem(`selectedModel`);return e&&e!==`gemini`?e:`antigravity`}),[ue,de]=(0,v.useState)(()=>localStorage.getItem(`selectedSubModel`)||``),[fe,pe]=(0,v.useState)([]),[me,he]=(0,v.useState)(!1),ge=(0,v.useRef)(null),_e=(0,v.useCallback)(()=>{l.current?.scrollIntoView({behavior:`smooth`})},[]);(0,v.useEffect)(_e,[r,_e]);let ve=(0,v.useCallback)(()=>{sr().then(e=>{j(e)}).catch(console.error),Zr().then(e=>te(e.items||[])).catch(console.error)},[]);(0,v.useEffect)(()=>{sr().then(e=>{j(e),e.length>0&&(N(e[0].id),e[0].brainId&&t&&t(e[0].brainId))}).catch(console.error),Zr().then(e=>te(e.items||[])).catch(console.error),ti().then(e=>{let t=e.cli_agents&&e.cli_agents.length>0?e.cli_agents:[`antigravity`,`grok`,`claude`,`codex`];se(t);let n=localStorage.getItem(`selectedModel`);if(n&&t.includes(n))le(n);else{let e=t.includes(`antigravity`)?`antigravity`:t.includes(`grok`)?`grok`:t[0];le(e),localStorage.setItem(`selectedModel`,e)}}).catch(()=>{let e=[`antigravity`,`grok`,`claude`,`codex`];se(e);let t=localStorage.getItem(`selectedModel`);t&&e.includes(t)?le(t):(le(`antigravity`),localStorage.setItem(`selectedModel`,`antigravity`))}),fi().then(e=>{if(pe(e),e&&e.length>0){let t=localStorage.getItem(`selectedSubModel`),n=e.some(e=>e.id===t);t&&n?de(t):(de(e[0].id),localStorage.setItem(`selectedSubModel`,e[0].id))}}).catch(console.error)},[]),(0,v.useEffect)(()=>{let e=!0,t=()=>{ui().then(t=>{e&&y(t)}).catch(console.error)};t();let n=setInterval(t,36e5);return()=>{e=!1,clearInterval(n)}},[]),(0,v.useEffect)(()=>{let t=!0,n=()=>{dr(e).then(e=>{t&&(L(e),F(t=>t.filter(t=>e.some(e=>e.slug===t))))}).catch(console.error)};n();let r=new EventSource(`http://localhost:9111/stream`);return r.onmessage=e=>{if(t)try{let t=JSON.parse(e.data);(t.sender===`conflict-detector`||t.sender===`memory-ingestion`||t.message?.includes(`Surface compilation`)||t.message?.includes(`Brain embeddings rebuilt`)||t.message?.includes(`Graph indices rebuilt`)||t.message?.includes(`deleted`))&&n()}catch{}},()=>{t=!1,r.close()}},[e]),(0,v.useEffect)(()=>{function e(e){ae.current&&!ae.current.contains(e.target)&&re(!1),ge.current&&!ge.current.contains(e.target)&&he(!1)}return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[ae,ge]),(0,v.useEffect)(()=>{or(M).then(e=>{e?(i(e),Ni=Math.max(Ni,e.length+1)):i([])}).catch(e=>{console.error(e),i([])})},[M]),(0,v.useEffect)(()=>{!p||h!==null||lr().then(e=>g(e.enabled)).catch(()=>g(!1))},[p,h]),(0,v.useEffect)(()=>{O||vi().then(D).catch(()=>{})},[O]);let ye=e=>{if(!(`speechSynthesis`in window))return;window.speechSynthesis.cancel();let t=new SpeechSynthesisUtterance(e);t.rate=1.05,t.pitch=.95,window.speechSynthesis.speak(t)},be=async e=>{if(!(!p||!e.trim())){if(h===!1){ye(e);return}try{let t=await ur(e);if(!t){g(!1),ye(e);return}let n=URL.createObjectURL(t);f.current&&(f.current.pause(),URL.revokeObjectURL(f.current.src));let r=new Audio(n);f.current=r,r.onended=()=>URL.revokeObjectURL(n),r.play().catch(()=>ye(e))}catch{ye(e)}}},xe=()=>{N(`thread-${Pi()}`),i([]),o(``),F([]),u.current&&(u.current.style.height=`44px`)},Se=async(e,t)=>{if(e.stopPropagation(),confirm(`Are you sure you want to delete this conversation thread?`))try{if(await cr(t),M===t){let e=A.filter(e=>e.id!==t);e.length>0?N(e[0].id):(N(void 0),i([]))}ve()}catch(e){console.error(`Failed to delete thread:`,e)}},Ce=async()=>{let t=a.trim();if(!t||s)return;let n=M||`thread-${Pi()}`;M||N(n);let l={id:String(++Ni),role:`user`,content:t,timestamp:Pi()};i(e=>[...e,l]),o(``),c(!0),d.current=new AbortController,u.current&&(u.current.style.height=`44px`);try{if(b){i(e=>[...e,{id:String(++Ni),role:`assistant`,content:`🕵️ **Deep Research Agents dispatched.** Gathering facts across parallel web streams...`,timestamp:Pi()}]);let{slug:e}=await ci(`proactive-research`,t,t),n=!1;for(;!n;){await new Promise(e=>setTimeout(e,2e3));let t=(await si()).find(t=>t.slug===e);t&&(t.status===`completed`||t.status===`failed`)&&(n=!0,i(e=>e.filter(e=>e.content!==`🕵️ **Deep Research Agents dispatched.** Gathering facts across parallel web streams...`)),i(e=>[...e,{id:String(++Ni),role:`assistant`,content:t.body||``,timestamp:Pi()}]),be(t.body||``))}c(!1);return}let a=[`gemini`,`antigravity`].includes(ce)&&ue?`${ce}:${ue}`:ce,o=await ar([...r,l].map(e=>({role:e.role,content:e.content})),d.current.signal,n,P,a,e),s={id:String(++Ni),role:`assistant`,content:o,timestamp:Pi(),versions:[o],currentVersionIndex:0};i(e=>[...e,s]),be(o),ve()}catch(e){if(e.name===`AbortError`)i(e=>[...e,{id:String(++Ni),role:`assistant`,content:`⛔ Generation stopped by user.`,timestamp:Pi(),versions:[`⛔ Generation stopped by user.`],currentVersionIndex:0}]);else{let t={id:String(++Ni),role:`assistant`,content:`⚠️ Error: ${e.message}`,timestamp:Pi(),versions:[`⚠️ Error: ${e.message}`],currentVersionIndex:0};i(e=>[...e,t])}}finally{c(!1),d.current=null}},we=async t=>{if(s)return;let n=r.slice(0,t).map(e=>({role:e.role,content:e.content}));c(!0),d.current=new AbortController;try{let r=[`gemini`,`antigravity`].includes(ce)&&ue?`${ce}:${ue}`:ce,a=await ar(n,d.current.signal,M,void 0,r,e);i(e=>{let n=[...e],r=n[t],i=r.versions||[r.content];return i.push(a),r.versions=i,r.currentVersionIndex=i.length-1,r.content=a,n}),be(a),ve()}catch(e){e.name!==`AbortError`&&console.error(e)}finally{c(!1),d.current=null}},Te=e=>{navigator.clipboard.writeText(e).catch(console.error)},Ee=(e,t)=>{i(n=>{let r=[...n],i=r[e];if(!i.versions)return n;let a=Math.max(0,Math.min(i.versions.length-1,(i.currentVersionIndex||0)+t));return i.currentVersionIndex=a,i.content=i.versions[a],r})},De=()=>{d.current&&(d.current.abort(),d.current=null,c(!1))},Oe=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ce())},ke=e=>{let t=e.target.value;o(t);let n=e.target;n.style.height=`44px`,n.style.height=Math.min(n.scrollHeight,160)+`px`;let r=t.match(/https?:\/\/[^\s]+/);C(r?r[0]:null)},Ae=async e=>{if(S)try{await li({url:S,action:e}),T(`✅ URL sent to ${e}`),C(null),setTimeout(()=>T(null),3e3)}catch(e){console.error(`Share API error:`,e),T(`⚠️ Failed to process URL`),setTimeout(()=>T(null),3e3)}},je=I.filter(e=>e.title.toLowerCase().includes(ie.toLowerCase())||e.slug.toLowerCase().includes(ie.toLowerCase())||e.category&&e.category.toLowerCase().includes(ie.toLowerCase()));return(0,V.jsxs)(`div`,{className:`chat-layout`,children:[(0,V.jsxs)(`aside`,{className:`chat-threads-sidebar`,children:[(0,V.jsx)(`div`,{className:`sidebar-header`,children:(0,V.jsxs)(`button`,{className:`new-chat-btn`,onClick:xe,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{marginRight:6},children:[(0,V.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,V.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}),`New Chat`]})}),(0,V.jsx)(`div`,{className:`thread-list`,children:A.map(e=>(0,V.jsxs)(`div`,{className:`thread-item ${M===e.id?`active`:``}`,onClick:()=>{N(e.id),e.brainId&&t&&t(e.brainId)},children:[(0,V.jsxs)(`div`,{className:`thread-info`,children:[(0,V.jsx)(`div`,{className:`thread-title`,title:e.title,children:e.title}),(0,V.jsxs)(`div`,{className:`thread-meta`,children:[(0,V.jsxs)(`span`,{children:[e.turns,` `,e.turns===1?`turn`:`turns`]}),(0,V.jsx)(`span`,{children:`•`}),(0,V.jsx)(`span`,{children:Fi(e.lastUpdated)})]})]}),(0,V.jsx)(`button`,{className:`thread-delete-btn`,onClick:t=>Se(t,e.id),title:`Delete chat thread`,children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,V.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,V.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,V.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]},e.id))})]}),(0,V.jsxs)(`div`,{className:`chat-container`,style:{position:`relative`,overflow:`hidden`},children:[(0,V.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:`none`,opacity:r.length>0?.22:.55,transition:`opacity 0.3s ease`},children:(0,V.jsx)(H,{threads:A,memoryNodes:I,researchItems:ee,onOpenThread:()=>{},onGroundMemoryNode:()=>{},selectedGroundingNodes:P,interactive:!1})}),(0,V.jsxs)(`header`,{className:`chat-header animate-fade-in`,style:{position:`relative`,zIndex:40,overflow:`visible`},children:[(0,V.jsxs)(`div`,{className:`chat-header-title`,children:[(0,V.jsx)(`h2`,{children:`Chat Session`}),M&&(0,V.jsx)(`span`,{className:`badge badge-accent`,style:{textTransform:`none`,letterSpacing:`normal`,fontSize:`11px`,padding:`2px 8px`},children:M})]}),(0,V.jsxs)(`div`,{className:`chat-header-model-selector`,ref:ge,style:{position:`relative`,zIndex:50},children:[(0,V.jsx)(`span`,{className:`selector-label`,children:`Model / provider:`}),(0,V.jsxs)(`div`,{className:`model-selector-dropdown-wrapper`,style:{position:`relative`,zIndex:50},children:[(0,V.jsxs)(`button`,{type:`button`,className:`model-selector-dropdown-btn ${me?`active`:``}`,onClick:e=>{e.stopPropagation(),he(e=>!e)},title:`Select CLI agent / provider`,children:[(0,V.jsx)(`span`,{style:{textTransform:`capitalize`},children:ce||`Select Model`}),(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),me&&(0,V.jsx)(`div`,{className:`model-selector-menu glass`,style:{zIndex:200,pointerEvents:`auto`},role:`listbox`,children:oe.map(e=>(0,V.jsxs)(`div`,{role:`option`,"aria-selected":ce===e,className:`model-selector-item ${ce===e?`selected`:``}`,onClick:t=>{t.stopPropagation(),le(e),localStorage.setItem(`selectedModel`,e),de(``),localStorage.removeItem(`selectedSubModel`),he(!1)},children:[(0,V.jsxs)(`div`,{className:`model-selector-item-info`,children:[(0,V.jsx)(`span`,{className:`model-selector-item-name`,style:{textTransform:`capitalize`},children:e}),(0,V.jsxs)(`span`,{className:`model-selector-item-desc`,children:[e===`antigravity`&&`Google Antigravity`,e===`grok`&&`xAI Grok Build CLI`,e===`gemini`&&`Google Gemini CLI`,e===`claude`&&`Anthropic Claude CLI`,e===`codex`&&`Codex Coding Agent`]})]}),(0,V.jsx)(`span`,{className:`model-selector-item-badge`,children:`CLI`})]},e))})]}),[`gemini`,`antigravity`].includes(ce)&&fe.length>0&&(0,V.jsxs)(`div`,{className:`chat-header-submodel-selector`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,V.jsx)(`span`,{className:`selector-label`,style:{fontSize:`12px`,color:`var(--text-tertiary)`,fontWeight:500},children:`Base:`}),(0,V.jsx)(`select`,{value:ue,onChange:e=>{de(e.target.value),localStorage.setItem(`selectedSubModel`,e.target.value)},className:`submodel-select`,style:{background:`rgba(255, 255, 255, 0.04)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-sm)`,color:`var(--text-secondary)`,padding:`6px 12px`,fontSize:`13px`,fontWeight:500,outline:`none`,cursor:`pointer`,transition:`all var(--transition-fast)`},children:fe.map(e=>(0,V.jsx)(`option`,{value:e.id,style:{background:`#12121a`,color:`var(--text-secondary)`},children:e.displayName},e.id))})]})]})]}),_?.updateAvailable&&(0,V.jsxs)(`div`,{className:`animate-fade-in`,style:{margin:`0 16px 12px`,padding:`12px 16px`,background:`linear-gradient(135deg, rgba(63, 185, 80, 0.12), rgba(34, 197, 94, 0.12))`,border:`1px solid rgba(63, 185, 80, 0.3)`,borderRadius:10,display:`flex`,alignItems:`center`,gap:12},children:[(0,V.jsx)(`span`,{style:{fontSize:22,flexShrink:0},children:`🚀`}),(0,V.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,V.jsx)(`div`,{style:{fontWeight:600,fontSize:13,color:`var(--text-primary)`,marginBottom:2},children:`System Update Available`}),(0,V.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-secondary)`},children:[`Version `,_.latestVersion,` is available. Upgrade to load the latest features.`]})]}),(0,V.jsx)(`button`,{onClick:()=>n(`/health`),style:{flexShrink:0,padding:`6px 14px`,background:`#3fb950`,color:`#fff`,border:`none`,borderRadius:6,fontWeight:600,fontSize:12,cursor:`pointer`,whiteSpace:`nowrap`},children:`Go to Update`})]}),E?.available&&!E.connected&&!O&&(0,V.jsxs)(`div`,{style:{margin:`0 16px 0`,padding:`12px 16px`,background:`linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(99, 179, 237, 0.12))`,border:`1px solid rgba(108, 92, 231, 0.3)`,borderRadius:10,display:`flex`,alignItems:`center`,gap:12,animation:`fadeIn 0.3s ease`},children:[(0,V.jsx)(`span`,{style:{fontSize:22,flexShrink:0},children:`🧩`}),(0,V.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,V.jsx)(`div`,{style:{fontWeight:600,fontSize:13,color:`var(--text-primary)`,marginBottom:2},children:`Chrome Extension Available`}),(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-secondary)`},children:`Browse with your brain — contextual memory, quick capture, and research from any page`})]}),(0,V.jsx)(`a`,{href:`/api/extension/download`,download:!0,style:{flexShrink:0,padding:`6px 14px`,background:`linear-gradient(135deg, #3b82f6, #93c5fd)`,color:`#fff`,borderRadius:6,fontWeight:500,fontSize:12,textDecoration:`none`,whiteSpace:`nowrap`},children:`⬇ Download`}),(0,V.jsx)(`button`,{onClick:()=>{k(!0),localStorage.setItem(`tr-ext-banner-dismissed`,`true`)},style:{flexShrink:0,background:`none`,border:`none`,color:`var(--text-tertiary)`,cursor:`pointer`,fontSize:16,padding:`0 2px`,lineHeight:1},title:`Dismiss`,children:`✕`})]}),(0,V.jsx)(`div`,{className:`chat-messages`,style:{position:`relative`,zIndex:1,pointerEvents:`auto`},children:(0,V.jsxs)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`,gap:`16px`,width:`100%`,maxWidth:800,margin:`0 auto`,pointerEvents:`auto`},children:[r.map((e,t)=>(0,V.jsxs)(`div`,{className:`message message-${e.role}`,style:{backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,background:e.role===`user`?`rgba(108, 92, 231, 0.75)`:`rgba(18, 18, 26, 0.75)`,border:`1px solid rgba(255, 255, 255, 0.08)`},children:[(0,V.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e.content}),e.role===`assistant`&&(0,V.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:12,fontSize:13,color:`var(--text-tertiary)`,alignItems:`center`,userSelect:`none`},children:[e.versions&&e.versions.length>1&&(0,V.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`center`,marginRight:4},children:[(0,V.jsx)(`button`,{onClick:()=>Ee(t,-1),disabled:(e.currentVersionIndex||0)===0,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,padding:2,opacity:(e.currentVersionIndex||0)===0?.3:1},children:`◄`}),(0,V.jsxs)(`span`,{children:[(e.currentVersionIndex||0)+1,` / `,e.versions.length]}),(0,V.jsx)(`button`,{onClick:()=>Ee(t,1),disabled:(e.currentVersionIndex||0)===e.versions.length-1,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,padding:2,opacity:(e.currentVersionIndex||0)===e.versions.length-1?.3:1},children:`►`})]}),(0,V.jsx)(`button`,{onClick:()=>Te(e.content),title:`Copy to clipboard`,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:4},children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,V.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}),(0,V.jsx)(`button`,{onClick:()=>be(e.content),title:`Read Aloud`,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:4},children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,V.jsx)(`path`,{d:`M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07`})]})}),(0,V.jsx)(`button`,{onClick:()=>we(t),disabled:s,title:`Regenerate Response`,style:{background:`none`,border:`none`,color:`inherit`,cursor:s?`default`:`pointer`,display:`flex`,alignItems:`center`,gap:4,opacity:s?.3:1},children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`polyline`,{points:`1 4 1 10 7 10`}),(0,V.jsx)(`polyline`,{points:`23 20 23 14 17 14`}),(0,V.jsx)(`path`,{d:`M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15`})]})})]})]},e.id)),s&&(0,V.jsx)(`div`,{className:`message message-assistant`,style:{backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,background:`rgba(18, 18, 26, 0.75)`,border:`1px solid rgba(255, 255, 255, 0.08)`},children:(0,V.jsx)(`span`,{className:`skeleton`,style:{display:`inline-block`,width:180,height:16}})}),(0,V.jsx)(`div`,{ref:l})]})}),(0,V.jsxs)(`div`,{className:`chat-input-bar`,style:{position:`relative`,zIndex:30,pointerEvents:`auto`},children:[P.length>0&&(0,V.jsx)(`div`,{className:`grounding-pills`,children:P.map(e=>{let t=I.find(t=>t.slug===e);return(0,V.jsxs)(`div`,{className:`grounding-pill animate-fade-in`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,V.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,V.jsx)(`span`,{className:`grounding-pill-title`,children:t?.title||e}),(0,V.jsx)(`button`,{className:`grounding-pill-remove`,onClick:()=>F(t=>t.filter(t=>t!==e)),title:`Remove grounding context`,children:`×`})]},e)})}),(0,V.jsxs)(`div`,{className:`chat-input-wrapper`,children:[(0,V.jsx)(`button`,{className:`btn btn-ghost ${p?`active`:``}`,style:{width:44,height:44,padding:0,display:`flex`,justifyContent:`center`,alignItems:`center`,color:p?`var(--accent)`:`var(--text-tertiary)`,borderColor:p?`var(--accent)`:`var(--border)`},onClick:()=>{m(!p),p&&`speechSynthesis`in window&&window.speechSynthesis.cancel()},title:p?`Voice Mode On`:`Voice Mode Off`,children:p?(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{width:20,height:20},children:[(0,V.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,V.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,V.jsx)(`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}),(0,V.jsx)(`line`,{x1:`8`,x2:`16`,y1:`22`,y2:`22`})]}):(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{width:20,height:20},children:[(0,V.jsx)(`line`,{x1:`1`,x2:`23`,y1:`1`,y2:`23`}),(0,V.jsx)(`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.88`}),(0,V.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-1.39 4.2M5 10v2a7 7 0 0 0 1.93 4.88`}),(0,V.jsx)(`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}),(0,V.jsx)(`line`,{x1:`8`,x2:`16`,y1:`22`,y2:`22`})]})}),(0,V.jsx)(`button`,{className:`btn btn-ghost ${b?`active`:``}`,style:{width:44,height:44,padding:0,display:`flex`,justifyContent:`center`,alignItems:`center`,color:b?`var(--accent)`:`var(--text-tertiary)`,borderColor:b?`var(--accent)`:`var(--border)`},onClick:()=>x(!b),title:b?`Deep Research On`:`Deep Research Off`,children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{width:18,height:18},children:[(0,V.jsx)(`path`,{d:`M12 2v20`}),(0,V.jsx)(`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`})]})}),(0,V.jsxs)(`div`,{style:{position:`relative`,display:`flex`},ref:ae,children:[(0,V.jsxs)(`button`,{className:`btn btn-ghost ${P.length>0?`active`:``}`,style:{width:44,height:44,padding:0,display:`flex`,justifyContent:`center`,alignItems:`center`,color:P.length>0?`var(--accent)`:`var(--text-tertiary)`,borderColor:P.length>0?`var(--accent)`:`var(--border)`},onClick:()=>re(!ne),title:`Ground with brain nodes`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{width:18,height:18},children:[(0,V.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,V.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`})]}),P.length>0&&(0,V.jsx)(`span`,{className:`grounding-count-badge`,children:P.length})]}),ne&&(0,V.jsxs)(`div`,{className:`node-selector-popover glass`,children:[(0,V.jsxs)(`div`,{className:`node-selector-header`,children:[(0,V.jsx)(`h4`,{children:`Ground with Brain Nodes`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`Search nodes...`,value:ie,onChange:e=>R(e.target.value),className:`node-search-input`,autoFocus:!0})]}),(0,V.jsx)(`div`,{className:`node-selector-list`,children:je.length===0?(0,V.jsx)(`div`,{className:`node-selector-empty`,children:`No nodes found`}):je.map(e=>{let t=P.includes(e.slug);return(0,V.jsxs)(`div`,{className:`node-selector-item ${t?`selected`:``}`,onClick:()=>{F(t?t=>t.filter(t=>t!==e.slug):t=>[...t,e.slug])},children:[(0,V.jsx)(`span`,{className:`node-selector-item-checkbox`,children:t?`✓`:``}),(0,V.jsxs)(`div`,{className:`node-selector-item-info`,children:[(0,V.jsx)(`span`,{className:`node-selector-item-title`,children:e.title}),(0,V.jsxs)(`span`,{className:`node-selector-item-meta`,children:[e.category,` • `,e.status||`active`]})]})]},e.slug)})})]})]}),(0,V.jsx)(Mi,{onTranscript:e=>{o(t=>t+(t.endsWith(` `)||t===``?``:` `)+e),setTimeout(()=>{if(u.current){u.current.focus();let e=new Event(`input`,{bubbles:!0});u.current.dispatchEvent(e)}},10)}}),(0,V.jsx)(`textarea`,{ref:u,id:`chat-input`,value:a,onChange:ke,onKeyDown:Oe,placeholder:`Message your brain…`,rows:1,disabled:s}),s?(0,V.jsx)(`button`,{className:`chat-send-btn`,onClick:De,id:`chat-stop`,style:{background:`var(--error)`,color:`#fff`},title:`Stop Generation`,children:(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,style:{width:20,height:20},children:(0,V.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`,ry:`2`})})}):(0,V.jsx)(`button`,{className:`chat-send-btn`,onClick:Ce,disabled:!a.trim(),id:`chat-send`,title:`Send Message`,children:(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M3.478 2.405a.75.75 0 00-.926.94l2.432 7.905H13.5a.75.75 0 010 1.5H4.984l-2.432 7.905a.75.75 0 00.926.94 60.519 60.519 0 0018.445-8.986.75.75 0 000-1.218A60.517 60.517 0 003.478 2.405z`})})})]}),S&&(0,V.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,padding:`8px 12px`,background:`var(--bg-secondary, #1e1e2e)`,borderRadius:`8px`,alignItems:`center`,fontSize:`0.85rem`,marginTop:4},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`🔗 URL detected`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>Ae(`research`),children:`🔬 Research`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>Ae(`remember`),children:`📌 Remember`})]}),w&&(0,V.jsx)(`div`,{style:{padding:`6px 12px`,background:`rgba(46, 204, 113, 0.1)`,border:`1px solid rgba(46, 204, 113, 0.3)`,borderRadius:`8px`,fontSize:`0.8rem`,color:`var(--success)`,marginTop:4,textAlign:`center`},children:w})]})]})]})}var Li=[`all`,`invariants`,`preferences`,`anti-patterns`,`patterns`,`decisions`,`concepts`,`facts`,`lore`];function Ri(e){if(!e)return``;let t=e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);return t=t.replace(/^### (.*$)/gim,`<h3>$1</h3>`),t=t.replace(/^## (.*$)/gim,`<h2>$1</h2>`),t=t.replace(/^# (.*$)/gim,`<h1>$1</h1>`),t=t.replace(/\*\*(.*?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/\*(.*?)\*/g,`<em>$1</em>`),t=t.replace(/```([\s\S]*?)```/g,`<pre style="background:rgba(0,0,0,0.3);padding:12px;border-radius:6px;border:1px solid rgba(255,255,255,0.06);font-family:monospace;overflow-x:auto;"><code>$1</code></pre>`),t=t.replace(/`(.*?)`/g,`<code style="background:rgba(255,255,255,0.06);padding:2px 6px;border-radius:4px;font-family:monospace;">$1</code>`),t=t.replace(/^> (.*$)/gim,`<blockquote style="border-left:4px solid var(--purple-primary);padding-left:14px;color:var(--text-secondary);margin:16px 0;font-style:italic;">$1</blockquote>`),t=t.replace(/^- (.*$)/gim,`<li style="margin-left:20px;list-style-type:disc;">$1</li>`),t=t.replace(/\n/g,`<br />`),(0,V.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t},className:`markdown-preview-block`})}function zi({activeBrainId:e}){let[t,n]=Rn(),r=t.get(`slug`),[i,a]=(0,v.useState)(`vault`),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(`all`),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)([]),[x,S]=(0,v.useState)(0),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)([]),[D,O]=(0,v.useState)(null),[k,A]=(0,v.useState)(!1),[j,M]=(0,v.useState)(!1),[N,P]=(0,v.useState)(``),[F,I]=(0,v.useState)(``),[L,ee]=(0,v.useState)(`invariants`),[te,ne]=(0,v.useState)(``),[re,ie]=(0,v.useState)(`active`),[R,ae]=(0,v.useState)(`low`),[oe,se]=(0,v.useState)(`should`),[ce,le]=(0,v.useState)(1),[ue,de]=(0,v.useState)(3),[fe,pe]=(0,v.useState)(``),[me,he]=(0,v.useState)(``),[ge,_e]=(0,v.useState)(``),[ve,ye]=(0,v.useState)(``),be=(0,v.useCallback)(async()=>{h(!0),_(``);try{f.trim()?s(await fr(f,u===`all`?void 0:u)):s(await dr(e,u===`all`?void 0:u))}catch(e){_(e.message),s([])}finally{h(!1)}},[u,f,e]);(0,v.useEffect)(()=>{c&&(P(c.slug||``),I(c.title||``),ee(c.category||`invariants`),ne(c.content||c.body||``),ie(c.status||`active`),ae(c.priority||`low`),se(c.modality||`should`),le(c.confidence??1),de(c.importance??3),pe((c.tags||[]).join(`, `)),he((c.related||[]).join(`, `)),_e((c.contradicts||[]).join(`, `)),ye((c.supersedes||[]).join(`, `)))},[c]);let xe=async()=>{if(c){h(!0),_(``);try{let t=fe.split(`,`).map(e=>e.trim()).filter(Boolean),n=me.split(`,`).map(e=>e.trim()).filter(Boolean),r=ge.split(`,`).map(e=>e.trim()).filter(Boolean),i=ve.split(`,`).map(e=>e.trim()).filter(Boolean);l(await mr(c.slug,{title:F,category:L,content:te,status:re,priority:R,modality:oe,confidence:ce,importance:ue,tags:t,related:n,contradicts:r,supersedes:i},e)),A(!1),be()}catch(e){_(e.message)}finally{h(!1)}}},Se=async()=>{if(!N.trim()||!F.trim()||!te.trim()){_(`Slug, Title, and Content are required fields.`);return}h(!0),_(``);try{let t=await hr({slug:N,title:F,category:L,content:te,status:re,priority:R,modality:oe,confidence:ce,importance:ue,tags:fe.split(`,`).map(e=>e.trim()).filter(Boolean),related:me.split(`,`).map(e=>e.trim()).filter(Boolean),contradicts:ge.split(`,`).map(e=>e.trim()).filter(Boolean),supersedes:ve.split(`,`).map(e=>e.trim()).filter(Boolean)},e);M(!1),l(t),n({slug:t.slug}),be()}catch(e){_(e.message)}finally{h(!1)}},Ce=async t=>{if(window.confirm(`Are you sure you want to delete memory node "${t}"?`)){h(!0),_(``);try{await gr(t,e),l(null),n({}),be()}catch(e){_(e.message)}finally{h(!1)}}},we=(0,v.useCallback)(async()=>{try{E((await _r()).conflicts||[])}catch(e){console.warn(`Conflicts API error (enhanced features might be disabled):`,e)}},[]);(0,v.useEffect)(()=>{let e=setTimeout(be,300);return()=>clearTimeout(e)},[be]);let Te=(0,v.useCallback)(async()=>{w(!0);try{let e=await yi(100);b(e.sessions),S(e.total)}catch(e){_(e.message)}finally{w(!1)}},[]);(0,v.useEffect)(()=>{i===`conflicts`?we():i===`sessions`&&Te()},[i,we,Te]);let Ee=async e=>{if(window.confirm(`Delete session "${e}"?`))try{await bi(e),Te()}catch(e){_(e.message)}};(0,v.useEffect)(()=>{r?(async()=>{let t=o.find(e=>e.slug===r);if(t&&(t.content||t.body)){l(t),_(``);return}h(!0),_(``);try{let n=await pr(r,e);n?l(n):t?l(t):(_(`Memory node not found: ${r}`),l(null))}catch(e){t?(l(t),_(``)):(_(`Failed to load memory node '${r}': ${e.message}`),l(null))}finally{h(!1)}})():l(null)},[r,e,o]),(0,v.useEffect)(()=>{let e=new EventSource(`http://localhost:9111/stream`);return e.onmessage=e=>{try{let t=JSON.parse(e.data);(t.subsystem===`conflict-detector`||t.subsystem===`rebuild`||t.subsystem===`session-watcher`)&&(be(),we())}catch{}},e.onerror=()=>{e.close()},()=>{e.close()}},[be,we]);let De=e=>{l(e),_(``),n({slug:e.slug})},Oe=async(e,t,n)=>{O(e),_(``);try{await vr(e,t,n),await we(),await be()}catch(e){_(e.message)}finally{O(null)}},ke=(e,t,n)=>(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:16},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Slug (kebab-case, matches filename)`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`e.g. prefer-atomic-writes`,value:N,onChange:e=>P(e.target.value),disabled:!n,style:{width:`100%`,background:`rgba(255,255,255,0.03)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`}})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Title (One-line description)`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`e.g. Always write files atomically (write-then-rename)`,value:F,onChange:e=>I(e.target.value),style:{width:`100%`,background:`rgba(255,255,255,0.03)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`}})]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Category`}),(0,V.jsxs)(`select`,{value:L,onChange:e=>ee(e.target.value),style:{width:`100%`,background:`rgba(15,23,42,0.9)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`},children:[(0,V.jsx)(`option`,{value:`invariants`,children:`invariants`}),(0,V.jsx)(`option`,{value:`patterns`,children:`patterns`}),(0,V.jsx)(`option`,{value:`anti-patterns`,children:`anti-patterns`}),(0,V.jsx)(`option`,{value:`preferences`,children:`preferences`}),(0,V.jsx)(`option`,{value:`decisions`,children:`decisions`}),(0,V.jsx)(`option`,{value:`concepts`,children:`concepts`}),(0,V.jsx)(`option`,{value:`facts`,children:`facts`}),(0,V.jsx)(`option`,{value:`lore`,children:`lore`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Modality`}),(0,V.jsxs)(`select`,{value:oe,onChange:e=>se(e.target.value),style:{width:`100%`,background:`rgba(15,23,42,0.9)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`},children:[(0,V.jsx)(`option`,{value:`must`,children:`must`}),(0,V.jsx)(`option`,{value:`must_not`,children:`must_not`}),(0,V.jsx)(`option`,{value:`should`,children:`should`}),(0,V.jsx)(`option`,{value:`should_not`,children:`should_not`})]})]})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Status`}),(0,V.jsxs)(`select`,{value:re,onChange:e=>ie(e.target.value),style:{width:`100%`,background:`rgba(15,23,42,0.9)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`},children:[(0,V.jsx)(`option`,{value:`active`,children:`active`}),(0,V.jsx)(`option`,{value:`draft`,children:`draft`}),(0,V.jsx)(`option`,{value:`deprecated`,children:`deprecated`}),(0,V.jsx)(`option`,{value:`superseded`,children:`superseded`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Importance (1-5 Stars)`}),(0,V.jsxs)(`select`,{value:ue,onChange:e=>de(Number(e.target.value)),style:{width:`100%`,background:`rgba(15,23,42,0.9)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`},children:[(0,V.jsx)(`option`,{value:1,children:`★ 1/5`}),(0,V.jsx)(`option`,{value:2,children:`★★ 2/5`}),(0,V.jsx)(`option`,{value:3,children:`★★★ 3/5`}),(0,V.jsx)(`option`,{value:4,children:`★★★★ 4/5`}),(0,V.jsx)(`option`,{value:5,children:`★★★★★ 5/5`})]})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:[`Confidence: `,(0,V.jsxs)(`strong`,{children:[Math.round(ce*100),`%`]})]}),(0,V.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.05`,value:ce,onChange:e=>le(Number(e.target.value)),style:{width:`100%`,height:6,background:`rgba(255,255,255,0.1)`,borderRadius:3,outline:`none`}})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Tags (comma separated)`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`e.g. filesystem, reliability, writes`,value:fe,onChange:e=>pe(e.target.value),style:{width:`100%`,background:`rgba(255,255,255,0.03)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`}})]})]})]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr 1fr`,gap:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Related Nodes (comma separated slugs)`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`e.g. use-atomic-writes, git-wiping`,value:me,onChange:e=>he(e.target.value),style:{width:`100%`,background:`rgba(255,255,255,0.03)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`}})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Contradicts Nodes (comma separated slugs)`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`e.g. write-anywhere-sync`,value:ge,onChange:e=>_e(e.target.value),style:{width:`100%`,background:`rgba(255,255,255,0.03)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`}})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Supersedes Nodes (comma separated slugs)`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`e.g. prefer-atomic-writes-v1`,value:ve,onChange:e=>ye(e.target.value),style:{width:`100%`,background:`rgba(255,255,255,0.03)`,border:`1px solid var(--border)`,borderRadius:6,padding:`8px 12px`,color:`#fff`}})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsx)(`label`,{style:{fontSize:12,color:`var(--text-secondary)`},children:`Memory Content`}),(0,V.jsx)(`textarea`,{value:te,onChange:e=>ne(e.target.value),placeholder:`Write markdown here...`,style:{minHeight:300,padding:16,color:`#fff`,background:`#090d16`,border:`1px solid var(--border)`,borderRadius:8,outline:`none`,fontSize:14,lineHeight:1.6,resize:`vertical`,width:`100%`,boxSizing:`border-box`}})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,marginTop:12},children:[(0,V.jsx)(`button`,{className:`btn btn-ghost`,type:`button`,onClick:t,style:{fontSize:13},children:`Cancel`}),(0,V.jsx)(`button`,{className:`btn btn-purple`,type:`button`,onClick:e,style:{fontSize:13},children:n?`🚀 Create Memory Node`:`💾 Save Changes`})]})]}),Ae=o.reduce((e,t)=>(e[t.category]=(e[t.category]||0)+1,e),{});return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-end`,marginBottom:20},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{children:`Memory Vault`}),(0,V.jsx)(`p`,{children:`Browse, audit, and resolve contradictions in your SSSS knowledge graph`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,background:`rgba(255,255,255,0.03)`,padding:4,borderRadius:8,border:`1px solid var(--border)`},children:[(0,V.jsx)(`button`,{className:`btn btn-sm ${i===`vault`?`btn-purple`:`btn-ghost`}`,onClick:()=>{a(`vault`),l(null),n({})},style:{borderRadius:6,fontSize:12,padding:`6px 12px`},children:`🧠 Active Nodes`}),(0,V.jsxs)(`button`,{className:`btn btn-sm ${i===`conflicts`?`btn-cyan`:`btn-ghost`}`,onClick:()=>{a(`conflicts`),l(null),n({})},style:{borderRadius:6,fontSize:12,padding:`6px 12px`,display:`flex`,alignItems:`center`,gap:6},children:[`⚠️ Quarantined Conflicts`,T.length>0&&(0,V.jsx)(`span`,{style:{background:`#ef4444`,color:`#fff`,fontSize:9,padding:`1px 5px`,borderRadius:10,fontWeight:700},children:T.length})]}),(0,V.jsxs)(`button`,{className:`btn btn-sm ${i===`sessions`?`btn-purple`:`btn-ghost`}`,onClick:()=>{a(`sessions`),l(null),n({})},style:{borderRadius:6,fontSize:12,padding:`6px 12px`},children:[`📝 Sessions`,x>0&&(0,V.jsx)(`span`,{style:{background:`rgba(139,92,246,0.3)`,color:`#a78bfa`,fontSize:9,padding:`1px 5px`,borderRadius:10,fontWeight:700,marginLeft:4},children:x})]})]})]}),g&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{alignSelf:`flex-start`,marginBottom:15},children:[`⚠️ `,g]}),i===`vault`?(0,V.jsxs)(`div`,{className:`memory-layout`,children:[(0,V.jsxs)(`div`,{className:`memory-sidebar`,children:[(0,V.jsx)(`h3`,{style:{margin:`0 0 12px 0`},children:`Categories`}),Li.map(e=>(0,V.jsxs)(`button`,{className:`category-btn ${u===e?`active`:``}`,onClick:()=>{d(e),n({}),M(!1),A(!1)},children:[(0,V.jsx)(`span`,{children:e===`all`?`📋 All Nodes`:e}),e===`all`?(0,V.jsx)(`span`,{className:`category-count`,children:o.length}):Ae[e]?(0,V.jsx)(`span`,{className:`category-count`,children:Ae[e]}):null]},e)),(0,V.jsx)(`button`,{className:`btn btn-purple`,style:{width:`100%`,marginTop:20,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8,fontSize:13},onClick:()=>{l(null),n({}),M(!0),A(!1),P(``),I(``),ee(`invariants`),ne(``),ie(`active`),ae(`low`),se(`should`),le(1),de(3),pe(``),he(``),_e(``),ye(``)},children:`➕ Create New Node`})]}),(0,V.jsxs)(`div`,{className:`memory-main`,children:[(0,V.jsxs)(`div`,{className:`memory-search`,children:[(0,V.jsx)(`input`,{id:`memory-search`,type:`text`,placeholder:`Search memory nodes…`,value:f,onChange:e=>p(e.target.value)}),(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:be,children:`Refresh`})]}),m?(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[1,2,3].map(e=>(0,V.jsx)(`div`,{className:`skeleton`,style:{height:60}},e))}):j?(0,V.jsxs)(`div`,{className:`memory-detail`,style:{background:`rgba(15,23,42,0.45)`,backdropFilter:`blur(12px)`,border:`1px solid var(--border)`,borderRadius:12,padding:24},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,V.jsx)(`h2`,{style:{margin:0,color:`#fff`},children:`Create New SSSS Memory Node`}),(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>M(!1),style:{fontSize:12},children:`← Back to List`})]}),ke(Se,()=>M(!1),!0)]}):c&&k?(0,V.jsxs)(`div`,{className:`memory-detail`,style:{background:`rgba(15,23,42,0.45)`,backdropFilter:`blur(12px)`,border:`1px solid var(--border)`,borderRadius:12,padding:24},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,V.jsx)(`h2`,{style:{margin:0,color:`#fff`},children:`Edit Memory Node`}),(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>A(!1),style:{fontSize:12},children:`← Cancel Edit`})]}),ke(xe,()=>A(!1),!1)]}):c?(0,V.jsxs)(`div`,{className:`memory-detail`,style:{background:`rgba(15,23,42,0.45)`,backdropFilter:`blur(12px)`,border:c.modality===`must`?`2px solid #10b981`:c.modality===`must_not`?`2px solid #ef4444`:c.modality===`should`?`1px solid #8b5cf6`:c.modality===`should_not`?`1px solid #f97316`:`1px solid var(--border)`,boxShadow:c.modality===`must`?`0 0 16px rgba(16, 185, 129, 0.1)`:c.modality===`must_not`?`0 0 16px rgba(239, 68, 68, 0.1)`:void 0,borderRadius:12,padding:24},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:16},children:[(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>n({}),style:{fontSize:12},children:`← Back to List`}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>{P(c.slug||``),I(c.title||``),ee(c.category||`invariants`),ne(c.content||c.body||``),ie(c.status||`active`),ae(c.priority||`low`),se(c.modality||`should`),le(c.confidence??1),de(c.importance??3),pe((c.tags||[]).join(`, `)),he((c.related||[]).join(`, `)),_e((c.contradicts||[]).join(`, `)),ye((c.supersedes||[]).join(`, `)),A(!0)},style:{fontSize:12,border:`1px solid var(--border)`},children:`✏️ Edit Node`}),(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Ce(c.slug),style:{fontSize:12,borderColor:`rgba(239,68,68,0.2)`,color:`#fca5a5`},children:`🗑️ Delete`})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,V.jsx)(`h2`,{style:{margin:0,color:`#fff`},children:c.title}),c.modality&&(0,V.jsx)(`span`,{style:{fontSize:10,fontWeight:700,textTransform:`uppercase`,padding:`4px 10px`,borderRadius:6,background:c.modality===`must`?`rgba(16, 185, 129, 0.15)`:c.modality===`must_not`?`rgba(239, 68, 68, 0.15)`:`rgba(255, 255, 255, 0.05)`,color:c.modality===`must`?`#10b981`:c.modality===`must_not`?`#ef4444`:`var(--text-secondary)`,border:c.modality===`must`?`1px solid rgba(16, 185, 129, 0.3)`:c.modality===`must_not`?`1px solid rgba(239, 68, 68, 0.3)`:`1px solid rgba(255, 255, 255, 0.1)`},children:c.modality})]}),(0,V.jsxs)(`dl`,{className:`frontmatter`,style:{display:`grid`,gridTemplateColumns:`120px 1fr`,gap:`10px 20px`,marginBottom:24,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.06)`},children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Slug`}),(0,V.jsx)(`dd`,{style:{margin:0},children:(0,V.jsx)(`code`,{children:c.slug})}),(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Category`}),(0,V.jsx)(`dd`,{style:{margin:0,textTransform:`capitalize`},children:c.category}),c.status&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Status`}),(0,V.jsx)(`dd`,{style:{margin:0},children:(0,V.jsx)(`span`,{className:`badge badge-success`,style:{background:c.status===`active`?`rgba(34, 197, 94, 0.15)`:`rgba(255,255,255,0.05)`,color:c.status===`active`?`#22c55e`:`var(--text-secondary)`},children:c.status})})]}),c.confidence!==void 0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Confidence`}),(0,V.jsxs)(`dd`,{style:{margin:0,display:`flex`,alignItems:`center`,gap:12},children:[(0,V.jsxs)(`strong`,{style:{fontSize:13},children:[Math.round(c.confidence*100),`%`]}),(0,V.jsx)(`div`,{style:{flex:1,maxWidth:150,height:6,background:`rgba(255,255,255,0.06)`,borderRadius:3,overflow:`hidden`,display:`inline-block`},children:(0,V.jsx)(`div`,{style:{width:`${Math.round(c.confidence*100)}%`,height:`100%`,background:`linear-gradient(90deg, #8b5cf6, #06b6d4)`,borderRadius:3}})})]})]}),c.importance!==void 0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Importance`}),(0,V.jsx)(`dd`,{style:{margin:0,color:`#fbbf24`,display:`flex`,gap:2},children:Array.from({length:5}).map((e,t)=>(0,V.jsx)(`span`,{children:t<(c.importance||0)?`★`:`☆`},t))})]}),c.tags?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Tags`}),(0,V.jsx)(`dd`,{style:{margin:0,display:`flex`,gap:6,flexWrap:`wrap`},children:c.tags.map(e=>(0,V.jsx)(`span`,{style:{background:`rgba(255,255,255,0.05)`,color:`var(--text-secondary)`,fontSize:10,padding:`2px 8px`,borderRadius:4,border:`1px solid rgba(255,255,255,0.03)`},children:e},e))})]}):null,c.related?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Related`}),(0,V.jsx)(`dd`,{style:{margin:0},children:(0,V.jsx)(`code`,{children:c.related.join(`, `)})})]}):null,c.contradicts?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Contradicts`}),(0,V.jsx)(`dd`,{style:{margin:0,color:`#fca5a5`},children:(0,V.jsx)(`code`,{children:c.contradicts.join(`, `)})})]}):null,c.supersedes?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Supersedes`}),(0,V.jsx)(`dd`,{style:{margin:0,color:`#93c5fd`},children:(0,V.jsx)(`code`,{children:c.supersedes.join(`, `)})})]}):null]}),(0,V.jsxs)(`div`,{style:{marginTop:20},children:[(0,V.jsx)(`h3`,{style:{fontSize:12,textTransform:`uppercase`,color:`var(--text-tertiary)`,letterSpacing:.5,marginBottom:12},children:`Memory Content (SSSS Body)`}),(0,V.jsx)(`div`,{style:{background:`rgba(0,0,0,0.15)`,border:`1px solid rgba(255,255,255,0.04)`,borderRadius:8,padding:20},children:Ri(c.body||c.content||``)})]})]}):(0,V.jsxs)(`div`,{className:`memory-list`,style:{display:`grid`,gridTemplateColumns:`1fr`,gap:12},children:[o.length===0&&!m&&(0,V.jsx)(`div`,{style:{textAlign:`center`,padding:40,color:`var(--text-tertiary)`},children:f?`No matching nodes found.`:u===`all`?`No memory nodes loaded. Is the backend running?`:`No memory nodes found in category "${u}".`}),o.map(e=>(0,V.jsxs)(`div`,{className:`memory-node-card`,onClick:()=>De(e),style:{border:e.modality===`must`?`2px solid #10b981`:e.modality===`must_not`?`2px solid #ef4444`:e.modality===`should`?`1px solid #8b5cf6`:e.modality===`should_not`?`1px solid #f97316`:`1px solid rgba(255, 255, 255, 0.08)`,boxShadow:e.modality===`must`?`0 0 12px rgba(16, 185, 129, 0.15)`:e.modality===`must_not`?`0 0 12px rgba(239, 68, 68, 0.15)`:void 0,transition:`transform 0.2s ease, box-shadow 0.2s ease`,position:`relative`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:6},children:[(0,V.jsx)(`h4`,{style:{margin:0,color:`#fff`,fontSize:15},children:e.title}),e.modality&&(0,V.jsx)(`span`,{style:{fontSize:9,fontWeight:700,textTransform:`uppercase`,padding:`2px 6px`,borderRadius:4,background:e.modality===`must`?`rgba(16, 185, 129, 0.15)`:e.modality===`must_not`?`rgba(239, 68, 68, 0.15)`:`rgba(255, 255, 255, 0.05)`,color:e.modality===`must`?`#10b981`:e.modality===`must_not`?`#ef4444`:`var(--text-secondary)`},children:e.modality})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:16,fontSize:11,color:`var(--text-tertiary)`,marginTop:8},children:[(0,V.jsxs)(`span`,{children:[`📂 `,e.category]}),e.importance!==void 0&&(0,V.jsxs)(`span`,{style:{color:`#fbbf24`},children:[`★ `,e.importance,`/5`]}),e.confidence!==void 0&&(0,V.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`🧠 `,Math.round(e.confidence*100),`%`]})]})]},e.slug))]})]})]}):(0,V.jsxs)(`div`,{style:{width:`100%`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,V.jsx)(`h3`,{children:`Quarantined Contradiction Records`}),(0,V.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`,display:`flex`,alignItems:`center`,gap:5},children:[(0,V.jsx)(`span`,{className:`pulse`,style:{background:`#06b6d4`}}),` SSE Real-time Agent Monitor Connected`]})]}),T.length===0?(0,V.jsxs)(`div`,{style:{textAlign:`center`,padding:60,background:`rgba(255,255,255,0.02)`,borderRadius:12,border:`1px dashed var(--border)`,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{style:{fontSize:32,display:`block`,marginBottom:12},children:`🛡️`}),(0,V.jsx)(`h4`,{style:{color:`#fff`,marginBottom:6},children:`All Clear!`}),"No memory conflicts enqueued or quarantined in `.agent/memory-inbox/conflicts/`."]}):(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:T.map(e=>{let t=e.status===`pending`;return(0,V.jsxs)(`div`,{style:{background:`rgba(15,23,42,0.45)`,backdropFilter:`blur(12px)`,border:t?`1px solid rgba(239, 68, 68, 0.25)`:`1px solid rgba(34, 197, 94, 0.2)`,borderRadius:12,padding:24,boxShadow:`0 8px 32px rgba(0,0,0,0.15)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:16,borderBottom:`1px solid rgba(255,255,255,0.06)`,paddingBottom:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h4`,{style:{margin:0,fontSize:16,color:`#fff`,display:`flex`,alignItems:`center`,gap:8},children:[`Conflict: `,(0,V.jsx)(`code`,{children:e.conflict_id}),(0,V.jsx)(`span`,{style:{fontSize:11,padding:`2px 8px`,borderRadius:10,background:t?`rgba(239,68,68,0.15)`:`rgba(34,197,94,0.15)`,color:t?`#ef4444`:`#22c55e`,textTransform:`uppercase`},children:e.status})]}),(0,V.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[`Detected at: `,new Date(e.detected_at).toLocaleString()]})]}),(0,V.jsxs)(`div`,{style:{textAlign:`right`},children:[(0,V.jsxs)(`span`,{style:{fontSize:12,color:`#ef4444`,fontWeight:700,display:`block`},children:[`Clash Similarity: `,Math.round(e.similarity*100),`%`]}),(0,V.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`Modality polarity flip`})]})]}),(0,V.jsxs)(`p`,{style:{fontSize:13,background:`rgba(239,68,68,0.03)`,padding:`10px 14px`,borderRadius:6,borderLeft:`3px solid #ef4444`,color:`#fca5a5`,marginBottom:20},children:[(0,V.jsx)(`strong`,{children:`Reason:`}),` `,e.reason]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:16,marginBottom:24},children:[(0,V.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.02)`,padding:16,borderRadius:8,border:`1px solid rgba(255,255,255,0.05)`},children:[(0,V.jsx)(`h5`,{style:{margin:`0 0 10px 0`,color:`#a78bfa`,textTransform:`uppercase`,fontSize:11,letterSpacing:.5},children:`✓ Existing Node In Vault`}),(0,V.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:`#fff`,marginBottom:8},children:(0,V.jsx)(`code`,{children:e.existing_slug})}),(0,V.jsxs)(`dl`,{style:{display:`grid`,gridTemplateColumns:`80px 1fr`,gap:4,margin:`0 0 12px 0`,fontSize:11,color:`var(--text-secondary)`},children:[(0,V.jsx)(`dt`,{children:`Modality:`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(`code`,{children:e._existing_node?.modality||`must`})}),(0,V.jsx)(`dt`,{children:`Polarity:`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(`code`,{children:e._existing_node?.sentiment_polarity||`directive_must`})}),(0,V.jsx)(`dt`,{children:`Confidence:`}),(0,V.jsx)(`dd`,{children:e._existing_node?.confidence===void 0?`N/A`:`${Math.round(e._existing_node.confidence*100)}%`})]}),(0,V.jsx)(`div`,{style:{fontSize:12,fontStyle:`italic`,background:`rgba(0,0,0,0.2)`,padding:10,borderRadius:6,color:`var(--text-tertiary)`,minHeight:60,whiteSpace:`pre-wrap`},children:e._existing_node?.excerpt||e._existing_node?.body||`No preview content.`})]}),(0,V.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.02)`,padding:16,borderRadius:8,border:`1px solid rgba(255,255,255,0.05)`},children:[(0,V.jsx)(`h5`,{style:{margin:`0 0 10px 0`,color:`#06b6d4`,textTransform:`uppercase`,fontSize:11,letterSpacing:.5},children:`⚠ New Ingestion Candidate`}),(0,V.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:`#fff`,marginBottom:8},children:(0,V.jsx)(`code`,{children:e.new_slug})}),(0,V.jsxs)(`dl`,{style:{display:`grid`,gridTemplateColumns:`80px 1fr`,gap:4,margin:`0 0 12px 0`,fontSize:11,color:`var(--text-secondary)`},children:[(0,V.jsx)(`dt`,{children:`Modality:`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(`code`,{children:e._new_node?.modality||`must_not`})}),(0,V.jsx)(`dt`,{children:`Polarity:`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(`code`,{children:e._new_node?.sentiment_polarity||`directive_must_not`})}),(0,V.jsx)(`dt`,{children:`Confidence:`}),(0,V.jsx)(`dd`,{children:e._new_node?.confidence===void 0?`N/A`:`${Math.round(e._new_node.confidence*100)}%`})]}),(0,V.jsx)(`div`,{style:{fontSize:12,fontStyle:`italic`,background:`rgba(0,0,0,0.2)`,padding:10,borderRadius:6,color:`var(--text-tertiary)`,minHeight:60,whiteSpace:`pre-wrap`},children:e._new_node?.excerpt||e._new_node?.body||`No preview content.`})]})]}),t?(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12},children:[(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,disabled:D!==null,onClick:()=>Oe(e.conflict_id,`keep`,e.existing_slug),style:{borderColor:`rgba(255,255,255,0.1)`,fontSize:12},children:D===e.conflict_id?`Processing...`:`Keep Existing Node (${e.existing_slug})`}),(0,V.jsx)(`button`,{className:`btn btn-purple btn-sm`,disabled:D!==null,onClick:()=>Oe(e.conflict_id,`supersede`,e.new_slug),style:{fontSize:12},children:D===e.conflict_id?`Processing...`:`Supersede with New (${e.new_slug})`})]}):(0,V.jsxs)(`div`,{style:{fontSize:12,color:`#22c55e`,background:`rgba(34,197,94,0.06)`,padding:`10px 14px`,borderRadius:6,border:`1px solid rgba(34,197,94,0.15)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`span`,{children:[`✓ Resolved successfully. Choice: `,(0,V.jsx)(`strong`,{children:e.resolution})]}),(0,V.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[`Resolved at: `,e.resolved_at?new Date(e.resolved_at).toLocaleString():``]})]})]},e.conflict_id)})})]}),i===`sessions`&&(0,V.jsxs)(`div`,{className:`health-log`,style:{background:`rgba(15,23,42,0.45)`,backdropFilter:`blur(12px)`,border:`1px solid var(--border)`,borderRadius:12,padding:24},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,V.jsxs)(`h2`,{style:{margin:0,color:`#fff`,fontSize:16},children:[`📝 IDE Sessions (`,x,`)`]}),(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:Te,style:{fontSize:12},children:`🔄 Refresh`})]}),C?(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[1,2,3].map(e=>(0,V.jsx)(`div`,{className:`skeleton`,style:{height:56}},e))}):y.length===0?(0,V.jsxs)(`div`,{style:{textAlign:`center`,padding:40,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{style:{fontSize:32,display:`block`,marginBottom:8},children:`📝`}),`No sessions ingested yet. Sessions appear here when the relay ships IDE conversation data.`]}):(0,V.jsxs)(`table`,{style:{width:`100%`,textAlign:`left`,borderCollapse:`collapse`},children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Title`}),(0,V.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Date`}),(0,V.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Source`}),(0,V.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Messages`}),(0,V.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600,width:60}})]})}),(0,V.jsx)(`tbody`,{children:y.map(e=>{let t={antigravity:`#8b5cf6`,"claude-code":`#f59e0b`,codex:`#10b981`,vscode:`#3b82f6`,cursor:`#06b6d4`,"gemini-cli":`#ec4899`}[e.source||``]||`var(--text-secondary)`;return(0,V.jsxs)(`tr`,{style:{borderBottom:`1px solid rgba(255,255,255,0.04)`},children:[(0,V.jsx)(`td`,{style:{padding:`10px 12px`,color:`#fff`,fontSize:13,maxWidth:400,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.title||e.id}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`,fontSize:12,whiteSpace:`nowrap`},children:e.date?new Date(e.date).toLocaleString():`-`}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`},children:e.source&&(0,V.jsx)(`span`,{style:{fontSize:10,fontWeight:600,textTransform:`uppercase`,padding:`2px 8px`,borderRadius:4,background:`${t}20`,color:t,border:`1px solid ${t}40`},children:e.source})}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`,fontSize:12},children:e.count}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`},children:(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Ee(e.id),style:{fontSize:10,padding:`2px 6px`,color:`#fca5a5`,borderColor:`rgba(239,68,68,0.2)`},children:`🗑️`})})]},e.id)})})]})]})]})}var Bi=Object.defineProperty,Vi=Object.getOwnPropertySymbols,Hi=Object.prototype.hasOwnProperty,Ui=Object.prototype.propertyIsEnumerable,Wi=(e,t,n)=>t in e?Bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gi=(e,t)=>{for(var n in t||={})Hi.call(t,n)&&Wi(e,n,t[n]);if(Vi)for(var n of Vi(t))Ui.call(t,n)&&Wi(e,n,t[n]);return e},Ki=(e,t)=>{var n={};for(var r in e)Hi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vi)for(var r of Vi(e))t.indexOf(r)<0&&Ui.call(e,r)&&(n[r]=e[r]);return n},qi;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(qi||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(qi||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(qi||={});var Ji=qi,Yi={L:Ji.QrCode.Ecc.LOW,M:Ji.QrCode.Ecc.MEDIUM,Q:Ji.QrCode.Ecc.QUARTILE,H:Ji.QrCode.Ecc.HIGH},Xi=128,Zi=`L`,Qi=`#FFFFFF`,$i=`#000000`,ea=!1,ta=1,na=4,ra=0,ia=.1;function aa(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function oa(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function sa(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*ia),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function ca(e,t){return t==null?e?na:ra:Math.max(Math.floor(t),0)}function la({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=v.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...Ji.QrSegment.makeSegments(t)),e),[]);return Ji.QrCode.encodeSegments(r,Yi[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=v.useMemo(()=>{let e=c.getModules(),t=ca(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:sa(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var ua=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),da=v.forwardRef(function(e,t){let n=e,{value:r,size:i=Xi,level:a=Zi,bgColor:o=Qi,fgColor:s=$i,includeMargin:c=ea,minVersion:l=ta,boostLevel:u,marginSize:d,imageSettings:f}=n,p=Ki(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=Ki(p,[`style`]),g=f?.src,_=v.useRef(null),y=v.useRef(null),b=v.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[x,S]=v.useState(!1),{margin:C,cells:w,numCells:T,calculatedImageSettings:E}=la({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});v.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=w,r=y.current,a=E!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&E.excavation!=null&&(n=oa(w,E.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/T*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,T,T),t.fillStyle=s,ua?t.fill(new Path2D(aa(n,C))):w.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+C,n+C,1,1)})}),E&&(t.globalAlpha=E.opacity),a&&t.drawImage(r,E.x+C,E.y+C,E.w,E.h)}}),v.useEffect(()=>{S(!1)},[g]);let D=Gi({height:i,width:i},m),O=null;return g!=null&&(O=v.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{S(!0)},ref:y,crossOrigin:E?.crossOrigin})),v.createElement(v.Fragment,null,v.createElement(`canvas`,Gi({style:D,height:i,width:i,ref:b,role:`img`},h)),O)});da.displayName=`QRCodeCanvas`;var fa=v.forwardRef(function(e,t){let n=e,{value:r,size:i=Xi,level:a=Zi,bgColor:o=Qi,fgColor:s=$i,includeMargin:c=ea,minVersion:l=ta,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=Ki(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:y}=la({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),b=g,x=null;p!=null&&y!=null&&(y.excavation!=null&&(b=oa(g,y.excavation)),x=v.createElement(`image`,{href:p.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:`none`,opacity:y.opacity,crossOrigin:y.crossOrigin}));let S=aa(b,h);return v.createElement(`svg`,Gi({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&v.createElement(`title`,null,d),v.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),v.createElement(`path`,{fill:s,d:S,shapeRendering:`crispEdges`}),x)});fa.displayName=`QRCodeSVG`;function pa(){let[e,t]=(0,v.useState)(``);return(0,v.useEffect)(()=>{let e=window.location.protocol,n=window.location.host;t(`${e}//${n}`)},[]),(0,V.jsxs)(`div`,{className:`mobile-pairing`,style:{padding:`20px`,background:`var(--bg-secondary)`,borderRadius:`12px`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{children:`Mobile Device Pairing`}),(0,V.jsx)(`p`,{style:{color:`var(--text-tertiary)`,fontSize:`13px`,marginBottom:`16px`},children:`Scan this QR code with your phone's camera to connect to this Total Recall instance. Ensure your phone is on the same Wi-Fi network.`}),(0,V.jsx)(`div`,{style:{background:`#fff`,padding:`16px`,borderRadius:`8px`,display:`inline-block`},children:e?(0,V.jsx)(fa,{value:e,size:150,level:`H`}):(0,V.jsx)(`div`,{style:{width:150,height:150,display:`flex`,alignItems:`center`,justifyContent:`center`},children:`Loading...`})}),(0,V.jsxs)(`p`,{style:{marginTop:`16px`,fontSize:`12px`,color:`var(--text-tertiary)`},children:[`URL: `,e]})]})}function ma({activeBrainId:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(`idle`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)([]),S=e||localStorage.getItem(`total-recall-active-brain`)||``;(0,v.useEffect)(()=>{ti().then(c).catch(console.error),ui().then(m).catch(console.error),oi().then(x).catch(console.error),Ci().then(e=>{e.security||={},e.security.dashboard||(e.security.dashboard={}),e.security.api||(e.security.api={}),e.security.network||(e.security.network={}),e.security.bind||(e.security.bind={}),e.security.rate_limits||(e.security.rate_limits={}),e.security.sandbox||(e.security.sandbox={}),e.security.privacy||(e.security.privacy={}),e.budget||={budget:{}},e.budget.budget||(e.budget.budget={}),e.brain||={},e.secrets||={},n(e)}).catch(console.error)},[e]);let C=[{id:`antigravity`,name:`Antigravity (Gemini SDK)`,desc:`Primary core developer agent`},{id:`gemini`,name:`Gemini CLI`,desc:`Direct Gemini assistant binary`},{id:`claude`,name:`Claude Code`,desc:`Anthropic developer CLI wrapper`},{id:`codex`,name:`Codex CLI`,desc:`OpenAI agent binary integration`},{id:`grok`,name:`Grok CLI`,desc:`xAI developer binary integration`}],w=async e=>{e.preventDefault(),u(!0),f(null);try{f((await ai()).output),ti().then(c).catch(console.error)}catch(e){f(`Error: `+e.message)}finally{u(!1)}},T=async()=>{g(!0),y(null);try{let e=await di();y(e.success?`Update complete. Restarting...`:`Update failed: `+e.message)}catch(e){y(`Update error: `+e.message)}finally{g(!1)}},E=async()=>{if(t){i(`saving`);try{await wi(t),i(`saved`),setTimeout(()=>i(`idle`),2500)}catch(e){console.error(e),i(`error`),setTimeout(()=>i(`idle`),3e3)}}},D=async(e,t)=>{o(`[Running] ${t}...\n$ ${e}`);let n=await xr(`
|
|
15
|
+
const { execSync } = require('child_process');
|
|
16
|
+
try {
|
|
17
|
+
const out = execSync('${e}', { encoding: 'utf8' });
|
|
18
|
+
console.log(out);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error(e.stdout || e.message);
|
|
21
|
+
}
|
|
22
|
+
`);o(`[Finished] ${t}\n\n`+n.output)},O=(e,t,r)=>{n(n=>n&&{...n,security:{...n.security,[e]:{...n.security[e]||{},[t]:r}}})},k=(e,t)=>{n(n=>n&&{...n,budget:{...n.budget,budget:{...n.budget.budget||{},[e]:t}}})},A=(e,t)=>{n(n=>n?{...n,brain:{...n.brain,[e]:t}}:null)},j=e=>Array.isArray(e)?e.join(`, `):``,M=e=>e.split(`,`).map(e=>e.trimStart());return t?(0,V.jsxs)(`div`,{className:`settings-page-wrapper`,children:[(0,V.jsx)(`style`,{children:`
|
|
23
|
+
.settings-page-wrapper {
|
|
24
|
+
padding: 32px 40px 100px;
|
|
25
|
+
max-width: 1200px;
|
|
26
|
+
margin: 0 auto;
|
|
27
|
+
animation: fade-in 0.4s ease-out;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.settings-header-sticky {
|
|
31
|
+
position: sticky;
|
|
32
|
+
top: 0;
|
|
33
|
+
z-index: 50;
|
|
34
|
+
background: rgba(13, 17, 23, 0.85);
|
|
35
|
+
backdrop-filter: blur(24px);
|
|
36
|
+
-webkit-backdrop-filter: blur(24px);
|
|
37
|
+
padding: 24px 0;
|
|
38
|
+
margin-bottom: 32px;
|
|
39
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
align-items: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.settings-grid {
|
|
46
|
+
display: grid;
|
|
47
|
+
grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
|
|
48
|
+
gap: 24px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.settings-card {
|
|
52
|
+
background: rgba(23, 32, 51, 0.4);
|
|
53
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
54
|
+
border-radius: 16px;
|
|
55
|
+
padding: 28px;
|
|
56
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
|
|
57
|
+
backdrop-filter: blur(16px);
|
|
58
|
+
-webkit-backdrop-filter: blur(16px);
|
|
59
|
+
transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
60
|
+
position: relative;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.settings-card::before {
|
|
65
|
+
content: '';
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0; left: 0; right: 0; height: 100%;
|
|
68
|
+
background: radial-gradient(circle at top right, rgba(255,255,255,0.03), transparent 60%);
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.settings-card:hover {
|
|
73
|
+
border-color: rgba(255, 255, 255, 0.12);
|
|
74
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.settings-icon-wrap {
|
|
78
|
+
width: 44px;
|
|
79
|
+
height: 44px;
|
|
80
|
+
border-radius: 12px;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
font-size: 20px;
|
|
85
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.field-col {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
margin-top: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.field-row {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
margin-top: 20px;
|
|
101
|
+
padding: 12px 16px;
|
|
102
|
+
background: rgba(0, 0, 0, 0.2);
|
|
103
|
+
border-radius: 12px;
|
|
104
|
+
border: 1px solid rgba(255,255,255,0.03);
|
|
105
|
+
transition: border-color 0.2s ease;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.field-row:hover {
|
|
109
|
+
border-color: rgba(255,255,255,0.1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.field-label {
|
|
113
|
+
font-size: 13px;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
color: var(--text-secondary);
|
|
116
|
+
letter-spacing: 0.3px;
|
|
117
|
+
text-transform: uppercase;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.settings-input, .settings-select {
|
|
121
|
+
background: rgba(9, 13, 20, 0.6);
|
|
122
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
123
|
+
color: var(--text-primary);
|
|
124
|
+
padding: 12px 16px;
|
|
125
|
+
border-radius: 10px;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
transition: all 0.2s ease;
|
|
128
|
+
width: 100%;
|
|
129
|
+
outline: none;
|
|
130
|
+
box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.settings-input.secret {
|
|
134
|
+
font-family: 'JetBrains Mono', monospace;
|
|
135
|
+
letter-spacing: 1px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.settings-input:focus, .settings-select:focus {
|
|
139
|
+
border-color: var(--accent);
|
|
140
|
+
box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.settings-checkbox {
|
|
144
|
+
appearance: none;
|
|
145
|
+
width: 44px;
|
|
146
|
+
height: 24px;
|
|
147
|
+
background: rgba(255, 255, 255, 0.1);
|
|
148
|
+
border-radius: 20px;
|
|
149
|
+
position: relative;
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
152
|
+
outline: none;
|
|
153
|
+
border: 1px solid rgba(255,255,255,0.05);
|
|
154
|
+
flex-shrink: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.settings-checkbox::after {
|
|
158
|
+
content: '';
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 2px;
|
|
161
|
+
left: 2px;
|
|
162
|
+
width: 18px;
|
|
163
|
+
height: 18px;
|
|
164
|
+
background: #fff;
|
|
165
|
+
border-radius: 50%;
|
|
166
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
167
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.settings-checkbox:checked {
|
|
171
|
+
background: var(--accent);
|
|
172
|
+
border-color: var(--accent);
|
|
173
|
+
box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.settings-checkbox:checked::after {
|
|
177
|
+
transform: translateX(20px);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.btn-primary {
|
|
181
|
+
background: linear-gradient(135deg, var(--accent), #2563eb);
|
|
182
|
+
color: #fff;
|
|
183
|
+
border: none;
|
|
184
|
+
padding: 10px 24px;
|
|
185
|
+
border-radius: 8px;
|
|
186
|
+
font-weight: 600;
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
transition: all 0.2s ease;
|
|
190
|
+
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.btn-primary:hover {
|
|
194
|
+
transform: translateY(-2px);
|
|
195
|
+
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.btn-secondary {
|
|
199
|
+
background: rgba(255, 255, 255, 0.05);
|
|
200
|
+
color: var(--text-primary);
|
|
201
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
202
|
+
padding: 8px 16px;
|
|
203
|
+
border-radius: 8px;
|
|
204
|
+
font-weight: 500;
|
|
205
|
+
font-size: 13px;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
transition: all 0.2s ease;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.btn-secondary:hover {
|
|
211
|
+
background: rgba(255, 255, 255, 0.1);
|
|
212
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.terminal-log {
|
|
216
|
+
background: rgba(0, 0, 0, 0.6);
|
|
217
|
+
border: 1px solid rgba(255,255,255,0.08);
|
|
218
|
+
border-radius: 8px;
|
|
219
|
+
padding: 16px;
|
|
220
|
+
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
221
|
+
font-size: 12px;
|
|
222
|
+
color: #a8b2d1;
|
|
223
|
+
white-space: pre-wrap;
|
|
224
|
+
max-height: 200px;
|
|
225
|
+
overflow-y: auto;
|
|
226
|
+
margin-top: 16px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@keyframes fade-in {
|
|
230
|
+
from { opacity: 0; transform: translateY(10px); }
|
|
231
|
+
to { opacity: 1; transform: translateY(0); }
|
|
232
|
+
}
|
|
233
|
+
`}),(0,V.jsxs)(`div`,{className:`settings-header-sticky`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{style:{fontSize:28,fontWeight:700,margin:0,background:`linear-gradient(to right, #fff, #a8b2d1)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`System Settings`}),(0,V.jsx)(`p`,{style:{margin:`4px 0 0`,color:`var(--text-secondary)`,fontSize:14},children:`Configure core system behavior, security, network bindings, and integration layers.`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[r===`saved`&&(0,V.jsx)(`span`,{style:{color:`#34d399`,fontSize:14,fontWeight:600},children:`✓ Saved successfully`}),r===`error`&&(0,V.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:`✗ Save failed`}),(0,V.jsx)(`button`,{className:`btn-primary`,onClick:E,disabled:r===`saving`,children:r===`saving`?`Saving...`:`Save Configuration`})]})]}),(0,V.jsxs)(`div`,{className:`settings-grid`,children:[(0,V.jsx)(`div`,{className:`settings-card glow-on-hover`,children:(0,V.jsx)(pa,{})}),(0,V.jsxs)(`div`,{className:`settings-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,V.jsx)(`div`,{className:`settings-icon-wrap`,style:{background:`linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.05))`,borderColor:`rgba(59, 130, 246, 0.2)`},children:`🌐`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Network & Binding`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Configure server host and ports`})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{htmlFor:`bind_host`,className:`field-label`,children:`Bind Host`}),(0,V.jsx)(`input`,{id:`bind_host`,type:`text`,className:`settings-input`,value:t.security.bind?.host??`127.0.0.1`,onChange:e=>O(`bind`,`host`,e.target.value)})]}),(0,V.jsxs)(`div`,{className:`field-col`,style:{width:100},children:[(0,V.jsx)(`label`,{htmlFor:`bind_port`,className:`field-label`,children:`Port`}),(0,V.jsx)(`input`,{id:`bind_port`,type:`number`,className:`settings-input`,value:t.security.bind?.port??3e3,onChange:e=>O(`bind`,`port`,parseInt(e.target.value,10))})]})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Allow Public Bind`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Allow listening on 0.0.0.0 interfaces`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.security.bind?.allow_public_bind,onChange:e=>O(`bind`,`allow_public_bind`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Require HTTPS`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Reject insecure HTTP requests`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.security.network?.require_https,onChange:e=>O(`network`,`require_https`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Public Health Check`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Allow pinging /health without auth`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.security.network?.public_health,onChange:e=>O(`network`,`public_health`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Allowed Origins (CORS)`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:j(t.security.network?.allowed_origins),onChange:e=>O(`network`,`allowed_origins`,M(e.target.value)),placeholder:`e.g. https://example.com, https://app.example.com`})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Trusted Proxies`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:j(t.security.network?.trusted_proxies),onChange:e=>O(`network`,`trusted_proxies`,M(e.target.value)),placeholder:`e.g. 10.0.0.1, 192.168.1.1`})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`API Requests Per Minute (Rate Limit)`}),(0,V.jsx)(`input`,{type:`number`,className:`settings-input`,value:t.security.rate_limits?.api_requests_per_minute??1200,onChange:e=>O(`rate_limits`,`api_requests_per_minute`,parseInt(e.target.value,10))})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Sandbox Requests Per Minute`}),(0,V.jsx)(`input`,{type:`number`,className:`settings-input`,value:t.security.rate_limits?.sandbox_requests_per_minute??60,onChange:e=>O(`rate_limits`,`sandbox_requests_per_minute`,parseInt(e.target.value,10))})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Ingest Requests Per Minute`}),(0,V.jsx)(`input`,{type:`number`,className:`settings-input`,value:t.security.rate_limits?.ingest_requests_per_minute??300,onChange:e=>O(`rate_limits`,`ingest_requests_per_minute`,parseInt(e.target.value,10))})]})]}),(0,V.jsxs)(`div`,{className:`settings-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,V.jsx)(`div`,{className:`settings-icon-wrap`,style:{background:`linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.05))`,borderColor:`rgba(16, 185, 129, 0.2)`},children:`🛡️`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Security & Privacy`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Manage access control and local sandboxing`})]})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Sandbox Enabled`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enforce strict code sandboxing`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.security.sandbox?.enabled,onChange:e=>O(`sandbox`,`enabled`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Force Password Reset`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Require password change on next login`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.security.dashboard?.force_password_reset,onChange:e=>O(`dashboard`,`force_password_reset`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Allow Static PATs`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enable Personal Access Tokens`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.security.api?.allow_static_pats,onChange:e=>O(`api`,`allow_static_pats`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{htmlFor:`session_ttl_hours`,className:`field-label`,children:`Dashboard Session TTL (Hours)`}),(0,V.jsx)(`input`,{id:`session_ttl_hours`,type:`number`,className:`settings-input`,value:t.security.dashboard?.session_ttl_hours??24,onChange:e=>O(`dashboard`,`session_ttl_hours`,parseInt(e.target.value,10))})]})]}),(0,V.jsxs)(`div`,{className:`settings-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,V.jsx)(`div`,{className:`settings-icon-wrap`,style:{background:`linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.05))`,borderColor:`rgba(245, 158, 11, 0.2)`},children:`💰`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Budget Limits`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Control AI spending dynamically`})]})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Enable Budget Caps`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enforce hard limits on token spend`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.budget.budget?.enabled,onChange:e=>k(`enabled`,e.target.checked)})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{htmlFor:`daily_cap`,className:`field-label`,children:`Daily Cap ($)`}),(0,V.jsx)(`input`,{id:`daily_cap`,type:`number`,step:`0.01`,className:`settings-input`,value:t.budget.budget?.daily_cap_usd??5,onChange:e=>k(`monthly_soft_cap`,e.target.value===``?null:Number(e.target.value))})]}),(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{htmlFor:`weekly_cap`,className:`field-label`,children:`Weekly Cap ($)`}),(0,V.jsx)(`input`,{id:`weekly_cap`,type:`number`,step:`0.01`,className:`settings-input`,value:t.budget.budget?.weekly_cap_usd??20,onChange:e=>k(`weekly_cap_usd`,parseFloat(e.target.value))})]})]})]}),(0,V.jsxs)(`div`,{className:`settings-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,V.jsx)(`div`,{className:`settings-icon-wrap`,style:{background:`linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.05))`,borderColor:`rgba(168, 85, 247, 0.2)`},children:`🧠`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Brain Configuration`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Manage memory kernel identities`})]})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,style:{color:`var(--text-accent)`,fontWeight:600},children:`Select Active Brain`}),(0,V.jsxs)(`select`,{className:`settings-select`,style:{border:`1px solid var(--border-accent)`,background:`rgba(59, 130, 246, 0.05)`},value:S,onChange:e=>{let t=e.target.value;t?localStorage.setItem(`total-recall-active-brain`,t):localStorage.removeItem(`total-recall-active-brain`),window.location.reload()},children:[(0,V.jsx)(`option`,{value:``,children:`Global Brain (Root)`}),b.map(e=>(0,V.jsxs)(`option`,{value:e.name,children:[e.name,` (`,e.role,` - `,e.nodes,` nodes)`]},e.name))]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Brain URL`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:t.brain?.url||``,onChange:e=>A(`url`,e.target.value)})]}),(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Brain Token`}),(0,V.jsx)(`input`,{type:`password`,className:`settings-input`,placeholder:t.brain?.has_token?`•••••••••••••••• (Leave blank)`:`No token set`,value:t.brain?.token||``,onChange:e=>A(`token`,e.target.value)})]})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Brain Name`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:t.brain?.name||``,onChange:e=>A(`name`,e.target.value)})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Role`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:t.brain?.role||``,onChange:e=>A(`role`,e.target.value)})]}),(0,V.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Layer`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:t.brain?.layer||``,onChange:e=>A(`layer`,e.target.value)})]})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{className:`field-label`,children:`Tags (Comma-Separated)`}),(0,V.jsx)(`input`,{type:`text`,className:`settings-input`,value:j(t.brain?.tags),onChange:e=>A(`tags`,M(e.target.value))})]}),(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Full Brain Mode`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enable omni-directional indexing`})]}),(0,V.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!t.brain?.full_brain,onChange:e=>A(`full_brain`,e.target.checked)})]}),(0,V.jsxs)(`div`,{className:`field-col`,children:[(0,V.jsx)(`label`,{htmlFor:`preferred_agent`,className:`field-label`,children:`Preferred CLI Agent`}),(0,V.jsxs)(`select`,{id:`preferred_agent`,className:`settings-select`,value:t.brain?.preferred_agent||`auto`,onChange:e=>A(`preferred_agent`,e.target.value),children:[(0,V.jsx)(`option`,{value:`auto`,children:`Auto-Select (Recommended)`}),(0,V.jsx)(`option`,{value:`antigravity`,children:`Antigravity (Google Deepmind)`}),(0,V.jsx)(`option`,{value:`gemini`,children:`Gemini (Google)`}),(0,V.jsx)(`option`,{value:`claude`,children:`Claude (Anthropic)`}),(0,V.jsx)(`option`,{value:`openai`,children:`OpenAI (O-Series)`}),(0,V.jsx)(`option`,{value:`grok`,children:`Grok (xAI)`})]})]})]}),(0,V.jsxs)(`div`,{className:`settings-card`,style:{gridColumn:`1 / -1`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,V.jsx)(`div`,{className:`settings-icon-wrap`,style:{background:`linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.05))`,borderColor:`rgba(236, 72, 153, 0.2)`},children:`🧩`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Ecosystem Integrations`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Chrome extensions, UCW bundles, and tools`})]})]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:24,marginTop:20},children:[(0,V.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.03)`,padding:20,borderRadius:12,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,V.jsx)(`div`,{style:{fontSize:24,marginBottom:12},children:`🦊`}),(0,V.jsx)(`h4`,{style:{margin:`0 0 8px`,fontSize:15},children:`Total Recall Browser Extension`}),(0,V.jsxs)(`p`,{style:{fontSize:13,color:`var(--text-tertiary)`,margin:`0 0 16px`,lineHeight:1.5},children:[`Capture context directly from your browser. Install from the Chrome Web Store or load unpacked from `,(0,V.jsx)(`code`,{children:`/extension`}),` directory.`]}),(0,V.jsx)(`a`,{href:`/api/extension/download`,download:!0,className:`btn-primary`,style:{display:`block`,textAlign:`center`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`},children:`Download Extension`})]}),(0,V.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.03)`,padding:20,borderRadius:12,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,V.jsx)(`div`,{style:{fontSize:24,marginBottom:12},children:`🛠️`}),(0,V.jsx)(`h4`,{style:{margin:`0 0 8px`,fontSize:15},children:`Developer Utilities`}),(0,V.jsx)(`p`,{style:{fontSize:13,color:`var(--text-tertiary)`,margin:`0 0 16px`,lineHeight:1.5},children:`Run background maintenance tasks or re-index the local search tree.`}),(0,V.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,V.jsx)(`button`,{className:`btn-secondary`,style:{flex:1},onClick:()=>D(`npx total-recall compile`,`Rebuilding Search Indexes`),children:`Rebuild Index`})})]})]}),a&&(0,V.jsx)(`div`,{className:`terminal-log`,children:a})]}),(0,V.jsxs)(`div`,{className:`settings-card`,style:{gridColumn:`1 / -1`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,V.jsx)(`div`,{className:`settings-icon-wrap`,style:{background:`linear-gradient(135deg, rgba(63, 185, 80, 0.2), rgba(34, 197, 94, 0.05))`,borderColor:`rgba(63, 185, 80, 0.2)`},children:`🚀`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`System Update`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Manage Total Recall version updates`})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:24,padding:`16px 20px`,background:`rgba(0,0,0,0.2)`,borderRadius:12,border:`1px solid rgba(255,255,255,0.05)`},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`var(--text-primary)`},children:p?.updateAvailable?`Update Available (v${p.latestVersion})`:`System is up to date`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`,marginTop:4},children:p?.updateAvailable?`A new version of Total Recall is available for download.`:`You are running the latest version.`}),_&&(0,V.jsx)(`div`,{style:{fontSize:12,color:_.includes(`error`)||_.includes(`failed`)?`#ef4444`:`#10b981`,marginTop:8},children:_})]}),p?.updateAvailable&&(0,V.jsx)(`button`,{className:`btn-primary`,onClick:T,disabled:h,style:{background:`#3fb950`,border:`none`},children:h?`Updating...`:`Download & Restart`})]})]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(360px, 1fr))`,gap:24},children:[(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,gap:16},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid var(--border)`,paddingBottom:12},children:[(0,V.jsx)(`span`,{style:{fontSize:20},children:`🧠`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:600},children:`CLI Reasoning Agents`}),(0,V.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Headless CLI reasoning agents configured on system`})]})]}),(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:C.map(e=>{let t=s?.cli_agents?.includes(e.id);return(0,V.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,background:`var(--bg-tertiary)`,padding:12,borderRadius:8,border:`1px solid var(--border)`},children:(0,V.jsxs)(`div`,{style:{flex:1},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.name}),(0,V.jsx)(`span`,{className:`badge`,style:{fontSize:9,padding:`2px 6px`,background:t?`rgba(16, 185, 129, 0.1)`:`rgba(239, 68, 68, 0.1)`,color:t?`#10b981`:`#ef4444`,border:t?`1px solid rgba(16, 185, 129, 0.2)`:`1px solid rgba(239, 68, 68, 0.2)`},children:t?`available`:`missing`})]}),(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-secondary)`,marginTop:2},children:e.desc}),(0,V.jsxs)(`div`,{style:{fontSize:9,color:`var(--text-tertiary)`,marginTop:4},children:[`Registry ID: `,e.id]})]})},e.id)})})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,gap:20},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid var(--border)`,paddingBottom:12},children:[(0,V.jsx)(`span`,{style:{fontSize:20},children:`📡`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:600},children:`CLI Agent Diagnostics`}),(0,V.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Trigger active paths check and verify registered agents`})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`p`,{style:{fontSize:12,lineHeight:1.5,color:`var(--text-secondary)`},children:[`This executes a diagnostic check on registered reasoning agents (equivalent to running `,(0,V.jsx)(`code`,{children:`npx total-recall upgrade --agents`}),` in the background) to audit paths and verify binaries.`]}),(0,V.jsx)(`button`,{onClick:w,disabled:l,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,padding:`10px`,borderRadius:6,fontWeight:500,border:`none`,marginTop:8,cursor:l?`not-allowed`:`pointer`},children:l?`⏳ Running Audit...`:`🚀 Run Diagnostics Audit`})]}),d&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:10},children:[(0,V.jsx)(`span`,{style:{fontSize:11,fontWeight:500,color:`var(--text-secondary)`},children:`Diagnostics Console Output:`}),(0,V.jsx)(`pre`,{style:{background:`#07070a`,border:`1px solid var(--border)`,padding:10,borderRadius:6,fontFamily:`var(--font-mono)`,fontSize:11,color:`#e6edf3`,whiteSpace:`pre-wrap`,maxHeight:150,overflowY:`auto`},children:d})]})]})]})]})]}):(0,V.jsx)(`div`,{style:{padding:40,color:`var(--text-secondary)`},children:(0,V.jsx)(`div`,{className:`glass-card`,style:{display:`inline-block`,padding:`12px 24px`},children:`Loading Settings...`})})}function ha(e){let{tasks:t,loading:n,showTaskForm:r,setShowTaskForm:i,taskCategory:a,setTaskCategory:o,taskTarget:s,setTaskTarget:c,taskBody:l,setTaskBody:u,taskSubmitting:d,handleCreateTask:f}=e;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,V.jsx)(`h3`,{style:{margin:0},children:`Active Scheduler Tasks`}),(0,V.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>i(!r),style:{borderColor:`var(--border)`},children:r?`Cancel`:`+ Add Custom Task`})]}),r&&(0,V.jsxs)(`form`,{onSubmit:f,style:{background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:12,padding:20,marginBottom:20,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 2fr`,gap:16},children:[(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Subsystem Category`,(0,V.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),style:{padding:`8px 10px`,borderRadius:8,background:`var(--bg-primary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,outline:`none`},children:[(0,V.jsx)(`option`,{value:`fact-seeker`,children:`Fact Seeker`}),(0,V.jsx)(`option`,{value:`post-mortem-daily`,children:`Post Mortem Daemon`}),(0,V.jsx)(`option`,{value:`clarity-rewriter`,children:`Clarity Rewriter`}),(0,V.jsx)(`option`,{value:`drift-detector`,children:`Drift Detector`}),(0,V.jsx)(`option`,{value:`dream`,children:`Dream Cycle`})]})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Target Operation / Description`,(0,V.jsx)(`input`,{type:`text`,required:!0,placeholder:`e.g. Audit security.yml files for weak encryption configs`,value:s,onChange:e=>c(e.target.value),style:{padding:`8px 10px`,borderRadius:8,background:`var(--bg-primary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,outline:`none`}})]})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Verification Payload Body (Optional Markdown)`,(0,V.jsx)(`textarea`,{placeholder:`Additional context or markdown checklist rules...`,value:l,onChange:e=>u(e.target.value),style:{padding:`10px`,borderRadius:8,background:`var(--bg-primary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,outline:`none`,minHeight:80,resize:`vertical`}})]}),(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:d||!s.trim(),style:{alignSelf:`flex-end`,minWidth:120},children:d?`Enqueuing...`:`Create Task`})]}),(0,V.jsx)(`div`,{className:`card-grid`,style:{display:`flex`,flexDirection:`column`,gap:12},children:n&&t.length===0?[1,2,3].map(e=>(0,V.jsx)(`div`,{className:`skeleton`,style:{height:68}},e)):t.length===0?(0,V.jsxs)(`div`,{style:{textAlign:`center`,padding:`50px 20px`,color:`var(--text-tertiary)`,border:`1px dashed var(--border)`,borderRadius:12},children:[`No tasks are currently running.`,(0,V.jsx)(`br`,{}),(0,V.jsxs)(`span`,{style:{fontSize:12},children:[`Click `,(0,V.jsx)(`strong`,{children:`Seed Gaps`}),` above to trigger autonomous background schedules.`]})]}):t.map(e=>(0,V.jsxs)(`div`,{className:`card`,style:{padding:`16px 20px`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:12},children:[(0,V.jsxs)(`div`,{style:{flex:1,marginRight:16},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4},children:[(0,V.jsxs)(`span`,{className:`badge ${e.category.includes(`clarity`)?`badge-primary`:e.category.includes(`post-mortem`)?`badge-error`:`badge-accent`}`,style:{fontSize:11,display:`flex`,alignItems:`center`,gap:4},children:[e.category.includes(`clarity`)&&(0,V.jsx)(`span`,{children:`✨`}),e.category.includes(`post-mortem`)&&(0,V.jsx)(`span`,{children:`💀`}),e.category]}),(0,V.jsx)(`h4`,{style:{margin:0,fontSize:14,fontWeight:600},children:e.target})]}),e.body&&(0,V.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:12,color:`var(--text-secondary)`,lineBreak:`anywhere`},children:e.body}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16,marginTop:8,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsxs)(`span`,{children:[`Ref: `,(0,V.jsx)(`code`,{children:e.slug})]}),(0,V.jsxs)(`span`,{children:[`Priority Weight: `,e.priority]})]})]}),(0,V.jsx)(`span`,{className:`badge ${e.status===`completed`?`badge-success`:e.status===`failed`?`badge-error`:`badge-warning`}`,style:{textTransform:`capitalize`,minWidth:80,textAlign:`center`},children:e.status})]},e.slug))})]})}function ga(e){let{researchItems:t,loading:n,showResearchForm:r,setShowResearchForm:i,researchTopic:a,setResearchTopic:o,researchPriority:s,setResearchPriority:c,researchNotes:l,setResearchNotes:u,researchSubmitting:d,handleCreateResearch:f,expandedResearchId:p,handleToggleExpand:m,loadedDiscoveries:h,loadingNodeSlugs:g,refreshResearch:_}=e,[y,b]=(0,v.useState)(null),x=(0,v.useRef)(null),[S,C]=(0,v.useState)({}),w=async(e,t)=>{try{await $r(e,t),_?.()}catch(e){console.error(`Failed to update research:`,e)}},T=async e=>{if(confirm(`Cancel this research project?`))try{await ei(e),_?.()}catch(e){console.error(`Failed to delete research:`,e)}};return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,V.jsx)(`h3`,{style:{margin:0},children:`Vector Research agenda`}),(0,V.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>i(!r),style:{borderColor:`var(--border)`},children:r?`Cancel`:`+ Queue Research Topic`})]}),r&&(0,V.jsxs)(`form`,{onSubmit:f,style:{background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:12,padding:20,marginBottom:20,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`2fr 1fr`,gap:16},children:[(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Research Query / Topic`,(0,V.jsx)(`input`,{type:`text`,required:!0,placeholder:`e.g. Bun vs Node.js HTTP clustering performance benchmarks`,value:a,onChange:e=>o(e.target.value),style:{padding:`8px 10px`,borderRadius:8,background:`var(--bg-primary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,outline:`none`}})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Agenda Priority`,(0,V.jsxs)(`select`,{value:s,onChange:e=>c(e.target.value),style:{padding:`8px 10px`,borderRadius:8,background:`var(--bg-primary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,outline:`none`},children:[(0,V.jsx)(`option`,{value:`low`,children:`Low`}),(0,V.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,V.jsx)(`option`,{value:`high`,children:`High`}),(0,V.jsx)(`option`,{value:`critical`,children:`Critical`})]})]})]}),(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Target Gaps / Reference Notes`,(0,V.jsx)(`textarea`,{placeholder:`Identify specific APIs, libraries or cutoff dates...`,value:l,onChange:e=>u(e.target.value),style:{padding:`10px`,borderRadius:8,background:`var(--bg-primary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,outline:`none`,minHeight:80,resize:`vertical`}})]}),(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:d||!a.trim(),style:{alignSelf:`flex-end`,minWidth:120},children:d?`Queueing...`:`Add to Agenda`})]}),(0,V.jsx)(`div`,{style:{overflowX:`auto`,border:`1px solid var(--border)`,borderRadius:12,background:`var(--bg-secondary)`},children:(0,V.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:13},children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border)`,color:`var(--text-secondary)`,textAlign:`left`,background:`rgba(255, 255, 255, 0.02)`},children:[(0,V.jsx)(`th`,{style:{padding:`12px 16px`,width:40,textAlign:`center`}}),(0,V.jsx)(`th`,{style:{padding:`12px 16px`},children:`Research Topic`}),(0,V.jsx)(`th`,{style:{padding:`12px 16px`,width:100},children:`Priority`}),(0,V.jsx)(`th`,{style:{padding:`12px 16px`,width:120},children:`Status`}),(0,V.jsx)(`th`,{style:{padding:`12px 16px`,width:160},children:`Updated At`})]})}),(0,V.jsx)(`tbody`,{children:n&&t.length===0?(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:5,style:{textAlign:`center`,padding:24,color:`var(--text-tertiary)`},children:`Loading agenda...`})}):t.length===0?(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:5,style:{textAlign:`center`,padding:40,color:`var(--text-tertiary)`},children:`No active research topics queued.`})}):t.map(e=>{let t=p===e.id,n=e.node_slug?h[e.node_slug]:null,r=e.node_slug?g[e.node_slug]:!1;return(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{onClick:()=>m(e),style:{borderBottom:t?`none`:`1px solid var(--border)`,cursor:`pointer`,background:t?`rgba(255, 255, 255, 0.015)`:`transparent`,transition:`background 0.2s ease`},children:[(0,V.jsx)(`td`,{style:{padding:`14px 16px`,textAlign:`center`,color:`var(--text-tertiary)`},children:(0,V.jsx)(`span`,{style:{display:`inline-block`,transform:t?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.2s`,fontSize:10},children:`▶`})}),(0,V.jsxs)(`td`,{style:{padding:`14px 16px`},children:[(0,V.jsx)(`div`,{style:{fontWeight:600,color:`var(--text-primary)`},children:e.topic}),e.notes&&(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`,marginTop:4},children:e.notes})]}),(0,V.jsx)(`td`,{style:{padding:`14px 16px`},children:(0,V.jsx)(`span`,{className:`badge ${e.priority===`critical`?`badge-error`:e.priority===`high`?`badge-accent`:e.priority===`medium`?`badge-warning`:`badge-ghost`}`,style:{fontSize:11,textTransform:`capitalize`},children:e.priority})}),(0,V.jsx)(`td`,{style:{padding:`14px 16px`},children:(0,V.jsx)(`span`,{className:`badge ${e.node_slug&&(e.status===`pending`||e.status===`in_progress`)||e.status===`done`?`badge-success`:e.status===`in_progress`?`badge-accent`:e.status===`failed`?`badge-error`:`badge-warning`}`,style:{textTransform:`capitalize`,fontSize:11},children:e.node_slug&&(e.status===`pending`||e.status===`in_progress`)?`Researched`:e.status.replace(`_`,` `)})}),(0,V.jsx)(`td`,{style:{padding:`14px 16px`,color:`var(--text-tertiary)`,fontSize:12},children:new Date(e.updated_at).toLocaleString([],{dateStyle:`short`,timeStyle:`short`})})]}),t&&(0,V.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border)`,background:`rgba(255, 255, 255, 0.015)`},children:(0,V.jsx)(`td`,{colSpan:5,style:{padding:`0 24px 20px 24px`},children:(0,V.jsxs)(`div`,{style:{border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:12,background:`rgba(10, 10, 15, 0.4)`,padding:20,boxShadow:`inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 20px rgba(0, 0, 0, 0.3)`},children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
|
|
234
|
+
@keyframes pulse {
|
|
235
|
+
0% { transform: scale(0.95); opacity: 0.5; }
|
|
236
|
+
50% { transform: scale(1.05); opacity: 1; }
|
|
237
|
+
100% { transform: scale(0.95); opacity: 0.5; }
|
|
238
|
+
}
|
|
239
|
+
`}}),(0,V.jsxs)(`div`,{style:{marginBottom:20},children:[(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.05em`,fontWeight:600,marginBottom:12},children:`Cognitive Research Engine Progress`}),(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(160px, 1fr))`,gap:12},children:[{title:`Data Acquisition`,phase:`acquisition`,icon:`🔍`,desc:`Deep multi-source crawling & LLM synthesis`},{title:`Cognitive Deliberation`,phase:`deliberation`,icon:`🧠`,desc:`System 2 context evaluation & insights`},{title:`Clarity Auditing`,phase:`improvement`,icon:`✨`,desc:`Markdown polish & premium layout restructuring`},{title:`Source Monitoring`,phase:`monitoring`,icon:`📡`,desc:`Ongoing newsletter, RSS & release tracking`},{title:`Tangent Spawning`,phase:`expansion`,icon:`🚀`,desc:`Autonomously brainstorming & enqueuing tangents`}].map((t,n)=>{let r=[`acquisition`,`deliberation`,`improvement`,`monitoring`,`expansion`],i=e.research_phase||`acquisition`,a=r.indexOf(i),o=`upcoming`;n<a?o=`completed`:n===a&&(o=e.status===`in_progress`?`active`:e.status===`pending`?`waiting`:e.status===`failed`?`failed`:`waiting`);let s=`rgba(255, 255, 255, 0.04)`,c=`rgba(255, 255, 255, 0.01)`,l=`var(--text-secondary)`,u=`rgba(255, 255, 255, 0.02)`,d=`Locked`,f=`var(--text-tertiary)`,p=!1;return o===`completed`?(s=`rgba(46, 204, 113, 0.25)`,c=`rgba(46, 204, 113, 0.02)`,l=`#fff`,u=`rgba(46, 204, 113, 0.12)`,d=`✓ Completed`,f=`#2ecc71`):o===`active`?(s=`rgba(108, 92, 231, 0.45)`,c=`rgba(108, 92, 231, 0.05)`,l=`#fff`,u=`rgba(108, 92, 231, 0.18)`,d=`⚡ Running`,f=`var(--accent)`,p=!0):o===`waiting`?(s=`rgba(241, 196, 15, 0.25)`,c=`rgba(241, 196, 15, 0.02)`,l=`var(--text-primary)`,u=`rgba(241, 196, 15, 0.1)`,d=`⏳ Queued`,f=`#f1c40f`):o===`failed`&&(s=`rgba(231, 76, 60, 0.25)`,c=`rgba(231, 76, 60, 0.02)`,l=`var(--text-primary)`,u=`rgba(231, 76, 60, 0.1)`,d=`⚠️ Failed`,f=`#e74c3c`),(0,V.jsxs)(`div`,{style:{border:`1px solid ${s}`,background:c,borderRadius:10,padding:12,display:`flex`,flexDirection:`column`,gap:6,transition:`all 0.3s ease`,position:`relative`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24,borderRadius:`50%`,background:u,fontSize:12},children:t.icon}),(0,V.jsxs)(`span`,{style:{fontSize:10,fontWeight:700,color:f,display:`inline-flex`,alignItems:`center`,gap:4},children:[p&&(0,V.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:`var(--accent)`,animation:`pulse 1.5s infinite ease-in-out`}}),d]})]}),(0,V.jsxs)(`div`,{style:{fontSize:12,fontWeight:600,color:l},children:[n+1,`. `,t.title]}),(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,lineHeight:1.3},children:t.desc})]},n)})})]}),(0,V.jsx)(`hr`,{style:{border:`none`,borderTop:`1px solid rgba(255, 255, 255, 0.06)`,margin:`20px 0`}}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,padding:`0 0 16px`,flexWrap:`wrap`},children:[e.status===`in_progress`&&(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`paused`})},children:`⏸ Pause`}),(e.status===`paused`||e.status===`failed`)&&(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`pending`})},children:`▶️ Resume`}),e.status===`done`&&(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`pending`,research_phase:`acquisition`})},children:`🔄 Re-run`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),b(e.id)},children:`🎯 Steer`}),e.status!==`done`&&(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`done`})},children:`✅ Conclude`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,style:{borderColor:`var(--error)`,color:`var(--error)`},onClick:t=>{t.stopPropagation(),T(e.id)},children:`❌ Cancel`})]}),e.node_slug?(0,V.jsx)(V.Fragment,{children:r?(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,color:`var(--text-secondary)`},children:[(0,V.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,style:{animation:`spin 1s linear infinite`},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,V.jsx)(`span`,{children:`Reading memory node and cataloging discoveries...`})]}):n?(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[e.status===`in_progress`&&(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,background:`rgba(108, 92, 231, 0.1)`,border:`1px solid rgba(108, 92, 231, 0.2)`,borderRadius:8,padding:`8px 12px`,fontSize:12,color:`var(--accent)`,marginBottom:4},children:[(0,V.jsx)(`span`,{className:`pulse`,style:{background:`var(--accent)`,width:8,height:8,borderRadius:`50%`,display:`inline-block`}}),(0,V.jsx)(`span`,{children:`Fact-seeker agents are currently updating this topic in the background. Previous discoveries are displayed below.`})]}),e.status===`pending`&&(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,background:`rgba(241, 196, 15, 0.1)`,border:`1px solid rgba(241, 196, 15, 0.2)`,borderRadius:8,padding:`8px 12px`,fontSize:12,color:`var(--warning)`,marginBottom:4},children:[(0,V.jsx)(`span`,{children:`⏳`}),(0,V.jsx)(`span`,{children:`Scheduled for automatic refresh. Previous discoveries are displayed below.`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,flexWrap:`wrap`,gap:12,borderBottom:`1px solid rgba(255, 255, 255, 0.06)`,paddingBottom:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h4`,{style:{margin:0,fontSize:15,fontWeight:700,color:`#fff`},children:n.title}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,marginTop:6,alignItems:`center`},children:[(0,V.jsx)(`span`,{className:`badge badge-accent`,style:{fontSize:10,padding:`2px 8px`},children:n.category}),n.modality&&(0,V.jsx)(`span`,{className:`badge`,style:{fontSize:10,padding:`2px 8px`,background:`rgba(255,255,255,0.06)`,color:`var(--text-secondary)`},children:n.modality})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`},children:[n.importance!==void 0&&(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,background:`rgba(255, 255, 255, 0.03)`,padding:`4px 8px`,borderRadius:6,fontSize:11,color:`var(--text-secondary)`,border:`1px solid rgba(255,255,255,0.04)`},children:[(0,V.jsx)(`span`,{children:`⭐ Importance:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[n.importance,`/5`]})]}),n.confidence!==void 0&&(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,background:n.confidence>=.9?`rgba(0, 206, 201, 0.08)`:`rgba(108, 92, 231, 0.08)`,border:`1px solid ${n.confidence>=.9?`rgba(0, 206, 201, 0.3)`:`rgba(108, 92, 231, 0.3)`}`,borderRadius:6,padding:`4px 8px`,fontSize:11,color:n.confidence>=.9?`var(--success)`:`var(--accent)`},children:[(0,V.jsx)(`span`,{children:`✓ Confidence:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600},children:[(n.confidence*100).toFixed(0),`%`]})]})]})]}),(0,V.jsxs)(`div`,{style:{position:`relative`},children:[(0,V.jsx)(`div`,{style:{maxHeight:S[e.id]?`none`:500,overflow:`hidden`,paddingRight:8,transition:`max-height 0.3s ease`},children:(0,V.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`},children:ji(n.content||n.body||``)})}),!S[e.id]&&(n.content||n.body||``).length>800&&(0,V.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,height:80,background:`linear-gradient(transparent, rgba(10, 10, 15, 0.95))`,pointerEvents:`none`}})]}),(n.content||n.body||``).length>800&&(0,V.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:t=>{t.stopPropagation(),C(t=>({...t,[e.id]:!t[e.id]}))},style:{alignSelf:`flex-start`,marginTop:8,fontSize:12,color:`var(--accent)`},children:S[e.id]?`▲ Show less`:`▼ Show more`}),ki(n.content||n.body).length>0&&(0,V.jsxs)(`div`,{style:{borderTop:`1px solid rgba(255, 255, 255, 0.06)`,paddingTop:12},children:[(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.04em`,fontWeight:600,marginBottom:8},children:`Sources & Citations`}),(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:ki(n.content||n.body).map((e,t)=>{let n=(()=>{try{return new URL(e.url).hostname.replace(/^www\./,``)}catch{return e.url}})();return(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,background:`rgba(108, 92, 231, 0.06)`,border:`1px solid rgba(108, 92, 231, 0.2)`,borderRadius:10,padding:`8px 14px`,fontSize:12,transition:`all 0.2s`},children:[(0,V.jsx)(`img`,{src:`https://www.google.com/s2/favicons?domain=${n}&sz=16`,width:16,height:16,alt:``,style:{borderRadius:2,flexShrink:0}}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2,flex:1,minWidth:0},children:[(0,V.jsx)(`span`,{style:{fontWeight:600,color:`var(--text-primary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.text}),(0,V.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:n})]}),(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-sm`,style:{fontSize:11,padding:`3px 10px`,textDecoration:`none`,flexShrink:0},onClick:e=>e.stopPropagation(),children:`Open`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,style:{fontSize:11,padding:`3px 10px`,flexShrink:0},onClick:t=>{t.stopPropagation(),li({url:e.url,action:`research`,title:e.text}).catch(console.error)},children:`🔬 Research deeper`})]},t)})})]})]}):(0,V.jsxs)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:13},children:[`No memory synthesis node found for slug: `,(0,V.jsx)(`code`,{children:e.node_slug})]})}):(0,V.jsxs)(V.Fragment,{children:[e.status===`pending`&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--warning)`,fontWeight:600,fontSize:14},children:[(0,V.jsx)(`span`,{children:`⏳`}),` Queued for Ingestion`]}),(0,V.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:13,margin:0},children:`This research topic is enqueued in the Cognitive Scheduler. The background fact-seeker daemon will systematically synthesize findings and catalog discoveries when processing background gaps.`})]}),e.status===`in_progress`&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--accent)`,fontWeight:600,fontSize:14},children:[(0,V.jsx)(`span`,{className:`pulse`,style:{background:`var(--accent)`}}),`Synthesizing Deep Discoveries...`]}),(0,V.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:13,margin:0},children:`Fact-seeker agents are actively searching vector indexes, crawling target APIs, and structuring new domain schemas. Results will be verified by the System 2 consensus writer.`})]}),e.status===`failed`&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--error)`,fontWeight:600,fontSize:14},children:[(0,V.jsx)(`span`,{children:`⚠️`}),` Ingestion Boundary Encountered`]}),(0,V.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:13,margin:0},children:`The research pipeline failed to produce high-confidence consensus conclusions or hit an instruction boundary. Check live cognitive console logs for execution specifics.`})]})]})]})})})]},e.id)})})]})}),y&&(0,V.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3},children:(0,V.jsxs)(`div`,{style:{background:`var(--bg-secondary, #1e1e2e)`,borderRadius:`12px`,padding:`24px`,maxWidth:`500px`,width:`90%`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{style:{margin:`0 0 12px`},children:`🎯 Steer Research`}),(0,V.jsx)(`textarea`,{ref:x,placeholder:`Add direction... e.g. 'Focus more on pricing comparisons'`,style:{width:`100%`,minHeight:`100px`,borderRadius:`8px`,padding:`12px`,background:`var(--bg-primary, #11111b)`,color:`inherit`,border:`1px solid var(--border, #333)`,outline:`none`,resize:`vertical`,boxSizing:`border-box`}}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginTop:`12px`,justifyContent:`flex-end`},children:[(0,V.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>b(null),children:`Cancel`}),(0,V.jsx)(`button`,{className:`btn btn-sm btn-primary`,onClick:async()=>{if(!y||!x.current)return;let e=x.current.value.trim();if(e)try{await $r(y,{notes:e}),b(null),_?.()}catch(e){console.error(`Failed to steer research:`,e)}},children:`Submit`})]})]})})]})}function _a({logs:e,activeTab:t}){let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{t===`logs`&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e,t]),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{className:`pulse`,style:{background:`#10b981`,width:8,height:8}}),(0,V.jsx)(`h3`,{style:{margin:0},children:`Cognitive Daemon Stream`})]}),(0,V.jsx)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Auto-refreshing every 3s`})]}),(0,V.jsxs)(`div`,{ref:n,style:{background:`#090d16`,border:`1px solid var(--border)`,borderRadius:12,padding:20,fontFamily:`Consolas, Monaco, "Andale Mono", monospace`,fontSize:13,color:`#34d399`,lineHeight:`1.6`,height:`460px`,overflowY:`auto`,whiteSpace:`pre-wrap`,boxShadow:`inset 0 0 20px rgba(0, 0, 0, 0.8)`,position:`relative`},children:[(0,V.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(52, 211, 153, 0.1)`,paddingBottom:10,marginBottom:14,display:`flex`,justifyContent:`space-between`,color:`#60a5fa`,fontSize:12},children:[(0,V.jsx)(`span`,{children:`TOTAL RECALL COGNITIVE DAEMON CONSOLE // active-tunnel-listener`}),(0,V.jsxs)(`span`,{children:[`UTC-CLOCK: `,new Date().toISOString()]})]}),e]})]})}function va(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)({pending:0,in_progress:0,done:0,failed:0}),[o,s]=(0,v.useState)(`(loading live cognitive stream...)`),[c,l]=(0,v.useState)(`tasks`),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)({}),[C,w]=(0,v.useState)({}),T=async e=>{if(y===e.id){b(null);return}if(b(e.id),e.node_slug&&!x[e.node_slug]&&!C[e.node_slug]){w(t=>({...t,[e.node_slug]:!0}));try{let t=await pr(e.node_slug);S(n=>({...n,[e.node_slug]:t}))}catch(e){console.error(`Failed to load memory node for research`,e),p(`Failed to load memory node: ${e.message}`)}finally{w(t=>({...t,[e.node_slug]:!1}))}}},[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(`fact-seeker`),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)(``),[P,F]=(0,v.useState)(!1),[I,L]=(0,v.useState)(!1),[ee,te]=(0,v.useState)(``),[ne,re]=(0,v.useState)(`medium`),[ie,R]=(0,v.useState)(``),[ae,oe]=(0,v.useState)(!1),se=(0,v.useCallback)(async()=>{try{t(await si()||[]),p(``)}catch(e){console.error(e),p(`Failed to fetch tasks: ${e.message}`)}},[]),ce=(0,v.useCallback)(async()=>{try{let e=await Zr();r(e.items||[]);let t={pending:0,in_progress:0,done:0,failed:0};for(let n of e.items||[])t[n.status]!==void 0&&t[n.status]++;a(t),p(``)}catch(e){console.error(e),p(`Failed to fetch research: ${e.message}`)}},[]),le=(0,v.useCallback)(async()=>{if(c===`logs`)try{return s((await ri(`server`)).content||`(no logs streamed yet)`),!0}catch(e){return s(`Error connecting to cognitive logs: ${e.message}`),!1}},[c]),ue=(0,v.useCallback)(async()=>{d(!0),await Promise.all([se(),ce(),le()]),d(!1)},[se,ce,le]);return(0,v.useEffect)(()=>{let e,t=!0,n=0,r=async()=>{if(t&&((await Promise.all([se(),ce(),le()])).includes(!1)?n++:n=0,t)){let t=Math.min(3e3*2**n,6e4);e=setTimeout(r,t)}};return(async()=>{await Promise.all([se(),ce(),le()]),d(!1),t&&(e=setTimeout(r,3e3))})(),()=>{t=!1,clearTimeout(e)}},[se,ce,le]),(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:16},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{children:`Cognitive Dashboard`}),(0,V.jsx)(`p`,{children:`Real-time background reasoning engine, autonomous research, and active schedulers`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,V.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:async()=>{p(``),_(``);try{await ci(`fact-seeker`,`Audit latest Chrome Extension MV3 API updates`,`Verify if chrome.declarativeNetRequest rulesets have new declarative properties.`),await ci(`post-mortem-daily`,`Ingest yesterday's IDE compile session logs`,`Analyze TypeScript build latency and suggest performance optimizations.`),await ci(`clarity-rewriter`,`Harden security.yml authentication encryption`,`Enforce bcrypt rounds to 12 and verify cross-origin session domain locks.`),await Qr(`TypeScript 5.4 advanced mapped types and template literal constraints`,`high`,`Evaluate mapped type performance on large monorepos.`),await Qr(`Glassmorphism backdrop-filter performance optimizations on mobile Safari`,`medium`,`Prevent GPU compositing lag by limiting blur radius.`),await Qr(`Local LLM quantization (GGUF vs EXL2) memory efficiency on macOS`,`high`,`Check metal buffer usage in Ollama backend models.`),_(`Autonomous gaps seeded successfully! Task queue and research agenda are now full.`),setTimeout(()=>_(``),5e3),ue()}catch(e){p(e.message)}},style:{border:`1px solid rgba(59, 130, 246, 0.4)`,background:`rgba(59, 130, 246, 0.05)`,color:`#60a5fa`},children:`🔥 Seed Gaps`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:async()=>{if(!m){h(!0),p(``),_(``);try{await ii(),_(`Surface projections recompiled successfully`),setTimeout(()=>_(``),4e3),ue()}catch(e){p(`Recompile failed: ${e.message}`)}finally{h(!1)}}},disabled:m,style:{background:m?`var(--bg-secondary)`:`linear-gradient(135deg, #3b82f6, #1d4ed8)`,color:`#ffffff`,border:`none`,cursor:m?`not-allowed`:`pointer`},children:m?(0,V.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,style:{animation:`spin 1s linear infinite`},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`Compiling...`]}):`Recompile Surface`})]})]}),f&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:16,display:`inline-flex`},children:[`⚠️ `,f]}),g&&(0,V.jsxs)(`div`,{className:`badge badge-success`,style:{marginBottom:16,display:`inline-flex`,background:`rgba(16, 185, 129, 0.1)`,border:`1px solid #10b981`,color:`#34d399`},children:[`✓ `,g]}),(0,V.jsxs)(`div`,{style:{display:`flex`,borderBottom:`1px solid var(--border)`,marginBottom:20,gap:20},children:[(0,V.jsxs)(`button`,{onClick:()=>l(`tasks`),style:{background:`none`,border:`none`,borderBottom:c===`tasks`?`2px solid #3b82f6`:`2px solid transparent`,color:c===`tasks`?`var(--text-primary)`:`var(--text-tertiary)`,padding:`10px 4px`,cursor:`pointer`,fontSize:14,fontWeight:500,display:`flex`,alignItems:`center`,gap:8},children:[`📅 Task Queue`,(0,V.jsx)(`span`,{className:`badge badge-accent`,style:{fontSize:10,padding:`2px 6px`},children:e.length})]}),(0,V.jsxs)(`button`,{onClick:()=>l(`research`),style:{background:`none`,border:`none`,borderBottom:c===`research`?`2px solid #3b82f6`:`2px solid transparent`,color:c===`research`?`var(--text-primary)`:`var(--text-tertiary)`,padding:`10px 4px`,cursor:`pointer`,fontSize:14,fontWeight:500,display:`flex`,alignItems:`center`,gap:8},children:[`🔬 Research Agenda`,(0,V.jsx)(`span`,{className:`badge`,style:{fontSize:10,padding:`2px 6px`,background:`rgba(16, 185, 129, 0.1)`,color:`#34d399`,border:`1px solid rgba(16, 185, 129, 0.2)`},children:i.pending+i.in_progress})]}),(0,V.jsxs)(`button`,{onClick:()=>l(`logs`),style:{background:`none`,border:`none`,borderBottom:c===`logs`?`2px solid #3b82f6`:`2px solid transparent`,color:c===`logs`?`var(--text-primary)`:`var(--text-tertiary)`,padding:`10px 4px`,cursor:`pointer`,fontSize:14,fontWeight:500,display:`flex`,alignItems:`center`,gap:8},children:[`📟 Live Brain Stream`,(0,V.jsx)(`span`,{className:`pulse`,style:{background:`#10b981`,width:6,height:6,borderRadius:`50%`}})]})]}),c===`tasks`&&(0,V.jsx)(ha,{tasks:e,loading:u,showTaskForm:E,setShowTaskForm:D,taskCategory:O,setTaskCategory:k,taskTarget:A,setTaskTarget:j,taskBody:M,setTaskBody:N,taskSubmitting:P,handleCreateTask:async e=>{if(e.preventDefault(),A.trim()){F(!0),p(``);try{await ci(O,A.trim(),M.trim()),j(``),N(``),D(!1),_(`Task enqueued successfully!`),setTimeout(()=>_(``),3e3),se()}catch(e){p(e.message)}finally{F(!1)}}}}),c===`research`&&(0,V.jsx)(ga,{researchItems:n,loading:u,showResearchForm:I,setShowResearchForm:L,researchTopic:ee,setResearchTopic:te,researchPriority:ne,setResearchPriority:re,researchNotes:ie,setResearchNotes:R,researchSubmitting:ae,handleCreateResearch:async e=>{if(e.preventDefault(),ee.trim()){oe(!0),p(``);try{await Qr(ee.trim(),ne,ie.trim()||void 0),te(``),R(``),L(!1),_(`Research project enqueued successfully!`),setTimeout(()=>_(``),3e3),ce()}catch(e){p(e.message)}finally{oe(!1)}}},expandedResearchId:y,handleToggleExpand:T,loadedDiscoveries:x,loadingNodeSlugs:C,refreshResearch:ce}),c===`logs`&&(0,V.jsx)(_a,{logs:o,activeTab:c})]})}function ya(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ba(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function xa(){return Sa.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var Sa={stubThis:e=>e};function Ca(e){let{id:t}=e;return{...e,id:ba(t),transports:e.transports}}function wa(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var Ta=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function Ea({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Ta({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Ta({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Ta({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Ta({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new Ta({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Ta({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Ta({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Ta({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!wa(t))return new Ta({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Ta({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Ta({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new Ta({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var Da=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Oa=[`cross-platform`,`platform`];function ka(e){if(e&&!(Oa.indexOf(e)<0))return e}async function Aa(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!xa())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:ba(t.challenge),user:{...t.user,id:ba(t.user.id)},excludeCredentials:t.excludeCredentials?.map(Ca)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=Da.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw Ea({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){ja(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=ya(e))}catch(e){ja(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=ya(c.getAuthenticatorData())}catch(e){ja(`getAuthenticatorData()`,e)}return{id:o,rawId:ya(s),response:{attestationObject:ya(c.attestationObject),clientDataJSON:ya(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:ka(a.authenticatorAttachment)}}function ja(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function Ma(){if(!xa())return Na.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Na.stubThis(new Promise(e=>e(!1))):Na.stubThis(e.isConditionalMediationAvailable())}var Na={stubThis:e=>e};function Pa({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Ta({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Ta({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!wa(t))return new Ta({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Ta({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Ta({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function Fa(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!xa())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(Ca));let a={...t,challenge:ba(t.challenge),allowCredentials:i},o={};if(n){if(!await Ma())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Da.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Pa({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=ya(u.userHandle)),{id:c,rawId:ya(l),response:{authenticatorData:ya(u.authenticatorData),clientDataJSON:ya(u.clientDataJSON),signature:ya(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:ka(s.authenticatorAttachment)}}var Ia=(0,v.createContext)(null),La=()=>(0,v.useContext)(Ia);function Ra(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ra(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function za(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ra(e))&&(r&&(r+=` `),r+=t);return r}var Ba=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function Va(e){return typeof e==`string`?Ba.includes(e):!1}var Ha=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function Ua(e){return typeof e==`string`?Ha.has(e):!1}function Wa(e){return typeof e==`string`&&e.startsWith(`data-`)}function Ga(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Ua(n)||Wa(n))&&(t[n]=e[n]);return t}function Ka(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return Ga(t)}return typeof e==`object`&&!Array.isArray(e)?Ga(e):null}function qa(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Ua(n)||Wa(n)||Va(n))&&(t[n]=e[n]);return t}function Ja(e){return e==null?null:(0,v.isValidElement)(e)?qa(e.props):typeof e==`object`&&!Array.isArray(e)?qa(e):null}var Ya=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(null,arguments)}function Za(e,t){if(e==null)return{};var n,r,i=Qa(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qa(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var $a=(0,v.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=Za(e,Ya),d=a||{width:r,height:i,x:0,y:0},f=za(`recharts-surface`,o);return v.createElement(`svg`,Xa({},qa(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),v.createElement(`title`,null,c),v.createElement(`desc`,null,l),n)});function U(e){return function(){return e}}var eo=Math.cos,to=Math.sin,no=Math.sqrt,ro=Math.PI;ro/2;var io=2*ro,ao=Math.PI,oo=2*ao,so=1e-6,co=oo-so;function W(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function lo(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return W;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var uo=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?W:lo(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>so)if(!(Math.abs(u*s-c*l)>so)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((ao-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>so&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>so||Math.abs(this._y1-l)>so)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%oo+oo),d>co?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>so&&this._append`A${n},${n},0,${+(d>=ao)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function fo(){return new uo}fo.prototype=uo.prototype;function po(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new uo(t)}Array.prototype.slice;function mo(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ho(e){this._context=e}ho.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function go(e){return new ho(e)}function _o(e){return e[0]}function vo(e){return e[1]}function yo(e,t){var n=U(!0),r=null,i=go,a=null,o=po(s);e=typeof e==`function`?e:e===void 0?_o:U(e),t=typeof t==`function`?t:t===void 0?vo:U(t);function s(s){var c,l=(s=mo(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:U(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:U(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:U(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function bo(e,t,n){var r=null,i=U(!0),a=null,o=go,s=null,c=po(l);e=typeof e==`function`?e:e===void 0?_o:U(+e),t=typeof t==`function`?t:U(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?vo:U(+n);function l(l){var u,d,f,p=(l=mo(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return yo().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:U(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:U(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:U(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:U(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:U(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:U(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:U(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var xo=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function So(e){return new xo(e,!0)}function Co(e){return new xo(e,!1)}var wo={draw(e,t){let n=no(t/ro);e.moveTo(n,0),e.arc(0,0,n,0,io)}},To={draw(e,t){let n=no(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Eo=no(1/3),Do=Eo*2,Oo={draw(e,t){let n=no(t/Do),r=n*Eo;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ko={draw(e,t){let n=no(t),r=-n/2;e.rect(r,r,n,n)}},Ao=.8908130915292852,jo=to(ro/10)/to(7*ro/10),Mo=to(io/10)*jo,No=-eo(io/10)*jo,Po={draw(e,t){let n=no(t*Ao),r=Mo*n,i=No*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=io*t/5,o=eo(a),s=to(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},Fo=no(3),Io={draw(e,t){let n=-no(t/(Fo*3));e.moveTo(0,n*2),e.lineTo(-Fo*n,-n),e.lineTo(Fo*n,-n),e.closePath()}},Lo=-.5,Ro=no(3)/2,zo=1/no(12),Bo=(zo/2+1)*3,Vo={draw(e,t){let n=no(t/Bo),r=n/2,i=n*zo,a=r,o=n*zo+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(Lo*r-Ro*i,Ro*r+Lo*i),e.lineTo(Lo*a-Ro*o,Ro*a+Lo*o),e.lineTo(Lo*s-Ro*c,Ro*s+Lo*c),e.lineTo(Lo*r+Ro*i,Lo*i-Ro*r),e.lineTo(Lo*a+Ro*o,Lo*o-Ro*a),e.lineTo(Lo*s+Ro*c,Lo*c-Ro*s),e.closePath()}};function Ho(e,t){let n=null,r=po(i);e=typeof e==`function`?e:U(e||wo),t=typeof t==`function`?t:U(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:U(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:U(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function Uo(){}function Wo(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Go(e){this._context=e}Go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Wo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Wo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ko(e){return new Go(e)}function qo(e){this._context=e}qo.prototype={areaStart:Uo,areaEnd:Uo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Wo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jo(e){return new qo(e)}function Yo(e){this._context=e}Yo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Wo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Xo(e){return new Yo(e)}function Zo(e){this._context=e}Zo.prototype={areaStart:Uo,areaEnd:Uo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Qo(e){return new Zo(e)}function $o(e){return e<0?-1:1}function es(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return($o(a)+$o(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ts(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ns(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function rs(e){this._context=e}rs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ns(this,this._t0,ts(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ns(this,ts(this,n=es(this,e,t)),n);break;default:ns(this,this._t0,n=es(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function is(e){this._context=new as(e)}(is.prototype=Object.create(rs.prototype)).point=function(e,t){rs.prototype.point.call(this,t,e)};function as(e){this._context=e}as.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function os(e){return new rs(e)}function ss(e){return new is(e)}function cs(e){this._context=e}cs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ls(e),i=ls(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function ls(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function us(e){return new cs(e)}function ds(e,t){this._context=e,this._t=t}ds.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function fs(e){return new ds(e,.5)}function ps(e){return new ds(e,0)}function ms(e){return new ds(e,1)}function hs(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function gs(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function _s(e,t){return e[t]}function vs(e){let t=[];return t.key=e,t}function ys(){var e=U([]),t=gs,n=hs,r=_s;function i(i){var a=Array.from(e.apply(this,arguments),vs),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=mo(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:U(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:U(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?gs:typeof e==`function`?e:U(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??hs,i):n},i}function bs(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}hs(e,t)}}function xs(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}hs(e,t)}}function Ss(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,hs(e,t)}}function Cs(e){return e===`__proto__`}function ws(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function Ts(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function Es(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Es).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Ds(e){if(Array.isArray(e))return e.map(Ts);if(typeof e==`symbol`)return[e];e=Es(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}function Os(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Cs(t))return n;let r=e[t];return r===void 0?ws(t)&&!Object.hasOwn(e,t)?Os(e,Ds(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Ts(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return ks(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Cs(t))return n;let r=e[t];return r===void 0?n:r}}}function ks(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Cs(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var As=4;function js(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:As),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function Ms(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+js(i)+n},``)}var Ns=e=>e===0?0:e>0?1:-1,Ps=e=>typeof e==`number`&&e!=+e,Fs=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,G=e=>(typeof e==`number`||e instanceof Number)&&!Ps(e),Is=e=>G(e)||typeof e==`string`,Ls=0,Rs=e=>{var t=++Ls;return`${e||``}${t}`},zs=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!G(e)&&typeof e!=`string`)return n;var i;if(Fs(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Ps(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},Bs=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Vs(e,t,n){return G(e)&&G(t)?js(e+n*(t-e)):t}function Hs(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):Os(e,t))===n)}var Us=e=>e==null,Ws=e=>Us(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Gs(e){return e!=null}function Ks(){}var qs=[`type`,`size`,`sizeType`];function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Js.apply(null,arguments)}function Ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ys(Object(n),!0).forEach(function(t){Zs(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zs(e,t,n){return(t=Qs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qs(e){var t=$s(e,`string`);return typeof t==`symbol`?t:t+``}function $s(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ec(e,t){if(e==null)return{};var n,r,i=tc(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tc(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nc={symbolCircle:wo,symbolCross:To,symbolDiamond:Oo,symbolSquare:ko,symbolStar:Po,symbolTriangle:Io,symbolWye:Vo},rc=Math.PI/180,ic=e=>nc[`symbol${Ws(e)}`]||wo,ac=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*rc;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},oc=(e,t)=>{nc[`symbol${Ws(e)}`]=t},sc=e=>{var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=Xs(Xs({},ec(e,qs)),{},{type:n,size:i,sizeType:o}),c=`circle`;typeof n==`string`&&(c=n);var l=()=>{var e=ic(c),t=Ho().type(e).size(ac(i,o,c))();if(t!==null)return t},u=s.className,d=s.cx,f=s.cy,p=qa(s);return G(d)&&G(f)&&G(i)?v.createElement(`path`,Js({},p,{className:za(`recharts-symbols`,u),transform:`translate(${d}, ${f})`,d:l()})):null};sc.registerSymbol=oc;var cc=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,lc=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,v.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{Va(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},uc=(e,t,n)=>r=>(e(t,n,r),null),dc=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Va(i)&&typeof a==`function`&&(r||={},r[i]=uc(a,t,n))}),r};function fc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fc(Object(n),!0).forEach(function(t){mc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mc(e,t,n){return(t=hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hc(e){var t=gc(e,`string`);return typeof t==`symbol`?t:t+``}function gc(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _c(e,t){var n=pc({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vc.apply(null,arguments)}function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yc(Object(n),!0).forEach(function(t){xc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xc(e,t,n){return(t=Sc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sc(e){var t=Cc(e,`string`);return typeof t==`symbol`?t:t+``}function Cc(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var wc=32,Tc={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Ec(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Dc(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=wc/2,a=wc/6,o=wc/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return v.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Ec(t.payload),x1:0,y1:i,x2:wc,y2:i,className:`recharts-legend-icon`});if(c===`line`)return v.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
|
|
240
|
+
A${a},${a},0,1,1,${2*o},${i}
|
|
241
|
+
H${wc}M${2*o},${i}
|
|
242
|
+
A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return v.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${wc/8}h${wc}v${wc*3/4}h${-wc}z`,className:`recharts-legend-icon`});if(v.isValidElement(t.legendIcon)){var l=bc({},t);return delete l.legendIcon,v.cloneElement(t.legendIcon,l)}return v.createElement(sc,{fill:s,cx:i,cy:i,size:wc,sizeType:`diameter`,type:c})}function Oc(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,o=e.iconType,s=e.labelStyle,c={x:0,y:0,width:wc,height:wc},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=za({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?bc({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return v.createElement(`li`,vc({className:f,style:l,key:`legend-item-${r}`},dc(e,t,r)),v.createElement($a,{width:n,height:n,viewBox:c,style:u,"aria-label":t.value==null?`legend icon`:`${t.value} legend icon`},v.createElement(Dc,{data:t,iconType:o,inactiveColor:a})),v.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var kc=e=>{var t=_c(e,Tc),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return v.createElement(`ul`,{className:`recharts-default-legend`,style:a},v.createElement(Oc,vc({},t,{payload:n})))};function Ac(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function jc(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Mc(e){return e}function Nc(e){return function(t){return Os(t,e)}}function Pc(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Fc(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ic(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Lc(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Rc=`[object RegExp]`,zc=`[object String]`,Bc=`[object Number]`,Vc=`[object Boolean]`,Hc=`[object Arguments]`,Uc=`[object Symbol]`,Wc=`[object Date]`,Gc=`[object Map]`,Kc=`[object Set]`,qc=`[object Array]`,Jc=`[object ArrayBuffer]`,Yc=`[object Object]`,Xc=`[object DataView]`,Zc=`[object Uint8Array]`,Qc=`[object Uint8ClampedArray]`,$c=`[object Uint16Array]`,el=`[object Uint32Array]`,tl=`[object Int8Array]`,nl=`[object Int16Array]`,rl=`[object Int32Array]`,il=`[object Float32Array]`,al=`[object Float64Array]`,ol=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function sl(e){return ol.Buffer!==void 0&&ol.Buffer.isBuffer(e)}function cl(e,t){return ll(e,void 0,e,new Map,t)}function ll(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Pc(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=ll(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,ll(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(ll(a,void 0,n,r,i));return t}if(sl(e))return e.subarray();if(Fc(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=ll(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),ul(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),ul(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),ul(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,ul(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),ul(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),ul(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),ul(t,e,n,r,i),t}if(typeof e==`object`&&dl(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),ul(t,e,n,r,i),t}return e}function ul(e,t,n=e,r,i){let a=[...Object.keys(t),...Ic(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=ll(t[s],s,n,r,i))}}function dl(e){switch(Lc(e)){case Hc:case qc:case Jc:case Xc:case Vc:case Wc:case il:case al:case tl:case nl:case rl:case Gc:case Bc:case Yc:case Rc:case Kc:case zc:case Uc:case Zc:case Qc:case $c:case el:return!0;default:return!1}}function fl(e){return ll(e,void 0,e,new Map,void 0)}function pl(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ml(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function hl(e,t,n){return typeof n==`function`?gl(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?gl(t,r,e,s,!1):!!c},new Map,!0):hl(e,t,()=>void 0)}function gl(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return _l(e,t,n,r);case`function`:return Object.keys(t).length>0?gl(e,{...t},n,r,i):pl(e,t);default:return ml(e)&&i?typeof t==`string`?t===``:!0:pl(e,t)}}function _l(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return yl(e,t,n,r);if(t instanceof Map)return vl(e,t,n,r);if(t instanceof Set)return bl(e,t,n,r);let i=Object.keys(t);if(e==null||Pc(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!Pc(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function vl(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function yl(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function bl(e,t,n,r){return t.size===0?!0:e instanceof Set?yl([...e],[...t],n,r):!1}function xl(e,t){return hl(e,t,()=>void 0)}function Sl(e){return e=fl(e),t=>xl(t,e)}function Cl(e,t){return cl(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Lc(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),ul(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Bc:case zc:case Vc:{let t=new e.constructor(e?.valueOf());return ul(t,e),t}case Hc:{let t={};return ul(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function wl(e){return Cl(e)}var Tl=/^(?:0|[1-9]\d*)$/;function El(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Tl.test(e)}}function Dl(e){return typeof e==`object`&&!!e&&Lc(e)===`[object Arguments]`}function Ol(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&ws(t)&&e?.[t]==null?Ds(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||Dl(r))&&El(t)&&t<r.length))return!1;r=r[t]}return!0}function kl(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=Ts(e);break}return t=wl(t),function(n){let r=Os(n,e);return r===void 0?Ol(n,e):t===void 0?r===void 0:xl(r,t)}}function Al(e){if(e==null)return Mc;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?kl(e[0],e[1]):Sl(e);case`string`:case`symbol`:case`number`:return Nc(e)}}function jl(e){return Number.isSafeInteger(e)&&e>=0}function Ml(e){return e!=null&&typeof e!=`function`&&jl(e.length)}function Nl(e){return typeof e==`object`&&!!e}function Pl(e){return Nl(e)&&Ml(e)}function Fl(e,t=Mc){return Pl(e)?Ac(Array.from(e),jc(Al(t),1)):[]}function Il(e,t,n){return t===!0?Fl(e,n):typeof t==`function`?Fl(e,t):e}var Ll=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Rl=o(((e,t)=>{t.exports=Ll()})),zl=o((e=>{var t=d(),n=Rl();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Bl=o(((e,t)=>{t.exports=zl()})),K=(0,v.createContext)(null),q=Bl(),Vl=e=>e,J=()=>{var e=(0,v.useContext)(K);return e?e.store.dispatch:Vl},Hl=()=>{},Ul=()=>Hl,Wl=(e,t)=>e===t;function Y(e){var t=(0,v.useContext)(K),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Hl,[t,e]);return(0,q.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Ul,t?t.store.getState:Hl,t?t.store.getState:Hl,n,Wl)}function Gl(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Kl(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var ql=e=>Array.isArray(e)?e:[e];function Jl(e){let t=Array.isArray(e[0])?e[0]:e;return Kl(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Yl(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Xl=class{constructor(e){this.value=e}deref(){return this.value}},Zl=typeof WeakRef>`u`?Xl:WeakRef,Ql=0,$l=1;function eu(){return{s:Ql,v:void 0,o:null,p:null}}function tu(e){return e instanceof Zl?e.deref():e}function nu(e,t={}){let n=eu(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=eu(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=eu(),e.set(n,t)):t=r}}let s=t,c;if(t.s===$l)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=tu(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Zl(c):c}return s.s=$l,s.v=c,c}return o.clearCache=()=>{n=eu(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function ru(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Gl(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=nu,argsMemoizeOptions:u=[]}={...n,...a},d=ql(c),f=ql(u),p=Jl(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=Yl(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var X=ru(nu);function iu(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function au(e,t,n){return ml(n)&&(typeof t==`number`&&Ml(n)&&El(t)&&t<n.length||typeof t==`string`&&t in n)?pl(n[t],e):!1}function ou(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var su=(e,t,n)=>{if(e!==t){let r=ou(e),i=ou(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0};function cu(e){return typeof e==`symbol`||e instanceof Symbol}var lu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uu=/^\w*$/;function du(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||cu(e)?!0:typeof e==`string`&&(uu.test(e)||!lu.test(e))||t!=null&&Object.hasOwn(t,e)}function fu(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||du(e)?e:{key:e,path:Ds(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=su(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function pu(e,...t){let n=t.length;return n>1&&au(e,t[0],t[1])?t=[]:n>2&&au(t[0],t[1],t[2])&&(t=[t[0]]),fu(e,iu(t),[`asc`])}var mu=e=>e.legend.settings,hu=e=>e.legend.size,gu=X([e=>e.legend.payload,mu],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?pu(r,n):r});function _u(){return Y(gu)}function vu(e,t){return Cu(e)||Su(e,t)||bu(e,t)||yu()}function yu(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
243
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bu(e,t){if(e){if(typeof e==`string`)return xu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xu(e,t):void 0}}function xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Su(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Cu(e){if(Array.isArray(e))return e}var wu=1;function Tu(e,t){return Math.abs(e.height-t.height)>wu||Math.abs(e.left-t.left)>wu||Math.abs(e.top-t.top)>wu||Math.abs(e.width-t.width)>wu}function Eu(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Du(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=vu((0,v.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,v.useRef)(null),a=(0,v.useRef)(n);a.current=n;var o=(0,v.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=Eu(e);if(Tu(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=Eu(e);Tu(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,v.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function Ou(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ku=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Au=()=>Math.random().toString(36).substring(7).split(``).join(`.`),ju={INIT:`@@redux/INIT${Au()}`,REPLACE:`@@redux/REPLACE${Au()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Au()}`};function Mu(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Nu(e,t,n){if(typeof e!=`function`)throw Error(Ou(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Ou(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Ou(1));return n(Nu)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Ou(3));return i}function d(e){if(typeof e!=`function`)throw Error(Ou(4));if(c)throw Error(Ou(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Ou(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!Mu(e))throw Error(Ou(7));if(e.type===void 0)throw Error(Ou(8));if(typeof e.type!=`string`)throw Error(Ou(17));if(c)throw Error(Ou(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Ou(10));r=e,f({type:ju.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Ou(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[ku](){return this}}}return f({type:ju.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[ku]:m}}function Pu(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:ju.INIT})===void 0)throw Error(Ou(12));if(n(void 0,{type:ju.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Ou(13))})}function Fu(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{Pu(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(Ou(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function Iu(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Lu(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Ou(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=Iu(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function Ru(e){return Mu(e)&&`type`in e&&typeof e.type==`string`}var zu=Symbol.for(`immer-nothing`),Bu=Symbol.for(`immer-draftable`),Vu=Symbol.for(`immer-state`);function Hu(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Uu=Object,Wu=Uu.getPrototypeOf,Gu=`constructor`,Ku=`prototype`,qu=`configurable`,Ju=`enumerable`,Yu=`writable`,Xu=`value`,Zu=e=>!!e&&!!e[Vu];function Qu(e){return e?td(e)||cd(e)||!!e[Bu]||!!e[Gu]?.[Bu]||ld(e)||ud(e):!1}var $u=Uu[Ku][Gu].toString(),ed=new WeakMap;function td(e){if(!e||!dd(e))return!1;let t=Wu(e);if(t===null||t===Uu[Ku])return!0;let n=Uu.hasOwnProperty.call(t,Gu)&&t[Gu];if(n===Object)return!0;if(!fd(n))return!1;let r=ed.get(n);return r===void 0&&(r=Function.toString.call(n),ed.set(n,r)),r===$u}function nd(e,t,n=!0){rd(e)===0?(n?Reflect.ownKeys(e):Uu.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function rd(e){let t=e[Vu];return t?t.type_:cd(e)?1:ld(e)?2:ud(e)?3:0}var id=(e,t,n=rd(e))=>n===2?e.has(t):Uu[Ku].hasOwnProperty.call(e,t),ad=(e,t,n=rd(e))=>n===2?e.get(t):e[t],od=(e,t,n,r=rd(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function sd(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var cd=Array.isArray,ld=e=>e instanceof Map,ud=e=>e instanceof Set,dd=e=>typeof e==`object`,fd=e=>typeof e==`function`,pd=e=>typeof e==`boolean`;function md(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var hd=e=>e.copy_||e.base_,gd=e=>e.modified_?e.copy_:e.base_;function _d(e,t){if(ld(e))return new Map(e);if(ud(e))return new Set(e);if(cd(e))return Array[Ku].slice.call(e);let n=td(e);if(t===!0||t===`class_only`&&!n){let t=Uu.getOwnPropertyDescriptors(e);delete t[Vu];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Yu]===!1&&(a[Yu]=!0,a[qu]=!0),(a.get||a.set)&&(t[i]={[qu]:!0,[Yu]:!0,[Ju]:a[Ju],[Xu]:e[i]})}return Uu.create(Wu(e),t)}else{let t=Wu(e);if(t!==null&&n)return{...e};let r=Uu.create(t);return Uu.assign(r,e)}}function vd(e,t=!1){return Z(e)||Zu(e)||!Qu(e)?e:(rd(e)>1&&Uu.defineProperties(e,{set:bd,add:bd,clear:bd,delete:bd}),Uu.freeze(e),t&&nd(e,(e,t)=>{vd(t,!0)},!1),e)}function yd(){Hu(2)}var bd={[Xu]:yd};function Z(e){return e===null||!dd(e)?!0:Uu.isFrozen(e)}var xd=`MapSet`,Sd=`Patches`,Cd=`ArrayMethods`,wd={};function Td(e){let t=wd[e];return t||Hu(0,e),t}var Ed=e=>!!wd[e],Dd,Od=()=>Dd,kd=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ed(xd)?Td(xd):void 0,arrayMethodsPlugin_:Ed(Cd)?Td(Cd):void 0});function Ad(e,t){t&&(e.patchPlugin_=Td(Sd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jd(e){Md(e),e.drafts_.forEach(Pd),e.drafts_=null}function Md(e){e===Dd&&(Dd=e.parent_)}var Nd=e=>Dd=kd(Dd,e);function Pd(e){let t=e[Vu];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Fd(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Vu].modified_&&(jd(t),Hu(4)),Qu(e)&&(e=Id(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Vu].base_,e,t)}else e=Id(t,n);return Ld(t,e,!0),jd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===zu?void 0:e}function Id(e,t){if(Z(t))return t;let n=t[Vu];if(!n)return Gd(t,e.handledSet_,e);if(!zd(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Ud(n,e)}return n.copy_}function Ld(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vd(t,n)}function Rd(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var zd=(e,t)=>e.scope_===t,Bd=[];function Vd(e,t,n,r){let i=hd(e),a=e.type_;if(r!==void 0&&ad(i,r,a)===t){od(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;nd(i,(e,n)=>{if(Zu(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Bd;for(let e of o)od(i,e,n,a)}function Hd(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!zd(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=gd(i);Vd(e,i.draft_??i,a,n),Ud(i,r)})}function Ud(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Rd(e)}}function Wd(e,t,n){let{scope_:r}=e;if(Zu(n)){let i=n[Vu];zd(i,r)&&i.callbacks_.push(function(){$d(e),Vd(e,n,gd(i),t)})}else Qu(n)&&e.callbacks_.push(function(){let i=hd(e);e.type_===3?i.has(n)&&Gd(n,r.handledSet_,r):ad(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Gd(ad(e.copy_,t,e.type_),r.handledSet_,r)})}function Gd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Zu(e)||t.has(e)||!Qu(e)||Z(e)?e:(t.add(e),nd(e,(r,i)=>{if(Zu(i)){let t=i[Vu];zd(t,n)&&(od(e,r,gd(t),e.type_),Rd(t))}else Qu(i)&&Gd(i,t,n)}),e)}function Kd(e,t){let n=cd(e),r={type_:+!!n,scope_:t?t.scope_:Od(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=qd;n&&(i=[r],a=Jd);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var qd={get(e,t){if(t===Vu)return e;if(t===`constructor`||t===`__proto__`){let n=hd(e)[t];return new Proxy(n||{},{get:(e,t)=>t===`__proto__`||t===`prototype`?Object.freeze(Object.create(null)):Reflect.get(e,t),set:()=>!0,apply:(e,t,n)=>Reflect.apply(e,t,n)})}let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=hd(e);if(!id(i,t,e.type_))return Xd(e,i,t);let a=i[t];if(e.finalized_||!Qu(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&md(t))return a;if(a===Yd(e.base_,t)){$d(e);let n=e.type_===1?+t:t,r=tf(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t===`constructor`||t===`__proto__`||t===`prototype`?!1:t in hd(e)},ownKeys(e){return Reflect.ownKeys(hd(e))},set(e,t,n){if(t===`constructor`||t===`__proto__`||t===`prototype`)return!0;let r=Zd(hd(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Yd(hd(e),t),i=r?.[Vu];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(sd(n,r)&&(n!==void 0||id(e.base_,t,e.type_)))return!0;$d(e),Qd(e)}return e.copy_[t]===n&&(n!==void 0||id(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),Wd(e,t,n),!0)},deleteProperty(e,t){return $d(e),Yd(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=hd(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Yu]:!0,[qu]:e.type_!==1||t!==`length`,[Ju]:r[Ju],[Xu]:n[t]}},defineProperty(){Hu(11)},getPrototypeOf(e){return Wu(e.base_)},setPrototypeOf(){Hu(12)}},Jd={};for(let e in qd){let t=qd[e];Jd[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}Jd.deleteProperty=function(e,t){return Jd.set.call(this,e,t,void 0)},Jd.set=function(e,t,n){return qd.set.call(this,e[0],t,n,e[0])};function Yd(e,t){let n=e[Vu];return(n?hd(n):e)[t]}function Xd(e,t,n){let r=Zd(t,n);return r?Xu in r?r[Xu]:r.get?.call(e.draft_):void 0}function Zd(e,t){if(!(t in e))return;let n=Wu(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Wu(n)}}function Qd(e){e.modified_||(e.modified_=!0,e.parent_&&Qd(e.parent_))}function $d(e){e.copy_||=(e.assigned_=new Map,_d(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ef=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(fd(e)&&!fd(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}fd(t)||Hu(6),n!==void 0&&!fd(n)&&Hu(7);let r;if(Qu(e)){let i=Nd(this),a=tf(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?jd(i):Md(i)}return Ad(i,n),Fd(r,i)}else if(!e||!dd(e)){if(r=t(e),r===void 0&&(r=e),r===zu&&(r=void 0),this.autoFreeze_&&vd(r,!0),n){let t=[],i=[];Td(Sd).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else Hu(1,e)},this.produceWithPatches=(e,t)=>{if(fd(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},pd(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),pd(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),pd(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Qu(e)||Hu(8),Zu(e)&&(e=nf(e));let t=Nd(this),n=tf(t,e,void 0);return n[Vu].isManual_=!0,Md(t),n}finishDraft(e,t){let n=e&&e[Vu];(!n||!n.isManual_)&&Hu(9);let{scope_:r}=n;return Ad(r,t),Fd(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Td(Sd).applyPatches_;return Zu(e)?r(e,t):this.produce(e,e=>r(e,t))}};function tf(e,t,n,r){let[i,a]=ld(t)?Td(xd).proxyMap_(t,n):ud(t)?Td(xd).proxySet_(t,n):Kd(t,n);return(n?.scope_??Od()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Hd(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function nf(e){return Zu(e)||Hu(10,e),rf(e)}function rf(e){if(!Qu(e)||Z(e))return e;let t=e[Vu],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_d(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=_d(e,!0);return nd(n,(e,t)=>{od(n,e,rf(t))},r),t&&(t.finalized_=!1),n}var af=new ef().produce,of=e=>e;function sf(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var cf=sf(),lf=sf,uf=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?Iu:Iu.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function df(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(bp(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Ru(t)&&t.type===e,n}var ff=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function pf(e){return Qu(e)?af(e,()=>{}):e}function mf(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function hf(e){return typeof e==`boolean`}var gf=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new ff;return t&&(hf(t)?a.push(cf):a.push(lf(t.extraArgument))),a},_f=`RTK_autoBatch`,vf=()=>e=>({payload:e,meta:{[_f]:!0}}),yf=e=>t=>{setTimeout(t,e)},bf=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},xf=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?bf(window.requestAnimationFrame,100):yf(10):e.type===`callback`?e.queueNotification:yf(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[_f],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Sf=e=>function(t){let{autoBatch:n=!0}=t??{},r=new ff(e);return n&&r.push(xf(typeof n==`object`?n:void 0)),r};function Cf(e){let t=gf(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(Mu(n))c=Fu(n);else throw Error(bp(1));let l;l=typeof r==`function`?r(t):t();let u=Iu;i&&(u=uf({trace:!1,...typeof i==`object`&&i}));let d=Sf(Lu(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Nu(c,o,p)}function wf(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(bp(28));if(r in t)throw Error(bp(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Tf(e){return typeof e==`function`}function Ef(e,t){let[n,r,i]=wf(t),a;if(Tf(e))a=()=>pf(e());else{let t=pf(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(Zu(e)){let r=n(e,t);return r===void 0?e:r}else if(Qu(e))return af(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var Df=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Of=(e=21)=>{let t=``,n=e;for(;n--;)t+=Df[Math.random()*64|0];return t},kf=Symbol.for(`rtk-slice-createasyncthunk`);function Af(e,t){return`${e}/${t}`}function jf({creators:e}={}){let t=e?.asyncThunk?.[kf];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(bp(11));let i=(typeof e.reducers==`function`?e.reducers(Pf()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(bp(12));if(n in o.sliceCaseReducersByType)throw Error(bp(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Af(n,r),createNotation:typeof e.reducers==`function`};If(a)?Rf(o,a,s,t):Ff(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?wf(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Ef(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=mf(d,r,m)),i}function i(t=l){return mf(mf(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Mf(a,t,()=>mf(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Mf(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var Nf=jf();function Pf(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function Ff({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Lf(r))throw Error(bp(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?df(e,o):df(e))}function If(e){return e._reducerDefinitionType===`asyncThunk`}function Lf(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Rf({type:e,reducerName:t},n,r,i){if(!i)throw Error(bp(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||zf,pending:s||zf,rejected:c||zf,settled:l||zf})}function zf(){}var Bf=`task`,Vf=`listener`,Hf=`completed`,Uf=`cancelled`,Wf=`task-${Uf}`,Gf=`task-${Hf}`,Kf=`${Vf}-${Uf}`,qf=`${Vf}-${Hf}`,Jf=class{constructor(e){this.code=e,this.message=`${Bf} ${Uf} (reason: ${e})`}code;name=`TaskAbortError`;message},Yf=(e,t)=>{if(typeof e!=`function`)throw TypeError(bp(32))},Xf=()=>{},Zf=(e,t=Xf)=>(e.catch(t),e),Qf=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),$f=e=>{if(e.aborted)throw new Jf(e.reason)};function ep(e,t){let n=Xf;return new Promise((r,i)=>{let a=()=>i(new Jf(e.reason));if(e.aborted){a();return}n=Qf(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Xf})}var tp=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof Jf?`cancelled`:`rejected`,error:e}}finally{t?.()}},np=e=>t=>Zf(ep(e,t).then(t=>($f(e),t))),rp=e=>{let t=np(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:ip}=Object,ap={},op=`listenerMiddleware`,sp=(e,t)=>{let n=t=>Qf(e,()=>t.abort(e.reason));return(r,i)=>{Yf(r,`taskExecutor`);let a=new AbortController;n(a);let o=tp(async()=>{$f(e),$f(a.signal);let t=await r({pause:np(a.signal),delay:rp(a.signal),signal:a.signal});return $f(a.signal),t},()=>a.abort(Gf));return i?.autoJoin&&t.push(o.catch(Xf)),{result:np(e)(o),cancel(){a.abort(Wf)}}}},cp=(e,t)=>{let n=async(n,r)=>{$f(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await ep(t,Promise.race(a));return $f(t),e}finally{i()}};return((e,t)=>Zf(n(e,t)))},lp=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=df(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(bp(21));return Yf(a,`options.listener`),{predicate:i,type:t,effect:a}},up=ip(e=>{let{type:t,predicate:n,effect:r}=lp(e);return{id:Of(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(bp(22))}}},{withTypes:()=>up}),dp=(e,t)=>{let{type:n,effect:r,predicate:i}=lp(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},fp=e=>{e.pending.forEach(e=>{e.abort(Kf)})},pp=(e,t)=>()=>{for(let e of t.keys())fp(e);e.clear()},mp=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},hp=ip(df(`${op}/add`),{withTypes:()=>hp}),gp=df(`${op}/removeAll`),_p=ip(df(`${op}/remove`),{withTypes:()=>_p}),vp=(...e)=>{console.error(`${op}/error`,...e)},yp=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=vp}=e;Yf(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&fp(e)}),c=(e=>s(dp(t,e)??up(e)));ip(c,{withTypes:()=>c});let l=e=>{let n=dp(t,e);return n&&(n.unsubscribe(),e.cancelActive&&fp(n)),!!n};ip(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=cp(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,ip({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:rp(u.signal),pause:np(u.signal),extra:a,signal:u.signal,fork:sp(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(Kf),n.delete(e))})},cancel:()=>{u.abort(Kf),e.pending.delete(u)},throwIfCancelled:()=>{$f(u.signal)}})))}catch(e){e instanceof Jf||mp(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(qf),i(e),e.pending.delete(u)}},d=pp(t,n);return{middleware:e=>n=>r=>{if(!Ru(r))return n(r);if(hp.match(r))return c(r.payload);if(gp.match(r)){d();return}if(_p.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===ap)throw Error(bp(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,mp(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=ap}return s},startListening:c,stopListening:l,clearListeners:d}};function bp(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var xp=Nf({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),Sp=xp.actions,Cp=Sp.setMargin,wp=Sp.setLayout,Tp=Sp.setChartSize,Ep=Sp.setScale,Dp=xp.reducer;function Op(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Q(e){return Number.isFinite(e)}function kp(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ap(Object(n),!0).forEach(function(t){Mp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ap(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mp(e,t,n){return(t=Np(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Np(e){var t=Pp(e,`string`);return typeof t==`symbol`?t:t+``}function Pp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Fp(e,t,n){return Us(e)||Us(t)?n:Is(t)?Os(e,t,n):typeof t==`function`?t(e):n}var Ip=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&G(e[a]))return jp(jp({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&G(e[o]))return jp(jp({},e),{},{[o]:e[o]+(i||0)})}return e},Lp=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Rp=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},zp=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Ns(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return Q(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(Gs):c&&l?l.map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Gs):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Gs):o.domain().map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(Gs)},Bp={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=Ps(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:bs,none:hs,silhouette:xs,wiggle:Ss,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=Ps(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},Vp=(e,t,n)=>{var r=Bp[n]??hs,i=ys().keys(t).value((e,t)=>Number(Fp(e,t,0))).order(gs).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=Fp(e[i],t[r],0);Array.isArray(a)&&a.length===2&&G(a[0])&&G(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function Hp(e){return e==null?void 0:String(e)}function Up(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!Us(i[t.dataKey])){var s=Hs(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Fp(i,Us(o)?t.dataKey:o),l=t.scale.map(c);return G(l)?l:null}var Wp=e=>{var t=e.flat(2).filter(G);return[Math.min(...t),Math.max(...t)]},Gp=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Kp=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Gp(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=Wp(Op(r,t,n));return!Q(i[0])||!Q(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},qp=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Jp=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Yp=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=pu(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function Xp(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return jp(jp({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Zp(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var Qp=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},$p=(e,t)=>t===`centric`?e.angle:e.radius,em=e=>e.layout.width,tm=e=>e.layout.height,nm=e=>e.layout.scale,rm=e=>e.layout.margin,im=X(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),am=X(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),om=`data-recharts-item-index`;function sm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sm(Object(n),!0).forEach(function(t){lm(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lm(e,t,n){return(t=um(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function um(e){var t=dm(e,`string`);return typeof t==`symbol`?t:t+``}function dm(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var fm=e=>e.brush.height;function pm(e){return am(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function mm(e){return am(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function hm(e){return im(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function gm(e){return im(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var _m=X([em,tm,rm,fm,pm,mm,hm,gm,mu,hu],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=cm(cm({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=Ip(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return cm(cm({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),vm=X(_m,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),ym=X(em,tm,(e,t)=>({x:0,y:0,width:e,height:t})),bm=(0,v.createContext)(null),xm=()=>(0,v.useContext)(bm)!=null,Sm=e=>e.brush,Cm=X([Sm,_m,rm],(e,t,n)=>({height:e.height,x:G(e.x)?e.x:t.left,y:G(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:G(e.width)?e.width:t.width}));function wm(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Tm(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=wm(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Em(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Tm(e,t,{leading:r,maxWait:t,trailing:i})}var Dm=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},Om={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},km=(e,t,n)=>{var r=n.width,i=r===void 0?Om.width:r,a=n.height,o=a===void 0?Om.height:a,s=n.aspect,c=n.maxHeight,l=Fs(i)?e:Number(i),u=Fs(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},Am={width:0,height:0,overflow:`visible`},jm={width:0,overflowX:`visible`},Mm={height:0,overflowY:`visible`},Nm={},Pm=e=>{var t=e.width,n=e.height,r=Fs(t),i=Fs(n);return r&&i?Am:r?jm:i?Mm:Nm};function Fm(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Om.width,a=Om.height):i===void 0?i=r&&r>0?void 0:Om.width:a===void 0&&(a=r&&r>0?void 0:Om.height),{width:i,height:a}}var Im=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function Lm(){return Lm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lm.apply(null,arguments)}function Rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rm(Object(n),!0).forEach(function(t){Bm(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bm(e,t,n){return(t=Vm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vm(e){var t=Hm(e,`string`);return typeof t==`symbol`?t:t+``}function Hm(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Um(e,t){return Jm(e)||qm(e,t)||Gm(e,t)||Wm()}function Wm(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
244
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gm(e,t){if(e){if(typeof e==`string`)return Km(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Km(e,t):void 0}}function Km(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qm(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Jm(e){if(Array.isArray(e))return e}function Ym(e,t){if(e==null)return{};var n,r,i=Xm(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Xm(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Zm=(0,v.createContext)(Om.initialDimension);function Qm(e){return kp(e.width)&&kp(e.height)}function $m(e){var t=e.children,n=e.width,r=e.height,i=(0,v.useMemo)(()=>({width:n,height:r}),[n,r]);return Qm(i)?v.createElement(Zm.Provider,{value:i},t):null}var eh=()=>(0,v.useContext)(Zm),th=(0,v.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Om.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?Om.minWidth:s,l=e.minHeight,u=e.maxHeight,d=e.children,f=e.debounce,p=f===void 0?Om.debounce:f,m=e.id,h=e.className,g=e.onResize,_=e.style,y=_===void 0?{}:_,b=Ym(e,Im),x=(0,v.useRef)(null),S=(0,v.useRef)();S.current=g,(0,v.useImperativeHandle)(t,()=>x.current);var C=Um((0,v.useState)({containerWidth:i.width,containerHeight:i.height}),2),w=C[0],T=C[1],E=(0,v.useCallback)((e,t)=>{T(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,v.useEffect)(()=>{if(x.current==null||typeof ResizeObserver>`u`)return Ks;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;E(i,a),(t=S.current)==null||t.call(S,i,a)}};p>0&&(e=Em(e,p,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=x.current.getBoundingClientRect(),r=n.width,i=n.height;return E(r,i),t.observe(x.current),()=>{t.disconnect()}},[E,p]);var D=w.containerWidth,O=w.containerHeight;Dm(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var k=km(D,O,{width:a,height:o,aspect:n,maxHeight:u}),A=k.calculatedWidth,j=k.calculatedHeight;return Dm(D<0||O<0||A!=null&&A>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
245
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
246
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
247
|
+
height and width.`,A,j,a,o,c,l,n),v.createElement(`div`,Lm({id:m?`${m}`:void 0,className:za(`recharts-responsive-container`,h),style:zm(zm({},y),{},{width:a,height:o,minWidth:c,minHeight:l,maxHeight:u}),ref:x},b),v.createElement(`div`,{style:Pm({width:a,height:o})},v.createElement($m,{width:A,height:j},d)))}),nh=(0,v.forwardRef)((e,t)=>{var n=eh();if(kp(n.width)&&kp(n.height))return e.children;var r=Fm({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=km(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return G(s)&&G(c)?v.createElement($m,{width:s,height:c},e.children):v.createElement(th,Lm({},e,{width:i,height:a,ref:t}))});function rh(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var ih=()=>{var e=xm(),t=Y(vm),n=Y(Cm),r=Y(Sm)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},ah={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},oh=()=>Y(_m)??ah,sh=()=>Y(em),ch=()=>Y(tm),lh=()=>Y(e=>e.layout.margin),uh=e=>e.layout.layoutType,dh=()=>Y(uh),fh=()=>{var e=dh();if(e===`horizontal`||e===`vertical`)return e},ph=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},mh=()=>dh()!==void 0,hh=e=>{var t=J(),n=xm(),r=e.width,i=e.height,a=eh(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&kp(o)&&kp(s)&&t(Tp({width:o,height:s}))},[t,n,o,s]),null},gh=Nf({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(of(t.payload))},prepare:vf()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=nf(e).payload.indexOf(of(r));a>-1&&(e.payload[a]=of(i))},prepare:vf()},removeLegendPayload:{reducer(e,t){var n=nf(e).payload.indexOf(of(t.payload));n>-1&&e.payload.splice(n,1)},prepare:vf()}}}),_h=gh.actions,vh=_h.setLegendSize,yh=_h.setLegendSettings,bh=_h.addLegendPayload,xh=_h.replaceLegendPayload,Sh=_h.removeLegendPayload,Ch=gh.reducer,wh=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=wh()}))();function Th(e){e()}function Eh(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Th(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Dh={notify(){},get:()=>[]};function Oh(e,t){let n,r=Dh,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Eh())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Dh)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var kh=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ah=typeof navigator<`u`&&navigator.product===`ReactNative`,jh=kh||Ah?v.useLayoutEffect:v.useEffect;function Mh(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function Nh(e,t){if(Mh(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Mh(e[n[r]],t[n[r]]))return!1;return!0}var Ph=Symbol.for(`react-redux-context`),Fh=typeof globalThis<`u`?globalThis:{};function Ih(){if(!v.createContext)return{};let e=Fh[Ph]??=new Map,t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var Lh=Ih();function Rh(e){let{children:t,context:n,serverState:r,store:i}=e,a=v.useMemo(()=>({store:i,subscription:Oh(i),getServerState:r?()=>r:void 0}),[i,r]),o=v.useMemo(()=>i.getState(),[i]);jh(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||Lh;return v.createElement(s.Provider,{value:a},t)}var zh=Rh,Bh=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function Vh(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function Hh(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(Bh.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Nh(e[n],t[n]))return!1}else if(!Vh(e[n],t[n]))return!1;return!0}var Uh=h(),Wh=[`contextPayload`];function Gh(){return Gh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gh.apply(null,arguments)}function Kh(e,t){return Zh(e)||Xh(e,t)||Jh(e,t)||qh()}function qh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
248
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jh(e,t){if(e){if(typeof e==`string`)return Yh(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yh(e,t):void 0}}function Yh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xh(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Zh(e){if(Array.isArray(e))return e}function Qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qh(Object(n),!0).forEach(function(t){eg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eg(e,t,n){return(t=tg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tg(e){var t=ng(e,`string`);return typeof t==`symbol`?t:t+``}function ng(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rg(e,t){if(e==null)return{};var n,r,i=ig(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ig(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ag(e){return e.value}function og(e){var t=e.contextPayload,n=rg(e,Wh),r=Il(t,e.payloadUniqBy,ag),i=$h($h({},n),{},{payload:r});return v.isValidElement(e.content)?v.cloneElement(e.content,i):typeof e.content==`function`?v.createElement(e.content,i):v.createElement(kc,i)}function sg(e,t,n,r,i,a){var o=t.layout,s=t.align,c=t.verticalAlign,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),$h($h({},l),u)}function cg(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=J();return(0,v.useLayoutEffect)(()=>{a(yh({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function lg(e){var t=e.width,n=e.height,r=J();return(0,v.useLayoutEffect)(()=>{r(vh({width:t,height:n}))},[r,t,n]),(0,v.useLayoutEffect)(()=>()=>{r(vh({width:0,height:0}))},[r]),null}function ug(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var dg={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,labelStyle:{},layout:`horizontal`,verticalAlign:`bottom`};function fg(e){var t=_c(e,dg),n=_u(),r=La(),i=lh(),a=t.width,o=t.height,s=t.wrapperStyle,c=t.portal,l=Kh(Du([n]),2),u=l[0],d=l[1],f=sh(),p=ch();if(f==null||p==null)return null;var m=f-(i?.left||0)-(i?.right||0),h=ug(t.layout,o,a,m),g=c?s:$h($h({position:`absolute`,width:h?.width||a||`auto`,height:h?.height||o||`auto`},sg(s,t,i,f,p,u)),s),_=c??r;return _==null||n==null?null:(0,Uh.createPortal)(v.createElement(`div`,{className:`recharts-legend-wrapper`,style:g,ref:d},v.createElement(cg,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&v.createElement(lg,{width:u.width,height:u.height}),v.createElement(og,Gh({},t,h,{margin:i,chartWidth:f,chartHeight:p,contextPayload:n}))),_)}var pg=v.memo(fg,Hh);pg.displayName=`Legend`;function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mg.apply(null,arguments)}function hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hg(Object(n),!0).forEach(function(t){_g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _g(e,t,n){return(t=vg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vg(e){var t=yg(e,`string`);return typeof t==`symbol`?t:t+``}function yg(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bg(e,t){return Tg(e)||wg(e,t)||Sg(e,t)||xg()}function xg(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
249
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sg(e,t){if(e){if(typeof e==`string`)return Cg(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cg(e,t):void 0}}function Cg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wg(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Tg(e){if(Array.isArray(e))return e}function Eg(e){return Array.isArray(e)&&Is(e[0])&&Is(e[1])?e.join(` ~ `):e}var Dg={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function Og(e,t){return t==null?e:pu(e,t)}var kg=e=>{var t=e.separator,n=t===void 0?Dg.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?Dg.labelStyle:a,s=e.payload,c=e.formatter,l=e.itemSorter,u=e.wrapperClassName,d=e.labelClassName,f=e.label,p=e.labelFormatter,m=e.accessibilityLayer,h=m===void 0?Dg.accessibilityLayer:m,g=()=>{if(s&&s.length){var e={padding:0,margin:0},t=Og(s,l).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||Eg,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var f=bg(d,2);l=f[0],u=f[1]}else if(d!=null)l=d;else return null}var p=gg(gg({},Dg.itemStyle),{},{color:e.color||Dg.itemStyle.color},i);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},Is(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,Is(u)?v.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,v.createElement(`span`,{className:`recharts-tooltip-item-value`},l),v.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return v.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},_=gg(gg({},Dg.contentStyle),r),y=gg({margin:0},o),b=!Us(f),x=b?f:``,S=za(`recharts-default-tooltip`,u),C=za(`recharts-tooltip-label`,d);b&&p&&s!=null&&(x=p(f,s));var w=h?{role:`status`,"aria-live":`assertive`}:{};return v.createElement(`div`,mg({className:S,style:_},w),v.createElement(`p`,{className:C,style:y},v.isValidElement(x)?x:`${x}`),g())},Ag=`recharts-tooltip-wrapper`,jg={visibility:`hidden`};function Mg(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return za(Ag,{[`${Ag}-right`]:G(n)&&t&&G(t.x)&&n>=t.x,[`${Ag}-left`]:G(n)&&t&&G(t.x)&&n<t.x,[`${Ag}-bottom`]:G(r)&&t&&G(t.y)&&r>=t.y,[`${Ag}-top`]:G(r)&&t&&G(t.y)&&r<t.y})}function Ng(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&G(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function Pg(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Fg(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s.height>0&&s.width>0&&n?(d=Ng({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=Ng({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Pg({translateX:d,translateY:f,useTranslate3d:c})):u=jg,{cssProperties:u,cssClasses:Mg({translateX:d,translateY:f,coordinate:n})}}var Ig={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Lg(e,t){return Hg(e)||Vg(e,t)||zg(e,t)||Rg()}function Rg(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
250
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zg(e,t){if(e){if(typeof e==`string`)return Bg(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bg(e,t):void 0}}function Bg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vg(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Hg(e){if(Array.isArray(e))return e}function Ug(){var e=Lg((0,v.useState)(()=>Ig.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),2),t=e[0],n=e[1];return(0,v.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{n(e.matches)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}},[]),t}function Wg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Wg(Object(n),!0).forEach(function(t){Kg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kg(e,t,n){return(t=qg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qg(e){var t=Jg(e,`string`);return typeof t==`symbol`?t:t+``}function Jg(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Yg(e,t){return e_(e)||$g(e,t)||Zg(e,t)||Xg()}function Xg(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
251
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zg(e,t){if(e){if(typeof e==`string`)return Qg(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qg(e,t):void 0}}function Qg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $g(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function e_(e){if(Array.isArray(e))return e}function t_(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing==`string`?e.animationEasing:`ease`;return`transform ${e.animationDuration}ms ${t}`}}function n_(e){var t=Ug(),n=Yg(v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];v.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(Gg(Gg({},r),{},{dismissed:!1}));var a=Fg({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=Gg(Gg({},e.hasPortalFromProps?{}:Gg(Gg({transition:t_({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return v.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var r_=v.memo(n_),i_=()=>Y(e=>e.rootProps.accessibilityLayer)??!0;function a_(){return a_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a_.apply(null,arguments)}function o_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?o_(Object(n),!0).forEach(function(t){c_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c_(e,t,n){return(t=l_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l_(e){var t=u_(e,`string`);return typeof t==`symbol`?t:t+``}function u_(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d_={curveBasisClosed:Jo,curveBasisOpen:Xo,curveBasis:Ko,curveBumpX:So,curveBumpY:Co,curveLinearClosed:Qo,curveLinear:go,curveMonotoneX:os,curveMonotoneY:ss,curveNatural:us,curveStep:fs,curveStepAfter:ms,curveStepBefore:ps},f_=e=>Q(e.x)&&Q(e.y),p_=e=>e.base!=null&&f_(e.base)&&f_(e),m_=e=>e.x,h_=e=>e.y,g_=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${Ws(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=d_[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return d_[n]||go},__={connectNulls:!1,type:`linear`},v_=e=>{var t=e.type,n=t===void 0?__.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?__.connectNulls:s,l=g_(n,o),u=c?i.filter(f_):i;if(Array.isArray(a)){var d,f=i.map((e,t)=>s_(s_({},e),{},{base:a[t]}));return d=o===`vertical`?bo().y(h_).x1(m_).x0(e=>e.base.x):bo().x(m_).y1(h_).y0(e=>e.base.y),d.defined(p_).curve(l)(c?f.filter(p_):f)}return(o===`vertical`&&G(a)?bo().y(h_).x1(m_).x0(a):G(a)?bo().x(m_).y1(h_).y0(a):yo().x(m_).y(h_)).defined(f_).curve(l)(u)},y_=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=dh();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?v_(o):r;return v.createElement(`path`,a_({},Ga(e),lc(e),{className:za(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},b_=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function x_(){return x_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x_.apply(null,arguments)}function S_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?S_(Object(n),!0).forEach(function(t){w_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w_(e,t,n){return(t=T_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T_(e){var t=E_(e,`string`);return typeof t==`symbol`?t:t+``}function E_(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function D_(e,t){if(e==null)return{};var n,r,i=O_(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function O_(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var k_=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,A_=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=D_(e,b_),h=C_({x:n,y:i,top:o,left:c,width:u,height:f},m);return!G(n)||!G(i)||!G(u)||!G(f)||!G(o)||!G(c)?null:v.createElement(`path`,x_({},qa(h),{className:za(`recharts-cross`,p),d:k_(n,i,u,f,o,c)}))};function j_(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}var M_=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],N_=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),P_=(e,t)=>n=>N_(M_(e,t),n),F_=(e,t)=>n=>N_([...M_(e,t).map((e,t)=>e*t).slice(1),0],n),I_=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},L_=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=I_(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},R_=(e,t,n,r)=>{var i=P_(e,n),a=P_(t,r),o=F_(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},z_=function(){return R_(...L_(...arguments))},B_=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?16.67:a,s=1,c=[0],l=0,u=0,d=1e4,f=0;f<d;){var p=-(l-s)*n,m=u*i;if(u+=(p-m)*o/1e3,l+=u*o/1e3,c.push(l),Math.abs(l-s)<1e-4&&Math.abs(u)<1e-4)break;f++}c[c.length-1]=s;var h=c.length-1;return e=>{if(e<=0)return 0;if(e>=1)return s;var t=e*h,n=Math.floor(t),r=t-n;return(c[n]??0)+((c[n+1]??0)-(c[n]??0))*r}},V_=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return z_(e);case`spring`:return B_();default:if(e.split(`(`)[0]===`cubic-bezier`)return z_(e)}return typeof e==`function`?e:null},H_=(0,v.createContext)((e,t,n)=>{var r,i=a=>{var o=t.tick(a);if(t.getState()===`active`){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,o);return}r=e.setTimeout(i,o)};return r=e.setTimeout(i,0),()=>r?.()});H_.Provider;function U_(e){var t=(0,v.useContext)(H_);return(0,v.useMemo)(()=>e??t,[e,t])}function W_(e,t,n){return(t=G_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G_(e){var t=K_(e,`string`);return typeof t==`symbol`?t:t+``}function K_(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var q_=`init`,J_=`pending`,Y_=`active`,X_=`completed`;function Z_(e){return Math.max(0,e)}var Q_=class{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;W_(this,`state`,q_),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=Z_(e.animationDuration),this.animationBegin=Z_(e.animationBegin),this.progress=0,this.from=e.from,this.to=e.to,this.easing=e.easing,(t=e.onAnimationStart)==null||t.call(e)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(e){if(this.getState()===q_)return this.state=J_,this.beginStartedTime=e,this.animationBegin;if(this.getState()===J_){if(this.beginStartedTime==null)throw Error();var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=Y_,this.animationStartedTime=e,this.nextAnimationUpdate(0)):Z_(this.animationBegin-t)}if(this.getState()===Y_){if(this.animationStartedTime==null)throw Error();var n=e-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state===`active`){var e;(e=this.onAnimationEnd)==null||e.call(this)}this.state=X_}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}},$_=class extends Q_{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Vs(this.getFrom(),this.getTo(),this.getProgress()))}},ev=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):r=requestAnimationFrame(i)};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function tv(e,t){return ov(e)||av(e,t)||rv(e,t)||nv()}function nv(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
252
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rv(e,t){if(e){if(typeof e==`string`)return iv(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iv(e,t):void 0}}function iv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function av(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ov(e){if(Array.isArray(e))return e}var sv={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},cv=0,lv=1;function uv(e){var t=_c(e,sv),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,s=t.begin,c=t.onAnimationEnd,l=t.onAnimationStart,u=t.children,d=Ug(),f=r===`auto`?!Ig.isSsr&&!d:r,p=U_(t.animationController),m=tv((0,v.useState)(f?cv:lv),2),h=m[0],g=m[1];return(0,v.useEffect)(()=>{f||g(lv)},[f]),(0,v.useEffect)(()=>{var e=V_(o);return!f||!i||e==null?Ks:p(new ev,new $_({animationId:n,easing:e,animationDuration:a,animationBegin:s,onAnimationStart:l,onAnimationEnd:c,from:cv,to:lv}),g)},[p,n,f,i,a,o,s,l,c]),u(Number(h))}function dv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,v.useRef)(Rs(t)),r=(0,v.useRef)(e);return r.current!==e&&(n.current=Rs(t),r.current=e),n.current}var fv=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),pv=(e,t,n)=>e.map(e=>`${fv(e)} ${t}ms ${n}`).join(`,`),mv=[`radius`],hv=[`radius`],gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv;function Ev(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ev(Object(n),!0).forEach(function(t){Ov(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ev(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ov(e,t,n){return(t=kv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kv(e){var t=Av(e,`string`);return typeof t==`symbol`?t:t+``}function Av(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jv(){return jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jv.apply(null,arguments)}function Mv(e,t){if(e==null)return{};var n,r,i=Nv(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Nv(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Pv(e,t){return zv(e)||Rv(e,t)||Iv(e,t)||Fv()}function Fv(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
253
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iv(e,t){if(e){if(typeof e==`string`)return Lv(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lv(e,t):void 0}}function Lv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rv(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function zv(e){if(Array.isArray(e))return e}function Bv(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Vv=(e,t,n,r,i)=>{var a=js(n),o=js(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=Ms(gv||=Bv([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=Ms(_v||=Bv([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=Ms(vv||=Bv([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=Ms(yv||=Bv([`A `,`,`,`,0,0,`,`,
|
|
254
|
+
`,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=Ms(bv||=Bv([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=Ms(xv||=Bv([`A `,`,`,`,0,0,`,`,
|
|
255
|
+
`,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=Ms(Sv||=Bv([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=Ms(Cv||=Bv([`A `,`,`,`,0,0,`,`,
|
|
256
|
+
`,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=Ms(wv||=Bv(`M .,.
|
|
257
|
+
A .,.,0,0,.,.,.
|
|
258
|
+
L .,.
|
|
259
|
+
A .,.,0,0,.,.,.
|
|
260
|
+
L .,.
|
|
261
|
+
A .,.,0,0,.,.,.
|
|
262
|
+
L .,.
|
|
263
|
+
A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=Ms(Tv||=Bv([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},Hv={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Uv=e=>{var t=_c(e,Hv),n=(0,v.useRef)(null),r=Pv((0,v.useState)(-1),2),i=r[0],a=r[1];(0,v.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive,_=(0,v.useRef)(c),y=(0,v.useRef)(l),b=(0,v.useRef)(o),x=(0,v.useRef)(s),S=dv((0,v.useMemo)(()=>({x:o,y:s,width:c,height:l,radius:u}),[o,s,c,l,u]),`rectangle-`);if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var C=za(`recharts-rectangle`,d);if(!g){var w=qa(t);w.radius;var T=Mv(w,mv);return v.createElement(`path`,jv({},T,{x:js(o),y:js(s),width:js(c),height:js(l),radius:typeof u==`number`?u:void 0,className:C,d:Vv(o,s,c,l,u)}))}var E=_.current,D=y.current,O=b.current,k=x.current,A=`0px ${i===-1?1:i}px`,j=`${i}px ${i}px`,M=pv([`strokeDasharray`],p,typeof f==`string`?f:Hv.animationEasing);return v.createElement(uv,{animationId:S,key:S,canBegin:i>0,duration:p,easing:f,isActive:g,begin:m},e=>{var r=Vs(E,c,e),i=Vs(D,l,e),a=Vs(O,o,e),d=Vs(k,s,e);n.current&&(_.current=r,y.current=i,b.current=a,x.current=d);var f=h?e>0?{transition:M,strokeDasharray:j}:{strokeDasharray:A}:{strokeDasharray:j},p=qa(t);p.radius;var m=Mv(p,hv);return v.createElement(`path`,jv({},m,{radius:typeof u==`number`?u:void 0,className:C,d:Vv(a,d,r,i,u),ref:n,style:Dv(Dv({},f),t.style)}))})};function Wv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Wv(Object(n),!0).forEach(function(t){Kv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kv(e,t,n){return(t=qv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qv(e){var t=Jv(e,`string`);return typeof t==`symbol`?t:t+``}function Jv(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Yv=Math.PI/180,Xv=e=>e*180/Math.PI,Zv=(e,t,n,r)=>({x:e+Math.cos(-Yv*r)*n,y:t+Math.sin(-Yv*r)*n}),Qv=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},$v=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},ey=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,o=$v({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:Xv(c),angleInRadian:c}},ty=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},ny=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},ry=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=ey({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c||a===0)return null;var l=ty(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?Gv(Gv({},t),{},{radius:a,angle:ny(f,t)}):null};function iy(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[Zv(t,n,r,i),Zv(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var ay,oy,sy,cy,ly,uy,dy;function fy(){return fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fy.apply(null,arguments)}function py(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var my=(e,t)=>Ns(t-e)*Math.min(Math.abs(t-e),359.999),hy=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/Yv,d=c?i:i+a*u,f=Zv(t,n,l,d),p=Zv(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:Zv(t,n,l*Math.cos(u*Yv),m),theta:u}},gy=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=my(a,o),c=a+s,l=Zv(t,n,i,a),u=Zv(t,n,i,c),d=Ms(ay||=py([`M `,`,`,`
|
|
264
|
+
A `,`,`,`,0,
|
|
265
|
+
`,`,`,`,
|
|
266
|
+
`,`,`,`
|
|
267
|
+
`]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=Zv(t,n,r,a),p=Zv(t,n,r,c);d+=Ms(oy||=py([`L `,`,`,`
|
|
268
|
+
A `,`,`,`,0,
|
|
269
|
+
`,`,`,`,
|
|
270
|
+
`,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=Ms(sy||=py([`L `,`,`,` Z`]),t,n);return d},_y=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=Ns(l-c),d=hy({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=hy({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?Ms(cy||=py([`M `,`,`,`
|
|
271
|
+
a`,`,`,`,0,0,1,`,`,0
|
|
272
|
+
a`,`,`,`,0,0,1,`,`,0
|
|
273
|
+
`]),p.x,p.y,a,a,a*2,a,a,-a*2):gy({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=Ms(ly||=py([`M `,`,`,`
|
|
274
|
+
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
275
|
+
A`,`,`,`,0,`,`,`,`,`,`,`,`
|
|
276
|
+
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
277
|
+
`]),p.x,p.y,a,a,+(u<0),f.x,f.y,i,i,+(y>180),+(u<0),g.x,g.y,a,a,+(u<0),_.x,_.y);if(r>0){var x=hy({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=hy({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=Ms(uy||=py([`L`,`,`,`
|
|
278
|
+
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
279
|
+
A`,`,`,`,0,`,`,`,`,`,`,`,`
|
|
280
|
+
A`,`,`,`,0,0,`,`,`,`,`,`Z`]),D.x,D.y,a,a,+(u<0),E.x,E.y,r,r,+(k>180),+(u>0),S.x,S.y,a,a,+(u<0),C.x,C.y)}else b+=Ms(dy||=py([`L`,`,`,`Z`]),t,n);return b},vy={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yy=e=>{var t=_c(e,vy),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=za(`recharts-sector`,d),p=a-i,m=zs(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?_y({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):gy({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return v.createElement(`path`,fy({},qa(t),{className:f,d:h}))};function by(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(cc(t)){if(e===`centric`){var r=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,s=t.angle,c=Zv(r,i,a,s),l=Zv(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return iy(t)}}function xy(e){return cu(e)?NaN:Number(e)}function Sy(e){return e?(e=xy(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function Cy(e,t,n){n&&typeof n!=`number`&&au(e,t,n)&&(t=n=void 0),e=Sy(e),t===void 0?(t=e,e=0):t=Sy(t),n=n===void 0?e<t?1:-1:Sy(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}var wy=e=>e.chartData,Ty=X([wy],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Ey=(e,t,n,r)=>r?Ty(e):wy(e),Dy=(e,t,n)=>n?Ty(e):wy(e),Oy=X([Ey],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});X([Ty],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});var ky=X([wy],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});function Ay(e,t){return Fy(e)||Py(e,t)||My(e,t)||jy()}function jy(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
281
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function My(e,t){if(e){if(typeof e==`string`)return Ny(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ny(e,t):void 0}}function Ny(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Py(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Fy(e){if(Array.isArray(e))return e}function Iy(e){if(Array.isArray(e)&&e.length===2){var t=Ay(e,2),n=t[0],r=t[1];if(Q(n)&&Q(r))return!0}return!1}function Ly(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Ry(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var n=Ay(e,2),r=n[0],i=n[1],a,o;if(Q(r))a=r;else if(typeof r==`function`)return;if(Q(i))o=i;else if(typeof i==`function`)return;var s=[a,o];if(Iy(s))return s}}function zy(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(Iy(r))return Ly(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=Ay(e,2),a=i[0],o=i[1],s,c;if(a===`auto`)t!=null&&(s=Math.min(...t));else if(G(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[0]))}catch{}else if(typeof a==`string`&&qp.test(a)){var l=qp.exec(a);if(l==null||l[1]==null||t==null)s=void 0;else{var u=+l[1];s=t[0]-u}}else s=t?.[0];if(o===`auto`)t!=null&&(c=Math.max(...t));else if(G(o))c=o;else if(typeof o==`function`)try{t!=null&&(c=o(t?.[1]))}catch{}else if(typeof o==`string`&&Jp.test(o)){var d=Jp.exec(o);if(d==null||d[1]==null||t==null)c=void 0;else{var f=+d[1];c=t[1]+f}}else c=t?.[1];var p=[s,c];if(Iy(p))return t==null?p:Ly(p,t,n)}}}var $=l(o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function By(e){return e===0?1:Math.floor(new $.default(e).abs().log(10).toNumber())+1}function Vy(e,t,n){for(var r=new $.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function Hy(e,t){return qy(e)||Ky(e,t)||Wy(e,t)||Uy()}function Uy(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
282
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wy(e,t){if(e){if(typeof e==`string`)return Gy(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gy(e,t):void 0}}function Gy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ky(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function qy(e){if(Array.isArray(e))return e}var Jy=e=>{var t=Hy(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},Yy=(e,t,n)=>{if(e.lte(0))return new $.default(0);var r=By(e.toNumber()),i=new $.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new $.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new $.default(s.toNumber()):new $.default(Math.ceil(s.toNumber()))},Xy=(e,t,n)=>{if(e.lte(0))return new $.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new $.default(i).abs().log(10).toNumber()),o=new $.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new $.default(10).pow(l))}var u=new $.default(r[c]??1).mul(o);return t?u:new $.default(Math.ceil(u.toNumber()))},Zy=(e,t,n)=>{var r=new $.default(1),i=new $.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new $.default(10).pow(By(e)-1),i=new $.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new $.default(Math.floor(e)))}else e===0?i=new $.default(Math.floor((t-1)/2)):n||(i=new $.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new $.default(c-o).mul(r)).toNumber());return s},Qy=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Yy;if(!Number.isFinite((t-e)/(n-1)))return{step:new $.default(0),tickMin:new $.default(0),tickMax:new $.default(0)};var o=a(new $.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new $.default(0):(s=new $.default(e).add(t).div(2),s=s.sub(new $.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new $.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?Qy(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new $.default(c).mul(o)),tickMax:s.add(new $.default(l).mul(o))})},$y=function(e){var t=Hy(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=Math.max(i,2),c=Hy(Jy([n,r]),2),l=c[0],u=c[1];if(l===-1/0||u===1/0){var d=u===1/0?[l,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?d.reverse():d}if(l===u)return Zy(l,i,a);var f=Qy(l,u,s,a,0,o===`snap125`?Xy:Yy),p=f.step,m=f.tickMin,h=f.tickMax,g=Vy(m,h.add(new $.default(.1).mul(p)),p);return n>r?g.reverse():g},eb=function(e,t){var n=Hy(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=Hy(Jy([r,i]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0)return[r,i];if(c===l)return[c];var u=o===`snap125`?Xy:Yy,d=Math.max(t,2),f=u(new $.default(l).sub(c).div(d-1),a,0),p=[...Vy(new $.default(c),new $.default(l),f),l];if(a===!1){p=p.map(e=>Math.round(e));var m=p.length-1;m>0&&p[m]===p[m-1]&&(p=p.slice(0,m))}return r>i?p.reverse():p},tb=e=>e.rootProps.barCategoryGap,nb=e=>e.rootProps.stackOffset,rb=e=>e.rootProps.reverseStackOrder,ib=e=>e.options.chartName,ab=e=>e.rootProps.syncId,ob=e=>e.rootProps.syncMethod,sb=e=>e.options.eventEmitter,cb=e=>e.rootProps.baseValue,lb={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},ub={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:lb.axis},db={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:lb.axis},fb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function pb(e,t,n){if(n!==`auto`)return n;if(e!=null)return Lp(e,t)?`category`:`number`}function mb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mb(Object(n),!0).forEach(function(t){gb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gb(e,t,n){return(t=_b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _b(e){var t=vb(e,`string`);return typeof t==`symbol`?t:t+``}function vb(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yb={allowDataOverflow:ub.allowDataOverflow,allowDecimals:ub.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:ub.angleAxisId,includeHidden:!1,name:void 0,reversed:ub.reversed,scale:ub.scale,tick:ub.tick,tickCount:void 0,ticks:void 0,type:ub.type,unit:void 0,niceTicks:`auto`},bb={allowDataOverflow:db.allowDataOverflow,allowDecimals:db.allowDecimals,allowDuplicatedCategory:db.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:db.radiusAxisId,includeHidden:db.includeHidden,name:void 0,reversed:db.reversed,scale:db.scale,tick:db.tick,tickCount:db.tickCount,ticks:void 0,type:db.type,unit:void 0,niceTicks:`auto`},xb=X([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},ph],(e,t)=>{if(e!=null)return e;var n=pb(t,`angleAxis`,yb.type)??`category`;return hb(hb({},yb),{},{type:n})}),Sb=X([(e,t)=>e.polarAxis.radiusAxis[t],ph],(e,t)=>{if(e!=null)return e;var n=pb(t,`radiusAxis`,bb.type)??`category`;return hb(hb({},bb),{},{type:n})}),Cb=e=>e.polarOptions,wb=X([em,tm,_m],Qv),Tb=X([Cb,wb],(e,t)=>{if(e!=null)return zs(e.innerRadius,t,0)}),Eb=X([Cb,wb],(e,t)=>{if(e!=null)return zs(e.outerRadius,t,t*.8)}),Db=X([Cb],e=>e==null?[0,0]:[e.startAngle,e.endAngle]);X([xb,Db],fb);var Ob=X([wb,Tb,Eb],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});X([Sb,Ob],fb);var kb=X([uh,Cb,Tb,Eb,em,tm],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var o=t.cx,s=t.cy,c=t.startAngle,l=t.endAngle;return{cx:zs(o,i,i/2),cy:zs(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),Ab=(e,t)=>t,jb=(e,t,n)=>n;function Mb(e){return e?.id}function Nb(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,o=n.dataKey,s=new Map;return e.forEach(e=>{var t=e.data??i;if(!(t==null||t.length===0)){var n=Mb(e);t.forEach((t,r)=>{var i=o==null||a?r:String(Fp(t,o,null)),c=Fp(t,e.dataKey,0),l=s.has(i)?s.get(i):{};Object.assign(l,{[n]:c}),s.set(i,l)})}}),Array.from(s.values())}function Pb(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var Fb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ib(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Lb(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Rb=e=>{var t=uh(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},zb=e=>e.tooltip.settings.axisId;function Bb(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var Vb=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!Iy(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Q(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function Hb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ub(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Wb(e){let t,n,r;e.length===2?(t=e===Hb||e===Ub?e:Gb,n=e,r=e):(t=Hb,n=(t,n)=>Hb(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Gb(){return 0}function Kb(e){return e===null?NaN:+e}function*qb(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var Jb=Wb(Hb),Yb=Jb.right;Jb.left,Wb(Kb).center;function Xb(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Zb(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Qb(e=Hb){if(e===Hb)return $b;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $b(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}function ex(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?$b:Qb(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));ex(e,t,u,d,i)}let a=e[t],o=n,s=r;for(tx(e,n,t),i(e[r],a)>0&&tx(e,n,r);o<s;){for(tx(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?tx(e,n,s):(++s,tx(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function tx(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function nx(e,t,n){if(e=Float64Array.from(qb(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Zb(e);if(t>=1)return Xb(e);var r,i=(r-1)*t,a=Math.floor(i),o=Xb(ex(e,a).subarray(0,a+1));return o+(Zb(e.subarray(a+1))-o)*(i-a)}}function rx(e,t,n=Kb){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function ix(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}var ax=Math.sqrt(50),ox=Math.sqrt(10),sx=Math.sqrt(2);function cx(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=ax?10:a>=ox?5:a>=sx?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?cx(e,t,n*2):[s,c,l]}function lx(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?cx(t,e,n):cx(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function ux(e,t,n){return t=+t,e=+e,n=+n,cx(e,t,n)[2]}function dx(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?ux(t,e,n):ux(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}var fx=class extends Map{constructor(e,t=gx){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(px(this,e))}has(e){return super.has(px(this,e))}set(e,t){return super.set(mx(this,e),t)}delete(e){return super.delete(hx(this,e))}};function px({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function mx({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function hx({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function gx(e){return typeof e==`object`&&e?e.valueOf():e}function _x(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function vx(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var yx=Symbol(`implicit`);function bx(){var e=new fx,t=[],n=[],r=yx;function i(i){let a=e.get(i);if(a===void 0){if(r!==yx)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new fx;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return bx(t,n).unknown(r)},_x.apply(i,arguments),i}function xx(){var e=bx().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=ix(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return xx(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},_x.apply(d(),arguments)}function Sx(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Sx(t())},e}function Cx(){return Sx(xx.apply(null,arguments).paddingInner(1))}function wx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Tx(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ex(){}var Dx=.7,Ox=1/Dx,kx=`\\s*([+-]?\\d+)\\s*`,Ax=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,jx=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Mx=/^#([0-9a-f]{3,8})$/,Nx=RegExp(`^rgb\\(${kx},${kx},${kx}\\)$`),Px=RegExp(`^rgb\\(${jx},${jx},${jx}\\)$`),Fx=RegExp(`^rgba\\(${kx},${kx},${kx},${Ax}\\)$`),Ix=RegExp(`^rgba\\(${jx},${jx},${jx},${Ax}\\)$`),Lx=RegExp(`^hsl\\(${Ax},${jx},${jx}\\)$`),Rx=RegExp(`^hsla\\(${Ax},${jx},${jx},${Ax}\\)$`),zx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};wx(Ex,Wx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bx,formatHex:Bx,formatHex8:Vx,formatHsl:Hx,formatRgb:Ux,toString:Ux});function Bx(){return this.rgb().formatHex()}function Vx(){return this.rgb().formatHex8()}function Hx(){return rS(this).formatHsl()}function Ux(){return this.rgb().formatRgb()}function Wx(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Mx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Gx(t):n===3?new Yx(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Kx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Kx(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Nx.exec(e))?new Yx(t[1],t[2],t[3],1):(t=Px.exec(e))?new Yx(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fx.exec(e))?Kx(t[1],t[2],t[3],t[4]):(t=Ix.exec(e))?Kx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Lx.exec(e))?nS(t[1],t[2]/100,t[3]/100,1):(t=Rx.exec(e))?nS(t[1],t[2]/100,t[3]/100,t[4]):zx.hasOwnProperty(e)?Gx(zx[e]):e===`transparent`?new Yx(NaN,NaN,NaN,0):null}function Gx(e){return new Yx(e>>16&255,e>>8&255,e&255,1)}function Kx(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yx(e,t,n,r)}function qx(e){return e instanceof Ex||(e=Wx(e)),e?(e=e.rgb(),new Yx(e.r,e.g,e.b,e.opacity)):new Yx}function Jx(e,t,n,r){return arguments.length===1?qx(e):new Yx(e,t,n,r??1)}function Yx(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}wx(Yx,Jx,Tx(Ex,{brighter(e){return e=e==null?Ox:Ox**+e,new Yx(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dx:Dx**+e,new Yx(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yx(eS(this.r),eS(this.g),eS(this.b),$x(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xx,formatHex:Xx,formatHex8:Zx,formatRgb:Qx,toString:Qx}));function Xx(){return`#${tS(this.r)}${tS(this.g)}${tS(this.b)}`}function Zx(){return`#${tS(this.r)}${tS(this.g)}${tS(this.b)}${tS((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qx(){let e=$x(this.opacity);return`${e===1?`rgb(`:`rgba(`}${eS(this.r)}, ${eS(this.g)}, ${eS(this.b)}${e===1?`)`:`, ${e})`}`}function $x(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eS(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tS(e){return e=eS(e),(e<16?`0`:``)+e.toString(16)}function nS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new aS(e,t,n,r)}function rS(e){if(e instanceof aS)return new aS(e.h,e.s,e.l,e.opacity);if(e instanceof Ex||(e=Wx(e)),!e)return new aS;if(e instanceof aS)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new aS(o,s,c,e.opacity)}function iS(e,t,n,r){return arguments.length===1?rS(e):new aS(e,t,n,r??1)}function aS(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}wx(aS,iS,Tx(Ex,{brighter(e){return e=e==null?Ox:Ox**+e,new aS(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dx:Dx**+e,new aS(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Yx(cS(e>=240?e-240:e+120,i,r),cS(e,i,r),cS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new aS(oS(this.h),sS(this.s),sS(this.l),$x(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=$x(this.opacity);return`${e===1?`hsl(`:`hsla(`}${oS(this.h)}, ${sS(this.s)*100}%, ${sS(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function oS(e){return e=(e||0)%360,e<0?e+360:e}function sS(e){return Math.max(0,Math.min(1,e||0))}function cS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var lS=e=>()=>e;function uS(e,t){return function(n){return e+n*t}}function dS(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function fS(e){return(e=+e)==1?pS:function(t,n){return n-t?dS(t,n,e):lS(isNaN(t)?n:t)}}function pS(e,t){var n=t-e;return n?uS(e,n):lS(isNaN(e)?t:e)}var mS=(function e(t){var n=fS(t);function r(e,t){var r=n((e=Jx(e)).r,(t=Jx(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=pS(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function hS(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function gS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _S(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=ES(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function vS(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function yS(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bS(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=ES(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var xS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,SS=new RegExp(xS.source,`g`);function CS(e){return function(){return e}}function wS(e){return function(t){return e(t)+``}}function TS(e,t){var n=xS.lastIndex=SS.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=xS.exec(e))&&(i=SS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:yS(r,i)})),n=SS.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?wS(c[0].x):CS(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function ES(e,t){var n=typeof t,r;return t==null||n===`boolean`?lS(t):(n===`number`?yS:n===`string`?(r=Wx(t))?(t=r,mS):TS:t instanceof Wx?mS:t instanceof Date?vS:gS(t)?hS:Array.isArray(t)?_S:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?bS:yS)(e,t)}function DS(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function OS(e,t){t===void 0&&(t=e,e=ES);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function kS(e){return function(){return e}}function AS(e){return+e}var jS=[0,1];function MS(e){return e}function NS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:kS(isNaN(t)?NaN:.5)}function PS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function FS(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=NS(i,r),a=n(o,a)):(r=NS(r,i),a=n(a,o)),function(e){return a(r(e))}}function IS(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=NS(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=Yb(e,t,1,r)-1;return a[n](i[n](t))}}function LS(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function RS(){var e=jS,t=jS,n=ES,r,i,a,o=MS,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==MS&&(o=PS(e[0],e[n-1])),s=n>2?IS:FS,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),yS))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,AS),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=DS,u()},d.clamp=function(e){return arguments.length?(o=e?!0:MS,u()):o!==MS},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function zS(){return RS()(MS,MS)}function BS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function VS(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function HS(e){return e=VS(Math.abs(e)),e?e[1]:NaN}function US(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function WS(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var GS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function KS(e){if(!(t=GS.exec(e)))throw Error(`invalid format: `+e);var t;return new qS({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}KS.prototype=qS.prototype;function qS(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}qS.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function JS(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var YS;function XS(e,t){var n=VS(e,t);if(!n)return YS=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(YS=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+VS(e,Math.max(0,t+a-1))[0]}function ZS(e,t){var n=VS(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var QS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:BS,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ZS(e*100,t),r:ZS,s:XS,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $S(e){return e}var eC=Array.prototype.map,tC=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function nC(e){var t=e.grouping===void 0||e.thousands===void 0?$S:US(eC.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?$S:WS(eC.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=KS(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):QS[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=QS[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=JS(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&YS!==void 0?tC[8+YS/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(HS(t)/3)))*3,r=10**-n,i=l((e=KS(e),e.type=`f`,e),{suffix:tC[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var rC,iC,aC;oC({thousands:`,`,grouping:[3],currency:[`$`,``]});function oC(e){return rC=nC(e),iC=rC.format,aC=rC.formatPrefix,rC}function sC(e){return Math.max(0,-HS(Math.abs(e)))}function cC(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(HS(t)/3)))*3-HS(Math.abs(e)))}function lC(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,HS(t)-HS(e))+1}function uC(e,t,n,r){var i=dx(e,t,n),a;switch(r=KS(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=cC(i,o))&&(r.precision=a),aC(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=lC(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=sC(i))&&(r.precision=a-(r.type===`%`)*2);break}return iC(r)}function dC(e){var t=e.domain;return e.ticks=function(e){var n=t();return lx(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return uC(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=ux(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function fC(){var e=zS();return e.copy=function(){return LS(e,fC())},_x.apply(e,arguments),dC(e)}function pC(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,AS),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return pC(e).unknown(t)},e=arguments.length?Array.from(e,AS):[0,1],dC(n)}function mC(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function hC(e){return Math.log(e)}function gC(e){return Math.exp(e)}function _C(e){return-Math.log(-e)}function vC(e){return-Math.exp(-e)}function yC(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function bC(e){return e===10?yC:e===Math.E?Math.exp:t=>e**+t}function xC(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function SC(e){return(t,n)=>-e(-t,n)}function CC(e){let t=e(hC,gC),n=t.domain,r=10,i,a;function o(){return i=xC(r),a=bC(r),n()[0]<0?(i=SC(i),a=SC(a),e(_C,vC)):e(hC,gC),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=lx(o,s,p))}else m=lx(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=KS(n)).precision==null&&(n.trim=!0),n=iC(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(mC(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function wC(){let e=CC(RS()).domain([1,10]);return e.copy=()=>LS(e,wC()).base(e.base()),_x.apply(e,arguments),e}function TC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function EC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function DC(e){var t=1,n=e(TC(t),EC(t));return n.constant=function(n){return arguments.length?e(TC(t=+n),EC(t)):t},dC(n)}function OC(){var e=DC(RS());return e.copy=function(){return LS(e,OC()).constant(e.constant())},_x.apply(e,arguments)}function kC(e){return function(t){return t<0?-((-t)**+e):t**+e}}function AC(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jC(e){return e<0?-e*e:e*e}function MC(e){var t=e(MS,MS),n=1;function r(){return n===1?e(MS,MS):n===.5?e(AC,jC):e(kC(n),kC(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},dC(t)}function NC(){var e=MC(RS());return e.copy=function(){return LS(e,NC()).exponent(e.exponent())},_x.apply(e,arguments),e}function PC(){return NC.apply(null,arguments).exponent(.5)}function FC(e){return Math.sign(e)*e*e}function IC(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function LC(){var e=zS(),t=[0,1],n=!1,r;function i(t){var i=IC(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(FC(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,AS)).map(FC)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return LC(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},_x.apply(i,arguments),dC(i)}function RC(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=rx(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[Yb(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(Hb),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return RC().domain(e).range(t).unknown(r)},_x.apply(a,arguments)}function zC(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[Yb(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return zC().domain([e,t]).range(i).unknown(a)},_x.apply(dC(o),arguments)}function BC(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[Yb(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return BC().domain(e).range(t).unknown(n)},_x.apply(i,arguments)}var VC=new Date,HC=new Date;function UC(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>UC(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(VC.setTime(+t),HC.setTime(+r),e(VC),e(HC),Math.floor(n(VC,HC))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var WC=1e3,GC=WC*60,KC=GC*60,qC=KC*24,JC=qC*7,YC=qC*30,XC=qC*365,ZC=UC(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*WC)},(e,t)=>(t-e)/WC,e=>e.getUTCSeconds());ZC.range;var QC=UC(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*WC)},(e,t)=>{e.setTime(+e+t*GC)},(e,t)=>(t-e)/GC,e=>e.getMinutes());QC.range;var $C=UC(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*GC)},(e,t)=>(t-e)/GC,e=>e.getUTCMinutes());$C.range;var ew=UC(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*WC-e.getMinutes()*GC)},(e,t)=>{e.setTime(+e+t*KC)},(e,t)=>(t-e)/KC,e=>e.getHours());ew.range;var tw=UC(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*KC)},(e,t)=>(t-e)/KC,e=>e.getUTCHours());tw.range;var nw=UC(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*GC)/qC,e=>e.getDate()-1);nw.range;var rw=UC(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qC,e=>e.getUTCDate()-1);rw.range;var iw=UC(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qC,e=>Math.floor(e/qC));iw.range;function aw(e){return UC(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*GC)/JC)}var ow=aw(0),sw=aw(1),cw=aw(2),lw=aw(3),uw=aw(4),dw=aw(5),fw=aw(6);ow.range,sw.range,cw.range,lw.range,uw.range,dw.range,fw.range;function pw(e){return UC(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/JC)}var mw=pw(0),hw=pw(1),gw=pw(2),_w=pw(3),vw=pw(4),yw=pw(5),bw=pw(6);mw.range,hw.range,gw.range,_w.range,vw.range,yw.range,bw.range;var xw=UC(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xw.range;var Sw=UC(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Sw.range;var Cw=UC(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cw.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:UC(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Cw.range;var ww=UC(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ww.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:UC(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),ww.range;var Tw=UC(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Tw.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?UC(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Tw),Tw.range;function Ew(e,t,n,r,i,a){let o=[[ZC,1,WC],[ZC,5,5*WC],[ZC,15,15*WC],[ZC,30,30*WC],[a,1,GC],[a,5,5*GC],[a,15,15*GC],[a,30,30*GC],[i,1,KC],[i,3,3*KC],[i,6,6*KC],[i,12,12*KC],[r,1,qC],[r,2,2*qC],[n,1,JC],[t,1,YC],[t,3,3*YC],[e,1,XC]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=Wb(([,,e])=>e).right(o,i);if(a===o.length)return e.every(dx(t/XC,n/XC,r));if(a===0)return Tw.every(Math.max(dx(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[Dw,Ow]=Ew(ww,Sw,mw,iw,tw,$C),[kw,Aw]=Ew(Cw,xw,ow,nw,ew,QC);function jw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Mw(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Nw(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Pw(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Vw(i),u=Hw(i),d=Vw(a),f=Hw(a),p=Vw(o),m=Hw(o),h=Vw(s),g=Hw(s),_=Vw(c),v=Hw(c),y={a:N,A:P,b:F,B:I,c:null,d:lT,e:lT,f:mT,g:TT,G:DT,H:uT,I:dT,j:fT,L:pT,m:hT,M:gT,p:L,q:ee,Q:XT,s:ZT,S:_T,u:vT,U:yT,V:xT,w:ST,W:CT,x:null,X:null,y:wT,Y:ET,Z:OT,"%":YT},b={a:te,A:ne,b:re,B:ie,c:null,d:kT,e:kT,f:PT,g:GT,G:qT,H:AT,I:jT,j:MT,L:NT,m:FT,M:IT,p:R,q:ae,Q:XT,s:ZT,S:LT,u:RT,U:zT,V:VT,w:HT,W:UT,x:null,X:null,y:WT,Y:KT,Z:JT,"%":YT},x={a:E,A:D,b:O,B:k,c:A,d:$w,e:$w,f:aT,g:Yw,G:Jw,H:tT,I:tT,j:eT,L:iT,m:Qw,M:nT,p:T,q:Zw,Q:sT,s:cT,S:rT,u:Ww,U:Gw,V:Kw,w:Uw,W:qw,x:j,X:M,y:Yw,Y:Jw,Z:Xw,"%":oT};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=Fw[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=Nw(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Mw(Nw(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?hw.ceil(a):hw(a),a=rw.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=jw(Nw(r.y,0,1)),o=a.getDay(),a=o>4||o===0?sw.ceil(a):sw(a),a=nw.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Mw(Nw(r.y,0,1)).getUTCDay():jw(Nw(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Mw(r)):jw(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in Fw?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function ee(e){return 1+~~(e.getMonth()/3)}function te(e){return o[e.getUTCDay()]}function ne(e){return a[e.getUTCDay()]}function re(e){return c[e.getUTCMonth()]}function ie(e){return s[e.getUTCMonth()]}function R(e){return i[+(e.getUTCHours()>=12)]}function ae(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var Fw={"-":``,_:` `,0:`0`},Iw=/^\s*\d+/,Lw=/^%/,Rw=/[\\^$*+?|[\]().{}]/g;function zw(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Bw(e){return e.replace(Rw,`\\$&`)}function Vw(e){return RegExp(`^(?:`+e.map(Bw).join(`|`)+`)`,`i`)}function Hw(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Uw(e,t,n){var r=Iw.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ww(e,t,n){var r=Iw.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Gw(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Kw(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function qw(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Jw(e,t,n){var r=Iw.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Yw(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xw(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Zw(e,t,n){var r=Iw.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Qw(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function $w(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function eT(e,t,n){var r=Iw.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tT(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function nT(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function rT(e,t,n){var r=Iw.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function iT(e,t,n){var r=Iw.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function aT(e,t,n){var r=Iw.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function oT(e,t,n){var r=Lw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function sT(e,t,n){var r=Iw.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function cT(e,t,n){var r=Iw.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function lT(e,t){return zw(e.getDate(),t,2)}function uT(e,t){return zw(e.getHours(),t,2)}function dT(e,t){return zw(e.getHours()%12||12,t,2)}function fT(e,t){return zw(1+nw.count(Cw(e),e),t,3)}function pT(e,t){return zw(e.getMilliseconds(),t,3)}function mT(e,t){return pT(e,t)+`000`}function hT(e,t){return zw(e.getMonth()+1,t,2)}function gT(e,t){return zw(e.getMinutes(),t,2)}function _T(e,t){return zw(e.getSeconds(),t,2)}function vT(e){var t=e.getDay();return t===0?7:t}function yT(e,t){return zw(ow.count(Cw(e)-1,e),t,2)}function bT(e){var t=e.getDay();return t>=4||t===0?uw(e):uw.ceil(e)}function xT(e,t){return e=bT(e),zw(uw.count(Cw(e),e)+(Cw(e).getDay()===4),t,2)}function ST(e){return e.getDay()}function CT(e,t){return zw(sw.count(Cw(e)-1,e),t,2)}function wT(e,t){return zw(e.getFullYear()%100,t,2)}function TT(e,t){return e=bT(e),zw(e.getFullYear()%100,t,2)}function ET(e,t){return zw(e.getFullYear()%1e4,t,4)}function DT(e,t){var n=e.getDay();return e=n>=4||n===0?uw(e):uw.ceil(e),zw(e.getFullYear()%1e4,t,4)}function OT(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+zw(t/60|0,`0`,2)+zw(t%60,`0`,2)}function kT(e,t){return zw(e.getUTCDate(),t,2)}function AT(e,t){return zw(e.getUTCHours(),t,2)}function jT(e,t){return zw(e.getUTCHours()%12||12,t,2)}function MT(e,t){return zw(1+rw.count(ww(e),e),t,3)}function NT(e,t){return zw(e.getUTCMilliseconds(),t,3)}function PT(e,t){return NT(e,t)+`000`}function FT(e,t){return zw(e.getUTCMonth()+1,t,2)}function IT(e,t){return zw(e.getUTCMinutes(),t,2)}function LT(e,t){return zw(e.getUTCSeconds(),t,2)}function RT(e){var t=e.getUTCDay();return t===0?7:t}function zT(e,t){return zw(mw.count(ww(e)-1,e),t,2)}function BT(e){var t=e.getUTCDay();return t>=4||t===0?vw(e):vw.ceil(e)}function VT(e,t){return e=BT(e),zw(vw.count(ww(e),e)+(ww(e).getUTCDay()===4),t,2)}function HT(e){return e.getUTCDay()}function UT(e,t){return zw(hw.count(ww(e)-1,e),t,2)}function WT(e,t){return zw(e.getUTCFullYear()%100,t,2)}function GT(e,t){return e=BT(e),zw(e.getUTCFullYear()%100,t,2)}function KT(e,t){return zw(e.getUTCFullYear()%1e4,t,4)}function qT(e,t){var n=e.getUTCDay();return e=n>=4||n===0?vw(e):vw.ceil(e),zw(e.getUTCFullYear()%1e4,t,4)}function JT(){return`+0000`}function YT(){return`%`}function XT(e){return+e}function ZT(e){return Math.floor(e/1e3)}var QT,$T,eE;tE({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function tE(e){return QT=Pw(e),$T=QT.format,QT.parse,eE=QT.utcFormat,QT.utcParse,QT}function nE(e){return new Date(e)}function rE(e){return e instanceof Date?+e:+new Date(+e)}function iE(e,t,n,r,i,a,o,s,c,l){var u=zS(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,rE)):f().map(nE)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(mC(n,e)):u},u.copy=function(){return LS(u,iE(e,t,n,r,i,a,o,s,c,l))},u}function aE(){return _x.apply(iE(kw,Aw,Cw,xw,ow,nw,ew,QC,ZC,$T).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function oE(){return _x.apply(iE(Dw,Ow,ww,Sw,mw,rw,tw,$C,ZC,eE).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function sE(){var e=0,t=1,n,r,i,a,o=MS,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(ES),l.rangeRound=u(DS),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function cE(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function lE(){var e=dC(sE()(MS));return e.copy=function(){return cE(e,lE())},vx.apply(e,arguments)}function uE(){var e=CC(sE()).domain([1,10]);return e.copy=function(){return cE(e,uE()).base(e.base())},vx.apply(e,arguments)}function dE(){var e=DC(sE());return e.copy=function(){return cE(e,dE()).constant(e.constant())},vx.apply(e,arguments)}function fE(){var e=MC(sE());return e.copy=function(){return cE(e,fE()).exponent(e.exponent())},vx.apply(e,arguments)}function pE(){return fE.apply(null,arguments).exponent(.5)}function mE(){var e=[],t=MS;function n(n){if(n!=null&&!isNaN(n=+n))return t((Yb(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(Hb),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>nx(e,r/t))},n.copy=function(){return mE(t).domain(e)},vx.apply(n,arguments)}function hE(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=MS,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=OS(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(ES),p.rangeRound=m(DS),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function gE(){var e=dC(hE()(MS));return e.copy=function(){return cE(e,gE())},vx.apply(e,arguments)}function _E(){var e=CC(hE()).domain([.1,1,10]);return e.copy=function(){return cE(e,_E()).base(e.base())},vx.apply(e,arguments)}function vE(){var e=DC(hE());return e.copy=function(){return cE(e,vE()).constant(e.constant())},vx.apply(e,arguments)}function yE(){var e=MC(hE());return e.copy=function(){return cE(e,yE()).exponent(e.exponent())},vx.apply(e,arguments)}function bE(){return yE.apply(null,arguments).exponent(.5)}var xE=s({scaleBand:()=>xx,scaleDiverging:()=>gE,scaleDivergingLog:()=>_E,scaleDivergingPow:()=>yE,scaleDivergingSqrt:()=>bE,scaleDivergingSymlog:()=>vE,scaleIdentity:()=>pC,scaleImplicit:()=>yx,scaleLinear:()=>fC,scaleLog:()=>wC,scaleOrdinal:()=>bx,scalePoint:()=>Cx,scalePow:()=>NC,scaleQuantile:()=>RC,scaleQuantize:()=>zC,scaleRadial:()=>LC,scaleSequential:()=>lE,scaleSequentialLog:()=>uE,scaleSequentialPow:()=>fE,scaleSequentialQuantile:()=>mE,scaleSequentialSqrt:()=>pE,scaleSequentialSymlog:()=>dE,scaleSqrt:()=>PC,scaleSymlog:()=>OC,scaleThreshold:()=>BC,scaleTime:()=>aE,scaleUtc:()=>oE,tickFormat:()=>uC});function SE(e){var t=xE;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${Ws(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function CE(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=SE(e);if(r!=null)return r.domain(t).range(n),r}}function wE(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?CE(e.scale,n,r):CE(t,n,r)}function TE(e){return`scale${Ws(e)}`}function EE(e){return TE(e)in xE}var DE=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return EE(r)?r:`point`}};function OE(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function kE(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=OE(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function AE(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):kE(e,void 0)}function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ME(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jE(Object(n),!0).forEach(function(t){NE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NE(e,t,n){return(t=PE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PE(e){var t=FE(e,`string`);return typeof t==`symbol`?t:t+``}function FE(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IE(e,t){return VE(e)||BE(e,t)||RE(e,t)||LE()}function LE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
283
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RE(e,t){if(e){if(typeof e==`string`)return zE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zE(e,t):void 0}}function zE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function VE(e){if(Array.isArray(e))return e}var HE=[0,`auto`],UE={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},WE=(e,t)=>e.cartesianAxis.xAxis[t],GE=(e,t)=>WE(e,t)??UE,KE={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:HE,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},qE=(e,t)=>e.cartesianAxis.yAxis[t],JE=(e,t)=>qE(e,t)??KE,YE={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},XE=(e,t)=>e.cartesianAxis.zAxis[t]??YE,ZE=(e,t,n)=>{switch(t){case`xAxis`:return GE(e,n);case`yAxis`:return JE(e,n);case`zAxis`:return XE(e,n);case`angleAxis`:return xb(e,n);case`radiusAxis`:return Sb(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},QE=(e,t,n)=>{switch(t){case`xAxis`:return GE(e,n);case`yAxis`:return JE(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},$E=(e,t,n)=>{switch(t){case`xAxis`:return GE(e,n);case`yAxis`:return JE(e,n);case`angleAxis`:return xb(e,n);case`radiusAxis`:return Sb(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},eD=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function tD(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var nD=e=>e.graphicalItems.cartesianItems,rD=X([Ab,jb],tD),iD=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),aD=X([nD,ZE,rD],iD,{memoizeOptions:{resultEqualityCheck:Ib}}),oD=X([aD],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(Pb)),sD=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),cD=X([aD],sD),lD=e=>e.map(e=>e.data).filter(Boolean).flat(1),uD=X([aD],e=>e.some(e=>!e.data)),dD=X([aD],lD,{memoizeOptions:{resultEqualityCheck:Ib}}),fD=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},pD=X([dD,Ey],fD),mD=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:Fp(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:Fp(e,t.dataKey)})),hD=(e,t,n,r,i,a)=>{var o=r.chartData,s=o===void 0?[]:o,c=r.dataStartIndex,l=r.dataEndIndex,u=mD(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...s.slice(c,l+1).map(e=>({value:Fp(e,t.dataKey)})).filter(e=>e.value!=null),...u]:u},gD=X([pD,ZE,aD,Ey,uD,dD],hD);function _D(e){if(Is(e)||e instanceof Date){var t=Number(e);if(Q(t))return t}}function vD(e){if(Array.isArray(e)){var t=[_D(e[0]),_D(e[1])];return Iy(t)?t:void 0}var n=_D(e);if(n!=null)return[n,n]}function yD(e){return e.map(_D).filter(Gs)}function bD(e,t){var n=_D(e),r=_D(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var xD=X([gD],e=>e?.map(e=>e.value).sort(bD));function SD(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function CD(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!Ps(t))r=t;else if(Array.isArray(t)){var i=yD(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:yD(n.flatMap(t=>{var n=Fp(e,t.dataKey),i,a;if(Array.isArray(n)){var o=IE(n,2);i=o[0],a=o[1]}else i=a=n;if(!(!Q(i)||!Q(a)))return[r-i,r+a]}))}var wD=e=>$E(e,Rb(e),zb(e)),TD=X([wD],e=>e?.dataKey),ED=X([oD,Ey,wD],Nb),DD=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var i=IE(t,2),a=i[0],o=i[1],s=r?[...o].reverse():o;return[a,{stackedData:Vp(e,s.map(Mb),n),graphicalItems:s}]}))},OD=X([ED,oD,nb,rb],DD),kD=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!==`zAxis`)return Kp(e,i,a)},AD=X([ZE],e=>e.allowDataOverflow),jD=e=>{if(e==null||!(`domain`in e))return HE;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=yD(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??HE},MD=X([ZE],jD),ND=X([MD,AD],Ry),PD=X([OD,wy,Ab,ND],kD,{memoizeOptions:{resultEqualityCheck:Fb}}),FD=e=>e.errorBars,ID=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>SD(n,e)),LD=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},RD=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>SD(i,e));n.forEach(n=>{var r=Fp(n,t.dataKey??e.dataKey),i=CD(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||a<o)&&(o=a),(s==null||l>s)&&(s=l)}var u=vD(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=vD(Fp(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),Q(o)&&Q(s))return[o,s]},zD=X([pD,ZE,cD,FD,Ab,Oy],RD,{memoizeOptions:{resultEqualityCheck:Fb}});function BD(e){var t=e.value;if(Is(t)||t instanceof Date)return t}var VD=(e,t,n)=>{var r=e.map(BD).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Bs(r))?Cy(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},HD=e=>e.referenceElements.dots,UD=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),WD=X([HD,Ab,jb],UD),GD=e=>e.referenceElements.areas,KD=X([GD,Ab,jb],UD),qD=e=>e.referenceElements.lines,JD=X([qD,Ab,jb],UD),YD=(e,t)=>{if(e!=null){var n=yD(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},XD=X(WD,Ab,YD),ZD=(e,t)=>{if(e!=null){var n=yD(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},QD=X([KD,Ab],ZD);function $D(e){if(e.x!=null)return yD([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:yD(t)}function eO(e){if(e.y!=null)return yD([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:yD(t)}var tO=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?$D(e):eO(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},nO=X(XD,X([JD,Ab],tO),QD,(e,t,n)=>LD(e,n,t)),rO=(e,t,n,r,i,a,o,s,c)=>{if(n!=null)return n;var l=o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?LD(r,a,i):LD(a,i),u=zy(t,l,e.allowDataOverflow);return u==null&&e.allowDataOverflow&&l==null&&c!=null?c:u},iO=X([ZE,MD,ND,PD,zD,nO,uh,Ab,X([ZE],e=>{if(!(e==null||e.type!==`number`||!(`ticks`in e)||e.ticks==null)){var t=yD(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},{memoizeOptions:{resultEqualityCheck:Fb}})],rO,{memoizeOptions:{resultEqualityCheck:Fb}}),aO=[0,1],oO=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var s=e.dataKey,c=e.type,l=Lp(t,a);return l&&s==null?Cy(0,n?.length??0):c===`category`?VD(r,e,l):i===`expand`&&!l?aO:o}},sO=X([ZE,uh,pD,gD,nb,Ab,iO],oO),cO=X([ZE,eD,ib],DE),lO=(e,t,n)=>{var r=t.niceTicks;if(r!==`none`){var i=jD(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&Iy(e)){if(a)return $y(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return eb(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&Iy(e))return $y(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&Iy(e))return eb(e,t.tickCount,t.allowDecimals,`adaptive`)}}},uO=X([sO,$E,cO],lO),dO=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&Iy(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},fO=X([ZE,sO,uO,Ab],dO),pO=X(X(gD,ZE,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(yD(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(!(c==null||l==null)){var u=l-c;n=Math.min(n,u)}}return n/o}}),uh,tb,_m,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Q(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=zs(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),mO=(e,t,n)=>{var r=GE(e,t);return r==null||typeof r.padding!=`string`?0:pO(e,`xAxis`,t,n,r.padding)},hO=(e,t,n)=>{var r=JE(e,t);return r==null||typeof r.padding!=`string`?0:pO(e,`yAxis`,t,n,r.padding)},gO=X(GE,mO,(e,t)=>{if(e==null)return{left:0,right:0};var n=e.padding;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),_O=X(JE,hO,(e,t)=>{if(e==null)return{top:0,bottom:0};var n=e.padding;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),vO=X([_m,gO,Cm,Sm,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),yO=X([_m,uh,_O,Cm,Sm,(e,t,n)=>n],(e,t,n,r,i,a)=>{var o=i.padding;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),bO=(e,t,n,r)=>{switch(t){case`xAxis`:return vO(e,n,r);case`yAxis`:return yO(e,n,r);case`zAxis`:return XE(e,n)?.range;case`angleAxis`:return Db(e);case`radiusAxis`:return Ob(e,n);default:return}},xO=X([ZE,bO],fb),SO=X([ZE,cO,X([cO,fO],Vb),xO],wE),CO=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale;if(Lp(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},wO=X([uh,gD,$E,Ab],CO),TO=X([SO],Bb);X([SO],AE),X([SO,xD],kE),X([aD,FD,Ab],ID);function EO(e,t){return e.id<t.id?-1:+(e.id>t.id)}var DO=(e,t)=>t,OO=(e,t,n)=>n,kO=X(im,DO,OO,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(EO)),AO=X(am,DO,OO,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(EO)),jO=(e,t)=>({width:e.width,height:t.height}),MO=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),NO=X(_m,GE,jO),PO=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},FO=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},IO=X(tm,_m,kO,DO,OO,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=jO(t,n);o??=PO(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),LO=X(em,_m,AO,DO,OO,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=MO(t,n);o??=FO(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),RO=X([_m,GE,(e,t)=>{var n=GE(e,t);if(n!=null)return IO(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),zO=X([_m,JE,(e,t)=>{var n=JE(e,t);if(n!=null)return LO(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),BO=X(_m,JE,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),VO=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,o=n.dataKey,s=Lp(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&Bs(l))return c}},HO=X([uh,gD,ZE,Ab],VO),UO=X([uh,QE,cO,TO,HO,wO,bO,uO,Ab],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=Lp(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),WO=X([uh,$E,cO,TO,uO,bO,HO,wO,Ab],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=Lp(e,c),u=t.type,d=t.ticks,f=t.tickCount,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?Ns(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return Q(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(Gs):l&&s?s.map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Gs):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Gs):r.domain().map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(Gs)}}),GO=X([uh,$E,TO,bO,HO,wO,Ab],(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=Lp(e,o),c=t.tickCount,l=0;return l=o===`angleAxis`&&r?.length>=2?Ns(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return Q(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Gs):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return Q(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Gs):n.domain().map((e,t)=>{var r=n.map(e);return Q(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(Gs)}}),KO=X(ZE,TO,(e,t)=>{if(!(e==null||t==null))return ME(ME({},e),{},{scale:t})});X((e,t,n)=>XE(e,n),X([X([ZE,cO,sO,xO],wE)],Bb),(e,t)=>{if(!(e==null||t==null))return ME(ME({},e),{},{scale:t})});var qO=X([uh,im,am],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});X([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var JO=e=>e.options.defaultTooltipEventType,YO=e=>e.options.validateTooltipEventTypes;function XO(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function ZO(e,t){return XO(t,JO(e),YO(e))}function QO(e){return Y(t=>ZO(t,e))}var $O=(e,t)=>{var n,r=Number(t);if(!(Ps(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},ek=e=>e.tooltip.settings,tk={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},nk=Nf({name:`tooltip`,initialState:{itemInteraction:{click:tk,hover:tk},axisInteraction:{click:tk,hover:tk},keyboardInteraction:tk,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(of(t.payload))},prepare:vf()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=nf(e).tooltipItemPayloads.indexOf(of(r));a>-1&&(e.tooltipItemPayloads[a]=of(i))},prepare:vf()},removeTooltipEntrySettings:{reducer(e,t){var n=nf(e).tooltipItemPayloads.indexOf(of(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:vf()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),rk=nk.actions,ik=rk.addTooltipEntrySettings,ak=rk.replaceTooltipEntrySettings,ok=rk.removeTooltipEntrySettings,sk=rk.setTooltipSettingsState,ck=rk.setActiveMouseOverItemIndex;rk.mouseLeaveItem;var lk=rk.mouseLeaveChart;rk.setActiveClickItemIndex;var uk=rk.setMouseOverAxisIndex,dk=rk.setMouseClickAxisIndex,fk=rk.setSyncInteraction,pk=rk.setKeyboardInteraction,mk=nk.reducer;function hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hk(Object(n),!0).forEach(function(t){_k(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _k(e,t,n){return(t=vk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vk(e){var t=yk(e,`string`);return typeof t==`symbol`?t:t+``}function yk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bk(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function xk(e){return e.index!=null}var Sk=(e,t,n,r)=>{if(t==null)return tk;var i=bk(e,t,n);if(i==null)return tk;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(xk(i)){if(a)return gk(gk({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return gk(gk({},tk),{},{coordinate:i.coordinate})};function Ck(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function wk(e,t){var n=Ck(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function Tk(e,t,n){if(n==null||t==null)return!0;var r=Fp(e,t);return r==null||!Iy(n)?!0:wk(r,n)}var Ek=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Q(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||Tk(l,n,r)?String(c):null},Dk=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},Ok=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},kk=e=>e.options.tooltipPayloadSearcher,Ak=e=>e.tooltip;function jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jk(Object(n),!0).forEach(function(t){Nk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nk(e,t,n){return(t=Pk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pk(e){var t=Fk(e,`string`);return typeof t==`symbol`?t:t+``}function Fk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ik(e){if(typeof e==`string`||typeof e==`number`)return e}function Lk(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function Rk(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function zk(e){if(typeof e==`string`)return e}function Bk(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?Ik(e.name):void 0,unit:`unit`in e?Lk(e.unit):void 0,dataKey:`dataKey`in e?Rk(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?zk(e.color):void 0,fill:`fill`in e?zk(e.fill):void 0}}function Vk(e,t){return e??t}var Hk=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var s=n.chartData,c=n.computedData,l=n.dataStartIndex,u=n.dataEndIndex;return e.reduce((e,n)=>{var d=n.dataDefinedOnItem,f=n.settings,p=Vk(d,s),m=Array.isArray(p)?Op(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?Hs(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=Bk(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=Mk(Mk({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(Xp({tooltipEntrySettings:o,dataKey:i,payload:a,value:Fp(a,i),name:r==null?void 0:String(r)}))}):e.push(Xp({tooltipEntrySettings:f,dataKey:h,payload:_,value:Fp(_,h),name:Fp(_,g)??f?.name})),e},[])}},Uk=X([wD,eD,ib],DE),Wk=X([X([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),wD,X([Rb,zb],tD)],iD,{memoizeOptions:{resultEqualityCheck:Ib}}),Gk=X([Wk],e=>e.filter(Pb)),Kk=X([Wk],lD,{memoizeOptions:{resultEqualityCheck:Ib}}),qk=X([Wk],e=>e.some(e=>!e.data)),Jk=X([Kk,wy],fD),Yk=X([Gk,wy,wD],Nb),Xk=X([Jk,wD,Wk,wy,qk,Kk],hD),Zk=X([wD],jD),Qk=X([Zk,X([wD],e=>e.allowDataOverflow)],Ry),$k=X([X([Yk,X([Wk],e=>e.filter(Pb)),nb,rb],DD),wy,Rb,Qk],kD),eA=X([Jk,wD,X([Wk],sD),FD,Rb,ky],RD,{memoizeOptions:{resultEqualityCheck:Fb}}),tA=X([X([HD,Rb,zb],UD),Rb],YD),nA=X([X([GD,Rb,zb],UD),Rb],ZD),rA=X([wD,uh,Jk,Xk,nb,Rb,X([wD,Zk,Qk,$k,eA,X([tA,X([X([qD,Rb,zb],UD),Rb],tO),nA],LD),uh,Rb],rO)],oO),iA=X([wD,rA,X([rA,wD,Uk],lO),Rb],dO),aA=e=>bO(e,Rb(e),zb(e),!1),oA=X([wD,aA],fb),sA=X([X([wD,Uk,iA,oA],wE)],Bb),cA=X([uh,wD,Uk,sA,aA,X([uh,Xk,wD,Rb],VO),X([uh,Xk,wD,Rb],CO),Rb],(e,t,n,r,i,a,o,s)=>{if(t){var c=t.type,l=Lp(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?Ns(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(Gs):r.domain().map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(Gs)}}}),lA=X([JO,YO,ek],(e,t,n)=>XO(n.shared,e,t)),uA=e=>e.tooltip.settings.trigger,dA=e=>e.tooltip.settings.defaultIndex,fA=X([Ak,lA,uA,dA],Sk),pA=X([fA,Jk,TD,rA],Ek),mA=X([cA,pA],$O),hA=X([fA],e=>{if(e)return e.dataKey}),gA=X([fA],e=>{if(e)return e.graphicalItemId}),_A=X([Ak,lA,uA,dA],Ok),vA=X([fA,X([em,tm,uh,_m,cA,dA,_A],Dk)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),yA=X([fA],e=>e?.active??!1),bA=X([X([_A,pA,wy,TD,mA,kk,lA],Hk)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function xA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xA(Object(n),!0).forEach(function(t){CA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CA(e,t,n){return(t=wA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wA(e){var t=TA(e,`string`);return typeof t==`symbol`?t:t+``}function TA(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var EA=()=>Y(wD),DA=()=>{var e=EA(),t=Y(cA),n=Y(sA);return Yp(!e||!n?void 0:SA(SA({},e),{},{scale:n}),t)};function OA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OA(Object(n),!0).forEach(function(t){AA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AA(e,t,n){return(t=jA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jA(e){var t=MA(e,`string`);return typeof t==`symbol`?t:t+``}function MA(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NA=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},PA=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,o=r.radius;return kA(kA(kA({},r),Zv(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return kA(kA(kA({},r),Zv(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function FA(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var IA=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(Ns(c-s)!==Ns(l-c)){var d=[];if(Ns(l-c)===Ns(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},LA=()=>Y(ib),RA=(e,t)=>t,zA=(e,t,n)=>n,BA=(e,t,n,r)=>r,VA=X(cA,e=>pu(e,e=>e.coordinate)),HA=X([Ak,RA,zA,BA],Sk),UA=X([HA,Jk,TD,rA],Ek),WA=(e,t,n)=>{if(t!=null){var r=Ak(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},GA=X([Ak,RA,zA,BA],Ok),KA=X([em,tm,uh,_m,cA,BA,GA],Dk),qA=X([HA,KA],(e,t)=>e.coordinate??t),JA=X([cA,UA],$O),YA=X([GA,UA,wy,TD,JA,kk,RA],Hk),XA=X([HA,UA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),ZA=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&FA(e,o)){var s=IA(Qp(e,t),a,i,n,r),c=NA(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},QA=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=ry(e,n);if(s){var c=IA($p(s,t),o,a,r,i),l=PA(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},$A=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?ZA(e,t,r,i,a,o,s):QA(e,t,n,r,i,a,o)},ej=X(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),tj=X(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(lb));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:Lb}});function nj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nj(Object(n),!0).forEach(function(t){ij(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ij(e,t,n){return(t=aj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aj(e){var t=oj(e,`string`);return typeof t==`symbol`?t:t+``}function oj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sj={zIndexMap:Object.values(lb).reduce((e,t)=>rj(rj({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},cj=new Set(Object.values(lb));function lj(e){return cj.has(e)}var uj=Nf({name:`zIndex`,initialState:sj,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:vf()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!lj(n)&&delete e.zIndexMap[n])},prepare:vf()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=of(i):e.zIndexMap[r].element=of(i):e.zIndexMap[r]={consumers:0,element:a?void 0:of(i),panoramaElement:a?of(i):void 0}},prepare:vf()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:vf()}}}),dj=uj.actions,fj=dj.registerZIndexPortal,pj=dj.unregisterZIndexPortal,mj=dj.registerZIndexPortalElement,hj=dj.unregisterZIndexPortalElement,gj=uj.reducer;function _j(e){var t=e.zIndex,n=e.children,r=mh()&&t!==void 0&&t!==0,i=xm(),a=(0,v.useRef)(void 0),o=(0,v.useRef)(new Set),s=J(),c=Y(e=>ej(e,t,i));if((0,v.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(pj({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(fj({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(pj({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,v.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(pj({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,Uh.createPortal)(n,l):null}function vj(){return vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vj.apply(null,arguments)}function yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yj(Object(n),!0).forEach(function(t){xj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xj(e,t,n){return(t=Sj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sj(e){var t=Cj(e,`string`);return typeof t==`symbol`?t:t+``}function Cj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wj(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return(0,v.isValidElement)(t)?(0,v.cloneElement)(t,r):(0,v.createElement)(n,r)}function Tj(e){var t=e.coordinate,n=e.payload,r=e.index,i=e.offset,a=e.tooltipAxisBandSize,o=e.layout,s=e.cursor,c=e.tooltipEventType,l=e.chartName,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=A_,h=lb.cursorLine;else if(l===`BarChart`)p=j_(o,u,i,a),m=Uv,h=lb.cursorRectangle;else if(o===`radial`&&cc(u)){var g=iy(u),_=g.cx,y=g.cy,b=g.radius;p={cx:_,cy:y,startAngle:g.startAngle,endAngle:g.endAngle,innerRadius:b,outerRadius:b},m=yy,h=lb.cursorLine}else p={points:by(o,u,i)},m=y_,h=lb.cursorLine;var x=typeof s==`object`&&`className`in s?s.className:void 0,S=bj(bj(bj(bj({stroke:`#ccc`,pointerEvents:`none`},i),p),Ka(s)),{},{payload:d,payloadIndex:f,className:za(`recharts-tooltip-cursor`,x)});return v.createElement(_j,{zIndex:e.zIndex??h},v.createElement(wj,{cursor:s,cursorComp:m,cursorProps:S}))}function Ej(e){var t=DA(),n=oh(),r=dh(),i=LA();return t==null||n==null||r==null||i==null?null:v.createElement(Tj,vj({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var Dj=(0,v.createContext)(null),Oj=()=>(0,v.useContext)(Dj),kj=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,Aj=new kj,jj=`recharts.syncEvent.tooltip`,Mj=`recharts.syncEvent.brush`,Nj=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ps(n))return e[n]}},Pj=Nf({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),Fj=Pj.reducer,Ij=Pj.actions.createEventEmitter;function Lj(e){return e.tooltip.syncInteraction}var Rj=Nf({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=of(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),zj=Rj.actions,Bj=zj.setChartData,Vj=zj.setDataStartEndIndexes;zj.setComputedData;var Hj=Rj.reducer,Uj=[`x`,`y`];function Wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Wj(Object(n),!0).forEach(function(t){Kj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kj(e,t,n){return(t=qj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qj(e){var t=Jj(e,`string`);return typeof t==`symbol`?t:t+``}function Jj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Yj(e,t){if(e==null)return{};var n,r,i=Xj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Xj(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Zj(){var e=Y(ab),t=Y(sb),n=J(),r=Y(ob),i=Y(cA),a=dh(),o=ih();(0,v.useEffect)(()=>{if(e==null)return Ks;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(fk({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,f=d.x,p=d.y,m=Yj(d,Uj),h=c.payload.sourceViewBox,g=h.x,_=h.y,v=h.width,y=h.height,b=Gj(Gj({},m),{},{x:o.x+(v?(f-g)/v:0)*o.width,y:o.y+(y?(p-_)/y:0)*o.height});n(Gj(Gj({},c),{},{payload:Gj(Gj({},c.payload),{},{coordinate:b})}))}else n(c);return}if(i!=null){var x;typeof r==`function`?x=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(x=i.find(e=>String(e.value)===c.payload.label));var S=c.payload.coordinate;if(S==null||o==null){n(fk({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(x==null){n(fk({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var C=S.x,w=S.y,T=Math.min(C,o.x+o.width),E=Math.min(w,o.y+o.height),D={x:a===`horizontal`?x.coordinate:T,y:a===`horizontal`?E:x.coordinate};n(fk({active:c.payload.active,coordinate:D,dataKey:c.payload.dataKey,index:String(x.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return Aj.on(jj,s),()=>{Aj.off(jj,s)}},[Y(e=>e.rootProps.className),n,t,e,r,i,a,o])}function Qj(){var e=Y(ab),t=Y(sb),n=J();(0,v.useEffect)(()=>{if(e==null)return Ks;var r=(r,i,a)=>{t!==a&&e===r&&n(Vj(i))};return Aj.on(Mj,r),()=>{Aj.off(Mj,r)}},[n,t,e])}function $j(){var e=J();(0,v.useEffect)(()=>{e(Ij())},[e]),Zj(),Qj()}function eM(e,t,n,r,i,a){var o=Y(n=>WA(n,e,t)),s=Y(gA),c=Y(sb),l=Y(ab),u=Y(ob),d=Y(Lj)?.sourceViewBox!=null,f=ih();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=fk({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});Aj.emit(jj,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function tM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tM(Object(n),!0).forEach(function(t){rM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rM(e,t,n){return(t=iM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iM(e){var t=aM(e,`string`);return typeof t==`symbol`?t:t+``}function aM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function oM(e,t){return dM(e)||uM(e,t)||cM(e,t)||sM()}function sM(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
284
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cM(e,t){if(e){if(typeof e==`string`)return lM(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lM(e,t):void 0}}function lM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uM(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function dM(e){if(Array.isArray(e))return e}function fM(e){return e.dataKey}function pM(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e==`function`?v.createElement(e,t):v.createElement(kg,t)}var mM=[],hM={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function gM(e){var t=_c(e,hM),n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.filterNull,c=t.isAnimationActive,l=t.offset,u=t.payloadUniqBy,d=t.position,f=t.reverseDirection,p=t.useTranslate3d,m=t.wrapperStyle,h=t.cursor,g=t.shared,_=t.trigger,y=t.defaultIndex,b=t.portal,x=t.axisId,S=J(),C=typeof y==`number`?String(y):y;(0,v.useEffect)(()=>{S(sk({shared:g,trigger:_,axisId:x,active:n,defaultIndex:C}))},[S,g,_,x,n,C]);var w=ih(),T=i_(),E=QO(g),D=Y(e=>XA(e,E,_,C))??{},O=D.activeIndex,k=D.isActive,A=Y(e=>YA(e,E,_,C)),j=Y(e=>JA(e,E,_,C)),M=Y(e=>qA(e,E,_,C)),N=A,P=Oj(),F=n??k??!1,I=oM(Du([N,F]),2),L=I[0],ee=I[1],te=E===`axis`?j:void 0;eM(E,_,M,te,O,F);var ne=b??P;if(ne==null||w==null||E==null)return null;var re=N??mM;F||(re=mM),s&&re.length&&(re=Il(re.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,fM));var ie=re.length>0,R=nM(nM({},t),{},{payload:re,label:te,active:F,activeIndex:O,coordinate:M,accessibilityLayer:T}),ae=v.createElement(r_,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:F,coordinate:M,hasPayload:ie,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:w,wrapperStyle:m,lastBoundingBox:L,innerRef:ee,hasPortalFromProps:!!b},pM(o,R));return v.createElement(v.Fragment,null,(0,Uh.createPortal)(ae,ne),F&&v.createElement(Ej,{cursor:h,tooltipEventType:E,coordinate:M,payload:re,index:O}))}function _M(e,t,n){return(t=vM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vM(e){var t=yM(e,`string`);return typeof t==`symbol`?t:t+``}function yM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bM=class{constructor(e){_M(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function xM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xM(Object(n),!0).forEach(function(t){CM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CM(e,t,n){return(t=wM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wM(e){var t=TM(e,`string`);return typeof t==`symbol`?t:t+``}function TM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var EM=SM({},{cacheSize:2e3,enableCache:!0}),DM=new bM(EM.cacheSize),OM={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},kM=`recharts_measurement_span`;function AM(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var jM=(e,t)=>{try{var n=document.getElementById(kM);n||(n=document.createElement(`span`),n.setAttribute(`id`,kM),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,OM,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},MM=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Ig.isSsr)return{width:0,height:0};if(!EM.enableCache)return jM(e,t);var n=AM(e,t),r=DM.get(n);if(r)return r;var i=jM(e,t);return DM.set(n,i),i};function NM(e){return(e%180+180)%180}var PM=function(e){var t=e.width,n=e.height,r=NM(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)};function FM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function IM(e,t,n){return PM({width:e.width+t.width,height:e.height+t.height},n)}function LM(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function RM(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function zM(e,t){return FM(e,t+1)}function BM(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:FM(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||RM(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function VM(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var o=t.start,s=t.end,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||RM(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m<a&&(p=f(),!(p!==0&&p===1));m+=c);if(d){for(var h=[],g=l;g<a;g+=c){var _=r[g];_!=null&&h.push(_)}return h}}return[]}function HM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HM(Object(n),!0).forEach(function(t){WM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WM(e,t,n){return(t=GM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GM(e){var t=KM(e,`string`);return typeof t==`symbol`?t:t+``}function KM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qM(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t];if(r==null)return 1;var l=r,u,d=()=>(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=UM(UM({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=UM(UM({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&RM(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=UM(UM({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function JM(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=UM(UM({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&RM(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=UM(UM({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=UM(UM({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=UM(UM({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&RM(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=UM(UM({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function YM(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(G(c)||Ig.isSsr)return zM(i,G(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?MM(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=(e,r)=>{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?IM(MM(i,{fontSize:t,letterSpacing:n}),m,d):MM(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?Ns(_.coordinate-g.coordinate):1,y=LM(a,v,p);return c===`equidistantPreserveStart`?BM(v,y,h,i,o):c===`equidistantPreserveEnd`?VM(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?JM(v,y,h,i,o,c===`preserveStartEnd`):qM(v,y,h,i,o),f.filter(e=>e.isShow))}var XM=[`children`,`className`];function ZM(){return ZM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZM.apply(null,arguments)}function QM(e,t){if(e==null)return{};var n,r,i=$M(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $M(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eN=v.forwardRef((e,t)=>{var n=e.children,r=e.className,i=QM(e,XM),a=za(`recharts-layer`,r);return v.createElement(`g`,ZM({className:a},qa(i),{ref:t}),n)}),tN;function nN(e,t){return sN(e)||oN(e,t)||iN(e,t)||rN()}function rN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
285
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iN(e,t){if(e){if(typeof e==`string`)return aN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aN(e,t):void 0}}function aN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function sN(e){if(Array.isArray(e))return e}function cN(e,t,n){return(t=lN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lN(e){var t=uN(e,`string`);return typeof t==`symbol`?t:t+``}function uN(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dN=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fN=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,pN=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,mN=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,hN={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},gN=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function _N(e){return gN.includes(e)}var vN=`NaN`;function yN(e,t){return e*hN[t]}var bN=class e{static parse(t){var n=nN(mN.exec(t)??[],3),r=n[1],i=n[2];return r==null?e.NaN:new e(parseFloat(r),i??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,Ps(e)&&(this.unit=``),t!==``&&!pN.test(t)&&(this.num=NaN,this.unit=``),_N(t)&&(this.num=yN(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return Ps(this.num)}};tN=bN,cN(bN,`NaN`,new tN(NaN,``));function xN(e){if(e==null||e.includes(vN))return vN;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=nN(dN.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=bN.parse(r??``),s=bN.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return vN;t=t.replace(dN,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=nN(fN.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=bN.parse(u??``),m=bN.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return vN;t=t.replace(fN,h.toString())}return t}var SN=/\(([^()]*)\)/;function CN(e){for(var t=e,n;(n=SN.exec(t))!=null;){var r=nN(n,2)[1];t=t.replace(SN,xN(r))}return t}function wN(e){var t=e.replace(/\s+/g,``);return t=CN(t),t=xN(t),t}function TN(e){try{return wN(e)}catch{return vN}}function EN(e){var t=TN(e.slice(5,-1));return t===vN?``:t}var DN=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],ON=[`dx`,`dy`,`angle`,`className`,`breakAll`];function kN(){return kN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kN.apply(null,arguments)}function AN(e,t){if(e==null)return{};var n,r,i=jN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jN(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function MN(e,t){return LN(e)||IN(e,t)||PN(e,t)||NN()}function NN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
286
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PN(e,t){if(e){if(typeof e==`string`)return FN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FN(e,t):void 0}}function FN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function IN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function LN(e){if(Array.isArray(e))return e}var RN=/[ \f\n\r\t\v\u2028\u2029]+/,zN=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return Us(t)||(i=n?t.toString().split(``):t.toString().split(RN)),{wordsWithComputedWidth:i.map(e=>({word:e,width:MM(e,r).width})),spaceWidth:n?0:MM(`\xA0`,r).width}}catch{return null}};function BN(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function VN(e){return Us(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var HN=(e,t,n,r)=>e.reduce((e,i)=>{var a=i.word,o=i.width,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),UN=e=>e.reduce((e,t)=>e.width>t.width?e:t),WN=`…`,GN=(e,t,n,r,i,a,o,s)=>{var c=zN({breakAll:n,style:r,children:e.slice(0,t)+WN});if(!c)return[!1,[]];var l=HN(c.wordsWithComputedWidth,a,o,s);return[l.length>i||UN(l).width>Number(a),l]},KN=(e,t,n,r,i)=>{var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=G(a),u=String(o),d=HN(t,r,n,i);if(!l||i||!(d.length>a||UN(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),_=MN(GN(u,g-1,c,s,a,r,n,i),2),v=_[0],y=_[1],b=MN(GN(u,g,c,s,a,r,n,i),1)[0];if(!v&&!b&&(f=g+1),v&&b&&(p=g-1),!v&&b){h=y;break}m++}return h||d},qN=e=>[{words:Us(e)?[]:e.toString().split(RN),width:void 0}],JN=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!Ig.isSsr){var s,c,l=zN({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return qN(r);return KN({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return qN(r)},YN=`#808080`,XN={angle:0,breakAll:!1,capHeight:`0.71em`,fill:YN,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},ZN=(0,v.forwardRef)((e,t)=>{var n=_c(e,XN),r=n.x,i=n.y,a=n.lineHeight,o=n.capHeight,s=n.fill,c=n.scaleToFit,l=n.textAnchor,u=n.verticalAnchor,d=AN(n,DN),f=(0,v.useMemo)(()=>JN({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),p=d.dx,m=d.dy,h=d.angle,g=d.className,_=d.breakAll,y=AN(d,ON);if(!Is(r)||!Is(i)||f.length===0)return null;var b=Number(r)+(G(p)?p:0),x=Number(i)+(G(m)?m:0);if(!Q(b)||!Q(x))return null;var S;switch(u){case`start`:S=EN(`calc(${o})`);break;case`middle`:S=EN(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=EN(`calc(${f.length-1} * -${a})`);break}var C=[],w=f[0];if(c&&w!=null){var T=w.width,E=d.width;C.push(`scale(${G(E)&&G(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,kN({},qa(y),{ref:t,x:b,y:x,className:za(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?YN:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return v.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});ZN.displayName=`Text`;function QN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $N(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QN(Object(n),!0).forEach(function(t){eP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eP(e,t,n){return(t=tP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tP(e){var t=nP(e,`string`);return typeof t==`symbol`?t:t+``}function nP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rP=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=rh(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?$N({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?$N({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?$N({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?$N({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?$N({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?$N({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?$N({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?$N({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(G(n.x)||Fs(n.x))&&(G(n.y)||Fs(n.y))?$N({x:c+zs(n.x,g),y:l+zs(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):$N({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},iP=[`labelRef`],aP=[`content`];function oP(e,t){if(e==null)return{};var n,r,i=sP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function sP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function cP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cP(Object(n),!0).forEach(function(t){uP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uP(e,t,n){return(t=dP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dP(e){var t=fP(e,`string`);return typeof t==`symbol`?t:t+``}function fP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pP(){return pP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pP.apply(null,arguments)}var mP=(0,v.createContext)(null),hP=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,s=e.children,c=(0,v.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return v.createElement(mP.Provider,{value:c},s)},gP=()=>{var e=(0,v.useContext)(mP),t=ih();return e||(t?rh(t):void 0)},_P=(0,v.createContext)(null),vP=()=>{var e=(0,v.useContext)(_P),t=Y(kb);return e||t},yP=e=>{var t=e.value,n=e.formatter,r=Us(e.children)?t:e.children;return typeof n==`function`?n(r):r},bP=e=>e!=null&&typeof e==`function`,xP=(e,t)=>Ns(t-e)*Math.min(Math.abs(t-e),360),SP=(e,t,n,r,i)=>{var a=e.offset,o=e.className,s=i.cx,c=i.cy,l=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,p=i.clockWise,m=(l+u)/2,h=xP(d,f),g=h>=0?1:-1,_,y;switch(t){case`insideStart`:_=d+g*a,y=p;break;case`insideEnd`:_=f-g*a,y=!p;break;case`end`:_=f+g*a,y=p;break;default:throw Error(`Unsupported position ${t}`)}y=h<=0?y:!y;var b=Zv(s,c,m,_),x=Zv(s,c,m,_+(y?1:-1)*359),S=`M${b.x},${b.y}
|
|
287
|
+
A${m},${m},0,1,${+!y},
|
|
288
|
+
${x.x},${x.y}`,C=Us(e.id)?Rs(`recharts-radial-line-`):e.id;return v.createElement(`text`,pP({},r,{dominantBaseline:`central`,className:za(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},CP=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,s=(e.startAngle+e.endAngle)/2;if(n===`outside`){var c=Zv(r,i,o+t,s),l=c.x;return{x:l,y:c.y,textAnchor:l>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var u=Zv(r,i,(a+o)/2,s);return{x:u.x,y:u.y,textAnchor:`middle`,verticalAnchor:`middle`}},wP=e=>e!=null&&`cx`in e&&G(e.cx),TP={angle:0,offset:5,zIndex:lb.label,position:`middle`,textBreakAll:!1};function EP(e){if(!wP(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function DP(e){var t=_c(e,TP),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,o=t.children,s=t.content,c=t.className,l=c===void 0?``:c,u=t.textBreakAll,d=t.labelRef,f=vP(),p=gP(),m=n==null?i===`center`?p:f??p:wP(n)?n:rh(n),h,g,_=EP(m);if(!m||Us(a)&&Us(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var y=lP(lP({},t),{},{viewBox:m});if((0,v.isValidElement)(s))return y.labelRef,(0,v.cloneElement)(s,oP(y,iP));if(typeof s==`function`){if(y.content,h=(0,v.createElement)(s,oP(y,aP)),(0,v.isValidElement)(h))return h}else h=yP(t);var b=qa(t);if(wP(m)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return SP(t,i,h,b,m);g=CP(m,t.offset,t.position)}else{if(!_)return null;var x=rP({viewBox:_,position:i,offset:t.offset,parentViewBox:wP(r)?void 0:r,clamp:!0});g=lP(lP({x:x.x,y:x.y,textAnchor:x.horizontalAnchor,verticalAnchor:x.verticalAnchor},x.width===void 0?{}:{width:x.width}),x.height===void 0?{}:{height:x.height})}return v.createElement(_j,{zIndex:t.zIndex},v.createElement(ZN,pP({ref:d,className:za(`recharts-label`,l)},b,g,{textAnchor:BN(b.textAnchor)?b.textAnchor:g.textAnchor,breakAll:u}),h))}DP.displayName=`Label`;var OP=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(DP,pP({key:`label-implicit`},r)):Is(e)?v.createElement(DP,pP({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===DP?(0,v.cloneElement)(e,lP({key:`label-implicit`},r)):v.createElement(DP,pP({key:`label-implicit`,content:e},r)):bP(e)?v.createElement(DP,pP({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(DP,pP({},e,{key:`label-implicit`},r)):null};function kP(e){var t=e.label,n=e.labelRef;return OP(t,gP(),n)||null}var AP=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r===void 0?5:r,a=e.tickSize,o=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,l=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>l&&(l=t.width)}});var u=n?n.getBoundingClientRect().width:0,d=o+c,f=l+d+u+(n?i:0);return Math.round(f)}return 0};function jP(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var MP=Nf({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=of(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),NP=MP.actions,PP=NP.setRenderedTicks,FP=NP.removeRenderedTicks,IP=MP.reducer,LP=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function RP(e,t){return UP(e)||HP(e,t)||BP(e,t)||zP()}function zP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
289
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BP(e,t){if(e){if(typeof e==`string`)return VP(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VP(e,t):void 0}}function VP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HP(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function UP(e){if(Array.isArray(e))return e}function WP(e,t){if(e==null)return{};var n,r,i=GP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function KP(){return KP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KP.apply(null,arguments)}function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qP(Object(n),!0).forEach(function(t){YP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YP(e,t,n){return(t=XP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XP(e){var t=ZP(e,`string`);return typeof t==`symbol`?t:t+``}function ZP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var QP={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`,zIndex:lb.axis};function $P(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=e.otherSvgProps;if(!s)return null;var l=JP(JP(JP({},c),Ga(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=JP(JP({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=JP(JP({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return v.createElement(`line`,KP({},l,{className:za(`recharts-cartesian-axis-line`,Os(s,`className`))}))}function eF(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=G(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_;break}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function tF(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function nF(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function rF(e){var t=e.option,n=e.tickProps,r=e.value,i,a=za(n.className,`recharts-cartesian-axis-tick-value`);if(v.isValidElement(t))i=v.cloneElement(t,JP(JP({},n),{},{className:a}));else if(typeof t==`function`)i=t(JP(JP({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=za(o,jP(t))),i=v.createElement(ZN,KP({},n,{className:o}),r)}return i}function iF(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=J();return(0,v.useEffect)(()=>r==null||n==null?Ks:(i(PP({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(FP({axisId:r,axisType:n}))}),[i,t,r,n]),null}var aF=(0,v.forwardRef)((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,o=e.stroke,s=e.tickFormatter,c=e.unit,l=e.padding,u=e.tickTextProps,d=e.orientation,f=e.mirror,p=e.x,m=e.y,h=e.width,g=e.height,_=e.tickSize,y=e.tickMargin,b=e.fontSize,x=e.letterSpacing,S=e.getTicksConfig,C=e.events,w=e.axisType,T=e.axisId,E=YM(JP(JP({},S),{},{ticks:r}),b,x),D=Ga(S),O=Ka(i),k=BN(D.textAnchor)?D.textAnchor:tF(d,f),A=nF(d,f),j={};typeof a==`object`&&(j=a);var M=JP(JP({},D),{},{fill:`none`},j),N=E.map(e=>JP({entry:e},eF(e,p,m,h,g,d,_,f,y))),P=N.map(e=>{var t=e.entry,n=e.line;return v.createElement(eN,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},a&&v.createElement(`line`,KP({},M,n,{className:za(`recharts-cartesian-axis-tick-line`,Os(a,`className`))})))}),F=N.map((e,t)=>{var n=e.entry,r=e.tick,a=JP(JP({},JP(JP(JP(JP({verticalAnchor:A},D),{},{textAnchor:k,stroke:`none`,fill:o},r),{},{index:t,payload:n,visibleTicksCount:E.length,tickFormatter:s,padding:l},u),{},{angle:u?.angle??D.angle??0})),O);return v.createElement(eN,KP({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},dc(C,n,t)),i&&v.createElement(rF,{option:i,tickProps:a,value:`${typeof s==`function`?s(n.value,t):n.value}${c||``}`}))});return v.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${w}-ticks`},v.createElement(iF,{ticks:E,axisId:T,axisType:w}),F.length>0&&v.createElement(_j,{zIndex:lb.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${w}-tick-labels`,ref:t},F)),P.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${w}-tick-lines`},P))}),oF=(0,v.forwardRef)((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,o=e.hide,s=e.ticks,c=e.axisType,l=e.axisId,u=WP(e,LP),d=RP((0,v.useState)(``),2),f=d[0],p=d[1],m=RP((0,v.useState)(``),2),h=m[0],g=m[1],_=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>AP({ticks:_.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var y=(0,v.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);_.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==f||a!==h)&&(p(i),g(a))}}},[f,h]);return o||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(_j,{zIndex:e.zIndex},v.createElement(eN,{className:za(`recharts-cartesian-axis`,a)},v.createElement($P,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Ga(e)}),v.createElement(aF,{ref:y,axisType:c,events:u,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),v.createElement(hP,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(kP,{label:e.label,labelRef:e.labelRef}),e.children)))}),sF=v.forwardRef((e,t)=>{var n=_c(e,QP);return v.createElement(oF,KP({},n,{ref:t}))});sF.displayName=`CartesianAxis`;var cF=[`x1`,`y1`,`x2`,`y2`,`key`],lF=[`offset`],uF=[`xAxisId`,`yAxisId`],dF=[`xAxisId`,`yAxisId`];function fF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fF(Object(n),!0).forEach(function(t){mF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mF(e,t,n){return(t=hF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hF(e){var t=gF(e,`string`);return typeof t==`symbol`?t:t+``}function gF(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _F(){return _F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_F.apply(null,arguments)}function vF(e,t){if(e==null)return{};var n,r,i=yF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var bF=e=>{var t=e.fill;if(!t||t===`none`)return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.ry;return v.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function xF(e){var t=e.option,n=e.lineItemProps,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var i=n.x1,a=n.y1,o=n.x2,s=n.y2,c=n.key,l=Ga(vF(n,cF))??{};l.offset;var u=vF(l,lF);r=v.createElement(`line`,_F({},u,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function SF(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=vF(e,uF),s=a.map((e,r)=>{var a=pF(pF({},o),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${r}`,index:r});return v.createElement(xF,{key:`line-${r}`,option:i,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},s)}function CF(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=vF(e,dF),s=a.map((e,r)=>{var a=pF(pF({},o),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${r}`,index:r});return v.createElement(xF,{option:i,lineItemProps:a,key:`line-${r}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},s)}function wF(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(c===void 0||c)||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return v.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function TF(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!n||!r||!r.length)return null;var u=l.map(e=>Math.round(e+a-a)).sort((e,t)=>e-t);a!==u[0]&&u.unshift(0);var d=u.map((e,t)=>{var n=u[t+1],l=n==null?a+s-e:n-e;if(l<=0)return null;var d=t%r.length;return v.createElement(`rect`,{key:`react-${t}`,x:e,y:o,width:l,height:c,stroke:`none`,fill:r[d],fillOpacity:i,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},d)}var EF=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return Rp(YM(pF(pF(pF({},QP),n),{},{ticks:zp(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},DF=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return Rp(YM(pF(pF(pF({},QP),n),{},{ticks:zp(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},OF={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:lb.grid};function kF(e){var t=sh(),n=ch(),r=oh(),i=pF(pF({},_c(e,OF)),{},{x:G(e.x)?e.x:r.left,y:G(e.y)?e.y:r.top,width:G(e.width)?e.width:r.width,height:G(e.height)?e.height:r.height}),a=i.xAxisId,o=i.yAxisId,s=i.x,c=i.y,l=i.width,u=i.height,d=i.syncWithTicks,f=i.horizontalValues,p=i.verticalValues,m=xm(),h=Y(e=>UO(e,`xAxis`,a,m)),g=Y(e=>UO(e,`yAxis`,o,m));if(!kp(l)||!kp(u)||!G(s)||!G(c))return null;var _=i.verticalCoordinatesGenerator||EF,y=i.horizontalCoordinatesGenerator||DF,b=i.horizontalPoints,x=i.verticalPoints;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?pF(pF({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);Dm(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof _==`function`){var w=p&&p.length,T=_({xAxis:h?pF(pF({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);Dm(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(_j,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(bF,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(wF,_F({},i,{horizontalPoints:b})),v.createElement(TF,_F({},i,{verticalPoints:x})),v.createElement(SF,_F({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(CF,_F({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}kF.displayName=`CartesianGrid`;var AF=[`valueAccessor`],jF=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function MF(){return MF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MF.apply(null,arguments)}function NF(e,t){if(e==null)return{};var n,r,i=PF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function PF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var FF=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(VN(t))return t},IF=(0,v.createContext)(void 0),LF=IF.Provider,RF=(0,v.createContext)(void 0);RF.Provider;function zF(){return(0,v.useContext)(IF)}function BF(){return(0,v.useContext)(RF)}function VF(e){var t=e.valueAccessor,n=t===void 0?FF:t,r=NF(e,AF),i=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,s=r.zIndex,c=NF(r,jF),l=zF(),u=BF(),d=l||u;return!d||!d.length?null:v.createElement(_j,{zIndex:s??lb.label},v.createElement(eN,{className:`recharts-label-list`},d.map((e,t)=>{var s=Us(i)?n(e,t):Fp(e.payload,i),l=Us(a)?{}:{id:`${a}-${t}`};return v.createElement(DP,MF({key:`label-${t}`},qa(e),c,l,{fill:r.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:t,zIndex:0}))})))}VF.displayName=`LabelList`;function HF(e){var t=e.label;return t?t===!0?v.createElement(VF,{key:`labelList-implicit`}):v.isValidElement(t)||bP(t)?v.createElement(VF,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(VF,MF({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}function UF(){return UF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UF.apply(null,arguments)}var WF=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=za(`recharts-dot`,i);return G(t)&&G(n)&&G(r)?v.createElement(`circle`,UF({},Ga(e),lc(e),{className:a,cx:t,cy:n,r})):null},GF=o((e=>{if(typeof Symbol==`function`&&Symbol.for){var t=Symbol.for;t(`react.element`),t(`react.portal`),t(`react.fragment`),t(`react.strict_mode`),t(`react.profiler`),t(`react.provider`),t(`react.context`),t(`react.forward_ref`),t(`react.suspense`),t(`react.suspense_list`),t(`react.memo`),t(`react.lazy`),t(`react.block`),t(`react.server.block`),t(`react.fundamental`),t(`react.debug_trace_mode`),t(`react.legacy_hidden`)}}));o(((e,t)=>{t.exports=GF()}))();var KF=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0,qF=[`points`];function JF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JF(Object(n),!0).forEach(function(t){XF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XF(e,t,n){return(t=ZF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZF(e){var t=QF(e,`string`);return typeof t==`symbol`?t:t+``}function QF(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $F(){return $F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$F.apply(null,arguments)}function eI(e,t){if(e==null)return{};var n,r,i=tI(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function nI(e){var t=e.option,n=e.dotProps,r=e.className;if((0,v.isValidElement)(t))return(0,v.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=za(r,typeof t==`boolean`?``:t.className),a=n??{};a.points;var o=eI(a,qF);return v.createElement(WF,$F({},o,{className:i}))}function rI(e,t){return e==null?!1:t?!0:e.length===1}function iI(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,o=e.baseProps,s=e.needClip,c=e.clipPathId,l=e.zIndex,u=l===void 0?lb.scatter:l;if(!rI(t,n))return null;var d=KF(n),f=Ja(n),p=t.map((e,r)=>{var s=YF(YF(YF({r:3},o),f),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return v.createElement(nI,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),m={};return s&&c!=null&&(m.clipPath=`url(#clipPath-${d?``:`dots-`}${c})`),v.createElement(_j,{zIndex:u},v.createElement(eN,$F({className:r},m),p))}function aI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?aI(Object(n),!0).forEach(function(t){sI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sI(e,t,n){return(t=cI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cI(e){var t=lI(e,`string`);return typeof t==`symbol`?t:t+``}function lI(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var uI=Nf({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=of(t.payload)},prepare:vf()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=of(i))},prepare:vf()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:vf()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=of(t.payload)},prepare:vf()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=of(i))},prepare:vf()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:vf()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=of(t.payload)},prepare:vf()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=of(i))},prepare:vf()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:vf()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var o=a.widthHistory||[];if(o.length===3&&o[0]===o[2]&&i===o[1]&&i!==a.width&&Math.abs(i-(o[0]??0))<=1)return;var s=[...o,i].slice(-3);e.yAxis[r]=oI(oI({},a),{},{width:i,widthHistory:s})}}}}),dI=uI.actions,fI=dI.addXAxis,pI=dI.replaceXAxis,mI=dI.removeXAxis,hI=dI.addYAxis,gI=dI.replaceYAxis,_I=dI.removeYAxis;dI.addZAxis,dI.replaceZAxis,dI.removeZAxis;var vI=dI.updateYAxisWidth,yI=uI.reducer,bI=X([X([_m],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),em,tm],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),xI=()=>Y(bI),SI=()=>Y(bA);function CI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CI(Object(n),!0).forEach(function(t){TI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TI(e,t,n){return(t=EI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EI(e){var t=DI(e,`string`);return typeof t==`symbol`?t:t+``}function DI(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var OI=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s=wI(wI(wI({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),Ka(i)),lc(i)),c=(0,v.isValidElement)(i)?(0,v.cloneElement)(i,s):typeof i==`function`?i(s):v.createElement(WF,s);return v.createElement(eN,{className:`recharts-active-dot`,clipPath:o},c)};function kI(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,s=o===void 0?lb.activeDot:o,c=Y(pA),l=SI();if(t==null||l==null)return null;var u=t.find(e=>l.includes(e.payload));return Us(u)?null:v.createElement(_j,{zIndex:s},v.createElement(OI,{point:u,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function AI(e){var t=e.tooltipEntrySettings,n=J(),r=xm(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(ik(t)):i.current!==t&&n(ak({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(ok(i.current)),null)},[n]),null}function jI(e,t){var n=Y(t=>GE(t,e)),r=Y(e=>JE(e,t)),i=n?.allowDataOverflow??UE.allowDataOverflow,a=r?.allowDataOverflow??KE.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function MI(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=xI(),a=jI(t,n),o=a.needClipX,s=a.needClipY,c=a.needClip,l=Y(e=>vO(e,t,!1)),u=Y(e=>yO(e,n,!1));if(!c||!i)return null;var d=i.x,f=i.y,p=i.width,m=i.height,h=o&&l?Math.min(l[0],l[1]):d-p/2,g=s&&u?Math.min(u[0],u[1]):f-m/2,_=o&&l?Math.abs(l[1]-l[0]):p*2,y=s&&u?Math.abs(u[1]-u[0]):m*2;return v.createElement(`clipPath`,{id:`clipPath-${r}`},v.createElement(`rect`,{x:h,y:g,width:_,height:y}))}function NI(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function PI(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var FI=(e,t,n)=>KO(e,`xAxis`,NI(e,t),n),II=(e,t,n)=>GO(e,`xAxis`,NI(e,t),n),LI=(e,t,n)=>KO(e,`yAxis`,PI(e,t),n),RI=(e,t,n)=>GO(e,`yAxis`,PI(e,t),n),zI=X([uh,FI,LI,II,RI],(e,t,n,r,i)=>Lp(e,`xAxis`)?Yp(t,r,!1):Yp(n,i,!1)),BI=X([nD,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),VI=e=>Lp(uh(e),`xAxis`)?`yAxis`:`xAxis`,HI=(e,t)=>VI(e)===`yAxis`?PI(e,t):NI(e,t),UI=X([uh,FI,LI,II,RI,X([BI,(e,t,n)=>OD(e,VI(e),HI(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var n=e.stackId,r=Mb(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Dy,zI,BI,cb],(e,t,n,r,i,a,o,s,c,l)=>{var u=o.chartData,d=o.dataStartIndex,f=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var p=c.data,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return bR({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}});function WI(e){var t=e.legendPayload,n=J(),r=xm(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(bh(t)):i.current!==t&&n(xh({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(Sh(i.current)),null)},[n]),null}function GI(e,t){return XI(e)||YI(e,t)||qI(e,t)||KI()}function KI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
290
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qI(e,t){if(e){if(typeof e==`string`)return JI(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JI(e,t):void 0}}function JI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function YI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function XI(e){if(Array.isArray(e))return e}var ZI=`index`;function QI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:`removed`,prev:i});for(var a=0;a<t.length;a++){var o=e[a],s=t[a];o==null?r.push({status:`added`,next:s}):r.push({status:`matched`,prev:o,next:s})}return r}function $I(e,t){var n=e.length/t.length;return QI(t.map((t,r)=>e[Math.floor(r*n)]),t)}function eL(e,t){return QI(t.map((t,n)=>e[n]),t)}function tL(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function nL(e,t,n){var r=tL(e,n),i=new Set,a=t.map((e,t)=>{var a=n(e,t);if(a!=null){var o=r.get(a);if(o!==void 0)return i.add(a),o}}),o=[];for(var s of r){var c=GI(s,2),l=c[0],u=c[1];i.has(l)||o.push(u)}return QI(a,t,o)}function rL(e,t,n){return t==null?null:e==null?t.map(e=>({status:`added`,next:e})):n===`index`?$I(e,t):n===`append`?eL(e,t):nL(e,t,n)}function iL(e,t){var n=(0,v.useRef)(e),r=(0,v.useRef)(t.current),i=(0,v.useRef)(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=(0,v.useCallback)(function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(n===0){i.current=!0;return}n===1&&(r.current=e),n>0&&i.current&&a&&(t.current=e)},[t]);return{startValue:r.current,syncStepValue:a}}function aL(e,t){return uL(e)||lL(e,t)||sL(e,t)||oL()}function oL(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
291
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sL(e,t){if(e){if(typeof e==`string`)return cL(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cL(e,t):void 0}}function cL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lL(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function uL(e){if(Array.isArray(e))return e}function dL(e,t){var n=aL((0,v.useState)(!1),2),r=n[0],i=n[1];return{isAnimating:r,handleAnimationStart:(0,v.useCallback)(()=>{typeof e==`function`&&e(),i(!0)},[e]),handleAnimationEnd:(0,v.useCallback)(()=>{typeof t==`function`&&t(),i(!1)},[t])}}function fL(e){var t=e.animationInput,n=e.animationIdPrefix,r=e.items,i=e.previousItemsRef,a=e.isAnimationActive,o=e.animationBegin,s=e.animationDuration,c=e.animationEasing,l=e.onAnimationStart,u=e.onAnimationEnd,d=e.animationInterpolateFn,f=e.animationMatchBy,p=e.shouldUpdatePreviousRef,m=e.children,h=e.layout,g=dv(t,n),_=iL(g,i),y=_.startValue??null,b=rL(y,r,f??ZI);return v.createElement(uv,{animationId:g,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:u,onAnimationStart:l,key:g},e=>{var t=y==null,n=r==null?r:d(b,e,h),i=p?p(e):e>0;return _.syncStepValue(n,e,i),n==null?null:m(n,e,t)})}function pL(e,t){return vL(e)||_L(e,t)||hL(e,t)||mL()}function mL(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
292
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hL(e,t){if(e){if(typeof e==`string`)return gL(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gL(e,t):void 0}}function gL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _L(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function vL(e){if(Array.isArray(e))return e}var yL=v.useId??(()=>pL(v.useState(()=>Rs(`uid-`)),1)[0]);function bL(e,t){var n=yL();return t||(e?`${e}-${n}`:n)}var xL=(0,v.createContext)(void 0),SL=e=>{var t=e.id,n=e.type,r=e.children,i=bL(`recharts-${n}`,t);return v.createElement(xL.Provider,{value:i},r(i))},CL=Nf({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(of(t.payload))},prepare:vf()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=nf(e).cartesianItems.indexOf(of(r));a>-1&&(e.cartesianItems[a]=of(i))},prepare:vf()},removeCartesianGraphicalItem:{reducer(e,t){var n=nf(e).cartesianItems.indexOf(of(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:vf()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(of(t.payload))},prepare:vf()},removePolarGraphicalItem:{reducer(e,t){var n=nf(e).polarItems.indexOf(of(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:vf()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=nf(e).polarItems.indexOf(of(r));a>-1&&(e.polarItems[a]=of(i))},prepare:vf()}}}),wL=CL.actions,TL=wL.addCartesianGraphicalItem,EL=wL.replaceCartesianGraphicalItem,DL=wL.removeCartesianGraphicalItem;wL.addPolarGraphicalItem,wL.removePolarGraphicalItem,wL.replacePolarGraphicalItem;var OL=CL.reducer,kL=(0,v.memo)(e=>{var t=J(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(TL(e)):n.current!==e&&t(EL({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(DL(n.current)),null)},[t]),null});function AL(e){var t=Ka(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}function jL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ML(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jL(Object(n),!0).forEach(function(t){NL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NL(e,t,n){return(t=PL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PL(e){var t=FL(e,`string`);return typeof t==`symbol`?t:t+``}function FL(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IL(e,t){return ML(ML({},t),e)}function LL(e){return(0,v.isValidElement)(e)?e.props:e}function RL(e,t){return(0,v.cloneElement)(e,IL(LL(e),t))}function zL(e){if(`index`in e){var t=e.index;return typeof t==`number`||typeof t==`string`?t:void 0}}function BL(e){return`isActive`in e&&e.isActive===!0}function VL(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?`recharts-active-shape`:i,o=e.inActiveClassName,s=o===void 0?`recharts-shape`:o,c=zL(r),l=(0,v.isValidElement)(t)?RL(t,r):t===n?v.createElement(n,r):typeof t==`function`?t(r,c):typeof t==`object`?v.createElement(n,IL(t,r)):v.createElement(n,r);return BL(r)?v.createElement(eN,{className:a},l):v.createElement(eN,{className:s},l)}var HL=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],UL=[`id`,`baseLine`];function WL(){return WL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WL.apply(null,arguments)}function GL(e,t){if(e==null)return{};var n,r,i=KL(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function KL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qL(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!Q(a)||!Q(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return G(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),G(c)?v.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function JL(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!Q(a)||!Q(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return G(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),G(c)?v.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function YL(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?v.createElement(JL,{alpha:t,points:r,baseLine:i,strokeWidth:a}):v.createElement(qL,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function XL(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r===void 0?!1:r,a=e.isEntrance,o=a===void 0?!1:a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=GL(e,HL),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=yL(),h=d.id,g=d.baseLine,_=Ga(GL(d,UL)),y=v.createElement(y_,WL({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&v.createElement(y_,WL({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:d.points})),x=l!==`none`&&c&&Array.isArray(g)&&v.createElement(y_,WL({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?v.createElement(eN,null,v.createElement(`defs`,null,v.createElement(`clipPath`,{id:m},v.createElement(YL,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),v.createElement(eN,{clipPath:`url(#${m})`},y,b,x)):v.createElement(v.Fragment,null,y,b,x)}var ZL=[`id`],QL=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function $L(){return $L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$L.apply(null,arguments)}function eR(e,t){if(e==null)return{};var n,r,i=tR(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tR(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function nR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nR(Object(n),!0).forEach(function(t){iR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iR(e,t,n){return(t=aR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aR(e){var t=oR(e,`string`);return typeof t==`symbol`?t:t+``}function oR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sR={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:ZI,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[rR(rR({},e.next),{},{x:Vs(e.prev.x,e.next.x,t),y:Vs(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:XL,xAxisId:0,yAxisId:0,zIndex:lb.area};function cR(e,t){return e&&e!==`none`?e:t}var lR=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:cR(r,i),value:Zp(n,t),payload:e}]},uR=v.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:Ks,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Zp(o,t),hide:s,type:u,color:cR(r,a),unit:c,formatter:l,graphicalItemId:d}};return v.createElement(AI,{tooltipEntrySettings:f})});function dR(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=Ga(r);return v.createElement(iI,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function fR(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return rR(rR({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return v.createElement(LF,{value:t?r:void 0},n)}function pR(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,f=a.connectNulls,p=a.isRange,m=a.shape,h=a.id,g=eR(a,ZL),_=rR(rR({},qa(g)),{},{id:h,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:d,isRange:p,animationElapsedTime:o,isAnimating:s,isEntrance:c});return v.createElement(v.Fragment,null,t?.length>1&&v.createElement(eN,{clipPath:r?`url(#clipPath-${i})`:void 0},v.createElement(VL,{option:m,DefaultShape:sR.shape,shapeProps:_})),v.createElement(dR,{points:t,props:g,clipPathId:i}))}function mR(e,t,n){return G(e)?Vs(G(t)?t:void 0,e,n):Us(e)||Ps(e)?Vs(G(t)?t:void 0,0,n):e}function hR(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,p=r.animationInterpolateFn,m=(0,v.useMemo)(()=>({points:o,baseLine:s}),[o,s]),h=iL(m,a),g=fh(),_=dL(r.onAnimationStart,r.onAnimationEnd),y=_.isAnimating,b=_.handleAnimationStart,x=_.handleAnimationEnd,S=h.startValue;if(g==null)return null;var C=Array.isArray(s)&&Array.isArray(S)?rL(S,s,f):Array.isArray(s)?rL(null,s,f):null;return v.createElement(fL,{animationInput:m,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:b,onAnimationEnd:x,animationInterpolateFn:p,animationMatchBy:f,layout:g},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?p(C,i,g):a?s:mR(s,S,i);return h.syncStepValue(c,i),v.createElement(fR,{showLabels:!y,points:o},r.children,v.createElement(pR,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:y||i<1,isEntrance:a}),v.createElement(HF,{label:r.label}))})}function gR(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,v.useRef)(null),a=(0,v.useRef)();return v.createElement(hR,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var _R=class extends v.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,l=e.yAxisId,u=e.width,d=e.height,f=e.id,p=e.baseLine,m=e.zIndex;if(t)return null;var h=za(`recharts-area`,i),g=f,_=AL(n),y=_.r,b=_.strokeWidth,x=KF(n),S=y*2+b,C=s?`url(#clipPath-${x?``:`dots-`}${g})`:void 0;return v.createElement(_j,{zIndex:m},v.createElement(eN,{className:h},s&&v.createElement(`defs`,null,v.createElement(MI,{clipPathId:g,xAxisId:c,yAxisId:l}),!x&&v.createElement(`clipPath`,{id:`clipPath-dots-${g}`},v.createElement(`rect`,{x:o-S/2,y:a-S/2,width:u+S,height:d+S}))),v.createElement(gR,{needClip:s,clipPathId:g,props:this.props})),v.createElement(kI,{points:r,mainColor:cR(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(p)&&v.createElement(kI,{points:p,mainColor:cR(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}};function vR(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=eR(e,QL),g=dh(),_=LA(),y=jI(p,m).needClip,b=xm(),x=Y(t=>UI(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=xI();if(g!==`horizontal`&&g!==`vertical`||T==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var E=T.height,D=T.width,O=T.x,k=T.y;return!S||!S.length?null:v.createElement(_R,$L({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:f,width:D,left:O,top:k,xAxisId:p,yAxisId:m}))}var yR=(e,t,n,r,i)=>{var a=n??t;if(G(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function bR(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=a&&a.length,g=yR(o,s,r,c,l),_=o===`horizontal`,v=!1,y=u.map((e,t)=>{var r;if(h)r=a[d+t];else{var o=Fp(e,i);Array.isArray(o)?(r=o,v=!0):r=[g,o]}var s=r?.[1]??null,u=s==null||h&&!n&&Fp(e,i)==null;return _?{x:Up({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:u?null:l.scale.map(s)??null,value:r,payload:e}:{x:u?null:c.scale.map(s)??null,y:Up({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:y,baseLine:(h||v?y.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return _?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):_?l.scale.map(g):c.scale.map(g))??0,isRange:v}}function xR(e){var t=_c(e,sR),n=xm();return v.createElement(SL,{id:t.id,type:`area`},e=>v.createElement(v.Fragment,null,v.createElement(WI,{legendPayload:lR(t)}),v.createElement(uR,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),v.createElement(kL,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Hp(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),v.createElement(vR,$L({},t,{id:e}))))}var SR=v.memo(xR,Hh);SR.displayName=`Area`;var CR=[`domain`,`range`],wR=[`domain`,`range`];function TR(e,t){if(e==null)return{};var n,r,i=ER(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ER(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function DR(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function OR(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=TR(e,CR),a=t.domain,o=t.range,s=TR(t,wR);return!DR(n,a)||!DR(r,o)?!1:Hh(i,s)}var kR=[`type`],AR=[`dangerouslySetInnerHTML`,`ticks`,`scale`],jR=[`id`,`scale`];function MR(){return MR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MR.apply(null,arguments)}function NR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NR(Object(n),!0).forEach(function(t){FR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FR(e,t,n){return(t=IR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IR(e){var t=LR(e,`string`);return typeof t==`symbol`?t:t+``}function LR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RR(e,t){if(e==null)return{};var n,r,i=zR(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zR(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function BR(e){var t=J(),n=(0,v.useRef)(null),r=fh(),i=e.type,a=RR(e,kR),o=pb(r,`xAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return PR(PR({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(fI(s)):n.current!==s&&t(pI({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(mI(n.current)),null)},[t]),null}var VR=e=>{var t=e.xAxisId,n=e.className,r=Y(ym),i=xm(),a=`xAxis`,o=Y(e=>WO(e,a,t,i)),s=Y(e=>NO(e,t)),c=Y(e=>RO(e,t)),l=Y(e=>WE(e,t));if(s==null||c==null||l==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var u=RR(e,AR);l.id,l.scale;var d=RR(l,jR);return v.createElement(sF,MR({},u,d,{x:c.x,y:c.y,width:s.width,height:s.height,className:za(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},HR={allowDataOverflow:UE.allowDataOverflow,allowDecimals:UE.allowDecimals,allowDuplicatedCategory:UE.allowDuplicatedCategory,angle:UE.angle,axisLine:QP.axisLine,height:UE.height,hide:!1,includeHidden:UE.includeHidden,interval:UE.interval,label:!1,minTickGap:UE.minTickGap,mirror:UE.mirror,orientation:UE.orientation,padding:UE.padding,reversed:UE.reversed,scale:UE.scale,tick:UE.tick,tickCount:UE.tickCount,tickLine:QP.tickLine,tickSize:QP.tickSize,type:UE.type,niceTicks:UE.niceTicks,xAxisId:0},UR=v.memo(e=>{var t=_c(e,HR);return v.createElement(v.Fragment,null,v.createElement(BR,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(VR,t))},OR);UR.displayName=`XAxis`;var WR=[`type`],GR=[`dangerouslySetInnerHTML`,`ticks`,`scale`],KR=[`id`,`scale`];function qR(){return qR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qR.apply(null,arguments)}function JR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JR(Object(n),!0).forEach(function(t){XR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XR(e,t,n){return(t=ZR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZR(e){var t=QR(e,`string`);return typeof t==`symbol`?t:t+``}function QR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $R(e,t){if(e==null)return{};var n,r,i=ez(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ez(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tz(e){var t=J(),n=(0,v.useRef)(null),r=fh(),i=e.type,a=$R(e,WR),o=pb(r,`yAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return YR(YR({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(hI(s)):n.current!==s&&t(gI({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(_I(n.current)),null)},[t]),null}function nz(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=Y(ym),c=xm(),l=J(),u=`yAxis`,d=Y(e=>BO(e,t)),f=Y(e=>zO(e,t)),p=Y(e=>WO(e,u,t,c)),m=Y(e=>qE(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||bP(i)||(0,v.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(vI({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var h=$R(e,GR);m.id,m.scale;var g=$R(m,KR);return v.createElement(sF,qR({},h,g,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:za(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var rz={allowDataOverflow:KE.allowDataOverflow,allowDecimals:KE.allowDecimals,allowDuplicatedCategory:KE.allowDuplicatedCategory,angle:KE.angle,axisLine:QP.axisLine,hide:!1,includeHidden:KE.includeHidden,interval:KE.interval,label:!1,minTickGap:KE.minTickGap,mirror:KE.mirror,orientation:KE.orientation,padding:KE.padding,reversed:KE.reversed,scale:KE.scale,tick:KE.tick,tickCount:KE.tickCount,tickLine:QP.tickLine,tickSize:QP.tickSize,type:KE.type,niceTicks:KE.niceTicks,width:KE.width,yAxisId:0},iz=v.memo(e=>{var t=_c(e,rz);return v.createElement(v.Fragment,null,v.createElement(tz,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(nz,t))},OR);iz.displayName=`YAxis`;var az=X([(e,t)=>t,uh,kb,Rb,oA,cA,VA,_m],$A);function oz(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function sz(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(oz(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var cz=df(`mouseClick`),lz=yp();lz.startListening({actionCreator:cz,effect:(e,t)=>{var n=e.payload,r=az(t.getState(),sz(n));r?.activeIndex!=null&&t.dispatch(dk({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var uz=df(`mouseMove`),dz=yp(),fz=null,pz=null,mz=null;dz.startListening({actionCreator:uz,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);fz!==null&&(cancelAnimationFrame(fz),fz=null),pz!==null&&(typeof i!=`number`||!o)&&(clearTimeout(pz),pz=null),mz=sz(n);var s=()=>{var e=t.getState(),n=ZO(e,e.tooltip.settings.shared);if(!mz){fz=null,pz=null;return}if(n===`axis`){var r=az(e,mz);r?.activeIndex==null?t.dispatch(lk()):t.dispatch(uk({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}fz=null,pz=null};if(!o){s();return}i===`raf`?fz=requestAnimationFrame(s):typeof i==`number`&&pz===null&&(pz=setTimeout(s,i))}});function hz(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var gz=Nf({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nf(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=nf(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(of(t.payload))},removeLine:(e,t)=>{var n=nf(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),_z=gz.actions;_z.addDot,_z.removeDot,_z.addArea,_z.removeArea,_z.addLine,_z.removeLine;var vz=gz.reducer,yz={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},bz=Nf({name:`brush`,initialState:yz,reducers:{setBrushSettings(e,t){return t.payload==null?yz:t.payload}}});bz.actions.setBrushSettings;var xz=bz.reducer,Sz={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},Cz=Nf({name:`rootProps`,initialState:Sz,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??Sz.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),wz=Cz.reducer,Tz=Cz.actions.updateOptions,Ez=Nf({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=of(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=of(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),Dz=Ez.actions;Dz.addRadiusAxis,Dz.removeRadiusAxis,Dz.addAngleAxis,Dz.removeAngleAxis;var Oz=Ez.reducer,kz=Nf({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}});kz.actions.updatePolarOptions;var Az=kz.reducer,jz=df(`keyDown`),Mz=df(`focus`),Nz=df(`blur`),Pz=yp(),Fz=null,Iz=null,Lz=null;Pz.startListening({actionCreator:jz,effect:(e,t)=>{Lz=e.payload,Fz!==null&&(cancelAnimationFrame(Fz),Fz=null);var n=t.getState().eventSettings,r=n.throttleDelay,i=n.throttledEvents,a=i===`all`||i.includes(`keydown`);Iz!==null&&(typeof r!=`number`||!a)&&(clearTimeout(Iz),Iz=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=Lz;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=Ek(n,Jk(e),TD(e),rA(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=cA(e),c=Jk(e),l=ZO(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=KA(e,l,`hover`,String(n.index));t.dispatch(pk({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=qO(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=TD(e),h=rA(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(Ek(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(Ek(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=KA(e,l,`hover`,String(p));t.dispatch(pk({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{Fz=null,Iz=null}};if(!a){o();return}r===`raf`?Fz=requestAnimationFrame(o):typeof r==`number`&&Iz===null&&(o(),Lz=null,Iz=setTimeout(()=>{Lz?o():(Iz=null,Fz=null)},r))}}),Pz.startListening({actionCreator:Mz,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;if(!r.active&&r.index==null){var i=`0`,a=KA(n,ZO(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(pk({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),Pz.startListening({actionCreator:Nz,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(pk({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function Rz(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var zz=df(`externalEvent`),Bz=yp(),Vz=new Map,Hz=new Map,Uz=new Map;Bz.startListening({actionCreator:zz,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=Rz(i);Uz.set(a,{handler:r,reactEvent:o});var s=Vz.get(a);s!==void 0&&(cancelAnimationFrame(s),Vz.delete(a));var c=t.getState().eventSettings,l=c.throttleDelay,u=c.throttledEvents,d=u===`all`||u?.includes(a),f=Hz.get(a);f!==void 0&&(typeof l!=`number`||!d)&&(clearTimeout(f),Hz.delete(a));var p=()=>{var e=Uz.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:vA(i),activeDataKey:hA(i),activeIndex:pA(i),activeLabel:mA(i),activeTooltipIndex:pA(i),isTooltipActive:yA(i)};n&&n(o,r)}finally{Vz.delete(a),Hz.delete(a),Uz.delete(a)}};if(!d){p();return}if(l===`raf`){var m=requestAnimationFrame(p);Vz.set(a,m)}else if(typeof l==`number`){if(!Hz.has(a)){p();var h=setTimeout(p,l);Hz.set(a,h)}}else p()}}});var Wz=X([X([Ak],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),Gz=df(`touchMove`),Kz=yp(),qz=null,Jz=null,Yz=null,Xz=null;Kz.startListening({actionCreator:Gz,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Xz=Rz(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);qz!==null&&(cancelAnimationFrame(qz),qz=null),Jz!==null&&(typeof i!=`number`||!o)&&(clearTimeout(Jz),Jz=null),Yz=Array.from(n.touches).map(e=>sz({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(Xz!=null){var e=t.getState(),n=ZO(e,e.tooltip.settings.shared);if(n===`axis`){var r=Yz?.[0];if(r==null){qz=null,Jz=null;return}var i=az(e,r);i?.activeIndex!=null&&t.dispatch(uk({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=Xz.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(om),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=Wk(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=Wz(e,s,c);t.dispatch(ck({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}qz=null,Jz=null}};if(!o){s();return}i===`raf`?qz=requestAnimationFrame(s):typeof i==`number`&&Jz===null&&(s(),Xz=null,Jz=setTimeout(()=>{Xz?s():(Jz=null,qz=null)},i))}}});var Zz=Nf({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(e=>e.dataKey===i.dataKey&&e.direction===i.direction?a:e))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==i.dataKey||e.direction!==i.direction))}}}),Qz=Zz.actions;Qz.addErrorBar,Qz.replaceErrorBar,Qz.removeErrorBar;var $z=Zz.reducer,eB={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},tB=Nf({name:`eventSettings`,initialState:eB,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=of(t.payload.throttledEvents))}}}),nB=tB.actions.setEventSettings,rB=tB.reducer,iB=Fu({brush:xz,cartesianAxis:yI,chartData:Hj,errorBars:$z,eventSettings:rB,graphicalItems:OL,layout:Dp,legend:Ch,options:Fj,polarAxis:Oz,polarOptions:Az,referenceElements:vz,renderedTicks:IP,rootProps:wz,tooltip:mk,zIndex:gj}),aB=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Cf({reducer:iB,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([lz.middleware,dz.middleware,Pz.middleware,Bz.middleware,Kz.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(xf({type:`raf`}))},devTools:Ig.devToolsEnabled&&{serialize:{replacer:hz},name:`recharts-${t}`}})};function oB(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=xm(),a=(0,v.useRef)(null);if(i)return n;a.current??=aB(t,r);var o=K;return v.createElement(zh,{context:o,store:a.current},n)}var sB=e=>{var t=e.chartData,n=J(),r=xm();return(0,v.useEffect)(()=>r?()=>{}:(n(Bj(t)),()=>{n(Bj(void 0))}),[t,n,r]),null};function cB(e){var t=e.layout,n=e.margin,r=J(),i=xm();return(0,v.useEffect)(()=>{i||(r(wp(t)),r(Cp(n)))},[r,i,t,n]),null}var lB=(0,v.memo)(cB,Hh);function uB(e){var t=J();return(0,v.useEffect)(()=>{t(Tz(e))},[t,e]),null}var dB=(0,v.memo)(e=>{var t=J();return(0,v.useEffect)(()=>{t(nB(e))},[t,e]),null},Hh);function fB(e){var t=e.zIndex,n=e.isPanorama,r=(0,v.useRef)(null),i=J();return(0,v.useLayoutEffect)(()=>(r.current&&i(mj({zIndex:t,element:r.current,isPanorama:n})),()=>{i(hj({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function pB(e){var t=e.children,n=e.isPanorama,r=Y(tj);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(fB,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(fB,{key:e,zIndex:e,isPanorama:n})))}var mB=[`children`];function hB(e,t){if(e==null)return{};var n,r,i=gB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _B(){return _B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_B.apply(null,arguments)}var vB={width:`100%`,height:`100%`,display:`block`},yB=(0,v.forwardRef)((e,t)=>{var n=sh(),r=ch(),i=i_();if(!kp(n)||!kp(r))return null;var a=e.children,o=e.otherAttributes,s=e.title,c=e.desc,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),v.createElement($a,_B({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:vB,ref:t}),a)}),bB=e=>{var t=e.children,n=Y(Cm);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return v.createElement($a,{width:r,height:i,x:o,y:a},t)},xB=(0,v.forwardRef)((e,t)=>{var n=e.children,r=hB(e,mB);return xm()?v.createElement(bB,null,v.createElement(pB,{isPanorama:!0},n)):v.createElement(yB,_B({ref:t},r),v.createElement(pB,{isPanorama:!1},n))});function SB(e,t){return DB(e)||EB(e,t)||wB(e,t)||CB()}function CB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
293
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wB(e,t){if(e){if(typeof e==`string`)return TB(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TB(e,t):void 0}}function TB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function EB(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function DB(e){if(Array.isArray(e))return e}function OB(){var e=J(),t=SB((0,v.useState)(null),2),n=t[0],r=t[1],i=Y(nm);return(0,v.useEffect)(()=>{if(n!=null){var t=n.getBoundingClientRect().width/n.offsetWidth;Q(t)&&t!==i&&e(Ep(t))}},[n,e,i]),r}function kB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kB(Object(n),!0).forEach(function(t){jB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jB(e,t,n){return(t=MB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MB(e){var t=NB(e,`string`);return typeof t==`symbol`?t:t+``}function NB(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function PB(){return PB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PB.apply(null,arguments)}function FB(e,t){return BB(e)||zB(e,t)||LB(e,t)||IB()}function IB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
294
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LB(e,t){if(e){if(typeof e==`string`)return RB(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?RB(e,t):void 0}}function RB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zB(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function BB(e){if(Array.isArray(e))return e}var VB=()=>($j(),null);function HB(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var UB=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),r=FB((0,v.useState)({containerWidth:HB(e.style?.width),containerHeight:HB(e.style?.height)}),2),i=r[0],a=r[1],o=(0,v.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var r=e.getBoundingClientRect(),i=r.width,a=r.height;o(i,a);var s=new ResizeObserver(e=>{var t=e[0];if(t!=null){var n=t.contentRect,r=n.width,i=n.height;o(r,i)}});s.observe(e),n.current=s}},[t,o]);return(0,v.useEffect)(()=>()=>{n.current?.disconnect()},[o]),v.createElement(v.Fragment,null,v.createElement(hh,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,PB({ref:s},e)))}),WB=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=FB((0,v.useState)({containerWidth:HB(n),containerHeight:HB(r)}),2),a=i[0],o=i[1],s=(0,v.useCallback)((e,t)=>{o(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),c=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var n=e.getBoundingClientRect(),r=n.width,i=n.height;s(r,i)}},[t,s]);return v.createElement(v.Fragment,null,v.createElement(hh,{width:a.containerWidth,height:a.containerHeight}),v.createElement(`div`,PB({ref:c},e)))}),GB=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return v.createElement(v.Fragment,null,v.createElement(hh,{width:n,height:r}),v.createElement(`div`,PB({ref:t},e)))}),KB=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?v.createElement(WB,PB({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(GB,PB({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(hh,{width:n,height:r}),v.createElement(`div`,PB({ref:t},e)))});function qB(e){return e?UB:KB}var JB=(0,v.forwardRef)((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,l=e.onMouseEnter,u=e.onMouseLeave,d=e.onMouseMove,f=e.onMouseUp,p=e.onTouchEnd,m=e.onTouchMove,h=e.onTouchStart,g=e.style,_=e.width,y=e.responsive,b=e.dispatchTouchEvents,x=b===void 0?!0:b,S=(0,v.useRef)(null),C=J(),w=FB((0,v.useState)(null),2),T=w[0],E=w[1],D=FB((0,v.useState)(null),2),O=D[0],k=D[1],A=OB(),j=eh(),M=j?.width>0?j.width:_,N=j?.height>0?j.height:i,P=(0,v.useCallback)(e=>{A(e),typeof t==`function`&&t(e),E(e),k(e),e!=null&&(S.current=e)},[A,t,E,k]),F=(0,v.useCallback)(e=>{C(cz(e)),C(zz({handler:a,reactEvent:e}))},[C,a]),I=(0,v.useCallback)(e=>{C(uz(e)),C(zz({handler:l,reactEvent:e}))},[C,l]),L=(0,v.useCallback)(e=>{C(lk()),C(zz({handler:u,reactEvent:e}))},[C,u]),ee=(0,v.useCallback)(e=>{C(uz(e)),C(zz({handler:d,reactEvent:e}))},[C,d]),te=(0,v.useCallback)(()=>{C(Mz())},[C]),ne=(0,v.useCallback)(()=>{C(Nz())},[C]),re=(0,v.useCallback)(e=>{C(jz(e.key))},[C]),ie=(0,v.useCallback)(e=>{C(zz({handler:o,reactEvent:e}))},[C,o]),R=(0,v.useCallback)(e=>{C(zz({handler:s,reactEvent:e}))},[C,s]),ae=(0,v.useCallback)(e=>{C(zz({handler:c,reactEvent:e}))},[C,c]),oe=(0,v.useCallback)(e=>{C(zz({handler:f,reactEvent:e}))},[C,f]),se=(0,v.useCallback)(e=>{C(zz({handler:h,reactEvent:e}))},[C,h]),ce=(0,v.useCallback)(e=>{x&&C(Gz(e)),C(zz({handler:m,reactEvent:e}))},[C,x,m]),le=(0,v.useCallback)(e=>{C(zz({handler:p,reactEvent:e}))},[C,p]),ue=qB(y);return v.createElement(Dj.Provider,{value:T},v.createElement(Ia.Provider,{value:O},v.createElement(ue,{width:M??g?.width,height:N??g?.height,className:za(`recharts-wrapper`,r),style:AB({position:`relative`,cursor:`default`,width:M,height:N},g),onClick:F,onContextMenu:ie,onDoubleClick:R,onFocus:te,onBlur:ne,onKeyDown:re,onMouseDown:ae,onMouseEnter:I,onMouseLeave:L,onMouseMove:ee,onMouseUp:oe,onTouchEnd:le,onTouchMove:ce,onTouchStart:se,ref:P},v.createElement(VB,null),n)))});function YB(e,t){return eV(e)||$B(e,t)||ZB(e,t)||XB()}function XB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
295
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZB(e,t){if(e){if(typeof e==`string`)return QB(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QB(e,t):void 0}}function QB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $B(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function eV(e){if(Array.isArray(e))return e}var tV=(0,v.createContext)(void 0),nV=e=>{var t=e.children,n=YB((0,v.useState)(`${Rs(`recharts`)}-clip`),1)[0],r=xI();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return v.createElement(tV.Provider,{value:n},v.createElement(`defs`,null,v.createElement(`clipPath`,{id:n},v.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)},rV=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function iV(e,t){if(e==null)return{};var n,r,i=aV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var oV=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=Ga(iV(e,rV));return c?v.createElement(v.Fragment,null,v.createElement(hh,{width:n,height:r}),v.createElement(xB,{otherAttributes:d,title:l,desc:u},a)):v.createElement(JB,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(xB,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(nV,null,a)))});function sV(){return sV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sV.apply(null,arguments)}function cV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cV(Object(n),!0).forEach(function(t){uV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uV(e,t,n){return(t=dV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dV(e){var t=fV(e,`string`);return typeof t==`symbol`?t:t+``}function fV(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pV=lV({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},eB),mV=(0,v.forwardRef)(function(e,t){var n=_c(e.categoricalChartProps,pV),r=e.chartName,i=e.defaultTooltipEventType,a=e.validateTooltipEventTypes,o=e.tooltipPayloadSearcher,s=e.categoricalChartProps,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return v.createElement(oB,{preloadedState:{options:c},reduxStoreName:s.id??r},v.createElement(sB,{chartData:s.data}),v.createElement(lB,{layout:n.layout,margin:n.margin}),v.createElement(dB,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(uB,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(oV,sV({},n,{ref:t})))}),hV=[`axis`],gV=(0,v.forwardRef)((e,t)=>v.createElement(mV,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:hV,tooltipPayloadSearcher:Nj,categoricalChartProps:e,ref:t}));function _V(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),c=async()=>{try{t(await ni()),r(await Ci()),s(null)}catch(e){s(e.message||`Failed to sync budget consumption stats.`)}finally{a(!1)}};(0,v.useEffect)(()=>{c();let e=setInterval(c,5e3);return()=>clearInterval(e)},[]);let l=n?.budget?.budget?.daily_cap_usd??5,u=n?.budget?.budget?.weekly_cap_usd??25,d=n?.budget?.budget?.enabled!==!1,f=Math.min(100,(e?.dailyUsd||0)/l*100),p=Math.min(100,(e?.weeklyUsd||0)/u*100),m=e=>e>85?`var(--error)`:e>60?`var(--warning)`:`var(--success)`,h=(0,v.useMemo)(()=>{if(e?.timeseries&&Object.keys(e.timeseries).length>0){let t=e.timeseries;return Object.entries(t).map(([e,t])=>{let n={date:new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})},r=0,i=0,a=0,o=0;for(let[,e]of Object.entries(t)){let t=e;t.provider===`gemini`?r+=t.cost:t.provider===`claude`?i+=t.cost:t.provider===`openrouter`?a+=t.cost:o+=t.cost}return n.gemini=+r.toFixed(3),n.claude=+i.toFixed(3),n.openrouter=+a.toFixed(3),n.codex=+o.toFixed(3),n})}return[]},[e]);return i?(0,V.jsxs)(`div`,{className:`page`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:[(0,V.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,style:{animation:`spin 1s linear infinite`,marginBottom:12},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,V.jsx)(`div`,{style:{color:`var(--text-secondary)`},children:`Aggregating token expenditures...`})]}):(0,V.jsxs)(`div`,{className:`page`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflowY:`auto`},children:[(0,V.jsxs)(`div`,{className:`page-header`,style:{marginBottom:24},children:[(0,V.jsx)(`h1`,{children:`Token & Budget Statistics`}),(0,V.jsx)(`p`,{children:`Monitor your token cost expenditure in real time against safety budget limits`})]}),(0,V.jsxs)(`div`,{style:{padding:`16px 20px`,marginBottom:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(12px)`,border:`1px solid var(--border)`,borderLeft:`3px solid var(--accent)`,borderRadius:10,display:`flex`,alignItems:`center`,gap:14},children:[(0,V.jsx)(`span`,{style:{fontSize:24},children:`🛡️`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:700,color:`#fff`,letterSpacing:.3},children:`Local-first · Self-hosted`}),(0,V.jsx)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`,marginTop:2},children:`Memory and processing stay on your machine. No vendor lock-in.`})]})]}),o&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:20,display:`inline-flex`,padding:`6px 12px`,background:`rgba(239, 68, 68, 0.1)`,border:`1px solid #ef4444`,color:`#f87171`},children:[`⚠️ `,o]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(340px, 1fr))`,gap:24,marginBottom:24},children:[(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,gap:16},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:13,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:`Daily Expenditure`}),(0,V.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,marginTop:4,color:`#fff`},children:[`$`,e?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`span`,{className:`badge`,style:{background:`var(--bg-elevated)`,color:`var(--text-secondary)`,border:`1px solid var(--border)`,fontSize:11},children:[`Cap: $`,l.toFixed(2)]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:8},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:11,color:`var(--text-secondary)`},children:[(0,V.jsx)(`span`,{children:`Consumption Ratio`}),(0,V.jsxs)(`span`,{children:[f.toFixed(1),`%`]})]}),(0,V.jsx)(`div`,{style:{height:6,background:`var(--bg-elevated)`,borderRadius:3,overflow:`hidden`},children:(0,V.jsx)(`div`,{style:{height:`100%`,width:`${f}%`,background:m(f),boxShadow:`0 0 8px ${m(f)}`,transition:`width 0.4s ease`}})})]}),(0,V.jsxs)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,borderTop:`1px solid var(--border)`,paddingTop:10,marginTop:4},children:[`Status: `,d?`🛡️ Budget supervision active`:`⚠️ Limits unmonitored (disabled)`]})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,gap:16},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:13,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:`Weekly Expenditure`}),(0,V.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,marginTop:4,color:`#fff`},children:[`$`,e?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`span`,{className:`badge`,style:{background:`var(--bg-elevated)`,color:`var(--text-secondary)`,border:`1px solid var(--border)`,fontSize:11},children:[`Cap: $`,u.toFixed(2)]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:8},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:11,color:`var(--text-secondary)`},children:[(0,V.jsx)(`span`,{children:`Consumption Ratio`}),(0,V.jsxs)(`span`,{children:[p.toFixed(1),`%`]})]}),(0,V.jsx)(`div`,{style:{height:6,background:`var(--bg-elevated)`,borderRadius:3,overflow:`hidden`},children:(0,V.jsx)(`div`,{style:{height:`100%`,width:`${p}%`,background:m(p),boxShadow:`0 0 8px ${m(p)}`,transition:`width 0.4s ease`}})})]}),(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,borderTop:`1px solid var(--border)`,paddingTop:10,marginTop:4},children:`Rolling window: Last 7 days in local system time`})]})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,borderBottom:`1px solid var(--border)`,paddingBottom:10,marginBottom:16},children:`Model Engine Spend breakdown`}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(280px, 1fr))`,gap:20},children:[(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`♊`}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Gemini CLI`}),(0,V.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`~/.gemini/tmp`})]})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(59, 130, 246, 0.1)`,color:`#60a5fa`,border:`1px solid rgba(59, 130, 246, 0.2)`},children:`Google API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.gemini?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.gemini?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.gemini?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`🍊`}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Claude Code CLI`}),(0,V.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`~/.claude`})]})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(239, 107, 107, 0.1)`,color:`#f87171`,border:`1px solid rgba(239, 107, 107, 0.2)`},children:`Anthropic API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.claude?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.claude?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.claude?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`💻`}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Codex CLI`}),(0,V.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`~/.codex/sessions`})]})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(16, 185, 129, 0.1)`,color:`#34d399`,border:`1px solid rgba(16, 185, 129, 0.2)`},children:`OpenAI API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.codex?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.codex?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.codex?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`🌐`}),(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`OpenRouter`})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(236, 72, 153, 0.1)`,color:`#f472b6`,border:`1px solid rgba(236, 72, 153, 0.2)`},children:`OR API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.openrouter?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.openrouter?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.openrouter?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`🔎`}),(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Tavily Search`})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(234, 179, 8, 0.1)`,color:`#eab308`,border:`1px solid rgba(234, 179, 8, 0.2)`},children:`Web API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.tavily?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.tavily?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.tavily?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`🦁`}),(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Brave Search`})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(234, 179, 8, 0.1)`,color:`#eab308`,border:`1px solid rgba(234, 179, 8, 0.2)`},children:`Web API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.brave?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.brave?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.brave?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`✨`}),(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Exa Search`})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(234, 179, 8, 0.1)`,color:`#eab308`,border:`1px solid rgba(234, 179, 8, 0.2)`},children:`Web API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.exa?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.exa?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.exa?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:18},children:`🔍`}),(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Serper Search`})]}),(0,V.jsx)(`span`,{className:`badge`,style:{background:`rgba(234, 179, 8, 0.1)`,color:`#eab308`,border:`1px solid rgba(234, 179, 8, 0.2)`},children:`Web API`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.serper?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.serper?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:4,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Rolling Tokens:`}),(0,V.jsxs)(`span`,{children:[e?.breakdown?.serper?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]})]})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,marginTop:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,borderBottom:`1px solid var(--border)`,paddingBottom:10,marginBottom:20},children:`30-Day Cost Trend`}),h.length===0?(0,V.jsx)(`div`,{style:{height:300,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-secondary)`},children:`No usage data available for the last 30 days.`}):(0,V.jsx)(nh,{width:`100%`,height:300,children:(0,V.jsxs)(gV,{data:h,margin:{top:5,right:20,left:0,bottom:5},children:[(0,V.jsxs)(`defs`,{children:[(0,V.jsxs)(`linearGradient`,{id:`gradGemini`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.4}),(0,V.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]}),(0,V.jsxs)(`linearGradient`,{id:`gradClaude`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`5%`,stopColor:`#e17055`,stopOpacity:.4}),(0,V.jsx)(`stop`,{offset:`95%`,stopColor:`#e17055`,stopOpacity:0})]}),(0,V.jsxs)(`linearGradient`,{id:`gradOpenRouter`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`5%`,stopColor:`#74b9ff`,stopOpacity:.4}),(0,V.jsx)(`stop`,{offset:`95%`,stopColor:`#74b9ff`,stopOpacity:0})]}),(0,V.jsxs)(`linearGradient`,{id:`gradCodex`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`5%`,stopColor:`#00cec9`,stopOpacity:.4}),(0,V.jsx)(`stop`,{offset:`95%`,stopColor:`#00cec9`,stopOpacity:0})]})]}),(0,V.jsx)(kF,{strokeDasharray:`3 3`,stroke:`rgba(255,255,255,0.04)`}),(0,V.jsx)(UR,{dataKey:`date`,tick:{fontSize:11,fill:`var(--text-secondary)`},axisLine:{stroke:`var(--border)`},tickLine:!1}),(0,V.jsx)(iz,{tick:{fontSize:11,fill:`var(--text-secondary)`},axisLine:{stroke:`var(--border)`},tickLine:!1,tickFormatter:e=>`$${e.toFixed(2)}`}),(0,V.jsx)(gM,{contentStyle:{background:`#1a1a2e`,border:`1px solid rgba(255,255,255,0.1)`,borderRadius:8,fontSize:12,color:`#e8e8e8`},labelStyle:{color:`#fff`,fontWeight:600,marginBottom:4},formatter:(e,t)=>[`$${Number(e).toFixed(3)}`,String(t).charAt(0).toUpperCase()+String(t).slice(1)]}),(0,V.jsx)(pg,{wrapperStyle:{fontSize:12,color:`var(--text-secondary)`}}),(0,V.jsx)(SR,{type:`monotone`,dataKey:`gemini`,stackId:`1`,stroke:`#3b82f6`,fill:`url(#gradGemini)`,strokeWidth:2}),(0,V.jsx)(SR,{type:`monotone`,dataKey:`claude`,stackId:`1`,stroke:`#e17055`,fill:`url(#gradClaude)`,strokeWidth:2}),(0,V.jsx)(SR,{type:`monotone`,dataKey:`openrouter`,stackId:`1`,stroke:`#74b9ff`,fill:`url(#gradOpenRouter)`,strokeWidth:2}),(0,V.jsx)(SR,{type:`monotone`,dataKey:`codex`,stackId:`1`,stroke:`#00cec9`,fill:`url(#gradCodex)`,strokeWidth:2})]})})]}),(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:16,marginTop:24},children:[{name:`Gemini`,color:`#3b82f6`,emoji:`♊`,key:`gemini`},{name:`Claude`,color:`#e17055`,emoji:`🍊`,key:`claude`},{name:`OpenRouter`,color:`#74b9ff`,emoji:`🌐`,key:`openrouter`},{name:`Codex`,color:`#00cec9`,emoji:`💻`,key:`codex`},{name:`Tavily`,color:`#eab308`,emoji:`🔎`,key:`tavily`},{name:`Brave`,color:`#eab308`,emoji:`🦁`,key:`brave`},{name:`Exa`,color:`#eab308`,emoji:`✨`,key:`exa`},{name:`Serper`,color:`#eab308`,emoji:`🔍`,key:`serper`}].map(t=>{let n=e?.breakdown?.[t.key];return(0,V.jsxs)(`div`,{style:{background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(12px)`,border:`1px solid var(--border)`,borderTop:`4px solid ${t.color}`,borderRadius:10,padding:20,display:`flex`,flexDirection:`column`,gap:12,transition:`transform 0.2s ease, box-shadow 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 8px 24px ${t.color}22`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`none`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`span`,{style:{fontSize:20},children:t.emoji}),(0,V.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#fff`},children:t.name})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:t.color},children:[`$`,n?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly`}),(0,V.jsxs)(`span`,{style:{fontWeight:600,color:t.color},children:[`$`,n?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),n?.dailyTokens!=null&&(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,borderTop:`1px solid var(--border)`,paddingTop:6,marginTop:2,fontSize:11,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{children:`Tokens (24h)`}),(0,V.jsx)(`span`,{children:n.dailyTokens.toLocaleString()})]})]})]},t.key)})}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,marginTop:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,borderBottom:`1px solid var(--border)`,paddingBottom:10,marginBottom:16},children:`Per-Model Breakdown`}),(0,V.jsx)(`div`,{style:{overflowX:`auto`},children:(0,V.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12},children:[(0,V.jsx)(`thead`,{children:(0,V.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border)`},children:[`Provider`,`Daily ($)`,`Weekly ($)`,`Daily Tokens`,`Weekly Tokens`].map(e=>(0,V.jsx)(`th`,{style:{textAlign:`left`,padding:`10px 12px`,fontSize:11,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:e},e))})}),(0,V.jsxs)(`tbody`,{children:[[{name:`Gemini`,key:`gemini`,color:`#3b82f6`},{name:`Claude`,key:`claude`,color:`#e17055`},{name:`Codex`,key:`codex`,color:`#00cec9`},{name:`OpenRouter`,key:`openrouter`,color:`#74b9ff`}].map((t,n)=>{let r=t.key===`openrouter`?e?.breakdown?.openrouter:e?.breakdown?.[t.key];return(0,V.jsxs)(`tr`,{style:{background:n%2==1?`rgba(255,255,255,0.02)`:`transparent`,borderBottom:`1px solid var(--border)`},children:[(0,V.jsx)(`td`,{style:{padding:`10px 12px`,fontWeight:600,color:t.color},children:t.name}),(0,V.jsxs)(`td`,{style:{padding:`10px 12px`,color:`#fff`},children:[`$`,r?.dailyUsd?.toFixed(4)??`0.0000`]}),(0,V.jsxs)(`td`,{style:{padding:`10px 12px`,color:`#fff`},children:[`$`,r?.weeklyUsd?.toFixed(4)??`0.0000`]}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`},children:r?.dailyTokens?.toLocaleString()||`—`}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`},children:r?.weeklyTokens?.toLocaleString()||`—`})]},t.key)}),(0,V.jsxs)(`tr`,{style:{borderTop:`2px solid var(--border)`,background:`rgba(108, 92, 231, 0.05)`},children:[(0,V.jsx)(`td`,{style:{padding:`10px 12px`,fontWeight:700,color:`#fff`},children:`Total`}),(0,V.jsxs)(`td`,{style:{padding:`10px 12px`,fontWeight:700,color:`#fff`},children:[`$`,((e?.breakdown?.gemini?.dailyUsd||0)+(e?.breakdown?.claude?.dailyUsd||0)+(e?.breakdown?.codex?.dailyUsd||0)+(e?.breakdown?.openrouter?.dailyUsd||0)).toFixed(4)]}),(0,V.jsxs)(`td`,{style:{padding:`10px 12px`,fontWeight:700,color:`#fff`},children:[`$`,((e?.breakdown?.gemini?.weeklyUsd||0)+(e?.breakdown?.claude?.weeklyUsd||0)+(e?.breakdown?.codex?.weeklyUsd||0)+(e?.breakdown?.openrouter?.weeklyUsd||0)).toFixed(4)]}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`,fontWeight:700,color:`var(--text-secondary)`},children:((e?.breakdown?.gemini?.dailyTokens||0)+(e?.breakdown?.claude?.dailyTokens||0)+(e?.breakdown?.codex?.dailyTokens||0)+(e?.breakdown?.openrouter?.dailyTokens||0)).toLocaleString()}),(0,V.jsx)(`td`,{style:{padding:`10px 12px`,fontWeight:700,color:`var(--text-secondary)`},children:((e?.breakdown?.gemini?.weeklyTokens||0)+(e?.breakdown?.claude?.weeklyTokens||0)+(e?.breakdown?.codex?.weeklyTokens||0)+(e?.breakdown?.openrouter?.weeklyTokens||0)).toLocaleString()})]})]})]})})]})]})}function vV(e){return{label:e.label||``,provider:e.provider||``,repos:(e.repos||[]).join(`, `),subscription_tier:e.subscription_tier||``,monthly_cost_usd:e.monthly_cost_usd==null?``:String(e.monthly_cost_usd),monthly_cap_usd:e.monthly_cap_usd==null?``:String(e.monthly_cap_usd),api_docs_url:e.api_docs_url||``,rotate_every_days:e.rotate_every_days==null?``:String(e.rotate_every_days),auto_rotate:!!e.auto_rotate,notes:e.notes||``,project_path:e.project_path||``}}function yV(e){let t=new Map;return e.forEach(e=>{let n=(e.provider||`unknown`).toLowerCase();t.has(n)||t.set(n,{id:n,label:n.toUpperCase(),kind:`repo`,keys:[]}),t.get(n).keys.push(e)}),[...t.values()].sort((e,t)=>e.id.localeCompare(t.id))}function bV({provider:e}){if(!e)return null;let t=e.toLowerCase();return t===`openai`?(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0462 6.0462 0 0 0 5.3-3.71 6.0415 6.0415 0 0 0 4.4646-6.4463A5.9847 5.9847 0 0 0 22.282 9.8211Z`})}):t===`anthropic`?(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M17.433 2.115L15.939 12h3.048l1.494-9.885h-3.048zM14.616 2.115l-1.392 9.885h3.048l1.392-9.885h-3.048zM10.371 14.542l-5.637 7.343H7.78l3.966-5.166 2.766 5.166h3.018l-7.159-12.836-5.836 12.836h3.043l1.838-4.043h4.636l-3.681-3.3z`})}):t===`google`?(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z`})}):t===`github`?(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.jsx)(`path`,{fillRule:`evenodd`,d:`M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z`,clipRule:`evenodd`})}):null}function xV(){let[e,t]=(0,v.useState)(`catalog`),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(!0),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(`repo`),[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)({label:``,provider:``,repos:``,subscription_tier:``,monthly_cost_usd:``,monthly_cap_usd:``,api_docs_url:``,rotate_every_days:``,auto_rotate:!1,notes:``,project_path:``}),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(!1),[N,P]=(0,v.useState)(``),[F,I]=(0,v.useState)(new Set),[L,ee]=(0,v.useState)(!1),[te,ne]=(0,v.useState)(!1),[re,ie]=(0,v.useState)(!1),[R,ae]=(0,v.useState)(null),[oe,se]=(0,v.useState)(null),[ce,le]=(0,v.useState)(``),[ue,de]=(0,v.useState)(!1),[fe,pe]=(0,v.useState)([]),[me,he]=(0,v.useState)(``),[ge,_e]=(0,v.useState)(null),[ve,ye]=(0,v.useState)(!1),[be,xe]=(0,v.useState)([]),[Se,Ce]=(0,v.useState)(new Set),we=(0,v.useCallback)(async()=>{_(!0),b(null);try{try{let e=await Ci();e.secrets||={},e.brain||={},r(e),a(await fi().catch(()=>[])),s(await pi().catch(()=>[])),l(await mi().catch(()=>[])),d(await hi().catch(()=>[]))}catch{}let e=await Lr();if(h(e),T){let t=e.keys.find(e=>e.key===T.key);E(t||null),t&&O(vV(t))}}catch(e){b(e.message)}finally{_(!1)}},[T]),Te=(0,v.useCallback)(async()=>{try{pe((await jr()).keys||[])}catch{}},[]),Ee=(0,v.useCallback)(async()=>{try{ae(await Gr())}catch{ae(null)}},[]);(0,v.useEffect)(()=>{we(),Te(),Ee()},[we,Te,Ee]);let De=(e,t)=>{n&&r({...n,secrets:{...n.secrets,[e]:t}})},Oe=(e,t)=>{n&&r({...n,brain:{...n.brain,[e]:t}})},ke=async()=>{if(n){M(!0),b(null),p(null);try{await wi(n),p(`Configuration saved successfully. Kernel will hot-reload settings.`),setTimeout(()=>p(null),4e3)}catch(e){b(e.message||`Failed to save configuration.`)}finally{M(!1)}}};function Ae(e,t){E(e),O(vV(e)),A(``),P(``),se(null),le(``),t&&I(e=>{let n=new Set(e);return n.add(t),n})}async function je(){if(!xa()){b(`This browser does not support passkeys / WebAuthn`);return}de(!0),b(null);try{await qr(await Aa({optionsJSON:await Kr()}),`Touch ID / platform`),await Ee(),P(`Passkey registered — use it to reveal secret values`)}catch(e){b(e.message||`Passkey registration cancelled`)}finally{de(!1)}}async function Me(){return(await Yr(await Fa({optionsJSON:await Jr()}))).step_up_token}async function Ne(){if(!ce.trim())throw Error(`Enter dashboard password`);let e=await Xr(ce);return le(``),e.step_up_token}async function Pe(e){if(T){de(!0),b(null),se(null);try{let t=e===`passkey`?await Me():await Ne();se((await Wr(T.key,t)).value),P(`Revealed ${T.key} (auto-hides in 30s)`),window.setTimeout(()=>se(null),3e4)}catch(e){b(e.message)}finally{de(!1)}}}async function Fe(){if(oe)try{await navigator.clipboard.writeText(oe),P(`Copied to clipboard`)}catch{b(`Clipboard copy failed`)}}function Ie(e){I(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function Le(e){I(new Set([e]))}function Re(e){I(new Set(e))}function ze(){I(new Set)}async function Be(){if(T){M(!0),P(``);try{let e=D.repos.split(/[,]+/).map(e=>e.trim()).filter(Boolean);if(e.length>1){b(`Each key may bind to only ONE repo (you entered ${e.length}: ${e.join(`, `)}). Pick one product repo, or leave empty for Developer secrets (tooling).`),M(!1);return}let t={label:D.label.trim()||null,provider:D.provider.trim()||null,repos:e,subscription_tier:D.subscription_tier.trim()||null,monthly_cost_usd:D.monthly_cost_usd.trim()===``?null:Number(D.monthly_cost_usd),monthly_cap_usd:D.monthly_cap_usd.trim()===``?null:Number(D.monthly_cap_usd),api_docs_url:D.api_docs_url.trim()||null,rotate_every_days:D.rotate_every_days.trim()===``?null:Number(D.rotate_every_days),auto_rotate:!!D.auto_rotate,notes:D.notes.trim()||null,project_path:D.project_path.trim()||null};await Rr(T.key,t),P(`Metadata saved`),await we()}catch(e){b(e.message)}finally{M(!1)}}}async function Ve(){if(!(!T||!k)){M(!0);try{let e=await zr(T.key,k,{export_env:!0,export_all:!0});A(``);let t=e.exports?.filter(e=>e.ok).length??0;P(t>0?`Rotated ${T.key} · exported .env to ${t} target(s)`:`Rotated ${T.key} · store updated (no project paths matched — bind --repo or Export .env)`),await we()}catch(e){b(e.message)}finally{M(!1)}}}async function He(){if(T&&confirm(`Delete secret ${T.key}?`))try{await Br(T.key),E(null),await we()}catch(e){b(e.message)}}async function Ue(){if(T)try{await Vr({key_ref:T.key,provider:T.provider||`unknown`,cost_usd:.01,model:`manual-sample`,source:`dashboard`}),P(`Sample usage event recorded ($0.01)`),await we()}catch(e){b(e.message)}}async function We(){try{let e=await Pr();xe(e.candidates||[]),Ce(new Set((e.candidates||[]).filter(e=>!e.already_set).map(e=>e.key))),t(`import`)}catch(e){b(e.message)}}async function Ge(){try{let e=await Ir({keys:[...Se]});P(`Imported ${e.imported_count}, skipped ${e.skipped_count}`),await we(),t(`catalog`)}catch(e){b(e.message)}}let Ke=(m?.keys||[]).filter(e=>{if(!x.trim())return!0;let t=x.toLowerCase();return e.key.toLowerCase().includes(t)||(e.provider||``).toLowerCase().includes(t)||(e.repos||[]).some(e=>e.toLowerCase().includes(t))||(e.label||``).toLowerCase().includes(t)}),qe=(0,v.useMemo)(()=>{if(!m?.keys)return[];let e=x.toLowerCase(),t=m.keys.filter(t=>t.key.toLowerCase().includes(e)||(t.provider||``).toLowerCase().includes(e)||(t.repos||[]).some(t=>t.toLowerCase().includes(e))||(t.label||``).toLowerCase().includes(e));return C===`api`?yV(t):wV(t)},[m,x,C]);(0,v.useEffect)(()=>{if(L||!qe.length)return;let e=new Set;for(let t of qe)t.kind===`error`&&e.add(t.id);let t=qe.find(e=>e.kind!==`error`);t&&e.add(t.id),I(e),ee(!0)},[qe,L]);let Je=m?.summary;return(0,V.jsxs)(`div`,{className:`page`,style:{maxWidth:T?1400:1100},children:[(0,V.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-end`,flexWrap:`wrap`,gap:12,marginBottom:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{style:{marginBottom:4},children:`Secrets & Access`}),(0,V.jsx)(`p`,{style:{margin:0,fontSize:13,color:`var(--text-secondary)`},children:`Provider keys (SSOT) · one key → one repo · empty repo = Developer secrets · PATs separate`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:async()=>{try{let e=await Hr({all_projects:!0});P(`Exported .env to ${e.results?.filter(e=>e.ok).length??e.count??0} project(s) from secrets store`)}catch(e){b(e.message)}},children:`Export .env → projects`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:async()=>{try{let e=await Ur(),t=e.tasks?.filter(e=>e.status===`created`).length??0,n=e.tasks?.filter(e=>e.status===`exists`).length??0;P(`Rotation queue: ${e.due??0} due · ${t} task(s) created · ${n} already pending`),await we()}catch(e){b(e.message)}},children:`Enqueue rotations`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void We(),children:`Migrate import`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void we(),children:`Refresh`})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginBottom:10,fontSize:11},onClick:()=>ne(e=>!e),children:te?`▾ Hide model notes`:`▸ How secrets work`}),te&&(0,V.jsx)(`div`,{className:`card`,style:{padding:12,marginBottom:12,fontSize:12,color:`var(--text-secondary)`,lineHeight:1.5,borderColor:`var(--border-accent)`},children:(0,V.jsxs)(`ul`,{style:{margin:0,paddingLeft:18},children:[(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:`SSOT`}),` — keys in TR store; `,(0,V.jsx)(`strong`,{children:`export-env`}),` writes repo `,(0,V.jsx)(`code`,{children:`.env`}),`.`]}),(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:`One key → one product repo`}),`; multi-repo is an error. Empty = Developer secrets (tooling).`]}),(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:`import-env`}),` = one-time migrate. `,(0,V.jsx)(`strong`,{children:`PATs`}),` = brain API tokens only.`]})]})}),y&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:16,display:`block`,padding:12},children:[y,(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginLeft:12},onClick:()=>b(null),children:`Dismiss`})]}),N&&(0,V.jsx)(`div`,{style:{marginBottom:12,fontSize:13,color:`#34d399`},children:N}),m?.store&&(0,V.jsxs)(`div`,{style:{marginBottom:12,fontSize:11,color:`var(--text-tertiary)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,wordBreak:`break-all`},children:[`Store (global SSOT — not filtered by brain selector): `,m.store,typeof m?.summary?.total_keys==`number`?` · ${m.summary.total_keys} keys`:``]}),Je&&(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:12,marginBottom:20},children:[(0,V.jsx)(EV,{label:`Keys`,value:String(Je.total_keys),accent:`#60a5fa`}),(0,V.jsx)(EV,{label:`Providers`,value:String(Je.providers_active),accent:`#a78bfa`}),(0,V.jsx)(EV,{label:`Planned / mo`,value:`$${(Je.monthly_subscription_usd||0).toFixed(0)}`,accent:`#fbbf24`}),(0,V.jsx)(EV,{label:`Usage 30d`,value:`$${(Je.usage_30d?.cost_usd||0).toFixed(2)}`,accent:`#34d399`}),(0,V.jsx)(EV,{label:`Usage 7d`,value:`$${(Je.usage_7d?.cost_usd||0).toFixed(2)}`,accent:`#22d3ee`}),(0,V.jsx)(EV,{label:`Rotate due`,value:String(Je.rotation_overdue||0),accent:Je.rotation_overdue?`#f87171`:`#64748b`}),(0,V.jsx)(EV,{label:`Multi-repo errors`,value:String(Je.multi_repo_violations||0),accent:Je.multi_repo_violations?`#f87171`:`#64748b`}),(0,V.jsx)(EV,{label:`Developer`,value:String(Je.developer_keys||0),accent:`#a78bfa`})]}),(Je?.multi_repo_violations||0)>0&&(0,V.jsxs)(`div`,{className:`card`,style:{marginBottom:16,padding:14,borderColor:`rgba(248,113,113,0.5)`,background:`rgba(248,113,113,0.08)`,fontSize:13,lineHeight:1.5},children:[(0,V.jsx)(`strong`,{style:{color:`#f87171`},children:`Multi-repo binding error`}),(0,V.jsxs)(`p`,{style:{margin:`6px 0 0`,color:`var(--text-secondary)`},children:[Je?.multi_repo_violations,` key(s) are bound to more than one repo. Each secret must be unique to a single product repo, or left unbound as a `,(0,V.jsx)(`strong`,{children:`Developer secret`}),` `,`(tooling / personal). Fix in the red “Needs fix” section below — set `,(0,V.jsx)(`em`,{children:`one`}),` repo or clear the field.`]})]}),m?.by_provider&&m.by_provider.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginBottom:8,fontSize:11},onClick:()=>ie(e=>!e),children:re?`▾ Hide cost chart`:`▸ Cost by provider`}),re&&(0,V.jsx)(`div`,{className:`card`,style:{marginBottom:12,padding:12},children:(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:m.by_provider.map(e=>{let t=Math.max(...m.by_provider.map(e=>e.cost_30d+e.monthly_cost),1),n=e.cost_30d+e.monthly_cost,r=Math.min(100,n/t*100);return(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr 80px`,gap:10,alignItems:`center`},children:[(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600},children:e.provider}),(0,V.jsx)(`div`,{style:{height:6,background:`rgba(148,163,184,0.12)`,borderRadius:99,overflow:`hidden`},children:(0,V.jsx)(`div`,{style:{width:`${r}%`,height:`100%`,background:`linear-gradient(90deg, #3b82f6, #22d3ee)`,borderRadius:99}})}),(0,V.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,textAlign:`right`},children:[`$`,n.toFixed(2),` · `,e.keys,`k`]})]},e.provider)})})})]}),(0,V.jsx)(`div`,{style:{display:`flex`,gap:8,marginBottom:12,flexWrap:`wrap`},children:[{id:`catalog`,label:`Provider secrets (env)`},{id:`import`,label:`Import from env`},{id:`cloud`,label:`Cloud Models (API)`},{id:`pats`,label:`TR PATs (key generator)`}].map(n=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>t(n.id),className:`btn btn-sm ${e===n.id?`btn-primary`:`btn-ghost`}`,children:n.label},n.id))}),e===`usage`&&(0,V.jsx)(`div`,{style:{height:`calc(100vh - 280px)`,minHeight:420,position:`relative`,overflowY:`auto`},children:(0,V.jsx)(_V,{})}),e===`catalog`&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`calc(100vh - 280px)`,minHeight:420,marginRight:T?440:0,transition:`margin 0.15s ease`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`,marginBottom:16,flexWrap:`wrap`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,background:`var(--bg-tertiary)`,borderRadius:6,padding:2},children:[(0,V.jsx)(`button`,{onClick:()=>w(`repo`),style:{padding:`4px 10px`,fontSize:11,fontWeight:500,borderRadius:4,cursor:`pointer`,border:`none`,background:C===`repo`?`var(--bg-active)`:`transparent`,color:C===`repo`?`var(--text-primary)`:`var(--text-secondary)`},children:`By Repo`}),(0,V.jsx)(`button`,{onClick:()=>w(`api`),style:{padding:`4px 10px`,fontSize:11,fontWeight:500,borderRadius:4,cursor:`pointer`,border:`none`,background:C===`api`?`var(--bg-active)`:`transparent`,color:C===`api`?`var(--text-primary)`:`var(--text-secondary)`},children:`By API`})]}),(0,V.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),placeholder:`Filter key, provider, repo, tier…`,style:{flex:`1 1 200px`,minWidth:160,padding:`8px 12px`,borderRadius:10,border:`1px solid var(--border)`,background:`var(--bg-primary)`,color:`var(--text-primary)`,outline:`none`}})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`,marginBottom:8,flexShrink:0},children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{fontSize:11},onClick:()=>Re(qe.map(e=>e.id)),children:`Expand all`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{fontSize:11},onClick:ze,children:`Collapse all`}),(0,V.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[Ke.length,` shown`,T?` · editing ${T.key}`:``]})]}),qe.length>0&&(0,V.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6,marginBottom:8,flexShrink:0,maxHeight:72,overflowY:`auto`},children:qe.map(e=>{let t=F.has(e.id);return(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-sm`,style:{fontSize:11,padding:`4px 10px`,background:t?e.kind===`error`?`rgba(248,113,113,0.2)`:`rgba(59,130,246,0.18)`:`transparent`,borderColor:e.kind===`error`?`rgba(248,113,113,0.45)`:t?`var(--border-accent)`:`var(--border)`,color:e.kind===`error`?`#f87171`:void 0},onClick:()=>Le(e.id),title:t?`Currently expanded`:`Expand this repo only`,children:[t?`▾ `:`▸ `,C===`api`&&(0,V.jsx)(bV,{provider:e.id}),e.label,(0,V.jsx)(`span`,{style:{marginLeft:6,opacity:.7},children:e.keys.length})]},`chip-${e.id}`)})}),g&&!m?(0,V.jsx)(`p`,{style:{color:`var(--text-tertiary)`},children:`Loading catalog…`}):Ke.length===0?(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,textAlign:`center`,color:`var(--text-secondary)`},children:[(0,V.jsxs)(`p`,{style:{marginBottom:12},children:[`No provider secrets in the global store`,x?` matching “${x}”`:``,`.`]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>void We(),children:`Scan / migrate import`})]}):(0,V.jsx)(`div`,{className:`card`,style:{flex:1,minHeight:0,overflowY:`auto`,padding:0,display:`flex`,flexDirection:`column`},children:qe.map(e=>{let t=F.has(e.id);return(0,V.jsxs)(`section`,{style:{borderBottom:`1px solid var(--border)`,background:e.kind===`error`?`rgba(248,113,113,0.04)`:e.kind===`developer`?`rgba(167,139,250,0.04)`:void 0},children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>Ie(e.id),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`10px 14px`,background:`transparent`,border:`none`,color:`inherit`,cursor:`pointer`,textAlign:`left`},children:[(0,V.jsxs)(`div`,{style:{minWidth:0},children:[(0,V.jsxs)(`div`,{style:{fontSize:13,fontWeight:700,color:e.kind===`error`?`#f87171`:`var(--text-primary)`},children:[t?`▾`:`▸`,` `,C===`api`&&(0,V.jsx)(bV,{provider:e.id}),` `,e.label]}),(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:2},children:e.kind===`error`?`Fix: one repo only, or clear for Developer secrets`:e.kind===`developer`?`Tooling / unbound`:`Product repo`})]}),(0,V.jsx)(`span`,{style:{fontSize:11,fontWeight:600,flexShrink:0,padding:`2px 8px`,borderRadius:99,background:e.kind===`error`?`rgba(248,113,113,0.15)`:`rgba(148,163,184,0.12)`,color:e.kind===`error`?`#f87171`:`var(--text-secondary)`},children:e.keys.length})]}),t&&(0,V.jsx)(`div`,{style:{padding:`0 8px 8px`},children:e.keys.map(t=>(0,V.jsx)(TV,{k:t,selected:T?.key===t.key,onOpen:()=>Ae(t,e.id)},`${e.id}::${t.key}`))})]},e.id)})}),T&&(0,V.jsxs)(`div`,{role:`dialog`,"aria-label":`Edit ${T.key}`,style:{position:`fixed`,top:0,right:0,bottom:0,width:`min(420px, 100vw)`,zIndex:80,background:`var(--bg-secondary, #0f1419)`,borderLeft:`1px solid var(--border)`,boxShadow:`-12px 0 40px rgba(0,0,0,0.35)`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,V.jsxs)(`div`,{style:{flexShrink:0,padding:`14px 16px`,borderBottom:`1px solid var(--border)`,display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:10,background:`rgba(0,0,0,0.2)`},children:[(0,V.jsxs)(`div`,{style:{minWidth:0},children:[(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.06em`},children:`Edit secret`}),(0,V.jsx)(`strong`,{style:{fontFamily:`ui-monospace, monospace`,fontSize:13,wordBreak:`break-all`,display:`block`,marginTop:2},children:T.key}),(0,V.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:4},children:[T.masked||`••••`,T.subscription_tier?` · ${T.subscription_tier}`:``,T.monthly_cost_usd==null?``:` · $${T.monthly_cost_usd}/mo`]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>E(null),children:`✕`})]}),(0,V.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,padding:16},children:[(0,V.jsxs)(OV,{title:`Reveal value (passkey)`,hint:`Full secret values require step-up auth — passkey preferred, password fallback`,children:[(0,V.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:8},children:[`Passkeys: `,R?.count??0,!xa()&&` · browser unsupported`]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,marginBottom:10},children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:ue||!xa(),onClick:()=>void je(),children:R?.has_passkeys?`Add another passkey`:`Register passkey (Touch ID)`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:ue||!R?.has_passkeys,onClick:()=>void Pe(`passkey`),children:`Reveal with passkey`}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,V.jsx)(`input`,{type:`password`,value:ce,onChange:e=>le(e.target.value),placeholder:`Or re-enter dashboard password`,style:{...AV,flex:1,marginTop:0},onKeyDown:e=>{e.key===`Enter`&&Pe(`password`)}}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:ue||!ce,onClick:()=>void Pe(`password`),children:`Reveal`})]})]}),oe!=null&&(0,V.jsxs)(`div`,{style:{padding:10,borderRadius:8,background:`rgba(52,211,153,0.08)`,border:`1px solid rgba(52,211,153,0.35)`,marginBottom:8},children:[(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginBottom:4},children:`PLAINTEXT (hides in 30s) — never paste into chat/vault`}),(0,V.jsx)(`code`,{style:{fontSize:11,wordBreak:`break-all`,display:`block`,color:`var(--text-primary)`},children:oe}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,marginTop:8},children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>void Fe(),children:`Copy`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>se(null),children:`Hide now`})]})]})]}),T.schema&&(0,V.jsxs)(`div`,{style:{fontSize:11,marginBottom:12,padding:10,borderRadius:8,background:`rgba(59,130,246,0.08)`,border:`1px solid var(--border-accent)`},children:[(0,V.jsx)(`div`,{style:{fontWeight:700,marginBottom:4},children:`Schema`}),(0,V.jsxs)(`div`,{children:[`auth: `,T.schema.auth]}),T.schema.header&&(0,V.jsx)(`div`,{style:{fontFamily:`monospace`},children:T.schema.header}),T.schema_notes&&(0,V.jsx)(`div`,{style:{marginTop:4,color:`var(--text-tertiary)`},children:T.schema_notes})]}),(0,V.jsxs)(OV,{title:`Identity`,children:[(0,V.jsx)(kV,{label:`Label`,value:D.label,onChange:e=>O({...D,label:e})}),(0,V.jsx)(kV,{label:`Provider`,value:D.provider,onChange:e=>O({...D,provider:e})})]}),(0,V.jsxs)(OV,{title:`Binding (one repo max)`,children:[(0,V.jsx)(kV,{label:`Product repo (exactly one name, or empty = Developer secrets)`,value:D.repos,onChange:e=>O({...D,repos:e})}),D.repos.split(/[,]+/).map(e=>e.trim()).filter(Boolean).length>1&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`#f87171`,marginBottom:10},children:`Error: only one repo allowed. Remove extras before save.`}),T.multi_repo_error&&T.binding_error&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`#f87171`,marginBottom:10},children:T.binding_error}),(0,V.jsx)(kV,{label:`Project path (optional)`,value:D.project_path,onChange:e=>O({...D,project_path:e})})]}),(0,V.jsxs)(OV,{title:`Subscription & cost`,hint:`Plan level + what you pay monthly for this key/provider`,children:[(0,V.jsx)(kV,{label:`Subscription level / tier`,value:D.subscription_tier,onChange:e=>O({...D,subscription_tier:e}),placeholder:`e.g. free, pro, team, enterprise, payg`}),(0,V.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4,marginBottom:10},children:(T.tiers?.length?T.tiers:DV).map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{fontSize:10,padding:`2px 8px`,borderColor:D.subscription_tier===e.id?`var(--border-accent)`:void 0,background:D.subscription_tier===e.id?`rgba(59,130,246,0.15)`:void 0},onClick:()=>O({...D,subscription_tier:e.id,monthly_cost_usd:e.monthly_usd==null?D.monthly_cost_usd:String(e.monthly_usd)}),children:[e.label,e.monthly_usd==null?``:` $${e.monthly_usd}`]},e.id))}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:10,marginBottom:4},children:[(0,V.jsx)(kV,{label:`Monthly cost $`,value:D.monthly_cost_usd,onChange:e=>O({...D,monthly_cost_usd:e}),placeholder:`20`}),(0,V.jsx)(kV,{label:`Monthly cap $ (budget)`,value:D.monthly_cap_usd,onChange:e=>O({...D,monthly_cap_usd:e}),placeholder:`100`})]}),(D.subscription_tier||D.monthly_cost_usd)&&(0,V.jsxs)(`div`,{style:{fontSize:12,marginBottom:10,padding:`8px 10px`,borderRadius:8,background:`rgba(251,191,36,0.08)`,border:`1px solid rgba(251,191,36,0.25)`,color:`var(--text-secondary)`},children:[`Plan preview:`,` `,(0,V.jsx)(`strong`,{style:{color:`var(--text-primary)`},children:D.subscription_tier||`—`}),D.monthly_cost_usd?` · $${D.monthly_cost_usd}/mo`:` · no monthly cost set`,D.monthly_cap_usd?` · cap $${D.monthly_cap_usd}`:``]})]}),(0,V.jsxs)(OV,{title:`Docs & rotation`,children:[(0,V.jsx)(kV,{label:`API docs URL`,value:D.api_docs_url,onChange:e=>O({...D,api_docs_url:e})}),(0,V.jsx)(kV,{label:`Rotate every (days)`,value:D.rotate_every_days,onChange:e=>O({...D,rotate_every_days:e})}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12,marginBottom:10},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:!!D.auto_rotate,onChange:e=>O({...D,auto_rotate:e.target.checked})}),`Auto-rotate when due (flag — use CLI/agent to supply new value)`]}),(0,V.jsx)(kV,{label:`Notes`,value:D.notes,onChange:e=>O({...D,notes:e})})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,marginTop:8},children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:j,onClick:()=>void Be(),children:`Save metadata`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void Ue(),children:`Record sample usage $0.01`})]}),(0,V.jsxs)(`div`,{style:{marginTop:16,borderTop:`1px solid var(--border)`,paddingTop:12},children:[(0,V.jsx)(`div`,{style:{fontSize:11,fontWeight:700,marginBottom:8},children:`Rotate value`}),(0,V.jsx)(`input`,{type:`password`,value:k,onChange:e=>A(e.target.value),placeholder:`New secret value`,style:AV}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,style:{marginTop:8,width:`100%`},disabled:!k||j,onClick:()=>void Ve(),children:`Rotate + export .env`}),(0,V.jsxs)(`p`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:8},children:[`Browser assist CLI: `,(0,V.jsxs)(`code`,{children:[`npx total-recall secret rotate-browser `,T.key]})]}),T.next_rotate_due&&(0,V.jsxs)(`div`,{style:{fontSize:11,color:T.rotation_overdue?`#f87171`:`var(--text-tertiary)`,marginTop:6},children:[`Next due: `,new Date(T.next_rotate_due).toLocaleDateString(),T.rotation_overdue?` — overdue`:``]})]}),(0,V.jsxs)(`div`,{style:{marginTop:12,fontSize:11,color:`var(--text-tertiary)`},children:[`30d usage: `,T.usage_30d?.events||0,` events · $`,(T.usage_30d?.cost_usd||0).toFixed(4)]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,marginTop:12},children:[T.console_url&&(0,V.jsx)(`a`,{href:T.console_url,target:`_blank`,rel:`noreferrer`,className:`btn btn-ghost btn-sm`,children:`Console`}),T.pricing_url&&(0,V.jsx)(`a`,{href:T.pricing_url,target:`_blank`,rel:`noreferrer`,className:`btn btn-ghost btn-sm`,children:`Pricing`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{color:`#f87171`,marginLeft:`auto`},onClick:()=>void He(),children:`Delete`})]}),(0,V.jsxs)(`div`,{style:{marginTop:12,fontSize:10,color:`var(--text-tertiary)`,fontFamily:`monospace`},children:[`CLI: secret meta `,T.key,` --repo my-app --tier pro --monthly-cost 25 --rotate-days 90`]})]})]})]}),e===`import`&&(0,V.jsxs)(`div`,{className:`card`,style:{padding:20},children:[(0,V.jsx)(`h3`,{style:{marginBottom:8},children:`One-time migrate (import-env)`}),(0,V.jsxs)(`p`,{style:{fontSize:12,color:`var(--text-secondary)`,marginBottom:12,lineHeight:1.45},children:[`Pull legacy keys from local `,(0,V.jsx)(`code`,{children:`.env`}),` files into the TR store. Steady-state path is the opposite:`,` `,(0,V.jsx)(`strong`,{children:`export-env`}),` writes projections out from the store.`]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void We(),style:{marginBottom:12},children:`Re-scan`}),be.length===0?(0,V.jsx)(`p`,{style:{color:`var(--text-tertiary)`,fontSize:13},children:`No candidates — click Re-scan or use onboarding paste.`}):(0,V.jsxs)(V.Fragment,{children:[be.map(e=>(0,V.jsxs)(`label`,{style:{display:`flex`,gap:10,padding:`8px 0`,borderBottom:`1px solid var(--border)`,opacity:e.already_set?.5:1},children:[(0,V.jsx)(`input`,{type:`checkbox`,disabled:!!e.already_set,checked:Se.has(e.key),onChange:()=>{Ce(t=>{let n=new Set(t);return n.has(e.key)?n.delete(e.key):n.add(e.key),n})}}),(0,V.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:12},children:e.key}),(0,V.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[e.masked,` · `,e.source_label]})]},e.key)),(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,style:{marginTop:14},onClick:()=>void Ge(),children:[`Import `,Se.size,` key(s)`]})]})]}),e===`pats`&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`p`,{style:{fontSize:13,color:`var(--text-secondary)`,marginBottom:16},children:[(0,V.jsx)(`strong`,{children:`Original Total Recall feature:`}),` issue Personal Access Tokens that authenticate to`,` `,(0,V.jsx)(`code`,{children:`this`}),` brain (`,(0,V.jsx)(`code`,{children:`Authorization: Bearer …`}),` on `,(0,V.jsx)(`code`,{children:`/api/*`}),`). These are`,` `,(0,V.jsx)(`em`,{children:`not`}),` OpenAI/Anthropic keys — they only unlock your TR API.`]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:16,marginBottom:16,display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,V.jsx)(`input`,{value:me,onChange:e=>he(e.target.value),placeholder:`PAT name`,style:{...AV,flex:1,minWidth:160}}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:!me.trim(),onClick:async()=>{try{_e(await Mr(me.trim(),[`*`])),he(``),await Te()}catch(e){b(e.message)}},children:`Issue PAT`})]}),ge&&(0,V.jsxs)(`div`,{className:`card`,style:{padding:16,marginBottom:16,borderColor:`rgba(52,211,153,0.4)`},children:[(0,V.jsx)(`strong`,{children:`Copy now — shown once`}),(0,V.jsx)(`div`,{style:{fontFamily:`monospace`,fontSize:12,marginTop:8,wordBreak:`break-all`},children:ge.token}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,style:{marginTop:8},onClick:()=>{navigator.clipboard.writeText(ge.token),ye(!0),setTimeout(()=>ye(!1),2e3)},children:ve?`Copied`:`Copy`})]}),fe.filter(e=>!e.revoked).map(e=>(0,V.jsxs)(`div`,{className:`card`,style:{padding:12,marginBottom:8,display:`flex`,justifyContent:`space-between`},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontWeight:600},children:e.name}),(0,V.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[e.token_preview,`… · `,e.scopes?.join(`, `)]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{color:`#f87171`},onClick:()=>void Nr(e.id).then(Te),children:`Revoke`})]},e.id))]}),e===`cloud`&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,V.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:8},children:(0,V.jsx)(`button`,{onClick:ke,disabled:j,className:`btn btn-primary`,style:{minWidth:120},children:j?`Saving...`:`Save Configuration`})}),f&&(0,V.jsxs)(`div`,{className:`badge badge-success`,style:{padding:`6px 12px`,background:`rgba(16, 185, 129, 0.1)`,border:`1px solid #10b981`,color:`#34d399`},children:[`✓ `,f]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,gap:16},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid var(--border)`,paddingBottom:12},children:[(0,V.jsx)(`span`,{style:{fontSize:20},children:`🔑`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:600},children:`Cloud & Search APIs`}),(0,V.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Bring your own cloud models`})]})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.05)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,V.jsx)(`label`,{htmlFor:`google_api_key`,style:{fontSize:13,fontWeight:500},children:`Google Gemini API Key`}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,cursor:`pointer`,color:n?.brain?.preferred_agent===`gemini`?`var(--accent)`:`var(--text-tertiary)`},children:[(0,V.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`gemini`,onChange:()=>Oe(`preferred_agent`,`gemini`)}),`Set Active`]})]}),(0,V.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,V.jsx)(`input`,{id:`google_api_key`,type:`password`,placeholder:`AIzaSy...`,value:n?.secrets?.google_api_key||``,onChange:e=>De(`google_api_key`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13}})}),(0,V.jsxs)(`select`,{disabled:!n?.secrets?.google_api_key,value:n?.brain?.gemini_model||``,onChange:e=>Oe(`gemini_model`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13,marginTop:4},children:[(0,V.jsx)(`option`,{value:``,children:`Default Gemini Model`}),i.map(e=>{let t=``;return e.pricing&&e.pricing.prompt&&e.pricing.completion&&(t=` - ${(parseFloat(e.pricing.prompt)*1e6).toFixed(2)}/${(parseFloat(e.pricing.completion)*1e6).toFixed(2)} per 1M`),(0,V.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})]}),!n?.secrets?.google_api_key&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-error, #f44336)`,marginTop:8},children:`⚠ API Key required to unlock model selection`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.05)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,V.jsx)(`label`,{htmlFor:`anthropic_api_key`,style:{fontSize:13,fontWeight:500},children:`Anthropic API Key (Claude)`}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,cursor:`pointer`,color:n?.brain?.preferred_agent===`claude`?`var(--accent)`:`var(--text-tertiary)`},children:[(0,V.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`claude`,onChange:()=>Oe(`preferred_agent`,`claude`)}),`Set Active`]})]}),(0,V.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,V.jsx)(`input`,{id:`anthropic_api_key`,type:`password`,placeholder:`sk-ant-...`,value:n?.secrets?.anthropic_api_key||``,onChange:e=>De(`anthropic_api_key`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13}})}),(0,V.jsxs)(`select`,{disabled:!n?.secrets?.anthropic_api_key,value:n?.brain?.claude_model||``,onChange:e=>Oe(`claude_model`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13,marginTop:4},children:[(0,V.jsx)(`option`,{value:``,children:`Default Claude Model`}),o.map(e=>{let t=``;return e.pricing&&e.pricing.prompt&&e.pricing.completion&&(t=` - ${(parseFloat(e.pricing.prompt)*1e6).toFixed(2)}/${(parseFloat(e.pricing.completion)*1e6).toFixed(2)} per 1M`),(0,V.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})]}),!n?.secrets?.anthropic_api_key&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-error, #f44336)`,marginTop:8},children:`⚠ API Key required to unlock model selection`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.05)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,V.jsx)(`label`,{htmlFor:`openai_api_key`,style:{fontSize:13,fontWeight:500},children:`OpenAI API Key (Codex)`}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,cursor:`pointer`,color:n?.brain?.preferred_agent===`codex`?`var(--accent)`:`var(--text-tertiary)`},children:[(0,V.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`codex`,onChange:()=>Oe(`preferred_agent`,`codex`)}),`Set Active`]})]}),(0,V.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,V.jsx)(`input`,{id:`openai_api_key`,type:`password`,placeholder:`sk-proj-...`,value:n?.secrets?.openai_api_key||``,onChange:e=>De(`openai_api_key`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13}})}),(0,V.jsxs)(`select`,{disabled:!n?.secrets?.openai_api_key,value:n?.brain?.openai_model||``,onChange:e=>Oe(`openai_model`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13,marginTop:4},children:[(0,V.jsx)(`option`,{value:``,children:`Default OpenAI Model`}),c.map(e=>{let t=``;return e.pricing&&e.pricing.prompt&&e.pricing.completion&&(t=` - ${(parseFloat(e.pricing.prompt)*1e6).toFixed(2)}/${(parseFloat(e.pricing.completion)*1e6).toFixed(2)} per 1M`),(0,V.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})]}),!n?.secrets?.openai_api_key&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-error, #f44336)`,marginTop:8},children:`⚠ API Key required to unlock model selection`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:8},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,V.jsx)(`label`,{htmlFor:`openrouter_api_key`,style:{fontSize:13,fontWeight:500},children:`OpenRouter API Key`}),(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,cursor:`pointer`,color:n?.brain?.preferred_agent===`openrouter`?`var(--accent)`:`var(--text-tertiary)`},children:[(0,V.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`openrouter`,onChange:()=>Oe(`preferred_agent`,`openrouter`)}),`Set Active`]})]}),(0,V.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,V.jsx)(`input`,{id:`openrouter_api_key`,type:`password`,placeholder:`sk-or-...`,value:n?.secrets?.openrouter_api_key||``,onChange:e=>De(`openrouter_api_key`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13}})}),g&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,padding:`0 4px`},children:`Fetching models...`}),!g&&u.length===0&&n?.secrets?.openrouter_api_key?.startsWith(`sk-or-`)&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--accent-red)`,padding:`0 4px`},children:`Failed to fetch OpenRouter models.`}),!g&&u.length>0&&(0,V.jsxs)(`select`,{id:`openrouter_model`,value:n?.brain?.openrouter_model||``,onChange:e=>Oe(`openrouter_model`,e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:13,marginTop:4},children:[(0,V.jsx)(`option`,{value:``,children:`Default OpenRouter Model`}),(()=>{let e={};return u.forEach(t=>{let n=t.id.split(`/`)[0].toUpperCase();e[n]||(e[n]=[]),e[n].push(t)}),Object.keys(e).sort((e,t)=>e.localeCompare(t)).map(t=>(0,V.jsx)(`optgroup`,{label:t,children:e[t].sort((e,t)=>e.id.localeCompare(t.id)).map(e=>{let t=``;return e.pricing&&e.pricing.prompt&&e.pricing.completion&&(t=` - ${(parseFloat(e.pricing.prompt)*1e6).toFixed(2)}/${(parseFloat(e.pricing.completion)*1e6).toFixed(2)} per 1M`),(0,V.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})},t))})()]})]}),(0,V.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`These keys are stored locally and injected into the CLI reasoning agents on dispatch.`})]})]}),(0,V.jsxs)(`p`,{style:{marginTop:24,fontSize:11,color:`var(--text-tertiary)`},children:[`CLI: `,(0,V.jsx)(`code`,{children:`secret catalog`}),` · `,(0,V.jsx)(`code`,{children:`secret meta KEY --repo app --tier pro --monthly-cost 25 --rotate-days 90`}),` ·`,` `,(0,V.jsx)(`code`,{children:`secret rotation-due`}),` · `,(0,V.jsx)(`code`,{children:`secret usage`}),` · `,(0,V.jsx)(`code`,{children:`secret providers`})]})]})}var SV=`__developer__`,CV=`__multi_repo_error__`;function wV(e){let t=new Map,n=[],r=[];for(let i of e){let e=(i.repos||[]).map(e=>e.trim()).filter(Boolean);if(e.length>1||i.multi_repo_error){r.push(i);continue}if(!e.length){n.push(i);continue}let a=e[0];t.has(a)||t.set(a,[]),t.get(a).push(i)}let i=[];r.length&&i.push({id:CV,label:`Needs fix — multi-repo binding`,keys:r.slice().sort((e,t)=>e.key.localeCompare(t.key)),kind:`error`});for(let[e,n]of[...t.entries()].sort(([e],[t])=>e.localeCompare(t,void 0,{sensitivity:`base`})))i.push({id:e.replace(/[^a-zA-Z0-9._-]+/g,`-`),label:e,keys:n.slice().sort((e,t)=>e.key.localeCompare(t.key)),kind:`repo`});return n.length&&i.push({id:SV,label:`Developer secrets`,keys:n.slice().sort((e,t)=>e.key.localeCompare(t.key)),kind:`developer`}),i}function TV({k:e,selected:t,onOpen:n}){return(0,V.jsxs)(`button`,{type:`button`,onClick:n,style:{width:`100%`,display:`grid`,gridTemplateColumns:`minmax(0, 1.4fr) minmax(0, 1fr) auto`,gap:8,alignItems:`center`,padding:`8px 10px`,marginBottom:4,borderRadius:8,border:`1px solid ${t?`var(--border-accent)`:`transparent`}`,background:t?`rgba(59,130,246,0.14)`:e.multi_repo_error||e.rotation_overdue?`rgba(248,113,113,0.06)`:`rgba(148,163,184,0.04)`,color:`inherit`,cursor:`pointer`,textAlign:`left`},children:[(0,V.jsxs)(`div`,{style:{minWidth:0},children:[(0,V.jsxs)(`div`,{style:{fontFamily:`ui-monospace, monospace`,fontWeight:650,fontSize:12,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.key,e.multi_repo_error&&(0,V.jsx)(`span`,{style:{marginLeft:6,fontSize:9,color:`#f87171`},children:`MULTI`}),e.rotation_overdue&&(0,V.jsx)(`span`,{style:{marginLeft:6,fontSize:9,color:`#f87171`},children:`DUE`})]}),(0,V.jsxs)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.provider_name||e.provider||`—`,` · `,e.masked||`••••`,e.multi_repo_error?` · ${e.repos.join(`, `)}`:``]})]}),(0,V.jsxs)(`div`,{style:{fontSize:10,color:`var(--text-secondary)`,minWidth:0},children:[(0,V.jsx)(`span`,{style:{color:e.subscription_tier?`#fbbf24`:`var(--text-tertiary)`},children:e.subscription_tier||`no tier`}),` · `,(0,V.jsx)(`span`,{style:{color:e.monthly_cost_usd==null?`var(--text-tertiary)`:`#34d399`},children:e.monthly_cost_usd==null?`no $/mo`:`$${e.monthly_cost_usd}/mo`})]}),(0,V.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,flexShrink:0},children:`›`})]})}function EV({label:e,value:t,accent:n}){return(0,V.jsxs)(`div`,{className:`card`,style:{padding:`14px 16px`,borderLeft:`3px solid ${n}`},children:[(0,V.jsx)(`div`,{style:{fontSize:20,fontWeight:700,letterSpacing:`-0.02em`},children:t}),(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.06em`,marginTop:2},children:e})]})}var DV=[{id:`free`,label:`Free`,monthly_usd:0},{id:`payg`,label:`Pay-as-you-go`,monthly_usd:null},{id:`pro`,label:`Pro`,monthly_usd:20},{id:`team`,label:`Team`,monthly_usd:30},{id:`business`,label:`Business`,monthly_usd:50},{id:`enterprise`,label:`Enterprise`,monthly_usd:null}];function OV({title:e,hint:t,children:n}){return(0,V.jsxs)(`div`,{style:{marginBottom:14,paddingBottom:12,borderBottom:`1px solid var(--border)`},children:[(0,V.jsx)(`div`,{style:{fontSize:11,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`,color:`var(--text-secondary)`,marginBottom:4},children:e}),t&&(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:8,lineHeight:1.4},children:t}),n]})}function kV({label:e,value:t,onChange:n,placeholder:r}){return(0,V.jsxs)(`label`,{style:{display:`block`,marginBottom:10},children:[(0,V.jsx)(`span`,{style:{fontSize:10,fontWeight:600,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:e}),(0,V.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),placeholder:r,style:{...AV,marginTop:4}})]})}var AV={width:`100%`,boxSizing:`border-box`,padding:`8px 10px`,borderRadius:8,border:`1px solid var(--border)`,background:`var(--bg-primary)`,color:`var(--text-primary)`,fontSize:12},jV=[{id:`antigravity`,name:`Antigravity`,surface:`AGENTS.md`,scopes:`ssss:read, memory:read`,command:`npx total-recall connect antigravity`,snippet:e=>`Read AGENTS.md from the repo root.\nDiscovery: ${e}/.well-known/total-recall.json`},{id:`cursor`,name:`Cursor`,surface:`.cursor/rules/total-recall.mdc`,scopes:`ssss:read, memory:read`,command:`npx total-recall connect cursor`,snippet:e=>`Discovery: ${e}/.well-known/total-recall.json`},{id:`claude-code`,name:`Claude Code`,surface:`CLAUDE.md`,scopes:`ssss:read, memory:read`,command:`npx total-recall connect claude-code`,snippet:()=>`Read CLAUDE.md from the repo root.`},{id:`codex`,name:`Codex`,surface:`AGENTS.md`,scopes:`ssss:read, memory:read`,command:`npx total-recall connect codex`,snippet:e=>`Read AGENTS.md from the repo root.\nDiscovery: ${e}/.well-known/total-recall.json`},{id:`http-api`,name:`HTTP host app`,surface:`OpenAI-compatible provider`,scopes:`models:read, chat:write, ssss:read`,command:`npx total-recall connect http-api --brain <brain-url>`,snippet:e=>`Base URL: ${e}/v1\nModel: total-recall/gemma4\nModels: ${e}/v1/models`},{id:`generic`,name:`Generic Client`,surface:`REST + OpenAI-compatible API`,scopes:`models:read, chat:write, memory:read`,command:`npx total-recall connect generic --brain <brain-url>`,snippet:e=>`POST ${e}/v1/chat/completions\nGET ${e}/api/ssss\nAuthorization: Bearer <PAT>`}];function MV({activeBrainId:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(null),p=(0,v.useMemo)(()=>{let e=Yn();return e?e.replace(/\/$/,``):window.location.origin},[]);(0,v.useEffect)(()=>{let e=!0;return jr().then(t=>{e&&c(t.keys||[])}).catch(t=>{e&&o({type:`error`,text:`Failed to list API keys: ${t.message||`Unknown error`}`})}),Si().then(t=>{e&&t.success&&Array.isArray(t.active)&&u(t.active)}).catch(t=>{e&&o({type:`error`,text:`Failed to fetch active integrations: ${t.message||`Unknown error`}`})}),vi().then(t=>{e&&f(t)}).catch(t=>{e&&o({type:`error`,text:`Failed to fetch extension status: ${t.message||`Unknown error`}`})}),()=>{e=!1}},[e]);let m=(0,v.useMemo)(()=>l.length===0?jV:jV.filter(e=>[`http-api`,`generic`].includes(e.id)?!0:l.includes(e.id)),[l]),h=async(e,t)=>{await navigator.clipboard.writeText(t),n(e),setTimeout(()=>n(null),1800)},g=async e=>{i(e),o(null);try{let t=await xi(e,p);t.success?(o({type:`success`,text:`Successfully connected ${e}! All config files have been automatically updated.`}),c((await jr()).keys||[])):o({type:`error`,text:`Failed to connect: ${t.message}`})}catch(e){o({type:`error`,text:e.message||`Failed to connect.`})}finally{i(null)}};return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(`div`,{className:`page-header`,children:[(0,V.jsx)(`h1`,{children:`Integrations`}),(0,V.jsx)(`p`,{children:`Connect IDEs, UltraChat, and scripts to this Total Recall brain`})]}),a&&(0,V.jsxs)(`div`,{style:{padding:`12px 16px`,borderRadius:8,marginBottom:16,fontSize:14,fontWeight:500,background:a.type===`success`?`rgba(16, 185, 129, 0.15)`:`rgba(239, 68, 68, 0.15)`,border:a.type===`success`?`1px solid rgba(16, 185, 129, 0.3)`:`1px solid rgba(239, 68, 68, 0.3)`,color:a.type===`success`?`#34d399`:`#f87171`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,backdropFilter:`blur(8px)`,boxShadow:`0 4px 12px rgba(0,0,0,0.1)`},children:[(0,V.jsx)(`span`,{children:a.text}),(0,V.jsx)(`button`,{onClick:()=>o(null),style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,fontSize:18,padding:`0 4px`,lineHeight:`1`},children:`×`})]}),(0,V.jsxs)(`div`,{style:{background:`rgba(30, 41, 59, 0.4)`,backdropFilter:`blur(8px)`,border:`1px solid var(--border)`,borderRadius:12,padding:20,marginBottom:22,color:`var(--text-secondary)`,fontSize:14,lineHeight:`1.5`},children:[(0,V.jsx)(`strong`,{style:{color:`var(--text-primary)`,display:`block`,marginBottom:6},children:`💡 How Integrations Work`}),`Total Recall acts as a secure, local-first semantic memory hub. To give your development environments (Cursor, Claude Code, etc.) access to your memory vault and instruction layers, they communicate as API clients using secure tokens.`,(0,V.jsx)(`br`,{}),(0,V.jsx)(`span`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:`The status badges below dynamically inspect whether your workspace has successfully registered its connection token and communicated with your active brain.`})]}),(0,V.jsxs)(`div`,{style:{border:`1px solid var(--border)`,background:`var(--bg-secondary)`,borderRadius:12,padding:18,marginBottom:22,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:12,fontSize:13},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{color:`var(--text-tertiary)`,marginBottom:4},children:`Discovery`}),(0,V.jsxs)(`code`,{children:[p,`/.well-known/total-recall.json`]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{color:`var(--text-tertiary)`,marginBottom:4},children:`Chat API`}),(0,V.jsxs)(`code`,{children:[p,`/v1/chat/completions`]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{color:`var(--text-tertiary)`,marginBottom:4},children:`Model`}),(0,V.jsx)(`code`,{children:`total-recall/gemma4`})]})]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(300px, 1fr))`,gap:16},children:[(0,V.jsxs)(`div`,{style:{border:`1px solid var(--border)`,background:`var(--bg-secondary)`,borderRadius:12,padding:18,display:`flex`,flexDirection:`column`,gap:12,position:`relative`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{margin:`0 0 4px`},children:`Chrome Extension`}),(0,V.jsx)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:12},children:`Browser Overlay Panel & Capture`})]}),d?d.connected?(0,V.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 8px`,borderRadius:6,background:`rgba(16, 185, 129, 0.1)`,border:`1px solid rgba(16, 185, 129, 0.3)`,fontSize:12,color:`#34d399`,fontWeight:500},children:[(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#10b981`,boxShadow:`0 0 8px #10b981`}}),`Connected`]}):(0,V.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 8px`,borderRadius:6,background:`rgba(245, 158, 11, 0.1)`,border:`1px solid rgba(245, 158, 11, 0.3)`,fontSize:12,color:`#fbbf24`,fontWeight:500},children:[(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#f59e0b`}}),`Not Connected`]}):(0,V.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 8px`,borderRadius:6,background:`rgba(255, 255, 255, 0.05)`,border:`1px solid rgba(255, 255, 255, 0.1)`,fontSize:12,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#94a3b8`}}),`Checking...`]})]}),(0,V.jsxs)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`},children:[`Scopes utilized: `,(0,V.jsx)(`code`,{children:`chat:write, memory:read, memory:write`})]}),(0,V.jsx)(`div`,{style:{background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:10,fontSize:13,color:`var(--text-secondary)`,lineHeight:`1.4`},children:`Install the Total Recall extension to passively capture context, store quick notes, and access the active brain search overlay inside any Chrome tab.`}),(0,V.jsxs)(`div`,{style:{background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:10,fontFamily:`monospace`,fontSize:11,whiteSpace:`pre-wrap`,color:`var(--text-tertiary)`},children:[`1. Download zip & unzip locally.`,`
|
|
296
|
+
`,`2. Go to chrome://extensions in browser.`,`
|
|
297
|
+
`,`3. Enable "Developer mode" (top right).`,`
|
|
298
|
+
`,`4. Click "Load unpacked" & select unzipped folder.`]}),(0,V.jsx)(`div`,{style:{display:`flex`,gap:10,marginTop:`auto`,paddingTop:8},children:(0,V.jsx)(`a`,{href:`${p}/api/extension/download`,download:!0,className:`btn btn-sm btn-primary`,style:{background:`linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%)`,border:`none`,boxShadow:`0 2px 4px rgba(59, 130, 246, 0.3)`,fontWeight:600,cursor:`pointer`,textDecoration:`none`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:`6px 12px`,borderRadius:`6px`,color:`#fff`,fontSize:`12px`},children:`⬇ Download Extension Zip`})})]}),m.map(e=>{let n=e.snippet(p),i=s.find(t=>{let n=t?.name,r=typeof n==`string`?n:n&&typeof n==`object`&&typeof n.name==`string`?String(n.name):``;if(!r||t.revoked)return!1;let i=r.toLowerCase();return e.id===`cursor`?i.includes(`cursor`):e.id===`claude-code`?i.includes(`claude`):e.id===`codex`?i.includes(`codex`)||i.includes(`agents`):e.id===`antigravity`?i.includes(`antigravity`):e.id===`grok`?i.includes(`grok`)||i.includes(`xai`):e.id===`http-api`?i.includes(`http`)||i.includes(`host`):!1}),a=(0,V.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 8px`,borderRadius:6,background:`rgba(255, 255, 255, 0.05)`,border:`1px solid rgba(255, 255, 255, 0.1)`,fontSize:12,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#94a3b8`}}),`Not Connected`]});if(i)if(i.hit_count>0||e.id===`antigravity`){let t=i.last_used_at?` (Active ${new Date(i.last_used_at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})`:e.id===`antigravity`?` (Active Now)`:``;a=(0,V.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 8px`,borderRadius:6,background:`rgba(16, 185, 129, 0.1)`,border:`1px solid rgba(16, 185, 129, 0.3)`,fontSize:12,color:`#34d399`,fontWeight:500},children:[(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#10b981`,boxShadow:`0 0 8px #10b981`}}),`Connected`,t]})}else a=(0,V.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 8px`,borderRadius:6,background:`rgba(245, 158, 11, 0.1)`,border:`1px solid rgba(245, 158, 11, 0.3)`,fontSize:12,color:`#fbbf24`,fontWeight:500},children:[(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#f59e0b`}}),`Registered (Pending Activity)`]});return(0,V.jsxs)(`div`,{style:{border:`1px solid var(--border)`,background:`var(--bg-secondary)`,borderRadius:12,padding:18,display:`flex`,flexDirection:`column`,gap:12,position:`relative`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:12},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{style:{margin:`0 0 4px`},children:e.name}),(0,V.jsx)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:12},children:e.surface})]}),a]}),(0,V.jsxs)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`},children:[`Recommended scopes: `,(0,V.jsx)(`code`,{children:e.scopes})]}),(0,V.jsx)(`div`,{style:{background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:10,fontFamily:`monospace`,fontSize:12,whiteSpace:`pre-wrap`,color:`var(--text-secondary)`},children:e.command}),(0,V.jsx)(`div`,{style:{background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:10,fontFamily:`monospace`,fontSize:12,whiteSpace:`pre-wrap`,color:`var(--text-secondary)`},children:n}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:4},children:[(0,V.jsx)(`button`,{className:`btn btn-sm btn-primary`,onClick:()=>g(e.id),disabled:r!==null,style:{background:`linear-gradient(135deg, #10b981 0%, #047857 100%)`,border:`none`,boxShadow:`0 2px 4px rgba(16, 185, 129, 0.3)`,fontWeight:600,cursor:`pointer`},children:r===e.id?`Connecting...`:`Connect`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>h(e.id,`${e.command}\n\n${n}`),style:{background:`rgba(255, 255, 255, 0.05)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`,cursor:`pointer`},children:t===e.id?`Copied!`:`Copy Config`})]})]},e.id)})]})]})}function NV(e,t=!1){return t?`linear-gradient(135deg, #60a5fa, #34d399)`:e===`global`?`linear-gradient(135deg, #60a5fa, #2563eb)`:`linear-gradient(135deg, #34d399, #059669)`}function PV({activeBrainId:e,onBrainChange:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!0),c=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=Yn();fetch(`${e}/api/brains`,{credentials:`include`}).then(e=>e.json()).then(e=>{r(e.brains||[]),s(!1)}).catch(()=>s(!1))},[]),(0,v.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&a(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let l=e.split(`,`).filter(Boolean),u=n.filter(e=>l.includes(e.id)),d=u[0]||n[0],f=l.length>1,p=u.reduce((e,t)=>e+(t.node_count||0),0)||d?.node_count||0,m=f?`${l.length} brains`:d?.name||`Brain`,h=(e,n)=>{n.stopPropagation(),l.includes(e)?t(l.filter(t=>t!==e).join(`,`)):t([...l,e].join(`,`))};return o?(0,V.jsx)(`div`,{className:`brain-selector-trigger`,style:{opacity:.6},children:(0,V.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Brains…`})}):n.length===0?null:(0,V.jsxs)(`div`,{ref:c,className:`brain-selector`,style:{position:`relative`},children:[(0,V.jsxs)(`button`,{type:`button`,className:`brain-selector-trigger`,onClick:()=>a(e=>!e),title:`Select brain layers`,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`6px 8px`,background:i?`rgba(59, 130, 246, 0.12)`:`rgba(148, 163, 184, 0.06)`,border:`1px solid ${i?`var(--border-accent)`:`var(--border)`}`,borderRadius:8,cursor:`pointer`,color:`var(--text-primary)`,textAlign:`left`,transition:`all 0.15s`},children:[(0,V.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:NV(d?.layer||`global`,f),boxShadow:f?`0 0 6px rgba(52, 211, 153, 0.5)`:`0 0 6px rgba(59, 130, 246, 0.45)`,flexShrink:0}}),(0,V.jsx)(`span`,{style:{flex:1,minWidth:0,fontSize:11,fontWeight:600,letterSpacing:`-0.01em`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:m}),(0,V.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`,flexShrink:0},children:p}),(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,style:{opacity:.45,transform:i?`rotate(180deg)`:`none`,transition:`transform 0.15s`,flexShrink:0},children:(0,V.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),i&&(0,V.jsxs)(`div`,{className:`brain-selector-menu`,style:{position:`absolute`,bottom:`100%`,left:0,right:0,marginBottom:6,background:`linear-gradient(165deg, rgba(18, 26, 43, 0.98), rgba(8, 12, 22, 0.99))`,border:`1px solid var(--border)`,borderRadius:10,boxShadow:`0 -8px 28px rgba(0,0,0,0.45)`,overflow:`hidden`,zIndex:1e3,maxHeight:280,overflowY:`auto`},children:[(0,V.jsx)(`div`,{style:{padding:`6px 10px`,fontSize:9,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.08em`,borderBottom:`1px solid var(--border)`},children:`Brains · multi-select`}),n.map(e=>{let n=l.includes(e.id);return(0,V.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:()=>{e.exists&&(t(e.id),a(!1))},onKeyDown:n=>{n.key===`Enter`&&e.exists&&(t(e.id),a(!1))},style:{display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,cursor:e.exists?`pointer`:`not-allowed`,opacity:e.exists?1:.45,background:n?`rgba(59, 130, 246, 0.12)`:`transparent`,borderLeft:n?`2px solid #3b82f6`:`2px solid transparent`,transition:`background 0.1s`},onMouseEnter:t=>{e.exists&&(t.currentTarget.style.background=`rgba(148, 163, 184, 0.08)`)},onMouseLeave:e=>{e.currentTarget.style.background=n?`rgba(59, 130, 246, 0.12)`:`transparent`},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:n,disabled:!e.exists,onClick:e=>e.stopPropagation(),onChange:t=>h(e.id,t),style:{width:13,height:13,accentColor:`#3b82f6`,cursor:e.exists?`pointer`:`not-allowed`,margin:0,flexShrink:0}}),(0,V.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:NV(e.layer),flexShrink:0}}),(0,V.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,V.jsx)(`div`,{style:{fontSize:11,fontWeight:600,color:`var(--text-primary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name}),(0,V.jsxs)(`div`,{style:{fontSize:9,color:`var(--text-tertiary)`,marginTop:1},children:[e.node_count,`n`,e.layer===`project`&&e.project_root?` · ${e.project_root.split(`/`).pop()}`:``,e.exists?``:` · missing`]})]}),(0,V.jsx)(`span`,{style:{fontSize:8,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.04em`,padding:`2px 5px`,borderRadius:4,flexShrink:0,background:e.layer===`global`?`rgba(59, 130, 246, 0.15)`:`rgba(16, 185, 129, 0.12)`,color:e.layer===`global`?`#93c5fd`:`#6ee7b7`},children:e.layer===`global`?`G`:`P`})]},e.id)})]})]})}function FV(e){let t=e.match(/^---\s*\n([\s\S]*?)\n---/);if(t){let e=t[1].match(/version:\s*['"]?([^\n'"]+)/i);if(e)return e[1].trim()}let n=e.match(/#+\s+v(\d+\.\d+(?:\.\d+)?)/);return n?n[1]:`0.0.0`}function IV(e){let t=[],n=/#{2,3}\s+v?(\d+\.\d+(?:\.\d+)?)\s*(?:[—–-]\s*(\d{4}-\d{2}-\d{2}))?\s*\n([\s\S]*?)(?=\n#{2,3}\s|$)/g,r;for(;(r=n.exec(e))!==null;){let e=r[3].split(`
|
|
299
|
+
`).map(e=>e.replace(/^[\s-*]+/,``).trim()).filter(e=>e.length>0);t.push({version:r[1],date:r[2]||``,changes:e})}return t}function LV(e,t){let n=[`scripts`,`references`,`evals`,`subagents`],r=(e.subSkills||[]).map(e=>e.toLowerCase()),i=n.map(e=>({label:`Has ${e}/ directory`,passed:r.includes(e),detail:r.includes(e)?`${e}/ present`:`Missing ${e}/ subdirectory`})),a={label:`Has SKILL.md`,passed:!0,detail:t.length>0?`SKILL.md present`:`SKILL.md missing or empty`},o={label:`Has evals.json with 3+ assertions`,passed:r.includes(`evals`),detail:r.includes(`evals`)?`Evals directory found`:`No evals directory detected`},s=t.match(/^---\s*\n([\s\S]*?)\n---/),c=!1;if(s){let e=s[1].match(/description:\s*['"]?(.*?)['"]?\s*$/im);e&&e[1].toLowerCase().startsWith(`use this skill when`)&&(c=!0)}let l={label:`Trigger-optimized description`,passed:c,detail:c?`Description starts with "Use this skill when"`:`Description should start with "Use this skill when"`};return[a,...i,o,l]}function RV({activeBrainId:e}){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(new Set),[d,f]=(0,v.useState)(`active`),[,p]=(0,v.useState)(!0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)([]),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(null),[L,ee]=(0,v.useState)(null),te=(0,v.useMemo)(()=>a&&s?FV(s):`0.0.0`,[a,s]),ne=(0,v.useMemo)(()=>a&&s?IV(s):[],[a,s]),re=(0,v.useMemo)(()=>a&&s?LV(a,s):[],[a,s]),[ie,R]=(0,v.useState)({}),[ae,oe]=(0,v.useState)({}),[se,ce]=(0,v.useState)(null),[le,ue]=(0,v.useState)(!1),[de,fe]=(0,v.useState)(null),[pe,me]=(0,v.useState)([]),[he,ge]=(0,v.useState)(!1),[_e,ve]=(0,v.useState)(!1),[ye,be]=(0,v.useState)([]),[xe,Se]=(0,v.useState)(!1),Ce=async()=>{if(!(xe||t.length===0)){Se(!0),be([]);try{let n=t.slice(0,5),r=[];for(let t of n)try{let n=await Ar(t.name,t.repo||e);(n.audit.outdated||n.audit.problematic)&&r.push({skillName:t.name,description:n.audit.proposed_changes,problematic:n.audit.problematic})}catch(e){console.error(`Audit error for`,t.name,e)}be(r),r.length===0&&(S(`AI Audit complete: All checked skills are well-configured.`),setTimeout(()=>S(null),3e3))}finally{Se(!1)}}},we=(0,v.useCallback)(async(t,r)=>{p(!0),b(null);try{let a=await Sr(),s=[],l=[];if(Array.isArray(a)){s=a;let e=new Map;for(let t of s){let n=t.repo||`unknown`;e.has(n)||e.set(n,[]),e.get(n).push(t)}l=[...e.entries()].map(([e,t])=>({repo:e,path:t[0]?.project_path||null,skills:t,count:t.length,ok:!0}))}else s=a.skills||[],l=a.repos||[];e&&(l=l.filter(t=>t.repo===`Global`||t.repo===e),s=l.flatMap(e=>e.skills||[])),n(s),i(l);let d=l.filter(e=>(e.skills?.length||0)>0).map(e=>e.repo);if(u(new Set(d.slice(0,6))),s.length>0){let e=t?s.find(e=>e.name===t&&(!r||e.repo===r)):s[0];e&&(o(e),c((await Cr(e.name,e.repo)).content||``))}else o(null),c(``)}catch(e){b(e.message||`Failed to fetch skills by repo.`)}finally{p(!1)}},[e]);(0,v.useEffect)(()=>{we()},[we]);let Te=async e=>{o(e),p(!0),b(null),S(null),ce(null),R({});try{c((await Cr(e.name,e.repo)).content||``)}catch(t){b(t.message||`Failed to fetch rules for skill "${e.name}".`)}finally{p(!1)}},Ee=async()=>{if(a){h(!0),b(null),S(null);try{await Tr(a.name,s,a.repo),S(`Skill "${a.name}"${a.repo?` (${a.repo})`:``} saved successfully!`),setTimeout(()=>S(null),5e3)}catch(e){b(e.message||`Failed to save skill changes.`)}finally{h(!1)}}},De=async()=>{_(!0),b(null),S(null);try{S((await ii()).message||`Brain surfaces and shims recompiled successfully!`),setTimeout(()=>S(null),5e3)}catch(e){b(e.message||`Recompilation failed.`)}finally{_(!1)}},Oe=async e=>{if(window.confirm(`Delete skill "${e.name}"${e.repo?` from ${e.repo}`:``} permanently?`)){b(null),S(null);try{await Er(e.name,e.repo),S(`Skill "${e.name}" successfully deleted.`),setTimeout(()=>S(null),5e3),we()}catch(e){b(e.message||`Failed to delete skill.`)}}},ke=async e=>{if(e.preventDefault(),!T.trim())return;b(null),S(null);let t=a?.repo||r.find(e=>e.ok&&e.path)?.repo||``;if(!t){b(`No project repo available to create a skill in. Register a project first.`);return}let n=T.toLowerCase().replace(/[^a-z0-9-]/g,`-`);if(n.startsWith(`tr-`)||n===`total-recall`){b(`Cannot create Total Recall system skills here.`);return}let i=`---
|
|
300
|
+
type: skill
|
|
301
|
+
name: ${n}
|
|
302
|
+
description: "${D.trim()||`Custom system skill capability`}"
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
# ${n.charAt(0).toUpperCase()+n.slice(1)} — custom system skill
|
|
306
|
+
|
|
307
|
+
Configure triggers, options, and prompts inside this rules sheet to hot-recompile IDE capabilities.
|
|
308
|
+
`;try{await Tr(n,i,t),E(``),O(``),w(!1),S(`Skill "${n}" successfully created!`),setTimeout(()=>S(null),5e3),we(n)}catch(e){b(e.message||`Failed to create new skill.`)}},Ae=async e=>{if(e.preventDefault(),k.trim()){P(!0),b(null),ee(null);try{M(await Dr(k.trim())||[])}catch(e){b(e.message||`Registry query failed. Is the server connected?`)}finally{P(!1)}}},je=async e=>{I(e),b(null),S(null),ee(null);try{let t=await Or(e);t.success?(S(`✓ Skill "${t.skillName||e}" successfully installed, security audited, and compiled!`),setTimeout(()=>S(null),7e3),we(t.skillName)):t.reason&&t.reason.includes(`quarantined`)?ee({pkg:e,reason:t.reason||`Static security audit scanned critical dynamic string evaluations or commands injection vectors.`}):b(`❌ Installation failed: ${t.reason||`Unknown error`}`)}catch(e){b(e.message||`Dynamic installation handler failed.`)}finally{I(null)}},Me=async e=>{if(R(t=>({...t,[e]:!t[e]})),!ae[e]&&a)try{let t=await wr(a.name,e,a.repo);oe(n=>({...n,[e]:t}))}catch(t){console.error(`Failed to fetch skill files`,t),b(t.message||`Failed to fetch skill files.`),oe(t=>({...t,[e]:[]}))}},Ne=async()=>{ue(!0),fe(null);try{let e=await xr(`node .agent/skills/tr-skill/scripts/enforce-skill-optimization.mjs`,15e3);fe(e.output),e.success&&(S(`Enforcement scan completed.`),setTimeout(()=>S(null),5e3))}catch(e){fe(e.message)}finally{ue(!1)}},Pe=(0,v.useCallback)(async()=>{ge(!0);try{me((await Zr()).items||[])}catch(e){b(e.message||`Failed to fetch research items.`)}finally{ge(!1)}},[]);(0,v.useEffect)(()=>{d===`automation`&&Pe()},[d,Pe]);let Fe=async()=>{ve(!0),await new Promise(e=>setTimeout(e,1500)),ve(!1),S(`All skills are up to date.`),setTimeout(()=>S(null),5e3)},Ie=async()=>{b(null);try{await Qr(`Skill reference material update cycle`,`medium`,`Auto-triggered by Skills Manager to refresh outdated skill references and evals`),S(`Research cycle queued successfully.`),setTimeout(()=>S(null),5e3),Pe()}catch(e){b(e.message||`Failed to queue research cycle.`)}},Le=[{id:`active`,label:`Skills by repo`,icon:`📂`},{id:`registry`,label:`skills.sh Registry Hub`,icon:`✨`},{id:`lifecycle`,label:`Lifecycle & Versioning`,icon:`📋`},{id:`network`,label:`P2P Skills Network`,icon:`🌐`},{id:`automation`,label:`Auto-Improvement`,icon:`⚡`}],Re=e=>e.id||`${e.repo||`_`}::${e.name}`,ze=e=>a?.name===e.name&&(a?.repo||``)===(e.repo||``),Be=e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ve=t=>(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,flex:1,overflowY:`auto`},children:[r.length===0&&(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,padding:8},children:`No project repos with skills found.`}),r.map(n=>{let i=l.has(n.repo),a=n.skills?.length||0;return(0,V.jsxs)(`div`,{style:{borderBottom:`1px solid var(--border)`},children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>Be(n.repo),style:{width:`100%`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:8,padding:`10px 8px`,background:`transparent`,border:`none`,color:`inherit`,cursor:`pointer`,textAlign:`left`},children:[(0,V.jsxs)(`span`,{style:{fontSize:12,fontWeight:700},children:[i?`▾`:`▸`,` `,n.repo]}),(0,V.jsx)(`span`,{style:{fontSize:10,fontWeight:600,padding:`2px 8px`,borderRadius:99,background:a?`rgba(59,130,246,0.15)`:`rgba(148,163,184,0.1)`,color:a?`#93c5fd`:`var(--text-tertiary)`},children:a})]}),i&&(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,padding:`0 4px 10px`},children:a===0?(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,padding:`4px 8px`},children:n.error||`No app skills (TR skills hidden)`}):n.skills.map(i=>{let a=ze(i);return(0,V.jsxs)(`div`,{id:`${t}-skill-${i.repo}-${i.name}`,onClick:()=>void Te(i),style:{background:a?`var(--accent-muted)`:`var(--bg-tertiary)`,border:a?`1px solid var(--accent)`:`1px solid var(--border)`,padding:`10px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.15s ease`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:a?600:500,color:a?`var(--accent)`:`var(--text-primary)`},children:i.name}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[e&&e!==`Global`&&n.repo===`Global`&&(0,V.jsx)(`input`,{type:`checkbox`,checked:!!r.find(t=>t.repo===e)?.skills?.some(e=>e.name===i.name),onClick:e=>e.stopPropagation(),onChange:async t=>{t.stopPropagation();try{await kr(i.name,e,t.target.checked),we()}catch(e){b(e.message)}},style:{cursor:`pointer`},title:`Enable/Disable skill for this repo`}),(0,V.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Oe(i)},style:{background:`none`,border:`none`,color:`var(--text-tertiary)`,fontSize:12,cursor:`pointer`,padding:`2px 6px`},title:`Delete skill`,children:`✖`})]})]}),i.source&&(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:4},children:i.source}),i.subSkills&&i.subSkills.length>0&&(0,V.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4,marginTop:6},children:i.subSkills.slice(0,6).map(e=>(0,V.jsx)(`span`,{className:`badge`,style:{fontSize:9,padding:`1px 5px`,background:`var(--bg-elevated)`,color:`var(--text-secondary)`,border:`1px solid var(--border)`},children:e},e))})]},Re(i))})})]},n.repo)})]});return(0,V.jsxs)(`div`,{className:`page`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,V.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:16},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{children:`Skills Manager`}),(0,V.jsx)(`p`,{children:`Track, edit, and deploy agent skills across any repo — registry-based, no hardcoded hosts`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,V.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>w(!C),style:{border:`1px solid var(--border)`,background:`var(--bg-secondary)`},children:C?`✖ Cancel`:`➕ Create Custom Skill`}),(0,V.jsx)(`button`,{className:`btn btn-sm`,onClick:De,disabled:g,style:{background:g?`var(--bg-secondary)`:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,border:`none`,fontWeight:500},children:g?`⏳ Compiling shims...`:`🔄 Hot-Recompile Shims`})]})]}),y&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:20,display:`inline-flex`,padding:`6px 12px`,background:`rgba(239, 68, 68, 0.1)`,border:`1px solid #ef4444`,color:`#f87171`},children:[`⚠️ `,y]}),x&&(0,V.jsxs)(`div`,{className:`badge badge-success`,style:{marginBottom:20,display:`inline-flex`,padding:`6px 12px`,background:`rgba(16, 185, 129, 0.1)`,border:`1px solid #10b981`,color:`#34d399`},children:[`✓ `,x]}),L&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:20,display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:16,background:`rgba(239, 68, 68, 0.15)`,border:`1px solid #ef4444`,borderRadius:8,color:`#f87171`,gap:6},children:[(0,V.jsx)(`div`,{style:{fontWeight:700,fontSize:13},children:`🚨 SECURITY QUARANTINE PURGE ACTIVE!`}),(0,V.jsxs)(`div`,{style:{fontSize:12},children:[`Installation of package `,(0,V.jsx)(`strong`,{children:L.pkg}),` was blocked and files were hard purged.`]}),(0,V.jsxs)(`div`,{style:{fontSize:11,opacity:.85},children:[`Reason: `,L.reason]})]}),C&&(0,V.jsxs)(`div`,{className:`card`,style:{marginBottom:24,padding:24,background:`rgba(18, 18, 26, 0.9)`,border:`1px solid var(--border)`,backdropFilter:`blur(10px)`},children:[(0,V.jsx)(`h3`,{style:{fontSize:14,fontWeight:600,borderBottom:`1px solid var(--border)`,paddingBottom:10,marginBottom:14},children:`➕ Create New Skill`}),(0,V.jsxs)(`form`,{onSubmit:ke,style:{display:`flex`,gap:16,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,V.jsxs)(`div`,{style:{flex:`1 1 200px`,display:`flex`,flexDirection:`column`,gap:6},children:[(0,V.jsx)(`label`,{htmlFor:`new_name`,style:{fontSize:11,fontWeight:500,color:`var(--text-secondary)`},children:`Skill Name (kebab-case)`}),(0,V.jsx)(`input`,{id:`new_name`,type:`text`,placeholder:`e.g. security-audit`,value:T,onChange:e=>E(e.target.value),required:!0,style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:12}})]}),(0,V.jsxs)(`div`,{style:{flex:`2 1 300px`,display:`flex`,flexDirection:`column`,gap:6},children:[(0,V.jsx)(`label`,{htmlFor:`new_desc`,style:{fontSize:11,fontWeight:500,color:`var(--text-secondary)`},children:`Brief Description / System Triggers`}),(0,V.jsx)(`input`,{id:`new_desc`,type:`text`,placeholder:`e.g. Audits security parameters, encryption costs, and Caddy forward gates`,value:D,onChange:e=>O(e.target.value),style:{background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,padding:`8px 12px`,borderRadius:6,outline:`none`,fontSize:12}})]}),(0,V.jsx)(`button`,{type:`submit`,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,padding:`8px 16px`,borderRadius:6,fontWeight:500,border:`none`,fontSize:12,cursor:`pointer`,height:33},children:`🚀 Initialize Skill`})]})]}),(0,V.jsx)(`div`,{style:{display:`flex`,gap:6,marginBottom:20,borderBottom:`1px solid var(--border)`,paddingBottom:10,flexWrap:`wrap`},children:Le.map(e=>(0,V.jsxs)(`button`,{id:`tab-${e.id}`,onClick:()=>f(e.id),style:{padding:`8px 14px`,borderRadius:8,border:`none`,background:d===e.id?`var(--accent)`:`var(--bg-tertiary)`,color:d===e.id?`#fff`:`var(--text-secondary)`,fontWeight:600,cursor:`pointer`,fontSize:11,transition:`all 0.15s ease`,whiteSpace:`nowrap`},children:[e.icon,` `,e.label]},e.id))}),d===`active`?(0,V.jsxs)(`div`,{style:{display:`flex`,flex:1,gap:24,minHeight:0,overflow:`hidden`,paddingBottom:16},children:[(0,V.jsx)(`div`,{style:{width:300,display:`flex`,flexDirection:`column`,gap:16,flexShrink:0,overflowY:`auto`},children:(0,V.jsxs)(`div`,{className:`card`,style:{padding:16,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,flex:1,display:`flex`,flexDirection:`column`},children:[(0,V.jsx)(`h3`,{style:{fontSize:12,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,borderBottom:`1px solid var(--border)`,paddingBottom:8,marginBottom:8},children:`Skills by repo`}),(0,V.jsxs)(`p`,{style:{fontSize:10,color:`var(--text-tertiary)`,margin:`0 0 10px`,lineHeight:1.4},children:[`Project skills only · total-recall / tr-* hidden · `,t.length,` skill`,t.length===1?``:`s`]}),Ve(`active`)]})}),(0,V.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:a?(0,V.jsxs)(`div`,{className:`card`,style:{flex:1,padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,borderBottom:`1px solid var(--border)`,paddingBottom:12,marginBottom:16,flexShrink:0},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h3`,{style:{fontSize:16,fontWeight:600,color:`var(--text-primary)`},children:[`📝 Editing Capability rules: `,a.name,`/SKILL.md`]}),(0,V.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Hot-recompiled rules preserve immutable instructions and custom shims`})]}),(0,V.jsx)(`button`,{className:`btn btn-primary`,onClick:Ee,disabled:m,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,fontWeight:500,borderRadius:6,padding:`8px 18px`,fontSize:12},children:m?`⏳ Saving...`:`💾 Save rules`})]}),(0,V.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:(0,V.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),style:{flex:1,width:`100%`,fontFamily:`var(--font-mono)`,fontSize:13,padding:16,background:`var(--bg-secondary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,borderRadius:8,resize:`none`,outline:`none`,lineHeight:1.6,whiteSpace:`pre`,overflowWrap:`normal`,overflowX:`auto`},spellCheck:!1})})]}):(0,V.jsx)(`div`,{className:`card`,style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`},children:`No skill selected. Click a skill in the registry to manage its rules sheet.`})})]}):d===`registry`?(0,V.jsxs)(`div`,{style:{display:`flex`,flex:1,flexDirection:`column`,minHeight:0,overflowY:`auto`,paddingBottom:16},children:[(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,marginBottom:20},children:[(0,V.jsx)(`h3`,{style:{fontSize:15,fontWeight:600,color:`var(--text-primary)`,marginBottom:8},children:`🔍 Discover AI Agent Skills from skills.sh`}),(0,V.jsx)(`p`,{style:{fontSize:12,color:`var(--text-secondary)`,marginBottom:16},children:`Query the absolute ratings list from the open-source registry. When you trigger installation, files are sandboxed, statically audited for command injection vulnerabilities, and automatically compiled.`}),(0,V.jsxs)(`form`,{onSubmit:Ae,style:{display:`flex`,gap:12},children:[(0,V.jsx)(`input`,{type:`text`,placeholder:`Search skills (e.g. git, typescript, prd...)`,value:k,onChange:e=>A(e.target.value),style:{flex:1,background:`var(--bg-tertiary)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`10px 16px`,fontSize:13,outline:`none`}}),(0,V.jsx)(`button`,{type:`submit`,disabled:N,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,border:`none`,borderRadius:8,padding:`10px 24px`,fontWeight:600,fontSize:13,cursor:`pointer`},children:N?`⏳ Sifting...`:`🔎 Query Registry`})]})]}),(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:N?(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:40,color:`var(--text-secondary)`},children:[(0,V.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,style:{animation:`spin 1s linear infinite`,marginBottom:12},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,V.jsx)(`span`,{children:`Searching packages in registry catalog...`})]}):j.length>0?(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(320px, 1fr))`,gap:16},children:j.map(e=>{let t=F===e.name;return(0,V.jsxs)(`div`,{style:{background:`rgba(18, 18, 26, 0.4)`,border:`1px solid var(--border)`,borderRadius:10,padding:20,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,gap:16},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,flexWrap:`wrap`,gap:8,marginBottom:8},children:[(0,V.jsx)(`span`,{style:{fontWeight:700,fontSize:14,color:`#fff`,wordBreak:`break-all`},children:e.name}),(0,V.jsxs)(`span`,{className:`badge`,style:{background:`rgba(59, 130, 246, 0.15)`,color:`#60a5fa`,border:`1px solid rgba(59, 130, 246, 0.2)`,fontSize:10,padding:`2px 8px`,borderRadius:20},children:[`⚡ `,e.installsStr,` installs`]})]}),(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`var(--accent)`,textDecoration:`none`},onMouseEnter:e=>e.currentTarget.style.textDecoration=`underline`,onMouseLeave:e=>e.currentTarget.style.textDecoration=`none`,children:`🔗 View Registry Repository`})]}),(0,V.jsx)(`button`,{onClick:()=>void je(e.name),disabled:!!F,style:{width:`100%`,background:t?`var(--bg-tertiary)`:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:t?`var(--text-secondary)`:`#fff`,border:`none`,borderRadius:8,padding:`10px 16px`,fontWeight:600,fontSize:12,cursor:F?`not-allowed`:`pointer`,transition:`all 0.15s ease`},children:t?`🛡️ Auditing & Installing...`:`➕ Install Capability`})]},e.name)})}):k.trim()?(0,V.jsx)(`div`,{style:{textAlign:`center`,padding:40,border:`1px dashed var(--border)`,borderRadius:10,color:`var(--text-secondary)`},children:`No matching skills found in the skills.sh registry. Try a different query like "git" or "prd".`}):(0,V.jsx)(`div`,{style:{textAlign:`center`,padding:40,border:`1px dashed var(--border)`,borderRadius:10,color:`var(--text-tertiary)`,fontSize:12},children:`Enter a search query above to browse portable capabilities from the cloud registry.`})})]}):d===`lifecycle`?(0,V.jsxs)(`div`,{style:{display:`flex`,flex:1,gap:24,minHeight:0,overflow:`hidden`,paddingBottom:16},children:[(0,V.jsx)(`div`,{style:{width:280,display:`flex`,flexDirection:`column`,gap:16,flexShrink:0,overflowY:`auto`},children:(0,V.jsxs)(`div`,{className:`card`,style:{padding:16,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,flex:1,display:`flex`,flexDirection:`column`},children:[(0,V.jsx)(`h3`,{style:{fontSize:12,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,borderBottom:`1px solid var(--border)`,paddingBottom:8,marginBottom:12},children:`Skills by repo`}),Ve(`lifecycle`)]})}),(0,V.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:20,overflowY:`auto`,minHeight:0},children:a?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,flexWrap:`wrap`},children:[(0,V.jsxs)(`h3`,{id:`lifecycle-version-title`,style:{fontSize:16,fontWeight:600,color:`var(--text-primary)`,margin:0},children:[a.name,a.repo?(0,V.jsxs)(`span`,{style:{fontSize:12,fontWeight:500,color:`var(--text-tertiary)`,marginLeft:8},children:[`· `,a.repo]}):null]}),(0,V.jsxs)(`span`,{id:`lifecycle-version-badge`,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,padding:`4px 14px`,borderRadius:20,fontSize:12,fontWeight:700,letterSpacing:.3},children:[`v`,te]}),(0,V.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[`Modified: `,new Date(a.modified).toLocaleDateString()]})]})}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{id:`lifecycle-changelog-heading`,style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:8},children:`📜 Changelog Timeline`}),ne.length>0?(0,V.jsxs)(`div`,{style:{position:`relative`,paddingLeft:28},children:[(0,V.jsx)(`div`,{style:{position:`absolute`,left:5,top:6,bottom:6,width:2,background:`var(--border)`}}),ne.map((e,t)=>(0,V.jsxs)(`div`,{style:{marginBottom:20,position:`relative`},children:[(0,V.jsx)(`div`,{style:{position:`absolute`,left:-28,top:4,width:12,height:12,borderRadius:`50%`,background:t===0?`var(--accent)`:`var(--text-tertiary)`,border:t===0?`2px solid var(--accent-hover)`:`2px solid var(--border)`,boxShadow:t===0?`0 0 8px rgba(var(--accent-rgb, 99, 102, 241), 0.4)`:`none`}}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`baseline`,marginBottom:6},children:[(0,V.jsxs)(`span`,{style:{fontSize:13,fontWeight:700,color:t===0?`var(--accent)`:`var(--text-primary)`},children:[`v`,e.version]}),e.date&&(0,V.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:e.date})]}),(0,V.jsx)(`ul`,{style:{margin:0,paddingLeft:16,listStyle:`disc`},children:e.changes.map((e,t)=>(0,V.jsx)(`li`,{style:{fontSize:12,color:`var(--text-secondary)`,lineHeight:1.7},children:e},t))})]},`${e.version}-${t}`))]}):(0,V.jsxs)(`div`,{style:{padding:20,textAlign:`center`,color:`var(--text-tertiary)`,fontSize:12,border:`1px dashed var(--border)`,borderRadius:8},children:[`No changelog entries detected in SKILL.md. Add `,(0,V.jsx)(`code`,{children:`## v1.0.0 — 2025-01-01`}),` sections to enable version tracking.`]})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:8},children:[(0,V.jsx)(`h3`,{id:`lifecycle-health-heading`,style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,margin:0},children:`🩺 Health Checks`}),(0,V.jsx)(`button`,{id:`lifecycle-run-enforcement-btn`,onClick:()=>void Ne(),disabled:le,style:{background:le?`var(--bg-tertiary)`:`linear-gradient(135deg, #f59e0b, #d97706)`,color:`#fff`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:le?`not-allowed`:`pointer`},children:le?`⏳ Running...`:`🛡️ Run Enforcement`})]}),(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(260px, 1fr))`,gap:10},children:re.map((e,t)=>(0,V.jsxs)(`div`,{id:`lifecycle-health-${t}`,style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 14px`,background:`var(--bg-tertiary)`,borderRadius:8,border:`1px solid ${e.passed?`rgba(16, 185, 129, 0.25)`:`rgba(239, 68, 68, 0.25)`}`},children:[(0,V.jsx)(`div`,{style:{width:10,height:10,borderRadius:`50%`,background:e.passed?`#10b981`:`#ef4444`,flexShrink:0,boxShadow:e.passed?`0 0 6px rgba(16, 185, 129, 0.4)`:`0 0 6px rgba(239, 68, 68, 0.4)`}}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.label}),(0,V.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:e.detail})]})]},t))}),de&&(0,V.jsx)(`pre`,{id:`lifecycle-enforcement-output`,style:{marginTop:16,padding:14,background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:8,fontSize:11,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`,whiteSpace:`pre-wrap`,maxHeight:200,overflowY:`auto`},children:de})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,V.jsx)(`h3`,{id:`lifecycle-subfiles-heading`,style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:8},children:`📁 Sub-file Browser`}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16,flexWrap:`wrap`},children:[(0,V.jsx)(`div`,{style:{flex:`1 1 300px`,display:`flex`,flexDirection:`column`,gap:8},children:[`scripts`,`references`,`evals`,`subagents`].map(e=>{let t=(a.subSkills||[]).map(e=>e.toLowerCase()).includes(e),n=ie[e];return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{id:`lifecycle-subdir-${e}`,onClick:()=>Me(e),style:{width:`100%`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`10px 14px`,background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,borderRadius:8,cursor:`pointer`,color:t?`var(--text-primary)`:`var(--text-tertiary)`,fontSize:13,fontWeight:500,transition:`all 0.15s ease`},children:[(0,V.jsxs)(`span`,{children:[n?`▼`:`▶`,` `,e,`/`]}),(0,V.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:t?`#10b981`:`#ef4444`}})]}),n&&ae[e]&&(0,V.jsx)(`div`,{style:{paddingLeft:20,paddingTop:6,display:`flex`,flexDirection:`column`,gap:4},children:ae[e].length>0?ae[e].map(t=>(0,V.jsxs)(`div`,{onClick:()=>ce({name:`${e}/${t.name}`,content:`// Contents of ${a.name}/${e}/${t.name}\n// Size: ${t.size}\n// (Preview loaded from skill filesystem)`}),style:{display:`flex`,justifyContent:`space-between`,padding:`6px 10px`,background:`var(--bg-secondary)`,borderRadius:6,cursor:`pointer`,fontSize:11,color:`var(--text-secondary)`,transition:`background 0.1s ease`},onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-elevated)`,onMouseLeave:e=>e.currentTarget.style.background=`var(--bg-secondary)`,children:[(0,V.jsxs)(`span`,{children:[`📄 `,t.name]}),(0,V.jsx)(`span`,{style:{color:`var(--text-tertiary)`},children:t.size})]},t.name)):(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,padding:`4px 10px`},children:`Empty directory`})})]},e)})}),se&&(0,V.jsx)(`div`,{style:{flex:`1 1 300px`},children:(0,V.jsxs)(`div`,{style:{background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:8,overflow:`hidden`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 14px`,background:`var(--bg-tertiary)`,borderBottom:`1px solid var(--border)`},children:[(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:se.name}),(0,V.jsx)(`button`,{id:`lifecycle-close-preview-btn`,onClick:()=>ce(null),style:{background:`none`,border:`none`,color:`var(--text-tertiary)`,cursor:`pointer`,fontSize:14},children:`✖`})]}),(0,V.jsx)(`pre`,{style:{padding:14,fontSize:11,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`,margin:0,whiteSpace:`pre-wrap`,maxHeight:200,overflowY:`auto`},children:se.content})]})})]})]})]}):(0,V.jsx)(`div`,{className:`card`,style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`,fontSize:13},children:`Select a skill from the left panel to view its lifecycle details.`})})]}):d===`network`?(0,V.jsxs)(`div`,{style:{display:`flex`,flex:1,flexDirection:`column`,minHeight:0,overflowY:`auto`,paddingBottom:16},children:[(0,V.jsx)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,marginBottom:20},children:(0,V.jsx)(`div`,{style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[{label:`Connected Peers`,value:`—`,icon:`🔗`},{label:`Shared Skills`,value:`—`,icon:`📦`},{label:`Last Sync`,value:`Never`,icon:`🔄`}].map(e=>(0,V.jsxs)(`div`,{id:`network-stat-${e.label.toLowerCase().replace(/\s/g,`-`)}`,style:{flex:`1 1 140px`,background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,borderRadius:10,padding:`16px 20px`,textAlign:`center`},children:[(0,V.jsx)(`div`,{style:{fontSize:22,marginBottom:4},children:e.icon}),(0,V.jsx)(`div`,{style:{fontSize:20,fontWeight:700,color:`var(--text-primary)`},children:e.value}),(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:2},children:e.label})]},e.label))})}),(0,V.jsxs)(`div`,{className:`card`,id:`network-coming-soon-panel`,style:{flex:1,position:`relative`,overflow:`hidden`,border:`1px solid var(--border)`,borderRadius:12},children:[(0,V.jsxs)(`div`,{style:{padding:40,filter:`blur(3px)`,opacity:.35,pointerEvents:`none`,userSelect:`none`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,gap:24,alignItems:`center`,marginBottom:30,flexWrap:`wrap`},children:[(0,V.jsxs)(`div`,{style:{padding:`20px 30px`,background:`var(--bg-tertiary)`,borderRadius:12,border:`2px solid var(--accent)`,textAlign:`center`},children:[(0,V.jsx)(`div`,{style:{fontSize:28},children:`📂`}),(0,V.jsx)(`div`,{style:{fontSize:13,fontWeight:700,marginTop:6,color:`var(--text-primary)`},children:`Local Skills`})]}),(0,V.jsx)(`div`,{style:{fontSize:28,color:`var(--accent)`},children:`⇄`}),(0,V.jsxs)(`div`,{style:{padding:`20px 30px`,background:`var(--bg-tertiary)`,borderRadius:12,border:`2px solid var(--accent)`,textAlign:`center`},children:[(0,V.jsx)(`div`,{style:{fontSize:28},children:`🌐`}),(0,V.jsx)(`div`,{style:{fontSize:13,fontWeight:700,marginTop:6,color:`var(--text-primary)`},children:`P2P Network`})]}),(0,V.jsx)(`div`,{style:{fontSize:28,color:`var(--accent)`},children:`⇄`}),(0,V.jsxs)(`div`,{style:{padding:`20px 30px`,background:`var(--bg-tertiary)`,borderRadius:12,border:`2px solid var(--accent)`,textAlign:`center`},children:[(0,V.jsx)(`div`,{style:{fontSize:28},children:`👥`}),(0,V.jsx)(`div`,{style:{fontSize:13,fontWeight:700,marginTop:6,color:`var(--text-primary)`},children:`Remote Peers`})]})]}),(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:16},children:[`Auto-discovery`,`Version Negotiation`,`Conflict Resolution`,`Security Quarantine`].map(e=>(0,V.jsx)(`div`,{style:{background:`var(--bg-tertiary)`,padding:16,borderRadius:8,border:`1px solid var(--border)`},children:(0,V.jsx)(`div`,{style:{fontSize:13,fontWeight:600,color:`var(--text-primary)`},children:e})},e))})]}),(0,V.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,background:`rgba(10, 10, 18, 0.6)`,backdropFilter:`blur(2px)`,zIndex:10},children:(0,V.jsxs)(`div`,{style:{background:`rgba(18, 18, 26, 0.95)`,border:`1px solid var(--border)`,borderRadius:16,padding:`40px 48px`,textAlign:`center`,maxWidth:520,backdropFilter:`blur(20px)`,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.4)`},children:[(0,V.jsx)(`div`,{style:{fontSize:48,marginBottom:16},children:`🚀`}),(0,V.jsx)(`h2`,{id:`network-coming-soon-title`,style:{fontSize:22,fontWeight:700,color:`var(--text-primary)`,marginBottom:12},children:`Coming Soon`}),(0,V.jsx)(`p`,{style:{fontSize:13,color:`var(--text-secondary)`,lineHeight:1.7,marginBottom:20},children:`Peer-to-peer skill sharing enables automatic discovery, sync, and versioning of skills across trusted Total Recall nodes.`}),(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,gap:12,marginBottom:24,flexWrap:`wrap`},children:[(0,V.jsx)(`div`,{style:{padding:`10px 16px`,background:`var(--bg-tertiary)`,borderRadius:8,border:`1px solid var(--accent)`,fontSize:12,fontWeight:600,color:`var(--accent)`},children:`📂 Local Skills`}),(0,V.jsx)(`span`,{style:{color:`var(--accent)`,fontSize:18,fontWeight:700},children:`↔`}),(0,V.jsx)(`div`,{style:{padding:`10px 16px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15))`,borderRadius:8,border:`1px solid var(--accent)`,fontSize:12,fontWeight:600,color:`var(--accent)`},children:`🌐 P2P Network`}),(0,V.jsx)(`span`,{style:{color:`var(--accent)`,fontSize:18,fontWeight:700},children:`↔`}),(0,V.jsx)(`div`,{style:{padding:`10px 16px`,background:`var(--bg-tertiary)`,borderRadius:8,border:`1px solid var(--accent)`,fontSize:12,fontWeight:600,color:`var(--accent)`},children:`👥 Remote Peers`})]}),(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8,textAlign:`left`},children:[{icon:`🔍`,label:`Auto-discovery`},{icon:`🔄`,label:`Version negotiation`},{icon:`⚔️`,label:`Conflict resolution`},{icon:`🛡️`,label:`Security quarantine`}].map(e=>(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`8px 12px`,background:`var(--bg-tertiary)`,borderRadius:6,fontSize:11,color:`var(--text-secondary)`,fontWeight:500},children:[(0,V.jsx)(`span`,{children:e.icon}),` `,e.label]},e.label))})]})})]})]}):(0,V.jsxs)(`div`,{style:{display:`flex`,flex:1,flexDirection:`column`,minHeight:0,overflowY:`auto`,paddingBottom:16,gap:20},children:[(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:10,flexWrap:`wrap`,gap:10},children:[(0,V.jsx)(`h3`,{id:`automation-update-heading`,style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,margin:0},children:`🔄 Auto-Update Status`}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,V.jsx)(`button`,{id:`automation-check-updates-btn`,onClick:()=>void Fe(),disabled:_e,style:{background:_e?`var(--bg-tertiary)`:`var(--bg-elevated)`,color:_e?`var(--text-tertiary)`:`var(--text-primary)`,border:`1px solid var(--border)`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:_e?`not-allowed`:`pointer`},children:_e?`⏳ Checking...`:`🔎 Check All Updates`}),(0,V.jsx)(`button`,{id:`automation-update-all-btn`,disabled:!0,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:`not-allowed`,opacity:.5},children:`⬆️ Update All`})]})]}),(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:t.map(e=>(0,V.jsxs)(`div`,{id:`automation-update-${e.name}`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`10px 14px`,background:`var(--bg-tertiary)`,borderRadius:8,border:`1px solid var(--border)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`var(--text-primary)`},children:e.name}),(0,V.jsxs)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`,fontFamily:`var(--font-mono)`},children:[`v`,FV(``)]})]}),(0,V.jsx)(`span`,{style:{fontSize:10,fontWeight:600,padding:`3px 10px`,borderRadius:12,background:`rgba(16, 185, 129, 0.1)`,color:`#10b981`,border:`1px solid rgba(16, 185, 129, 0.2)`},children:`✓ Up to date`})]},e.name))})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12,borderBottom:`1px solid var(--border)`,paddingBottom:10,flexWrap:`wrap`,gap:10},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{id:`automation-research-heading`,style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,margin:0},children:`🧠 Continuous Intelligence Loop`}),(0,V.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:4,margin:0},children:`Skills automatically trigger background research to update their reference material and improve evals`})]}),(0,V.jsx)(`button`,{id:`automation-trigger-research-btn`,onClick:()=>void Ie(),style:{background:`linear-gradient(135deg, #8b5cf6, #7c3aed)`,color:`#fff`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:`pointer`,flexShrink:0},children:`🔬 Trigger Research Cycle`})]}),he?(0,V.jsx)(`div`,{style:{textAlign:`center`,padding:20,color:`var(--text-tertiary)`,fontSize:12},children:`Loading research items...`}):pe.length>0?(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:pe.slice(0,8).map(e=>(0,V.jsxs)(`div`,{id:`automation-research-${e.id}`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`10px 14px`,background:`var(--bg-tertiary)`,borderRadius:8,border:`1px solid var(--border)`},children:[(0,V.jsxs)(`div`,{style:{flex:1},children:[(0,V.jsx)(`div`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.topic}),(0,V.jsxs)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:2},children:[e.priority,` priority · `,new Date(e.created_at).toLocaleDateString()]})]}),(0,V.jsx)(`span`,{style:{fontSize:10,fontWeight:600,padding:`3px 10px`,borderRadius:12,background:e.status===`done`?`rgba(16, 185, 129, 0.1)`:e.status===`in_progress`?`rgba(59, 130, 246, 0.1)`:e.status===`failed`?`rgba(239, 68, 68, 0.1)`:`rgba(245, 158, 11, 0.1)`,color:e.status===`done`?`#10b981`:e.status===`in_progress`?`#60a5fa`:e.status===`failed`?`#ef4444`:`#f59e0b`,border:`1px solid ${e.status===`done`?`rgba(16, 185, 129, 0.2)`:e.status===`in_progress`?`rgba(59, 130, 246, 0.2)`:e.status===`failed`?`rgba(239, 68, 68, 0.2)`:`rgba(245, 158, 11, 0.2)`}`},children:e.status})]},e.id))}):(0,V.jsx)(`div`,{style:{padding:20,textAlign:`center`,color:`var(--text-tertiary)`,fontSize:12,border:`1px dashed var(--border)`,borderRadius:8},children:`No pending research items. Trigger a research cycle to auto-update skill references.`})]}),(0,V.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:8},children:[(0,V.jsx)(`h3`,{id:`automation-improvements-heading`,style:{margin:0,fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:`💡 AI Skill Improvement Queue`}),(0,V.jsx)(`button`,{onClick:Ce,disabled:xe,style:{background:xe?`var(--bg-secondary)`:`linear-gradient(135deg, #10b981, #059669)`,color:`#fff`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:xe?`not-allowed`:`pointer`,flexShrink:0},children:xe?`⏳ Auditing Skills...`:`🤖 Run AI Audit`})]}),ye.length>0?(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:ye.map((e,t)=>(0,V.jsxs)(`div`,{id:`automation-suggestion-${t}`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`10px 14px`,background:`var(--bg-tertiary)`,borderRadius:8,border:`1px solid var(--border)`,gap:12},children:[(0,V.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:2,flexWrap:`wrap`},children:[(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.skillName}),(0,V.jsx)(`span`,{style:{fontSize:9,fontWeight:700,padding:`2px 8px`,borderRadius:10,textTransform:`uppercase`,letterSpacing:.3,background:e.problematic?`rgba(239, 68, 68, 0.1)`:`rgba(245, 158, 11, 0.1)`,color:e.problematic?`#f87171`:`#f59e0b`,border:`1px solid ${e.problematic?`rgba(239, 68, 68, 0.2)`:`rgba(245, 158, 11, 0.2)`}`},children:e.problematic?`Problematic`:`Outdated`})]}),(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-secondary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.description})]}),(0,V.jsx)(`button`,{id:`automation-fix-${t}`,style:{background:`var(--bg-elevated)`,color:`var(--text-primary)`,border:`1px solid var(--border)`,borderRadius:6,padding:`5px 12px`,fontSize:10,fontWeight:600,cursor:`pointer`,flexShrink:0,transition:`all 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`var(--accent)`,e.currentTarget.style.color=`#fff`},onMouseLeave:e=>{e.currentTarget.style.background=`var(--bg-elevated)`,e.currentTarget.style.color=`var(--text-primary)`},children:`🔧 Fix`})]},t))}):(0,V.jsx)(`div`,{style:{padding:20,textAlign:`center`,color:`var(--text-tertiary)`,fontSize:12,border:`1px dashed var(--border)`,borderRadius:8},children:`No improvement suggestions. All skills are well-configured. ✨`})]})]})]})}function zV(e){if(!e)return``;let t=e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);return t=t.replace(/^### (.*$)/gim,`<h3>$1</h3>`),t=t.replace(/^## (.*$)/gim,`<h2>$1</h2>`),t=t.replace(/^# (.*$)/gim,`<h1>$1</h1>`),t=t.replace(/\*\*(.*?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/\*(.*?)\*/g,`<em>$1</em>`),t=t.replace(/```([\s\S]*?)```/g,`<pre style="background:rgba(0,0,0,0.3);padding:12px;border-radius:6px;border:1px solid rgba(255,255,255,0.06);font-family:monospace;overflow-x:auto;margin:12px 0;"><code>$1</code></pre>`),t=t.replace(/`(.*?)`/g,`<code style="background:rgba(255,255,255,0.06);padding:2px 6px;border-radius:4px;font-family:monospace;">$1</code>`),t=t.replace(/^> (.*$)/gim,`<blockquote style="border-left:4px solid var(--purple-primary);padding-left:14px;color:var(--text-secondary);margin:16px 0;font-style:italic;">$1</blockquote>`),t=t.replace(/^- (.*$)/gim,`<li style="margin-left:20px;list-style-type:disc;">$1</li>`),t=t.replace(/\n/g,`<br />`),(0,V.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t},className:`markdown-preview-block`})}function BV(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``);return(0,v.useEffect)(()=>{async function e(){try{let e=await gi();t(e.topics),e.topics.length>0&&r(e.topics[0].id)}catch(e){l(e.message||`Failed to load help topics`)}}e()},[]),(0,v.useEffect)(()=>{if(!n)return;async function e(){s(!0);try{a((await _i(n)).content)}catch(e){l(e.message||`Failed to load help details`)}finally{s(!1)}}e()},[n]),(0,V.jsxs)(`div`,{className:`page`,style:{padding:`24px`,maxWidth:`1100px`,margin:`0 auto`},children:[(0,V.jsxs)(`div`,{className:`page-header`,style:{marginBottom:`24px`},children:[(0,V.jsx)(`h1`,{children:`Help & CLI Reference`}),(0,V.jsx)(`p`,{children:`Offline docs for portable memory: CLI commands, vault layout, dream, tasks, and IDE connect.`})]}),c&&(0,V.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:`16px`},children:[`⚠️ `,c]}),(0,V.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`260px 1fr`,gap:`30px`,minHeight:`500px`},children:[(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`10px`},children:e.map(e=>(0,V.jsxs)(`button`,{onClick:()=>r(e.id),style:{textAlign:`left`,padding:`12px 16px`,borderRadius:`8px`,background:n===e.id?`var(--purple-primary)`:`rgba(255, 255, 255, 0.03)`,color:`#fff`,border:n===e.id?`1px solid var(--purple-border)`:`1px solid transparent`,cursor:`pointer`,transition:`all 0.2s`},children:[(0,V.jsx)(`div`,{style:{fontWeight:`bold`,fontSize:`14px`},children:e.title}),(0,V.jsx)(`div`,{style:{fontSize:`11px`,color:n===e.id?`rgba(255, 255, 255, 0.8)`:`var(--text-secondary)`,marginTop:`4px`},children:e.description})]},e.id))}),(0,V.jsx)(`div`,{style:{background:`var(--surface-bg)`,border:`1px solid var(--border)`,borderRadius:`12px`,padding:`30px`,overflowY:`auto`,maxHeight:`75vh`},children:o?(0,V.jsx)(`div`,{className:`skeleton`,style:{height:`400px`}}):(0,V.jsx)(`div`,{className:`markdown-body`,style:{color:`var(--text-primary)`,lineHeight:`1.7`,fontSize:`14px`},children:zV(i)})})]})]})}function VV({activeBrainId:e}){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!0),[l,u]=(0,v.useState)([]);return(0,v.useEffect)(()=>{async function t(){c(!0);try{let[t,r,a]=await Promise.all([dr(e).catch(()=>[]),Zr().catch(()=>({items:[]})),sr().catch(()=>[])]);n(t),i(r.items||[]),o(a)}catch(e){console.error(`Failed to load graph data`,e)}finally{c(!1)}}t()},[e]),(0,V.jsxs)(`div`,{className:`page`,style:{padding:0,height:`calc(100vh - 1px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,V.jsxs)(`div`,{style:{padding:`16px 24px`,background:`rgba(18, 18, 26, 0.45)`,backdropFilter:`blur(16px)`,borderBottom:`1px solid var(--border)`,flexShrink:0},children:[(0,V.jsx)(`h1`,{style:{fontSize:`18px`,fontWeight:700,letterSpacing:`-0.02em`},children:`Memory Graph`}),(0,V.jsx)(`p`,{style:{fontSize:`12px`,color:`var(--text-secondary)`,marginTop:`2px`},children:`3D vault map — facts (blue), rules (cyan/rose), research (amber), sessions (teal).`})]}),(0,V.jsx)(`div`,{style:{flex:1,position:`relative`,overflow:`hidden`},children:s?(0,V.jsx)(`div`,{className:`skeleton`,style:{width:`100%`,height:`100%`}}):t.length===0&&r.length===0&&a.length===0?(0,V.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`var(--text-secondary)`},children:`No nodes found for graph`}):(0,V.jsx)(H,{threads:a,memoryNodes:t,researchItems:r,onOpenThread:()=>{},onGroundMemoryNode:e=>{u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},selectedGroundingNodes:l})})]})}function HV(e,t=140){let n=e.body||e.content||e.excerpt||``;return n.length<=t?n:n.slice(0,t).trimEnd()+`…`}function UV(e){return{invariant:{bg:`rgba(239, 68, 68, 0.15)`,fg:`#ef4444`,icon:`⚡`},preference:{bg:`rgba(59, 130, 246, 0.15)`,fg:`#3b82f6`,icon:`⭐`},fact:{bg:`rgba(16, 185, 129, 0.15)`,fg:`#10b981`,icon:`📌`},concept:{bg:`rgba(245, 158, 11, 0.15)`,fg:`#f59e0b`,icon:`💡`},pattern:{bg:`rgba(139, 92, 246, 0.15)`,fg:`#8b5cf6`,icon:`🔄`},decision:{bg:`rgba(236, 72, 153, 0.15)`,fg:`#ec4899`,icon:`⚖️`},lore:{bg:`rgba(156, 163, 175, 0.15)`,fg:`#9ca3af`,icon:`📜`}}[e]||{bg:`rgba(148, 163, 184, 0.12)`,fg:`#94a3b8`,icon:`📄`}}function WV(e){return!e||e===`global`?`Global System Brain`:e.split(`,`).map(e=>{let t=e.trim();return t===`global`?`Global`:t.startsWith(`project:`)?t.slice(8):t.startsWith(`tenant:`)?`tenant:${t.slice(7)}`:t}).join(` + `)}function GV({activeBrainId:e=`global`}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(!0),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(`.`),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)([]),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(null),E=(0,v.useRef)(null),D=async e=>{C(!0),o(!0);try{let t=await yr(e);x(t),i(t.length),n(t.length>0),T(null)}catch{x([]),n(!1)}finally{C(!1),o(!1)}},O=async()=>{try{c(await ti())}catch{c(null)}};(0,v.useEffect)(()=>{D(e||`global`),O();let t=setInterval(O,15e3);return()=>clearInterval(t)},[e]);let k=async t=>{m(!0),f(``),g(!1);try{let n=await xr(`
|
|
309
|
+
const { execSync } = require('child_process');
|
|
310
|
+
try {
|
|
311
|
+
const out = execSync(${JSON.stringify(t)}, { encoding: 'utf8', timeout: 60000 });
|
|
312
|
+
console.log(out);
|
|
313
|
+
} catch (e) {
|
|
314
|
+
console.error(e.stderr || e.message);
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}`,6e4);f(n.output),g(!n.success),n.success&&await D(e||`global`)}catch(e){f(e.message),g(!0)}finally{m(!1)}};return(0,V.jsxs)(`div`,{className:`dashboard-wrapper`,children:[(0,V.jsx)(`style`,{children:`
|
|
317
|
+
.dashboard-wrapper {
|
|
318
|
+
padding: 32px 40px 100px;
|
|
319
|
+
max-width: 1400px;
|
|
320
|
+
margin: 0 auto;
|
|
321
|
+
animation: fade-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.dashboard-header-sticky {
|
|
325
|
+
position: sticky;
|
|
326
|
+
top: 0;
|
|
327
|
+
z-index: 50;
|
|
328
|
+
background: rgba(7, 11, 20, 0.85);
|
|
329
|
+
backdrop-filter: blur(24px);
|
|
330
|
+
-webkit-backdrop-filter: blur(24px);
|
|
331
|
+
padding: 24px 0;
|
|
332
|
+
margin-bottom: 32px;
|
|
333
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
334
|
+
display: flex;
|
|
335
|
+
justify-content: space-between;
|
|
336
|
+
align-items: flex-end;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.stat-grid {
|
|
340
|
+
display: grid;
|
|
341
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
342
|
+
gap: 20px;
|
|
343
|
+
margin-bottom: 32px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.stat-card {
|
|
347
|
+
background: rgba(23, 32, 51, 0.4);
|
|
348
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
349
|
+
border-radius: 16px;
|
|
350
|
+
padding: 24px;
|
|
351
|
+
position: relative;
|
|
352
|
+
overflow: hidden;
|
|
353
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
|
354
|
+
transition: all 0.3s ease;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.stat-card:hover {
|
|
358
|
+
border-color: rgba(255, 255, 255, 0.12);
|
|
359
|
+
transform: translateY(-2px);
|
|
360
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.stat-card::before {
|
|
364
|
+
content: '';
|
|
365
|
+
position: absolute;
|
|
366
|
+
top: 0; left: 0; right: 0; height: 100%;
|
|
367
|
+
background: radial-gradient(circle at top right, rgba(255,255,255,0.03), transparent 60%);
|
|
368
|
+
pointer-events: none;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.node-grid {
|
|
372
|
+
display: grid;
|
|
373
|
+
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
|
374
|
+
gap: 16px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.node-card {
|
|
378
|
+
background: rgba(23, 32, 51, 0.3);
|
|
379
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
380
|
+
border-radius: 14px;
|
|
381
|
+
padding: 20px;
|
|
382
|
+
cursor: pointer;
|
|
383
|
+
transition: all 0.2s ease;
|
|
384
|
+
display: flex;
|
|
385
|
+
flex-direction: column;
|
|
386
|
+
height: 100%;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.node-card:hover {
|
|
390
|
+
background: rgba(36, 51, 82, 0.5);
|
|
391
|
+
border-color: rgba(59, 130, 246, 0.4);
|
|
392
|
+
transform: translateY(-2px);
|
|
393
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.node-badge {
|
|
397
|
+
display: inline-flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
gap: 6px;
|
|
400
|
+
padding: 4px 10px;
|
|
401
|
+
border-radius: 6px;
|
|
402
|
+
font-size: 11px;
|
|
403
|
+
font-weight: 600;
|
|
404
|
+
text-transform: uppercase;
|
|
405
|
+
letter-spacing: 0.5px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.drawer-overlay {
|
|
409
|
+
position: fixed;
|
|
410
|
+
inset: 0;
|
|
411
|
+
background: rgba(0, 0, 0, 0.6);
|
|
412
|
+
backdrop-filter: blur(4px);
|
|
413
|
+
z-index: 8000;
|
|
414
|
+
display: flex;
|
|
415
|
+
justify-content: flex-end;
|
|
416
|
+
animation: fade-in 0.2s ease-out;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.drawer-panel {
|
|
420
|
+
width: 100%;
|
|
421
|
+
maxWidth: 600px;
|
|
422
|
+
height: 100%;
|
|
423
|
+
background: var(--bg-primary);
|
|
424
|
+
border-left: 1px solid var(--border);
|
|
425
|
+
overflow-y: auto;
|
|
426
|
+
padding: 40px;
|
|
427
|
+
box-shadow: -8px 0 40px rgba(0,0,0,0.5);
|
|
428
|
+
animation: slide-in-right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.btn-primary {
|
|
432
|
+
background: linear-gradient(135deg, var(--accent), #2563eb);
|
|
433
|
+
color: #fff;
|
|
434
|
+
border: none;
|
|
435
|
+
padding: 10px 20px;
|
|
436
|
+
border-radius: 8px;
|
|
437
|
+
font-weight: 600;
|
|
438
|
+
font-size: 13px;
|
|
439
|
+
cursor: pointer;
|
|
440
|
+
transition: all 0.2s ease;
|
|
441
|
+
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
|
|
442
|
+
}
|
|
443
|
+
.btn-primary:hover:not(:disabled) {
|
|
444
|
+
transform: translateY(-2px);
|
|
445
|
+
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
|
|
446
|
+
}
|
|
447
|
+
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
|
|
448
|
+
|
|
449
|
+
.btn-ghost {
|
|
450
|
+
background: rgba(255, 255, 255, 0.05);
|
|
451
|
+
color: var(--text-primary);
|
|
452
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
453
|
+
padding: 10px 20px;
|
|
454
|
+
border-radius: 8px;
|
|
455
|
+
font-weight: 500;
|
|
456
|
+
font-size: 13px;
|
|
457
|
+
cursor: pointer;
|
|
458
|
+
transition: all 0.2s ease;
|
|
459
|
+
}
|
|
460
|
+
.btn-ghost:hover:not(:disabled) {
|
|
461
|
+
background: rgba(255, 255, 255, 0.1);
|
|
462
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.pulse-dot {
|
|
466
|
+
width: 10px; height: 10px;
|
|
467
|
+
border-radius: 50%;
|
|
468
|
+
background: #10b981;
|
|
469
|
+
box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
|
|
470
|
+
animation: pulse 2s infinite;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.terminal-log {
|
|
474
|
+
background: rgba(0, 0, 0, 0.5);
|
|
475
|
+
border: 1px solid rgba(255,255,255,0.08);
|
|
476
|
+
border-radius: 8px;
|
|
477
|
+
padding: 16px;
|
|
478
|
+
font-family: 'JetBrains Mono', monospace;
|
|
479
|
+
font-size: 12px;
|
|
480
|
+
color: #a8b2d1;
|
|
481
|
+
white-space: pre-wrap;
|
|
482
|
+
max-height: 240px;
|
|
483
|
+
overflow-y: auto;
|
|
484
|
+
margin-top: 16px;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
@keyframes fade-in {
|
|
488
|
+
from { opacity: 0; }
|
|
489
|
+
to { opacity: 1; }
|
|
490
|
+
}
|
|
491
|
+
@keyframes slide-in-right {
|
|
492
|
+
from { transform: translateX(100%); }
|
|
493
|
+
to { transform: translateX(0); }
|
|
494
|
+
}
|
|
495
|
+
@keyframes pulse {
|
|
496
|
+
0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
|
|
497
|
+
70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
|
|
498
|
+
100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
|
|
499
|
+
}
|
|
500
|
+
`}),(0,V.jsxs)(`div`,{className:`dashboard-header-sticky`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{style:{fontSize:32,fontWeight:700,margin:0,background:`linear-gradient(to right, #fff, #93c5fd)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,letterSpacing:`-0.5px`},children:`System Dashboard`}),(0,V.jsxs)(`p`,{style:{margin:`6px 0 0`,color:`var(--text-secondary)`,fontSize:15},children:[`Overview for `,(0,V.jsx)(`strong`,{style:{color:`var(--text-primary)`,fontWeight:600},children:WV(e)})]})]}),(0,V.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,V.jsx)(`button`,{className:`btn-ghost`,onClick:()=>y(!_),children:_?`Hide Operations`:`⚙️ Operations`})})]}),(0,V.jsxs)(`div`,{className:`stat-grid`,children:[(0,V.jsxs)(`div`,{className:`stat-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,V.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`rgba(59, 130, 246, 0.15)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:20},children:`🧠`}),a?(0,V.jsx)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Syncing...`}):(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:t?`#10b981`:`#f59e0b`,background:t?`rgba(16,185,129,0.1)`:`rgba(245,158,11,0.1)`,padding:`4px 10px`,borderRadius:20},children:t?`Active`:`Uninitialized`})]}),(0,V.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`,fontWeight:500,textTransform:`uppercase`,letterSpacing:.5,marginBottom:4},children:`OpenWiki Nodes`}),(0,V.jsx)(`div`,{style:{fontSize:36,fontWeight:700,color:`var(--text-primary)`,lineHeight:1},children:r})]}),(0,V.jsxs)(`div`,{className:`stat-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,V.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`rgba(16, 185, 129, 0.15)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:20},children:`⚡`}),(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[s?.status!==`unreachable`&&(0,V.jsx)(`div`,{className:`pulse-dot`}),(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:s?.status===`unreachable`?`#ef4444`:`#10b981`},children:s?.status===`unreachable`?`Offline`:`Online`})]})]}),(0,V.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`,fontWeight:500,textTransform:`uppercase`,letterSpacing:.5,marginBottom:4},children:`Server Status`}),(0,V.jsx)(`div`,{style:{fontSize:28,fontWeight:600,color:`var(--text-primary)`,lineHeight:1.2},children:s?.version?`v${s.version}`:`Unknown`})]}),(0,V.jsxs)(`div`,{className:`stat-card`,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,V.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`rgba(139, 92, 246, 0.15)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:20},children:`🛡️`}),(0,V.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`#8b5cf6`,background:`rgba(139,92,246,0.1)`,padding:`4px 10px`,borderRadius:20},children:s?.daemon===`running`?`Protected`:`Standard`})]}),(0,V.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`,fontWeight:500,textTransform:`uppercase`,letterSpacing:.5,marginBottom:4},children:`Daemon Process`}),(0,V.jsx)(`div`,{style:{fontSize:28,fontWeight:600,color:`var(--text-primary)`,lineHeight:1.2,textTransform:`capitalize`},children:s?.daemon||`Offline`})]})]}),_&&(0,V.jsxs)(`div`,{className:`stat-card`,style:{marginBottom:32,padding:32,animation:`fade-in 0.3s ease-out`},children:[(0,V.jsx)(`h2`,{style:{fontSize:18,fontWeight:600,margin:`0 0 20px`},children:`Repository Operations`}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16,alignItems:`flex-end`,flexWrap:`wrap`},children:[(0,V.jsxs)(`div`,{style:{flex:1,minWidth:280},children:[(0,V.jsx)(`label`,{style:{display:`block`,fontSize:13,color:`var(--text-secondary)`,marginBottom:8,fontWeight:500},children:`Target Directory`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`Path to directory (default: .)`,value:l,onChange:e=>u(e.target.value),style:{width:`100%`,padding:`12px 16px`,background:`rgba(0,0,0,0.3)`,border:`1px solid rgba(255,255,255,0.1)`,borderRadius:8,color:`white`,outline:`none`}})]}),(0,V.jsx)(`button`,{className:`btn-ghost`,onClick:()=>k(`npx -y openwiki --init`),disabled:p,children:p?`⏳ Working...`:`Initialize OpenWiki`}),(0,V.jsx)(`button`,{className:`btn-primary`,onClick:()=>k(`npx total-recall ingest openwiki ${JSON.stringify(l.trim()||`.`)}`),disabled:p,children:p?`⏳ Ingesting...`:`Ingest into Memory`})]}),d&&(0,V.jsx)(`div`,{className:`terminal-log`,style:{borderColor:h?`rgba(239, 68, 68, 0.4)`:`rgba(255,255,255,0.08)`},children:d})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20},children:[(0,V.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,margin:0},children:`Knowledge Graph`}),(0,V.jsxs)(`span`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:[b.length,` nodes loaded`]})]}),S?(0,V.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 20px`,color:`var(--text-secondary)`,fontSize:15},children:[(0,V.jsx)(`div`,{style:{display:`inline-block`,width:24,height:24,border:`2px solid rgba(255,255,255,0.1)`,borderTopColor:`var(--accent)`,borderRadius:`50%`,animation:`spin 1s linear infinite`,marginBottom:16}}),(0,V.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`}),(0,V.jsx)(`div`,{children:`Syncing nodes...`})]}):b.length===0?(0,V.jsxs)(`div`,{className:`stat-card`,style:{textAlign:`center`,padding:`64px 24px`},children:[(0,V.jsx)(`div`,{style:{fontSize:48,marginBottom:16,opacity:.8},children:`📭`}),(0,V.jsx)(`h3`,{style:{fontSize:18,margin:`0 0 8px`},children:`No Knowledge Nodes Found`}),(0,V.jsxs)(`p`,{style:{color:`var(--text-secondary)`,fontSize:14,maxWidth:440,margin:`0 auto 24px`,lineHeight:1.6},children:[`The vault for `,(0,V.jsx)(`strong`,{children:WV(e)}),` is empty. Use the operations panel to ingest a repository or change your active brain.`]}),(0,V.jsx)(`button`,{className:`btn-primary`,onClick:()=>y(!0),children:`Open Operations`})]}):(0,V.jsx)(`div`,{className:`node-grid`,children:b.map(e=>{let t=UV(e.category);return(0,V.jsxs)(`div`,{className:`node-card`,onClick:()=>T(e),children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,marginBottom:12},children:[(0,V.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0,lineHeight:1.3,color:`#f8fafc`},children:e.title}),(0,V.jsxs)(`div`,{className:`node-badge`,style:{background:t.bg,color:t.fg},children:[t.icon,` `,e.category]})]}),(0,V.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:13,lineHeight:1.6,margin:`0 0 16px`,flex:1},children:HV(e)}),e.tags&&e.tags.length>0&&(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:[e.tags.slice(0,4).map(e=>(0,V.jsxs)(`span`,{style:{fontSize:11,background:`rgba(255,255,255,0.06)`,padding:`2px 8px`,borderRadius:4,color:`var(--text-tertiary)`},children:[`#`,e]},e)),e.tags.length>4&&(0,V.jsxs)(`span`,{style:{fontSize:11,background:`rgba(255,255,255,0.02)`,padding:`2px 8px`,borderRadius:4,color:`var(--text-tertiary)`},children:[`+`,e.tags.length-4]})]})]},e.slug)})})]}),w&&(0,V.jsx)(`div`,{className:`drawer-overlay`,onClick:e=>{E.current&&!E.current.contains(e.target)&&T(null)},children:(0,V.jsxs)(`div`,{className:`drawer-panel`,ref:E,children:[(0,V.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:32},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:12},children:[(()=>{let e=UV(w.category);return(0,V.jsxs)(`span`,{className:`node-badge`,style:{background:e.bg,color:e.fg},children:[e.icon,` `,w.category]})})(),(0,V.jsx)(`span`,{style:{fontSize:13,color:`var(--text-tertiary)`,fontFamily:`var(--font-mono)`},children:w.slug})]}),(0,V.jsx)(`h2`,{style:{fontSize:28,fontWeight:700,margin:0,lineHeight:1.2},children:w.title})]}),(0,V.jsx)(`button`,{className:`btn-ghost`,onClick:()=>T(null),style:{padding:`8px 12px`,fontSize:16},children:`✕`})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:24,background:`rgba(255,255,255,0.02)`,padding:16,borderRadius:12,border:`1px solid rgba(255,255,255,0.05)`},children:[w.importance!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,marginBottom:4},children:`Importance`}),(0,V.jsxs)(`div`,{style:{fontSize:14,fontWeight:600},children:[w.importance,`/5`]})]}),w.modality&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,marginBottom:4},children:`Modality`}),(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:600,textTransform:`capitalize`},children:w.modality})]}),w.priority&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,marginBottom:4},children:`Priority`}),(0,V.jsx)(`div`,{style:{fontSize:14,fontWeight:600,textTransform:`capitalize`},children:w.priority})]})]}),(0,V.jsx)(`div`,{style:{background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.06)`,borderRadius:12,padding:24,fontSize:15,lineHeight:1.8,color:`var(--text-primary)`,whiteSpace:`pre-wrap`},children:w.body||w.content||w.excerpt||`No content available.`}),w.tags&&w.tags.length>0&&(0,V.jsxs)(`div`,{style:{marginTop:24},children:[(0,V.jsx)(`div`,{style:{fontSize:13,color:`var(--text-tertiary)`,marginBottom:8,fontWeight:500},children:`TAGS`}),(0,V.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:w.tags.map(e=>(0,V.jsxs)(`span`,{style:{fontSize:12,background:`rgba(255,255,255,0.08)`,padding:`4px 10px`,borderRadius:6},children:[`#`,e]},e))})]}),w.related&&w.related.length>0&&(0,V.jsxs)(`div`,{style:{marginTop:24},children:[(0,V.jsx)(`div`,{style:{fontSize:13,color:`var(--text-tertiary)`,marginBottom:8,fontWeight:500},children:`RELATED NODES`}),(0,V.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:w.related.map(e=>(0,V.jsx)(`span`,{style:{fontSize:12,background:`var(--bg-hover)`,border:`1px solid var(--border)`,padding:`4px 10px`,borderRadius:6,color:`var(--text-secondary)`},children:e},e))})]})]})})]})}function KV(){return localStorage.getItem(`tr-onboarding-complete`)===`1`}var qV=`tr-onboarding-v1`,JV=[{id:`welcome`,title:`Welcome to Total Recall`,body:`Portable personal memory for any IDE. Your rules and facts live as Markdown files on disk — not a locked vendor database.`},{id:`import-env`,title:`Import your API keys`,body:`Scan the machine for keys already in .env files or the shell, or paste a .env block. Nothing is written until you choose what to import.`},{id:`remember`,title:`Save your first memory`,body:`Write a fact or preference into the vault. This is the core write path: remember → compile → IDEs see it.`},{id:`connect`,title:`Connect an IDE`,body:`Wire Claude Code, Cursor, Codex, Gemini, Aider, Obsidian, or any HTTP host. Injected blocks never overwrite your local rules outside TR markers.`},{id:`dream`,title:`Dream consolidates memory`,body:`Dream is sleep for your vault: ingest sessions, conflict-check, recompile surfaces, prune. Run it anytime; no always-on LLM required.`},{id:`done`,title:`You're set`,body:`Default loop: init → connect → remember/recall → dream. Optional: task queue, skill track any repo, daemon in the background.`}];function YV(){try{return JSON.parse(localStorage.getItem(qV)||`{}`)}catch{return{step:0}}}function XV(e){localStorage.setItem(qV,JSON.stringify(e)),e.complete&&localStorage.setItem(`tr-onboarding-complete`,`1`)}function ZV(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e||e.startsWith(`#`))continue;let r=e.startsWith(`export `)?e.slice(7).trim():e,i=r.indexOf(`=`);if(i<=0)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();o=o.startsWith(`"`)&&o.endsWith(`"`)||o.startsWith(`'`)&&o.endsWith(`'`)?o.slice(1,-1):o.replace(/\s+#.*$/,``).trim(),a&&o&&(t[a]=o)}return t}function QV(){let e=ut(),t=YV(),[n,r]=(0,v.useState)(t.step||0),[i,a]=(0,v.useState)(t.fact||``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)([]),[m,h]=(0,v.useState)(new Set),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)({}),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(`scan`),D=JV[Math.min(n,JV.length-1)];(0,v.useEffect)(()=>{dr().then(e=>{let t=e||[],n=t.some(e=>e.slug===`user-profile`||e.slug===`onboarding-first-memory`||(e.tags||[]).includes(`onboarding`)),r=n||t.length>=5;d(n||r),r&&!KV()&&localStorage.setItem(`tr-onboarding-complete`,`1`)}).catch(()=>{})},[]),(0,v.useEffect)(()=>{if(D.id!==`import-env`||T!==`scan`)return;let e=!1;return Promise.resolve().then(()=>{w(!0),S(``)}),Pr().then(t=>{e||(p(t.candidates||[]),h(new Set((t.candidates||[]).filter(e=>!e.already_set).map(e=>e.key))))}).catch(t=>{e||S(t instanceof Error?t.message:`Scan failed`)}).finally(()=>{e||w(!1)}),()=>{e=!0}},[D.id,T]);function O(){let e=Math.min(n+1,JV.length-1);r(e),XV({step:e,fact:i}),s(``)}function k(){let e=Math.max(n-1,0);r(e),XV({step:e,fact:i}),s(``)}function A(e){h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function j(){h(new Set(f.filter(e=>!e.already_set).map(e=>e.key)))}function M(){h(new Set)}async function N(){if(!g.trim()){s(`Paste a .env block first.`);return}l(!0),S(``);try{b(ZV(g));let e=await Fr(g);p(e.candidates||[]),h(new Set((e.candidates||[]).filter(e=>!e.already_set).map(e=>e.key))),s(e.count?`Found ${e.count} importable key(s) in paste.`:`No known API key names in paste.`)}catch(e){S(e instanceof Error?e.message:`Parse failed`)}finally{l(!1)}}async function P(){let e=[...m];if(!e.length){s(`Select at least one key, or skip this step.`);return}l(!0),s(``);try{let t=T===`paste`&&Object.keys(y).length?await Ir({keys:e,pairs:y,overwrite:!1}):await Ir({keys:e,overwrite:!1});s(`Imported ${t.imported_count} secret(s)`+(t.skipped_count?`, skipped ${t.skipped_count} already set`:``)+`.`),T===`scan`?(p((await Pr()).candidates||[]),h(new Set)):(p(e=>e.map(e=>t.imported.some(t=>t.key===e.key)?{...e,already_set:!0}:e)),h(new Set))}catch(e){s(e instanceof Error?e.message:`Import failed`)}finally{l(!1)}}async function F(){if(!i.trim()){s(`Write a short fact or preference first.`);return}l(!0),s(``);try{await hr({slug:`onboarding-first-memory`,category:`preferences`,title:`Onboarding first memory`,content:i.trim(),tags:[`onboarding`],importance:4});try{await ii()}catch{}s(`Saved and queued surface compile.`),XV({step:n,fact:i}),O()}catch(e){s(e instanceof Error?e.message:`Failed to save memory`)}finally{l(!1)}}function I(){XV({step:JV.length-1,fact:i,complete:!0}),e(`/memory`)}let L=Math.round((n+1)/JV.length*100);return(0,V.jsxs)(`div`,{className:`onboarding-shell`,children:[D.id===`welcome`&&(0,V.jsx)(`div`,{style:{marginBottom:28,borderRadius:16,padding:`16px 20px`,background:`linear-gradient(180deg, #f8fafc 0%, #e8eef9 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 40px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148,163,184,0.2)`,display:`flex`,justifyContent:`center`},children:(0,V.jsx)(Di,{variant:`lockup`,height:64,alt:`Total Recall`})}),(0,V.jsxs)(`div`,{style:{marginBottom:28},children:[(0,V.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:10,letterSpacing:`0.08em`,textTransform:`uppercase`,fontWeight:600},children:[`Onboarding · `,n+1,`/`,JV.length]}),(0,V.jsx)(`div`,{className:`onboarding-progress`,children:(0,V.jsx)(`div`,{style:{width:`${L}%`}})})]}),(0,V.jsx)(`h1`,{style:{fontSize:28,fontWeight:700,margin:`0 0 12px`,letterSpacing:`-0.03em`,background:`linear-gradient(135deg, #f8fafc 0%, #93c5fd 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:D.title}),(0,V.jsx)(`p`,{style:{fontSize:15.5,lineHeight:1.6,color:`var(--text-secondary)`,margin:`0 0 28px`},children:D.body}),D.id===`welcome`&&(0,V.jsxs)(`div`,{className:`loop-card`,style:{marginBottom:24},children:[`write\xA0\xA0→ remember / session ingest`,(0,V.jsx)(`br`,{}),`sleep\xA0\xA0→ dream (consolidate, conflict, compile)`,(0,V.jsx)(`br`,{}),`read\xA0\xA0\xA0→ recall + compiled surfaces`,(0,V.jsx)(`br`,{}),`async\xA0\xA0→ daemon tasks (any intent under policy)`]}),D.id===`import-env`&&(0,V.jsxs)(`div`,{style:{marginBottom:24},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:14},children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>E(`scan`),style:T===`scan`?iH:aH,children:`Scan machine`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{E(`paste`),p([]),h(new Set)},style:T===`paste`?iH:aH,children:`Paste .env`})]}),T===`paste`&&(0,V.jsxs)(`div`,{style:{marginBottom:14},children:[(0,V.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value),placeholder:`OPENAI_API_KEY=sk-...
|
|
501
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
502
|
+
GOOGLE_API_KEY=...`,rows:6,style:{width:`100%`,boxSizing:`border-box`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:10,padding:12,color:`var(--text-primary)`,fontSize:12,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,resize:`vertical`}}),(0,V.jsx)(`button`,{type:`button`,disabled:c,onClick:N,style:{...tH,marginTop:8},children:`Preview keys in paste`})]}),C&&(0,V.jsx)(`p`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:`Scanning env sources…`}),x&&(0,V.jsx)(`p`,{style:{fontSize:13,color:`#f87171`,marginBottom:12},children:x}),!C&&f.length===0&&!x&&(0,V.jsx)(`div`,{style:{padding:14,borderRadius:10,border:`1px solid var(--border)`,background:`rgba(148,163,184,0.06)`,fontSize:13,color:`var(--text-secondary)`,marginBottom:12},children:T===`scan`?`No known API keys found in process.env or common .env paths (~/.agent/.env, project .env, …). Paste a .env or continue and set keys later with secret set.`:`Paste your .env and click Preview.`}),f.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:10,flexWrap:`wrap`},children:[(0,V.jsx)(`button`,{type:`button`,onClick:j,style:rH,children:`Select new`}),(0,V.jsx)(`button`,{type:`button`,onClick:M,style:rH,children:`Clear`}),(0,V.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`,alignSelf:`center`},children:[m.size,` selected · values never shown raw`]})]}),(0,V.jsx)(`div`,{style:{maxHeight:280,overflowY:`auto`,border:`1px solid var(--border)`,borderRadius:12,marginBottom:12},children:f.map(e=>(0,V.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderBottom:`1px solid var(--border)`,cursor:e.already_set?`default`:`pointer`,opacity:e.already_set?.55:1,background:m.has(e.key)?`rgba(59,130,246,0.08)`:`transparent`},children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:m.has(e.key),disabled:!!e.already_set,onChange:()=>A(e.key),style:{accentColor:`#3b82f6`}}),(0,V.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,V.jsxs)(`div`,{style:{fontSize:12,fontWeight:600,fontFamily:`ui-monospace, monospace`},children:[e.key,e.provider&&(0,V.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#93c5fd`,fontWeight:500},children:e.provider}),e.already_set&&(0,V.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#34d399`},children:`already set`})]}),(0,V.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:2},children:[e.masked,` · `,e.source_label]})]})]},e.key+e.source_label))}),(0,V.jsx)(`button`,{type:`button`,disabled:c||m.size===0,onClick:P,style:{...eH,opacity:c||m.size===0?.5:1,cursor:c||m.size===0?`not-allowed`:`pointer`},children:c?`Importing…`:`Import ${m.size} secret(s)`})]}),(0,V.jsxs)(`p`,{style:{marginTop:14,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI: `,(0,V.jsx)(`code`,{children:`npx total-recall secret import-env --all`}),` · `,(0,V.jsx)(An,{to:`/keys`,style:{color:`var(--accent)`},children:`Secrets page`})]})]}),D.id===`remember`&&(0,V.jsxs)(`div`,{style:{marginBottom:24},children:[(0,V.jsx)(`label`,{style:{fontSize:12,fontWeight:600,color:`var(--text-tertiary)`,display:`block`,marginBottom:8},children:`First memory (fact or preference)`}),(0,V.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),placeholder:`e.g. "I prefer short answers and single quotes in JS."`,rows:4,style:{width:`100%`,boxSizing:`border-box`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:10,padding:12,color:`var(--text-primary)`,fontSize:14,resize:`vertical`}}),(0,V.jsx)(`button`,{type:`button`,disabled:c,onClick:F,style:{...eH,marginTop:12},children:c?`Saving…`:`Save to vault & continue`})]}),D.id===`connect`&&(0,V.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,V.jsx)(`code`,{style:$V,children:`npx total-recall connect claude-code`}),(0,V.jsx)(`code`,{style:$V,children:`npx total-recall connect cursor`}),(0,V.jsx)(`code`,{style:$V,children:`npx total-recall connect http-api --brain http://localhost:3000`}),(0,V.jsx)(An,{to:`/integrations`,style:{fontSize:13,color:`var(--accent)`},children:`Open Integrations page →`})]}),D.id===`dream`&&(0,V.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,V.jsx)(`code`,{style:$V,children:`npx total-recall dream`}),(0,V.jsx)(`code`,{style:$V,children:`npx total-recall daemon start # optional background worker`}),(0,V.jsx)(`code`,{style:$V,children:`npx total-recall task add "Extract decisions from last session" --cap vault:write`}),(0,V.jsx)(An,{to:`/tasks`,style:{fontSize:13,color:`var(--accent)`},children:`Open Tasks page →`})]}),D.id===`done`&&(0,V.jsxs)(`div`,{style:{marginBottom:24,padding:16,borderRadius:12,background:`rgba(34,197,94,0.08)`,border:`1px solid rgba(34,197,94,0.25)`,fontSize:14,color:`var(--text-secondary)`},children:[u?`Vault already has onboarding profile data — you can jump to Memory anytime.`:`Optional: chat with the assistant to run the full preference interview (user-profile.md).`,(0,V.jsxs)(`div`,{style:{marginTop:12,display:`flex`,gap:12,flexWrap:`wrap`},children:[(0,V.jsx)(An,{to:`/`,style:nH,children:`Open Chat`}),(0,V.jsx)(An,{to:`/memory`,style:nH,children:`Open Vault`}),(0,V.jsx)(An,{to:`/integrations`,style:nH,children:`Connect IDE`})]})]}),o&&(0,V.jsx)(`p`,{style:{fontSize:13,color:o.startsWith(`Saved`)||o.startsWith(`Imported`)||o.startsWith(`Found`)?`#22c55e`:`#f59e0b`,marginBottom:16},children:o}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10,justifyContent:`space-between`},children:[(0,V.jsx)(`button`,{type:`button`,onClick:k,disabled:n===0,style:tH,children:`Back`}),(0,V.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[D.id!==`done`&&D.id!==`remember`&&(0,V.jsx)(`button`,{type:`button`,onClick:O,style:eH,children:(D.id,`Continue`)}),D.id===`import-env`&&(0,V.jsx)(`button`,{type:`button`,onClick:O,style:tH,children:`Skip for now`}),D.id===`remember`&&(0,V.jsx)(`button`,{type:`button`,onClick:O,style:tH,children:`Skip for now`}),D.id===`done`&&(0,V.jsx)(`button`,{type:`button`,onClick:I,style:eH,children:`Go to Memory`})]})]}),(0,V.jsxs)(`p`,{style:{marginTop:32,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI-first: `,(0,V.jsx)(`code`,{children:`init → secret import-env --all → connect → remember → dream`})]}),n<JV.length-1&&(0,V.jsx)(`button`,{type:`button`,onClick:I,style:{...tH,marginTop:16,width:`100%`},children:`Skip onboarding → Memory`})]})}var $V={display:`block`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`10px 12px`,fontSize:12,color:`var(--text-secondary)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,overflowX:`auto`},eH={background:`linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%)`,color:`#fff`,border:`none`,borderRadius:12,padding:`11px 20px`,fontWeight:600,cursor:`pointer`,fontSize:14,boxShadow:`0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 20px rgba(37, 99, 235, 0.28)`},tH={background:`rgba(148, 163, 184, 0.06)`,color:`var(--text-secondary)`,border:`1px solid var(--border)`,borderRadius:12,padding:`11px 20px`,cursor:`pointer`,fontSize:14},nH={...tH,textDecoration:`none`,display:`inline-block`},rH={...tH,padding:`5px 10px`,fontSize:11},iH={...eH,padding:`8px 14px`,fontSize:12},aH={...tH,padding:`8px 14px`,fontSize:12};function oH({ok:e,label:t}){return(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:e?`#22c55e`:`#ef4444`,boxShadow:e?`0 0 6px rgba(34,197,94,0.5)`:`0 0 6px rgba(239,68,68,0.5)`,display:`inline-block`,animation:e?void 0:`blink 1s ease-in-out infinite`}}),t]})}function sH({onLogout:e,health:t,activeBrainId:n,onBrainChange:r}){return(0,V.jsxs)(`aside`,{className:`sidebar`,children:[(0,V.jsxs)(`div`,{className:`sidebar-brand`,children:[(0,V.jsx)(`div`,{className:`sidebar-brand-lockup`,title:`Total Recall`,children:(0,V.jsx)(Di,{variant:`lockup`,height:48,alt:`Total Recall`})}),(0,V.jsx)(`span`,{style:{paddingLeft:2},children:`Portable memory · any IDE`})]}),(0,V.jsxs)(`nav`,{className:`sidebar-nav`,children:[(0,V.jsx)(`div`,{className:`nav-section-label`,children:`Memory`}),!KV()&&(0,V.jsxs)(jn,{to:`/onboarding`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-onboarding`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,V.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,V.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup`]}),(0,V.jsxs)(jn,{to:`/`,end:!0,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-chat`,children:[(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z`})}),`Chat`]}),(0,V.jsxs)(jn,{to:`/memory`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-memory`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`M12 16v-4M12 8h.01`})]}),`Vault`]}),(0,V.jsxs)(jn,{to:`/graph`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-graph`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`5`,cy:`6`,r:`2`}),(0,V.jsx)(`circle`,{cx:`19`,cy:`6`,r:`2`}),(0,V.jsx)(`circle`,{cx:`12`,cy:`18`,r:`2`}),(0,V.jsx)(`path`,{d:`M7 7l4 9M17 7l-4 9`})]}),`Graph`]}),(0,V.jsxs)(jn,{to:`/tasks`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-tasks`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M9 11l3 3L22 4`}),(0,V.jsx)(`path`,{d:`M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11`})]}),`Tasks`]}),(0,V.jsx)(`div`,{className:`nav-section-label`,children:`Connect`}),(0,V.jsxs)(jn,{to:`/integrations`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-integrations`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71`}),(0,V.jsx)(`path`,{d:`M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71`})]}),`IDEs`]}),(0,V.jsxs)(jn,{to:`/skills`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-skills`,children:[(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5`})}),`Skills`]}),(0,V.jsxs)(jn,{to:`/openwiki`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-openwiki`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2z`}),(0,V.jsx)(`path`,{d:`M22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7z`})]}),`OpenWiki`]}),(0,V.jsx)(`div`,{className:`nav-section-label`,children:`Account`}),(0,V.jsxs)(jn,{to:`/keys`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-keys`,children:[(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M21 2l-2 2m-7.61 7.61a5.5 5.5 0 11-7.778 7.778 5.5 5.5 0 017.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4`})}),`Keys & Usage`]}),(0,V.jsxs)(jn,{to:`/settings`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-settings`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,V.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z`})]}),`Settings`]}),(0,V.jsxs)(jn,{to:`/help`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-help`,children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`path`,{d:`M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3`}),(0,V.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),`Help`]}),KV()&&(0,V.jsxs)(jn,{to:`/onboarding`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-onboarding-replay`,style:{opacity:.75},children:[(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,V.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,V.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup guide`]})]}),(0,V.jsxs)(`div`,{className:`sidebar-footer`,style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,V.jsx)(PV,{activeBrainId:n,onBrainChange:r}),(0,V.jsxs)(`select`,{value:Yn(),onChange:e=>Xn(e.target.value),title:`API host`,style:{width:`100%`,background:`rgba(148, 163, 184, 0.06)`,color:`var(--text-tertiary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`5px 8px`,fontSize:10,outline:`none`},children:[(0,V.jsx)(`option`,{value:``,children:`Local API`}),void 0]}),(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,fontSize:11},children:(()=>{let e=t?.daemon===`running`,n=t&&t.status!==`unreachable`,r=e&&n;return t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{children:`@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }`}),r?(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,V.jsx)(`span`,{className:`pulse`}),` All Systems Go`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(oH,{ok:!!n,label:n?`Server online`:`Server offline`}),(0,V.jsx)(oH,{ok:e,label:e?`Daemon`:`Daemon `+(t?.daemon??`unknown`)})]})]}):(0,V.jsx)(`div`,{style:{color:`var(--text-tertiary)`},children:`Checking…`})})()}),(0,V.jsxs)(`button`,{id:`btn-logout`,onClick:e,title:`Sign out`,style:{background:`none`,border:`1px solid var(--border)`,borderRadius:6,cursor:`pointer`,color:`var(--text-tertiary)`,display:`flex`,alignItems:`center`,gap:5,padding:`4px 8px`,fontSize:11,transition:`color 0.15s, border-color 0.15s`},onMouseEnter:e=>{e.currentTarget.style.color=`#ef4444`,e.currentTarget.style.borderColor=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.color=`var(--text-tertiary)`,e.currentTarget.style.borderColor=`var(--border)`},children:[(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4`}),(0,V.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,V.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]}),`Sign out`]})]})]})]})}function cH(){let e=st();return!KV()&&e.pathname!==`/onboarding`?(0,V.jsx)(Ft,{to:`/onboarding`,replace:!0}):null}function lH({activeBrainId:e,onBrainChange:t}){let n=st(),r=n.pathname===`/`||n.pathname===`/chat`,[i,a]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=()=>a(e=>!e);return window.addEventListener(`toggle-floating-chat`,e),()=>window.removeEventListener(`toggle-floating-chat`,e)},[]),(0,V.jsxs)(`main`,{className:`main-content`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,position:`relative`},children:[(0,V.jsx)(cH,{}),(0,V.jsxs)(`div`,{style:i?{display:`flex`,position:`fixed`,bottom:20,right:20,width:400,height:600,zIndex:9999,backgroundColor:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:12,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.4)`,overflow:`hidden`,flexDirection:`column`}:{display:r||i?`flex`:`none`,flex:1,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[i&&(0,V.jsxs)(`div`,{style:{padding:`8px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,V.jsxs)(`span`,{style:{fontSize:12,fontWeight:600,display:`flex`,alignItems:`center`,gap:8},children:[(0,V.jsx)(`img`,{src:`/brand/total-recall-icon.svg`,alt:``,width:18,height:18,style:{borderRadius:4}}),`Total Recall`]}),(0,V.jsx)(`button`,{onClick:()=>a(!1),style:{background:`none`,border:`none`,cursor:`pointer`,color:`var(--text-tertiary)`},children:`✖`})]}),(0,V.jsx)(Ii,{activeBrainId:e,onBrainChange:t})]}),(!r||i)&&(0,V.jsx)(`div`,{style:{flex:1,overflow:`auto`},children:(0,V.jsxs)(Rt,{children:[(0,V.jsx)(It,{path:`/`,element:(0,V.jsx)(Ft,{to:KV()?`/openwiki`:`/onboarding`,replace:!0})}),(0,V.jsx)(It,{path:`/chat`,element:(0,V.jsx)(Ii,{activeBrainId:e})}),(0,V.jsx)(It,{path:`/onboarding`,element:(0,V.jsx)(QV,{})}),(0,V.jsx)(It,{path:`/memory`,element:(0,V.jsx)(zi,{activeBrainId:e})}),(0,V.jsx)(It,{path:`/graph`,element:(0,V.jsx)(VV,{activeBrainId:e})}),(0,V.jsx)(It,{path:`/tasks`,element:(0,V.jsx)(va,{})}),(0,V.jsx)(It,{path:`/skills`,element:(0,V.jsx)(RV,{activeBrainId:e})}),(0,V.jsx)(It,{path:`/openwiki`,element:(0,V.jsx)(GV,{})}),(0,V.jsx)(It,{path:`/integrations`,element:(0,V.jsx)(MV,{activeBrainId:e})}),(0,V.jsx)(It,{path:`/keys`,element:(0,V.jsx)(xV,{})}),(0,V.jsx)(It,{path:`/settings`,element:(0,V.jsx)(ma,{activeBrainId:e})}),(0,V.jsx)(It,{path:`/help`,element:(0,V.jsx)(BV,{})}),(0,V.jsx)(It,{path:`/vault`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`/inbox`,element:(0,V.jsx)(Ft,{to:`/tasks`,replace:!0})}),(0,V.jsx)(It,{path:`/automations`,element:(0,V.jsx)(Ft,{to:`/tasks`,replace:!0})}),(0,V.jsx)(It,{path:`/files`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`/sandbox`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`/models`,element:(0,V.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,V.jsx)(It,{path:`/health`,element:(0,V.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,V.jsx)(It,{path:`/usage`,element:(0,V.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,V.jsx)(It,{path:`/collab`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`/instructions`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`/design`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`/okf`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,V.jsx)(It,{path:`*`,element:(0,V.jsx)(Ft,{to:`/memory`,replace:!0})})]})})]})}var uH=`total-recall-active-brain`;function dH(){let[e,t]=(0,v.useState)(`loading`),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(()=>localStorage.getItem(uH)||`global`);(0,v.useEffect)(()=>{localStorage.setItem(uH,i)},[i]),(0,v.useEffect)(()=>(Qn(()=>t(`unauthed`)),()=>{}),[]),(0,v.useEffect)(()=>{$n().then(e=>t(e?`authed`:`unauthed`))},[]),(0,v.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await ti();e&&r(t)}catch{e&&r({status:`unreachable`,version:``,uptime_seconds:0,timestamp:``})}};t();let n=setInterval(t,1e4);return()=>{e=!1,clearInterval(n)}},[]);async function o(){await ir(),t(`unauthed`)}function s(){t(`authed`)}return e===`loading`?(0,V.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,V.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,V.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):e===`unauthed`?(0,V.jsx)(Oi,{onAuthenticated:s}):(0,V.jsx)(On,{children:(0,V.jsxs)(`div`,{className:`app-layout`,children:[(0,V.jsx)(sH,{onLogout:o,health:n,activeBrainId:i,onBrainChange:a}),(0,V.jsx)(lH,{activeBrainId:i,onBrainChange:a})]})})}`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).then(e=>{console.log(`ServiceWorker registration successful with scope: `,e.scope)},e=>{console.log(`ServiceWorker registration failed: `,e)})}),(0,y.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(v.StrictMode,{children:(0,V.jsx)(dH,{})}));
|