total-recall-brain 3.14.4 → 3.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/frontend/dist/assets/index-D9-jAOr9.js +502 -0
  2. package/frontend/dist/assets/index-L0eEIoBf.css +1 -0
  3. package/frontend/dist/brand/total-recall-badge.jpg +0 -0
  4. package/frontend/dist/brand/total-recall-icon.svg +6 -0
  5. package/frontend/dist/brand/total-recall-lockup.png +0 -0
  6. package/frontend/dist/brand/total-recall-mark.svg +9 -0
  7. package/frontend/dist/favicon.svg +6 -0
  8. package/frontend/dist/icons.svg +24 -0
  9. package/frontend/dist/index.html +27 -0
  10. package/frontend/dist/manifest.json +25 -0
  11. package/frontend/dist/sw.js +272 -0
  12. package/frontend/index.html +7 -2
  13. package/frontend/package.json +2 -0
  14. package/frontend/src/App.spec.tsx +82 -0
  15. package/frontend/src/api/_base.ts +35 -0
  16. package/frontend/src/api/api.spec.ts +297 -0
  17. package/frontend/src/api/auth.ts +73 -0
  18. package/frontend/src/api/chat.ts +93 -0
  19. package/frontend/src/api/config.ts +35 -0
  20. package/frontend/src/api/docs.ts +146 -0
  21. package/frontend/src/api/extension.ts +9 -0
  22. package/frontend/src/api/index.ts +20 -0
  23. package/frontend/src/api/integrations.ts +22 -0
  24. package/frontend/src/api/keys.ts +384 -0
  25. package/frontend/src/api/memory.ts +234 -0
  26. package/frontend/src/api/models.ts +36 -0
  27. package/frontend/src/api/research.ts +43 -0
  28. package/frontend/src/api/sandbox.ts +19 -0
  29. package/frontend/src/api/sessions.ts +27 -0
  30. package/frontend/src/api/skills.ts +127 -0
  31. package/frontend/src/api/system.ts +165 -0
  32. package/frontend/src/api/update.ts +21 -0
  33. package/frontend/src/components/BrainSelector.spec.tsx +72 -0
  34. package/frontend/src/components/DaemonLogsTab.spec.tsx +21 -0
  35. package/frontend/src/components/DocumentEditorModal.spec.tsx +80 -0
  36. package/frontend/src/components/DocumentTable.spec.tsx +45 -0
  37. package/frontend/src/components/Graph3D.spec.tsx +75 -0
  38. package/frontend/src/components/MarkdownUtils.spec.tsx +82 -0
  39. package/frontend/src/components/MobilePairing.spec.tsx +24 -0
  40. package/frontend/src/components/MobilePairing.tsx +37 -0
  41. package/frontend/src/components/ResearchAgendaTab.spec.tsx +127 -0
  42. package/frontend/src/components/TaskQueueTab.spec.tsx +70 -0
  43. package/frontend/src/components/TaskQueueTab.tsx +9 -1
  44. package/frontend/src/components/UsageChart.spec.tsx +89 -0
  45. package/frontend/src/components/VoiceInput.spec.tsx +38 -0
  46. package/frontend/src/components/VoiceInput.tsx +68 -0
  47. package/frontend/src/index.css +30 -0
  48. package/frontend/src/main.tsx +13 -0
  49. package/frontend/src/pages/ApiKeysPage.spec.tsx +32 -0
  50. package/frontend/src/pages/AutomationsPage.spec.tsx +60 -0
  51. package/frontend/src/pages/ChatPage.spec.tsx +37 -0
  52. package/frontend/src/pages/ChatPage.tsx +14 -0
  53. package/frontend/src/pages/CollabPage.spec.tsx +64 -0
  54. package/frontend/src/pages/DesignDocsPage.spec.tsx +43 -0
  55. package/frontend/src/pages/FilesPage.spec.tsx +46 -0
  56. package/frontend/src/pages/GraphPage.spec.tsx +24 -0
  57. package/frontend/src/pages/HealthPage.spec.tsx +31 -0
  58. package/frontend/src/pages/HelpPage.spec.tsx +63 -0
  59. package/frontend/src/pages/InboxPage.spec.tsx +55 -0
  60. package/frontend/src/pages/InstructionsPage.spec.tsx +52 -0
  61. package/frontend/src/pages/InstructionsPage.tsx +1 -1
  62. package/frontend/src/pages/IntegrationsPage.spec.tsx +55 -0
  63. package/frontend/src/pages/LoginPage.spec.tsx +73 -0
  64. package/frontend/src/pages/LoginPage.tsx +20 -0
  65. package/frontend/src/pages/MemoryPage.spec.tsx +51 -0
  66. package/frontend/src/pages/ModelsPage.spec.tsx +64 -0
  67. package/frontend/src/pages/ModelsPage.tsx +18 -11
  68. package/frontend/src/pages/OkfPage.spec.tsx +46 -0
  69. package/frontend/src/pages/OnboardingPage.spec.tsx +58 -0
  70. package/frontend/src/pages/OpenWikiPage.spec.tsx +32 -0
  71. package/frontend/src/pages/SandboxPage.spec.tsx +33 -0
  72. package/frontend/src/pages/SettingsPage.spec.tsx +33 -0
  73. package/frontend/src/pages/SettingsPage.tsx +6 -1
  74. package/frontend/src/pages/SkillsPage.spec.tsx +20 -0
  75. package/frontend/src/pages/TasksPage.spec.tsx +17 -0
  76. package/frontend/src/pages/UsagePage.spec.tsx +35 -0
  77. package/frontend/src/pages/VaultPage.spec.tsx +26 -0
  78. package/frontend/src/setupTests.ts +23 -0
  79. package/frontend/vite.config.ts +6 -0
  80. package/package.json +16 -4
  81. package/scaffold/.agent/skills/total-recall/SKILL.md +6 -2
  82. package/scaffold/.agent/skills/total-recall/skills-registry/index.yaml +2575 -0
  83. package/src/cli/connect.mjs +7 -1
  84. package/src/cli/deploy.mjs +8 -8
  85. package/src/cli/init.mjs +14 -4
  86. package/src/cli/recall.mjs +3 -1
  87. package/src/cli/remember.mjs +2 -1
  88. package/src/cli/restore.mjs +2 -2
  89. package/src/cli/upgrade.mjs +2 -2
  90. package/src/core/clarity-rewriter.mjs +2 -2
  91. package/src/core/crons.mjs +23 -55
  92. package/src/core/crypto.mjs +4 -8
  93. package/src/core/daemon-control.mjs +5 -0
  94. package/src/core/embeddings.mjs +207 -374
  95. package/src/core/fact-seeker.mjs +114 -0
  96. package/src/core/github-sync.mjs +319 -0
  97. package/src/core/obsidian-sync.mjs +129 -0
  98. package/src/core/project-brain.mjs +2 -1
  99. package/src/core/remote-vault-sync.mjs +6 -6
  100. package/src/core/runtime.mjs +1 -1
  101. package/src/core/skills-registry.mjs +11 -0
  102. package/src/core/snapshot.mjs +1 -1
  103. package/src/core/vault-watcher.mjs +6 -3
  104. package/src/server/api.mjs +1 -1
  105. package/src/server/rest.mjs +50 -2163
  106. package/src/server/route-manifest.json +57 -5
  107. package/src/server/routes/brains.mjs +212 -0
  108. package/src/server/routes/capture.mjs +33 -0
  109. package/src/server/routes/collab.mjs +1 -1
  110. package/src/server/routes/config.mjs +206 -0
  111. package/src/server/routes/context.mjs +68 -0
  112. package/src/server/routes/dashboard.mjs +53 -0
  113. package/src/server/routes/dream.mjs +30 -0
  114. package/src/server/routes/export.mjs +40 -0
  115. package/src/server/routes/extension.mjs +83 -0
  116. package/src/server/routes/field.mjs +48 -0
  117. package/src/server/routes/files.mjs +34 -0
  118. package/src/server/routes/graph.mjs +323 -0
  119. package/src/server/routes/help.mjs +184 -0
  120. package/src/server/routes/import.mjs +39 -0
  121. package/src/server/routes/instructions.mjs +29 -0
  122. package/src/server/routes/integrations.mjs +123 -0
  123. package/src/server/routes/memory.mjs +19 -1
  124. package/src/server/routes/models.mjs +388 -0
  125. package/src/server/routes/scripts.mjs +110 -0
  126. package/src/server/routes/sessions.mjs +1 -1
  127. package/src/server/routes/ssss.mjs +173 -0
  128. package/src/server/routes/system.mjs +167 -0
  129. package/src/server/routes/tasks.mjs +96 -0
  130. package/src/server/routes/tts.mjs +39 -0
  131. package/src/server/routes/update.mjs +42 -0
  132. package/src/server/routes/vault.mjs +99 -0
  133. package/frontend/src/api.ts +0 -1441
  134. package/scaffold/.agent/skills/ssss/SKILL.md +0 -235
  135. package/scaffold/.agent/skills/ssss/evals/evals.json +0 -37
  136. package/scaffold/.agent/skills/ssss/references/contract-reference.md +0 -95
  137. package/scaffold/.agent/skills/ssss/scripts/validate-schema.mjs +0 -215
  138. package/scaffold/.agent/skills/ssss/subagents/audit-ssss-contract.md +0 -22
  139. package/src/core/pattern_detector.mjs +0 -113
  140. package/src/core/promotion-pipeline.mjs +0 -54
  141. package/src/core/semantic-index.mjs +0 -276
  142. package/src/core/task_runner.mjs +0 -131
@@ -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 ee(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 F=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)},I={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=I,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:ee}},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,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),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.6`})),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 ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function L(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function R(e,t){re++,ne[re]=e.current,e.current=t}var ae=ie(null),oe=ie(null),se=ie(null),z=ie(null);function ce(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)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(ae),R(ae,e)}function le(){L(ae),L(oe),L(se)}function ue(e){e.memoizedState!==null&&R(z,e);var t=ae.current,n=Ud(t,e.type);t!==n&&(R(oe,e),R(ae,n))}function de(e){oe.current===e&&(L(ae),L(oe)),z.current===e&&(L(z),Qf._currentValue=te)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!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{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(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 We(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=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(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 Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(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 qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(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-Ie(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&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $e(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(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 tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function rt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,ut=`__reactHandles$`+it,dt=`__reactResources$`+it,ft=`__reactMarker$`+it;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[at])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),wt={},Tt={};function Et(e){return ye.call(Tt,e)?!0:ye.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ot(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function B(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function At(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function jt(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 Mt(e){if(!e._valueTracker){var t=At(e)?`checked`:`value`;e._valueTracker=jt(e,t,``+e[t])}}function Nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=At(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Pt(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 Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(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=``+B(t)):e.value!==``+B(t)&&(e.value=``+B(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,B(n)):zt(e,o,B(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=``+B(s):e.removeAttribute(`name`)}function Rt(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)){Mt(e);return}n=n==null?``:``+B(n),t=t==null?n:``+B(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),Mt(e)}function zt(e,t,n){t===`number`&&Pt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(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=``+B(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 Vt(e,t,n){if(t!=null&&(t=``+B(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+B(n)}function Ht(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=B(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Mt(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=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 Gt(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||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(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&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function qt(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 Jt=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`]]),Yt=/^[\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 Xt(e){return Yt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Zt(){}var Qt=null;function $t(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var en=null,tn=null;function nn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(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="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ot]||null;if(!a)throw Error(i(90));Lt(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&&Nt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var rn=!1;function an(e,t,n){if(rn)return e(t,n);rn=!0;try{return e(t)}finally{if(rn=!1,(en!==null||tn!==null)&&(bu(),en&&(t=en,e=tn,tn=en=null,nn(t),e)))for(t=0;t<e.length;t++)nn(e[t])}}function on(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var sn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.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 fn=i.slice(e,1<r?1-r:void 0)}function mn(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 hn(){return!0}function gn(){return!1}function _n(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)?hn:gn,this.isPropagationStopped=gn,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=hn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=hn)},persist:function(){},isPersistent:hn}),t}var vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yn=_n(vn),bn=m({},vn,{view:0,detail:0}),xn=_n(bn),Sn,Cn,wn,Tn=m({},bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:In,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!==wn&&(wn&&e.type===`mousemove`?(Sn=e.screenX-wn.screenX,Cn=e.screenY-wn.screenY):Cn=Sn=0,wn=e),Sn)},movementY:function(e){return`movementY`in e?e.movementY:Cn}}),En=_n(Tn),Dn=_n(m({},Tn,{dataTransfer:0})),On=_n(m({},bn,{relatedTarget:0})),kn=_n(m({},vn,{animationName:0,elapsedTime:0,pseudoElement:0})),An=_n(m({},vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),jn=_n(m({},vn,{data:0})),Mn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Nn={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`},Pn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Fn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pn[e])?!!t[e]:!1}function In(){return Fn}var Ln=_n(m({},bn,{key:function(e){if(e.key){var t=Mn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Nn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:In,charCode:function(e){return e.type===`keypress`?mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Rn=_n(m({},Tn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zn=_n(m({},bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:In})),Bn=_n(m({},vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Vn=_n(m({},Tn,{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})),Hn=_n(m({},vn,{newState:0,oldState:0})),V=[9,13,27,32],Un=sn&&`CompositionEvent`in window,Wn=null;sn&&`documentMode`in document&&(Wn=document.documentMode);var Gn=sn&&`TextEvent`in window&&!Wn,Kn=sn&&(!Un||Wn&&8<Wn&&11>=Wn),H=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return V.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,H):null;case`textInput`:return e=t.data,e===H&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Un&&Jn(e,t)?(e=pn(),fn=dn=un=null,Xn=!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 Kn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={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 er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){en?tn?tn.push(r):tn=[r]:en=r,t=Dd(t,`onChange`),0<t.length&&(n=new yn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){bd(e,0)}function ar(e){if(Nt(gt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(sn){var cr;if(sn){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,$t(e)),an(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(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(!ye.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xr(e,t){var n=br(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=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pt(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=Pt(e.document)}return t}function wr(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 Tr=sn&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Pt(r)||(r=Er,`selectionStart`in r&&wr(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}),Or&&yr(Or,r)||(Or=r,r=Dd(Dr,`onSelect`),0<r.length&&(t=new yn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Mr={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Nr={},Pr={};sn&&(Pr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),`TransitionEvent`in window||delete Mr.transitionend.transition);function Fr(e){if(Nr[e])return Nr[e];if(!Mr[e])return e;var t=Mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pr)return Nr[e]=t[n];return e}var Ir=Fr(`animationend`),Lr=Fr(`animationiteration`),Rr=Fr(`animationstart`),zr=Fr(`transitionrun`),Br=Fr(`transitionstart`),Vr=Fr(`transitioncancel`),Hr=Fr(`transitionend`),Ur=new Map,Wr=`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(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),xt(t,[e])}var Kr=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)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[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&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(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-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(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 ni={};function ri(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 ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(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 si(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 ci(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=Wf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ii(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return li(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ii(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ii(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ii(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=ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function li(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function ui(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function di(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function fi(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pi=new WeakMap;function mi(e,t){if(typeof e==`object`&&e){var n=pi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},pi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var hi=[],gi=0,_i=null,U=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){hi[gi++]=U,hi[gi++]=_i,_i=e,U=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Ie(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,U=hi[--gi],hi[gi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,W=!1,Ai=null,ji=!1,Mi=Error(i(519));function Ni(e){throw zi(mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=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),Rt(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),Ht(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=Zt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Oi=Oi.return}}function Ii(e){if(e!==Oi)return!1;if(!W)return Fi(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Wd(e.type,e.memoizedProps)),n=!n),n&&ki&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=df(e)}else t===27?(t=ki,Qd(e.type)?(e=uf,uf=null,ki=e):ki=t):ki=Oi?lf(e.stateNode.nextSibling):null;return!0}function Li(){ki=Oi=null,W=!1}function Ri(){var e=Ai;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=ie(null),Vi=null,Hi=null;function Ui(e,t,n){R(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,L(Bi)}function Gi(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 Ki(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),Gi(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),Gi(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 qi(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;vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===z.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=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()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=fd(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(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 fa=F.S;F.S=function(e,t){eu=we(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=ie(null);function ma(){var e=pa.current;return e===null?Ll.pooledCache:e}function ha(e,t){t===null?R(pa,pa.current):R(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),ya=Error(i(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Zt,Zt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Zt,Zt);else{if(e=Ll,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,Ea(e),e}throw wa=t,_a}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,_a):e}}var wa=null;function Ta(){if(wa===null)throw Error(i(459));var e=wa;return wa=null,e}function Ea(e){if(e===_a||e===ya)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Sa(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(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 Ma(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=oi(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=ui(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&&Ca(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=ci(n.type,n.key,n.props,null,e.mode,r),Aa(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=fi(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=li(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=ui(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ci(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case v:return t=fi(t,e.mode,n),t.return=e,t;case O:return t=Ca(t),f(e,t,n)}if(ee(t)||M(t))return t=li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===C)return f(e,Zi(e,t),n);ja(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=Ca(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===C)return p(e,t,Zi(e,n),r);ja(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=Ca(r),m(e,t,n,r,i)}if(ee(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,ka(r),i);if(r.$$typeof===C)return m(e,t,n,Zi(t,r),i);ja(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),W&&Ci(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 W&&Ci(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)}),W&&Ci(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),W&&Ci(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 W&&Ci(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)}),W&&Ci(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&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),Aa(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=fi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ca(o),b(e,r,o,c)}if(ee(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,ka(o),c);if(o.$$typeof===C)return b(e,r,Zi(e,o),c);ja(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=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(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 Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Il&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Ba(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,Qe(e,n)}}function Va(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 Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!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?(X&f)===f:(r&f)===f){f!==0&&f===sa&&(Ha=!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:Fa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ga(n[e],t)}var qa=ie(null),Ja=ie(0);function Ya(e,t){e=Ul,R(Ja,e),R(qa,t),Ul=e|t.baseLanes}function Xa(){R(Ja,Ul),R(qa,qa.current)}function Za(){Ul=Ja.current,L(qa),L(Ja)}var Qa=ie(null),$a=null;function eo(e){var t=e.alternate;R(ao,ao.current&1),R(Qa,e),$a===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&($a=e)}function to(e){R(ao,ao.current),R(Qa,e),$a===null&&($a=e)}function no(e){e.tag===22?(R(ao,ao.current),R(Qa,e),$a===null&&($a=e)):ro(e)}function ro(){R(ao,ao.current),R(Qa,Qa.current)}function io(e){L(Qa),$a===e&&($a=null),L(ao)}var ao=ie(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(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 so=0,G=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return so=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Is:Ls,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){F.H=Fs;var t=co!==null&&co.next!==null;if(so=0,lo=co=G=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&Ji(e)&&(ec=!0))}function So(e,t,n,r){G=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Rs,o=t(n,r)}while(fo);return o}function Co(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(G.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}so=0,lo=co=G=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?G.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?G.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw G.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?G.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Sa(go,e,t),t=G,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Is:Ls),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Xi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.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=ko(),G.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 No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(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?(so&f)===f:(X&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===sa&&(d=!0);else if((so&p)===p){u=u.next,p===sa&&(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,G.lanes|=p,Gl|=p;f=u.action,po&&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,G.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&(ec=!0,d&&(n=ca,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 Io(e){var t=Oo(),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);vr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=G,a=Oo(),o=W;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!vr((co||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||so&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=ko(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Ho(e){var t=$r(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ms(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)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(W){var n=Ll.formState;if(n!==null){a:{var r=G;if(W){if(ki){b:{for(var i=ki,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=lf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=ks.bind(null,G,r),r.dispatch=n,r=Uo(!1),a=js.bind(null,G,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===_a?ya:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=ko(),G.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 is(){return Oo().memoizedState}function K(e,t,n,r){var i=Do();G.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(G.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function os(e,t){K(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=ko(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Oo().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Il&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||so&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),G.lanes|=e,Gl|=e,n)}function vs(e,t,n,r){return vr(n,t)?n:qa.current===null?!(so&42)||so&1073741824&&!(X&261930)?(ec=!0,e.memoizedState=n):(e=mu(),G.lanes|=e,Gl|=e,t):(e=_s(e,n,r),vr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,js(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,da(c,r),pu(e)):As(e,t,r,pu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,te,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},pu())}function ws(){return Xi(Qf)}function Ts(){return Oo().memoizedState}function Es(){return Oo().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ra(n);var r=za(t,e,n);r!==null&&(hu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Qr(e,t,n,r),n!==null&&(hu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,pu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,vr(s,o))return Zr(e,t,i,0),Ll===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return hu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&hu(t,e,2)}function Ms(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Fs={readContext:Xi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Fs.useEffectEvent=vo;var Is={readContext:Xi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),K(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return K(4194308,4,e,t)},useInsertionEffect:function(e,t){K(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Fe(!0);try{n(t)}finally{Fe(!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=Os.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=ks.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=ys.bind(null,G,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,a=Do();if(W){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));X&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Ll.identifierPrefix;if(W){var n=Si,r=xi;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Ds.bind(null,G)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(Il&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Xi,use:jo,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Ts,useHostTransitionStatus:ws,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Xi,use:jo,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Oo();return co===null?_s(n,e,t):vs(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Ts,useHostTransitionStatus:ws,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(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 Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(hu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(hu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(hu(t,e,n),Ba(t,e,n))}};function Vs(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?!yr(n,r)||!yr(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(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 Ws(e){Kr(e)}function Gs(e){console.error(e)}function Ks(e){Kr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(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 Ys(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ra(e),e.tag=3,e}function Zs(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(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Qa.current,n!==null){switch(n.tag){case 31:case 13:return $a===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ba?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===ba?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(W)return t=Qa.current,t===null?(r!==Mi&&(t=Error(i(423),{cause:r}),zi(mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=mi(r,n),a=Ys(e.stateNode,r,a),Va(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Mi&&(e=Error(i(422),{cause:r}),zi(mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=mi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function nc(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 Yi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!ec?(To(e,t,i),Ec(e,t,i)):(W&&s&&Ti(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(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 sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Xa():Ya(t,a),no(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Xa(),ro(t)):(ha(t,a.cachePool),Ya(t,a),ro(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Xa(),no(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Na(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(to(t),(e=ki)?(e=af(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||qi(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=Ll,r!==null&&(s=$e(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),hu(r,e,s),$s;Du(),t=lc(e,t,n)}else e=o.treeContext,ki=lf(s.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=cc(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(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 fc(e,t,n,r,i){return Yi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!ec?(To(e,t,i),Ec(e,t,i)):(W&&r&&Ti(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!ec?(To(e,t,a),Ec(e,t,a)):(W&&r&&Ti(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ni,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(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&&Bs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),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=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ni,typeof u==`object`&&u&&(o=Xi(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)&&Hs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Fa||Vs(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,La(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ni,typeof l==`object`&&l&&(c=Xi(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)&&Hs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Fa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(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,dc(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=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Li(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ga()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function yc(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:(ao.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(W){if(a?eo(t):ro(t),(e=ki)?(e=af(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ro(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=li(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):(eo(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=li(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||qi(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=Ll,s!==null&&(r=$e(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),hu(s,e,r),$s;of(c)||Du(),t=Sc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=lf(c.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(ro(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=li(c,a,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ga():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=oi(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 bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Na(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function wc(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 Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,R(ao,o),tc(e,t,r,n),r=W?U:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(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&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(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&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(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=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ji(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(ao,ao.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,W&&t.flags&1048576&&wi(t,U,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ua(),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=hc(e,t,r,n);break a}else if(r!==a){a=mi(Error(i(424)),t),zi(a),t=hc(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(ki=lf(e.firstChild),Oi=t,W=!0,Ai=null,ji=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,r=Vd(se.current).createElement(n),r[at]=t,r[ot]=e,Fd(r,n,e),vt(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&W&&(r=t.stateNode=pf(t.type,t.pendingProps,se.current),Oi=t,ji=!0,a=ki,Qd(t.type)?(uf=a,ki=lf(r.firstChild)):ki=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((a=r=ki)&&(r=nf(r,t.type,t.pendingProps,ji),r===null?a=!1:(t.stateNode=r,Oi=t,ki=lf(r.firstChild),ji=!1,a=!0)),a||Ni(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ki)&&(n=rf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Ni(t)),null;case 13:return yc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=ma(),a===null&&(a=Ll,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Ui(t,na,a)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(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 wa=ba,va}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t))if(wu())e.flags|=8192;else throw wa=ba,va}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,Yl|=t)}function Pc(e,t){if(!W)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 Fc(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 Ic(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(de(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=ae.current,Ii(t)?Pi(t,e):(e=pf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=ae.current,Ii(t))Pi(t,o);else{var s=Vd(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[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Ni(t,!0)}else e=Vd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[at]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[at]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(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),Nc(t,t.updateQueue),Fc(t),null);case 4:return le(),e===null&&Cd(t.stateNode.containerInfo),Fc(t),null;case 10:return Wi(t.type),Fc(t),null;case 19:if(L(ao),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return R(ao,ao.current&1|2),W&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>tu&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!W)return Fc(t),null}else 2*we()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Pc(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?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=ao.current,R(ao,a?n&1|2:n&1),W&&Ci(t,r.treeForkCount),e);case 22:case 23:return io(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(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&&L(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(ao),null;case 4:return le(),null;case 10:return Wi(t.type),null;case 22:case 23:return io(t),Za(),e!==null&&L(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Rc(e,t){switch(Ei(t),t.tag){case 3:Wi(na),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:L(ao);break;case 10:Wi(t.type);break;case 22:case 23:io(t),Za(),e!==null&&L(pa);break;case 24:Wi(na)}}function zc(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 Bc(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 Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Gu(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Gu(e,t,n)}}function Uc(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 Wc(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 Gc(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 Kc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[ot]=t}catch(t){Gu(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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&&Qd(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 Yc(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=Zt));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(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&&Qd(e.type)&&(n=e.stateNode),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[at]=e,t[ot]=n}catch(t){Gu(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,zd=sp,e=Cr(e),wr(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(Bd={focusedElem:e,selectionRange:n},sp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,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=Us(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)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(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,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&zc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Gu(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Gu(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(vl(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{Ka(e,t)}catch(e){Gu(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ul(e,n);break;case 13:vl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Yu.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Qc=i,$c=a}break;case 30:break;default:vl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;Qd(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),mf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Gu(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Gu(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):$d(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Gu(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Gu(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Xu.bind(null,e,t);t.then(r,r)}})}function ml(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(Qd(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),q(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),q(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(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=hl;if(ml(t,e),q(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ft]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Hf(`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),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Hf(`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),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[at]=e,vt(o),r=o}e.stateNode=r}else Uf(a,e.type,e.stateNode);else e.stateNode=Lf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Uf(a,e.type,e.stateNode):Lf(a,r,e.memoizedProps))}break;case 27:ml(t,e),q(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),q(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Ut(a,``)}catch(t){Gu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),q(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(Vf=null,a=hl,hl=_f(t.containerInfo),ml(t,e),hl=a,q(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Gu(e,e.return,t)}el&&(el=!1,_l(e));break;case 4:r=hl,hl=_f(e.stateNode.containerInfo),ml(t,e),q(e),hl=r;break;case 12:ml(t,e),q(e);break;case 31:ml(t,e),q(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),q(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,q(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||yl(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?ef(m,!0):ef(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,pl(e,n))));break;case 19:ml(t,e),q(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),q(e)}}function q(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ut(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Gu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),yl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),yl(t);break;case 27:mf(t.stateNode);case 26:case 5:Wc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(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:bl(i,a,n),zc(4,a);break;case 1:if(bl(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++)Ga(c[i],s)}catch(e){Gu(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ul(i,a);break;case 13:bl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Uc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(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&&ia(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&zc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(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&&ia(e)));break;case 12:if(i&2048){Cl(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 Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(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:Tl(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(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:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Kf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=hl;hl=_f(e.stateNode.containerInfo),Ol(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function J(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 Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Nl(r,e)}J(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jl(e),e=e.sibling}function jl(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ml(e)):Al(e);break;default:Al(e)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Nl(r,e)}J(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Ml(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ml(t));break;default:Ml(t)}e=e.sibling}}function Nl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Pl={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Fl=typeof WeakMap==`function`?WeakMap:Map,Il=0,Ll=null,Y=null,X=0,Rl=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return Il&2&&X!==0?X&-X:F.T===null?nt():fd()}function mu(){if(Jl===0)if(!(X&536870912)||W){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),Jl=e}else Jl=536870912;return e=Qa.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Ll&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,X,Jl,!1)),Ye(e,n),(!(Il&2)||e!==Ll)&&(e===Ll&&(!(Il&2)&&(Kl|=n),Wl===4&&yu(e,X,Jl,!1)),id(e))}function gu(e,t,n){if(Il&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ge(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-we(),10<a)){if(yu(r,t,Jl,!Bl),We(r,0,!0)!==0)break a;su=t,r.timeoutHandle=qd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);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:Zt},kl(t,a,d);var m=(a&62914560)===a?$l-we():(a&4194048)===a?eu-we():0;if(m=Jf(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(!vr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ze(e,n,t)}function bu(){return Il&6?!0:(ad(0,!1),!1)}function xu(){if(Y!==null){if(Rl===0)var e=Y.return;else e=Y,Hi=Vi=null,Eo(e),Da=null,Oa=0,e=Y;for(;e!==null;)Rc(e.alternate,e),e=e.return;Y=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Ll=e,Y=n=oi(e.current,null),X=t,Rl=0,zl=null,Bl=!1,Vl=Ge(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Xr(),n}function Cu(e,t){G=null,F.H=Fs,t===_a||t===ya?(t=Ta(),Rl=3):t===va?(t=Ta(),Rl=4):Rl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,Y===null&&(Wl=1,qs(e,mi(t,e.current)))}function wu(){var e=Qa.current;return e===null?!0:(X&4194048)===X?$a===null:(X&62914560)===X||X&536870912?e===$a:!1}function Tu(){var e=F.H;return F.H=Fs,e===null?Fs:e}function Eu(){var e=F.A;return F.A=Pl,e}function Du(){Wl=4,Bl||(X&4194048)!==X&&Qa.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||Ll===null||yu(Ll,X,Jl,!1)}function Ou(e,t,n){var r=Il;Il|=2;var i=Tu(),a=Eu();(Ll!==e||X!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(Rl!==0&&Y!==null){var s=Y,c=zl;switch(Rl){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:Qa.current===null&&(t=!0);var l=Rl;if(Rl=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=Rl,Rl=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,Il=r,F.H=i,F.A=a,Y===null&&(Ll=null,X=0,Xr()),o}function ku(){for(;Y!==null;)Mu(Y)}function Au(e,t){var n=Il;Il|=2;var r=Tu(),a=Eu();Ll!==e||X!==t?(nu=null,tu=we()+500,Su(e,t)):Vl=Ge(e,t);a:do try{if(Rl!==0&&Y!==null){t=Y;var o=zl;b:switch(Rl){case 1:Rl=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(xa(o)){Rl=0,zl=null,Nu(t);break}t=function(){Rl!==2&&Rl!==9||Ll!==e||(Rl=7),id(e)},o.then(t,t);break a;case 3:Rl=7;break a;case 4:Rl=5;break a;case 7:xa(o)?(Rl=0,zl=null,Nu(t)):(Rl=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Gf(s):c.stateNode.complete){Rl=0,zl=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,Fu(u))}break b}}Rl=0,zl=null,Pu(e,t,o,5);break;case 6:Rl=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Hi=Vi=null,F.H=r,F.A=a,Il=n,Y===null?(Ll=null,X=0,Xr(),Wl):0}function ju(){for(;Y!==null&&!Se();)Mu(Y)}function Mu(e){var t=kc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):Y=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:Eo(t);default:Rc(n,t),t=Y=si(t,Ul),t=kc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):Y=t}function Pu(e,t,n,r){Hi=Vi=null,Eo(t),Da=null,Oa=0;var i=t.return;try{if(Qs(e,i,t,n,X)){Wl=1,qs(e,mi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;Wl=1,qs(e,mi(n,e.current)),Y=null;return}t.flags&32768?(W||r===1?e=!0:Vl||X&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Ic(t.alternate,t,Ul);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);Wl=6,Y=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(Il&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,Xe(e,n,o,s,c,l),e===Ll&&(Y=Ll=null,X=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(Oe,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Il,Il|=4;try{rl(e,t,n)}finally{Il=s,I.p=a,F.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=F.T,F.T=null;var r=I.p;I.p=2;var i=Il;Il|=4;try{gl(t,e);var a=Bd,o=Cr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Sr(s.ownerDocument.documentElement,s)){if(c!==null&&wr(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 _=xr(s,h),v=xr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!zd,Bd=zd=null}finally{Il=i,I.p=r,F.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=F.T,F.T=null;var r=I.p;I.p=2;var i=Il;Il|=4;try{il(e,t.alternate,t)}finally{Il=i,I.p=r,F.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Ce();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),tt(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.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{F.T=t,I.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,ia(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=tt(su),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,Il&6)throw Error(i(331));var c=Il;if(Il|=4,jl(o.current),wl(o,o.current,s,n),Il=c,ad(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{I.p=a,F.T=r,Vu(e,t)}}function Wu(e,t,n){t=mi(n,t),t=Ys(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Ye(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`&&(ru===null||!ru.has(r))){e=mi(n,e),n=Xs(2),r=za(t,n,2),r!==null&&(Zs(n,r,t,e),Ye(r,2),id(r));break}}t=t.return}}function Ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=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,Ll===e&&(X&n)===n&&(Wl===4||Wl===3&&(X&62914560)===X&&300>we()-$l?!(Il&2)&&Su(e,0):ql|=n,Yl===X&&(Yl=0)),id(e)}function Ju(e,t){t===0&&(t=qe()),e=$r(e,t),e!==null&&(Ye(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 be(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-Ie(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=X,a=We(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(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&&Kd()&&(e=rd);for(var t=we(),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-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=X,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),tt(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=ld.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(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=X;return r=We(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),cd(e,we()),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(){Xd(function(){Il&6?be(Ee,od):sd()})}function fd(){if(rd===0){var e=sa;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),rd=e}return rd}function pd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Xt(``+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[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?pd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new yn(`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);xs(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),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var gd=0;gd<Wr.length;gd++){var _d=Wr[gd];Gr(_d.toLowerCase(),`on`+(_d[0].toUpperCase()+_d.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var 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){Kr(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){Kr(e)}i.currentTarget=null,a=c}}}}function Z(e,t){var n=t[ct];n===void 0&&(n=t[ct]=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,yt.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(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!cn||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=mt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}an(function(){var r=a,i=$t(n),s=[];a:{var c=Ur.get(e);if(c!==void 0){var l=yn,u=e;switch(e){case`keypress`:if(mn(n)===0)break a;case`keydown`:case`keyup`:l=Ln;break;case`focusin`:u=`focus`,l=On;break;case`focusout`:u=`blur`,l=On;break;case`beforeblur`:case`afterblur`:l=On;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=En;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Dn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=zn;break;case Ir:case Lr:case Rr:l=kn;break;case Hr:l=Bn;break;case`scroll`:case`scrollend`:l=xn;break;case`wheel`:l=Vn;break;case`copy`:case`cut`:case`paste`:l=An;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Rn;break;case`toggle`:case`beforetoggle`:l=Hn}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=on(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!==Qt&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=En,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Rn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:gt(l),h=u==null?c:gt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=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?gt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=or;else if(er(c))if(sr)v=gr;else{v=mr;var y=pr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&qt(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(s,n,i);break;case`selectionchange`:if(Tr)break;case`keydown`:case`keyup`:Ar(s,n,i)}var b;if(Un)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 Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=pn()):(un=i,dn=`value`in un?un.value:un.textContent,Xn=!0)),y=Dd(r,x),0<y.length&&(x=new jn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Gn?Zn(e,n):Qn(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new jn(`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=on(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=on(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=on(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=on(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 Q(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+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`&&Q(e,t,`name`,a.name,a,null),Q(e,t,`formEncType`,a.formEncType,a,null),Q(e,t,`formMethod`,a.formMethod,a,null),Q(e,t,`formTarget`,a.formTarget,a,null)):(Q(e,t,`encType`,a.encType,a,null),Q(e,t,`method`,a.method,a,null),Q(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Zt);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=Xt(``+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),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Jt.get(n)||n,Dt(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Kt(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`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(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=Zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Fd(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:Q(e,t,o,s,n,null)}}a&&Q(e,t,`srcSet`,n.srcSet,n,null),r&&Q(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:Q(e,t,r,d,n,null)}}Rt(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:Q(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(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:Q(e,t,s,c,n,null)}Ht(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:Q(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:Q(e,t,u,r,n,null)}return;default:if(qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Q(e,t,c,r,n,null))}function Id(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)||Q(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&&Q(e,t,p,m,r,f)}}Lt(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)||Q(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&&Q(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(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:Q(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&&Q(e,t,s,a,r,o)}Vt(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:Q(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:Q(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)&&Q(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:Q(e,t,u,p,r,m)}return;default:if(qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(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||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Q(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||Q(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){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&&Ld(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&&Ld(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 zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(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 Ud(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 Wd(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 Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body);n=i}while(n);Np(t)}function ef(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 tf(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`:tf(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(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 lf(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 uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(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 pf(e,t,n){switch(t=Vd(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 mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=I.d;I.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=bu();return e||t}function bf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=_t(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);vt(c),Fd(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,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=_t(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),vt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=_t(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),vt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=se.current)?_f(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=jf(n.href),n=_t(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=_t(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.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},hf.set(e,n),o||Pf(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=Ff(n),n=_t(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+It(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(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}),Fd(t,`link`,n),vt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+It(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,vt(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`),vt(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,vt(a),a):(r=n,(a=hf.get(o))&&(r=m({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),vt(a),Fd(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,Rf(r,n.precedence,e));return t.instance}function Rf(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 zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[at]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(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 Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(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=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(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=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach($,e),Xf=null,Yf.call(e))}function $(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.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=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function tp(e){return e?(e=ni,e):ni}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(hu(n,e,t),Ba(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=et(t);var n=$r(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,up(e,t,n,r)}finally{I.p=a,F.T=i}}function lp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,up(e,t,n,r)}finally{I.p=a,F.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Td(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}id(a),!(Il&6)&&(tu=we()+500,ad(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&Td(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function dp(e){return e=$t(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=mt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=mt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,rt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,rt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qt=r,n.target.dispatchEvent(r),Qt=null}else return t=ht(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[st]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));I.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 Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ne=zp.inject(Rp),Pe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[st]=t.current,Cd(e),new Fp(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}))))}r=o(t.map(t=>{if(t=x(t,n),t in S)return;S[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:b,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.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=`popstate`;function T(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function E(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return j(``,{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:M(t)}return P(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function k(){return Math.random().toString(36).substring(2,10)}function A(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 j(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?N(t):t,state:n,key:t&&t.key||r||k(),mask:i}}function M({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 N(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 P(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=T(e)?e:j(h.location,e,t);n&&n(r,e),l=u()+1;let d=A(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=T(e)?e:j(h.location,e,t);n&&n(r,e),l=u();let i=A(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(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(w,d),c=e,()=>{i.removeEventListener(w,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=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),D(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:M(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function F(e,t,n=`/`){return I(e,t,n,!1)}function I(e,t,n,r,i){let a=ge((typeof t==`string`?N(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ne(e),s=null,c=he(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function te(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 ne(e){let t=re(e);return L(t),t}function re(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;D(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=Te([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),re(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ie(e.path))a(e,t,!0,n)}),t}function ie(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=ie(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 L(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var R=/^:[\w-]+$/,ae=3,oe=2,se=1,z=10,ce=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=ce),t&&(r+=oe),n.filter(e=>!le(e)).reduce((e,t)=>e+(R.test(t)?ae:t===``?se:z),r)}function de(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 fe(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=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Te([a,u.pathname]),pathnameBase:De(Te([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Te([a,u.pathnameBase]))}return o}function pe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end),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 me(e,t=!1,n=!0){O(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 he(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!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 ge(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)||`/`}var _e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ve(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?N(e):e,a;return n?(n=we(n),a=n.startsWith(`/`)?ye(n.substring(1),`/`):ye(n,t)):a=t,{pathname:a,search:Oe(r),hash:ke(i)}}function ye(e,t){let n=Ee(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function be(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 xe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Se(e){let t=xe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ce(e,t,n,r=!1){let i;typeof e==`string`?i=N(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),be(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),be(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),be(`#`,`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=ve(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var we=e=>e.replace(/\/\/+/g,`/`),Te=e=>we(e.join(`/`)),Ee=e=>e.replace(/\/+$/,``),De=e=>Ee(e).replace(/^\/*/,`/`),Oe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ke=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ae=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 je(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Me(e){return Te(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ne=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Pe(e,t){let n=e;if(typeof n!=`string`||!_e.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ne)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ge(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!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 Fe=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Fe);var Ie=[`GET`,...Fe];new Set(Ie);var Le=v.createContext(null);Le.displayName=`DataRouter`;var Re=v.createContext(null);Re.displayName=`DataRouterState`;var ze=v.createContext(!1);function Be(){return v.useContext(ze)}var Ve=v.createContext({isTransitioning:!1});Ve.displayName=`ViewTransition`;var He=v.createContext(new Map);He.displayName=`Fetchers`;var Ue=v.createContext(null);Ue.displayName=`Await`;var We=v.createContext(null);We.displayName=`Navigation`;var Ge=v.createContext(null);Ge.displayName=`Location`;var Ke=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ke.displayName=`Route`;var qe=v.createContext(null);qe.displayName=`RouteError`;var Je=`REACT_ROUTER_ERROR`,Ye=`REDIRECT`,Xe=`ROUTE_ERROR_RESPONSE`;function Ze(e){if(e.startsWith(`${Je}:${Ye}:{`))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 Qe(e){if(e.startsWith(`${Je}:${Xe}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ae(t.status,t.statusText,t.data)}catch{}}function $e(e,{relative:t}={}){D(et(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(We),{hash:i,pathname:a,search:o}=ot(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Te([n,a])),r.createHref({pathname:s,search:o,hash:i})}function et(){return v.useContext(Ge)!=null}function tt(){return D(et(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(Ge).location}var nt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function rt(e){v.useContext(We).static||v.useLayoutEffect(e)}function it(){let{isDataRoute:e}=v.useContext(Ke);return e?Tt():at()}function at(){D(et(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(Le),{basename:t,navigator:n}=v.useContext(We),{matches:r}=v.useContext(Ke),{pathname:i}=tt(),a=JSON.stringify(Se(r)),o=v.useRef(!1);return rt(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(O(o.current,nt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ce(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Te([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function ot(e,{relative:t}={}){let{matches:n}=v.useContext(Ke),{pathname:r}=tt(),i=JSON.stringify(Se(n));return v.useMemo(()=>Ce(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function st(e,t){return ct(e,t)}function ct(e,t,n){D(et(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(We),{matches:i}=v.useContext(Ke),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||``;Dt(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=tt(),d;if(t){let e=typeof t==`string`?N(t):t;D(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})):F(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(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=ht(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Te([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Te([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(Ge.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function lt(){let e=wt(),t=je(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 ut=v.createElement(lt,null),dt=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=Qe(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(Ke.Provider,{value:this.props.routeContext},v.createElement(qe.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(pt,{error:e},t):t}};dt.contextType=ze;var ft=new WeakMap;function pt({children:e,error:t}){let{basename:n}=v.useContext(We);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ze(t.digest);if(e){let r=ft.get(t);if(r)throw r;let i=Pe(e.location,n);if(Ne&&!ft.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ft.set(t,n),n}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function mt({routeContext:e,match:t,children:n}){let r=v.useContext(Le);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ke.Provider,{value:e},n)}function ht(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);D(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:Me(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||ut,o&&(s<0&&c===0?(Dt(`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(mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(dt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function gt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _t(e){let t=v.useContext(Le);return D(t,gt(e)),t}function vt(e){let t=v.useContext(Re);return D(t,gt(e)),t}function yt(e){let t=v.useContext(Ke);return D(t,gt(e)),t}function bt(e){let t=yt(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xt(){return bt(`useRouteId`)}function St(){return vt(`useNavigation`).navigation}function Ct(){let{matches:e,loaderData:t}=vt(`useMatches`);return v.useMemo(()=>e.map(e=>te(e,t)),[e,t])}function wt(){let e=v.useContext(qe),t=vt(`useRouteError`),n=bt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Tt(){let{router:e}=_t(`useNavigate`),t=bt(`useNavigate`),n=v.useRef(!1);return rt(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{O(n.current,nt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Et={};function Dt(e,t,n){!t&&!Et[e]&&(Et[e]=!0,O(!1,n))}v.memo(Ot);function Ot({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ct(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function kt({to:e,replace:t,state:n,relative:r}){D(et(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=v.useContext(We);O(!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(Ke),{pathname:o}=tt(),s=it(),c=Ce(e,Se(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 B(e){D(!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 At({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!et(),`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=N(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=ge(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 O(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(We.Provider,{value:c},v.createElement(Ge.Provider,{children:t,value:h}))}function jt({children:e,location:t}){return st(Mt(e),t)}v.Component;function Mt(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,Mt(e.props.children,i));return}D(e.type===B,`[${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>`),D(!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=Mt(e.props.children,i)),n.push(a)}),n}var Nt=`get`,Pt=`application/x-www-form-urlencoded`;function Ft(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function It(e){return Ft(e)&&e.tagName.toLowerCase()===`button`}function Lt(e){return Ft(e)&&e.tagName.toLowerCase()===`form`}function Rt(e){return Ft(e)&&e.tagName.toLowerCase()===`input`}function zt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bt(e,t){return e.button===0&&(!t||t===`_self`)&&!zt(e)}function Vt(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 Ht(e,t){let n=Vt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ut=null;function Wt(){if(Ut===null)try{new FormData(document.createElement(`form`),0),Ut=!1}catch{Ut=!0}return Ut}var Gt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Kt(e){return e!=null&&!Gt.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pt}"`),null):e}function qt(e,t){let n,r,i,a,o;if(Lt(e)){let o=e.getAttribute(`action`);r=o?ge(o,t):null,n=e.getAttribute(`method`)||Nt,i=Kt(e.getAttribute(`enctype`))||Pt,a=new FormData(e)}else if(It(e)||Rt(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?ge(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Nt,i=Kt(e.getAttribute(`formenctype`))||Kt(o.getAttribute(`enctype`))||Pt,a=new FormData(o,e),!Wt()){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(Ft(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Nt,r=null,i=Pt,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 Jt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Yt=/[&><\u2028\u2029]/g;function Xt(e){return e.replace(Yt,e=>Jt[e])}function Zt(e,t){if(e===!1||e==null)throw Error(t)}function Qt(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&&ge(i.pathname,t)===`/`?i.pathname=`${Ee(t)}/_root.${r}`:i.pathname=`${Ee(i.pathname)}.${r}`,i}async function $t(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 en(e){return e!=null&&typeof e.page==`string`}function tn(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 nn(e,t,n){return cn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await $t(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(tn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function rn(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 an(e,t,{includeHydrateFallback:n}={}){return on(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 on(e){return[...new Set(e)]}function sn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function cn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!en(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(sn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ln(){let e=v.useContext(Le);return Zt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function un(){let e=v.useContext(Re);return Zt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var dn=v.createContext(void 0);dn.displayName=`FrameworkContext`;function fn(){let e=v.useContext(dn);return Zt(e,`You must render this element inside a <HydratedRouter> element`),e}function pn(e,t){let n=v.useContext(dn),[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:mn(s,p),onBlur:mn(c,m),onMouseEnter:mn(l,p),onMouseLeave:mn(u,m),onTouchStart:mn(d,p)}]:[a,f,{}]:[!1,f,{}]}function mn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function hn({page:e,...t}){let n=Be(),{router:r}=ln(),i=v.useMemo(()=>F(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?v.createElement(_n,{page:e,matches:i,...t}):v.createElement(vn,{page:e,matches:i,...t}):null}function gn(e){let{manifest:t,routeModules:n}=fn(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return nn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function _n({page:e,matches:t,...n}){let r=tt(),{future:i}=fn(),{basename:a}=ln(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Qt(e,a,i.unstable_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.unstable_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 vn({page:e,matches:t,...n}){let r=tt(),{future:i,manifest:a,routeModules:o}=fn(),{basename:s}=ln(),{loaderData:c,matches:l}=un(),u=v.useMemo(()=>rn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>rn(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=Qt(e,s,i.unstable_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.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>an(d,a),[d,a]),m=gn(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 yn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var bn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{bn&&(window.__reactRouterVersion=`7.15.0`)}catch{}function xn({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=E({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(At,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Sn({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(At,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Sn.displayName=`unstable_HistoryRouter`;var Cn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wn=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(We),y=typeof l==`string`&&Cn.test(l),b=Pe(l,h);l=b.to;let x=$e(l,{relative:r}),S=tt(),C=null;if(o){let e=Ce(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Te([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=pn(n,p),D=jn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=v.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:yn(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,A,v.createElement(hn,{page:x})):A});wn.displayName=`Link`;var Tn=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=ot(a,{relative:c.relative}),d=tt(),f=v.useContext(Re),{navigator:p,basename:m}=v.useContext(We),h=f!=null&&Hn(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=ge(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(wn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Tn.displayName=`NavLink`;var En=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Nt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(We),g=Fn(),_=In(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Cn.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})});En.displayName=`Form`;function Dn({getKey:e,storageKey:t,...n}){let r=v.useContext(dn),{basename:i}=v.useContext(We),a=tt(),o=Ct();Bn({getKey:e,storageKey:t});let s=v.useMemo(()=>{if(!r||!e)return null;let t=zn(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 v.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Xt(JSON.stringify(t||Ln))}, ${Xt(JSON.stringify(s))})`}})}Dn.displayName=`ScrollRestoration`;function On(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kn(e){let t=v.useContext(Le);return D(t,On(e)),t}function An(e){let t=v.useContext(Re);return D(t,On(e)),t}function jn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=it(),d=tt(),f=ot(e,{relative:o});return v.useCallback(p=>{if(Bt(p,t)){p.preventDefault();let t=n===void 0?M(d)===M(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 Mn(e){O(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(Vt(e)),n=v.useRef(!1),r=tt(),i=v.useMemo(()=>Ht(r.search,n.current?null:t.current),[r.search]),a=it();return[i,v.useCallback((e,t)=>{let r=Vt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Nn=0,Pn=()=>`__${String(++Nn)}__`;function Fn(){let{router:e}=kn(`useSubmit`),{basename:t}=v.useContext(We),n=xt(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=qt(e,t);a.navigate===!1?await r(a.fetcherKey||Pn(),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 In(e,{relative:t}={}){let{basename:n}=v.useContext(We),r=v.useContext(Ke);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ot(e||`.`,{relative:t})},o=tt();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:Te([n,a.pathname])),M(a)}var Ln=`react-router-scroll-positions`,Rn={};function zn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ge(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Bn({getKey:e,storageKey:t}={}){let{router:n}=kn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=An(`useScrollRestoration`),{basename:a}=v.useContext(We),o=tt(),s=Ct(),c=St();v.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Vn(v.useCallback(()=>{if(c.state===`idle`){let t=zn(o,s,a,e);Rn[t]=window.scrollY}try{sessionStorage.setItem(t||Ln,JSON.stringify(Rn))}catch(e){O(!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||Ln);e&&(Rn=JSON.parse(e))}catch{}},[t]),v.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Rn,()=>window.scrollY,e?(t,n)=>zn(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{O(!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 Vn(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 Hn(e,{relative:t}={}){let n=v.useContext(Ve);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kn(`useViewTransitionState`),i=ot(e,{relative:t});if(!n.isTransitioning)return!1;let a=ge(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ge(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pe(i.pathname,o)!=null||pe(i.pathname,a)!=null}var V=localStorage.getItem(`TOTAL_RECALL_API_BASE`)||``;function Un(){return V}function Wn(e){V=e,localStorage.setItem(`TOTAL_RECALL_API_BASE`,e),window.location.reload()}var Gn=null;function Kn(e){Gn=e}async function H(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&&Gn?.(),i}async function qn(){try{return(await fetch(V+`/auth/me`,{credentials:`include`})).ok}catch{return!1}}async function Jn(e){try{let t=await fetch(V+`/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 Yn(e){try{let t=await fetch(V+`/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 Xn(){try{let e=await fetch(V+`/auth/status`);return e.ok?await e.json():{configured:!0}}catch{return{configured:!0}}}async function Zn(e){try{let t=await fetch(V+`/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 Qn(){await fetch(V+`/auth/logout`,{method:`POST`,credentials:`include`}).catch(()=>{})}async function $n(e,t,n,r,i,a){let o={"Content-Type":`application/json`};n&&(o[`x-session-id`]=n);let s=await H(V+`/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 er(e){let t={};e&&(t[`x-session-id`]=e);let n=await H(V+`/v1/chat/history`,{headers:t});if(!n.ok)throw Error(`Chat history error: ${n.status}`);return(await n.json()).messages??[]}async function tr(){let e=await H(V+`/v1/chat/threads`);if(!e.ok)throw Error(`Chat threads list error: ${e.status}`);return e.json()}async function nr(e){let t=await H(V+`/v1/chat/threads/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Delete chat thread error: ${t.status}`);return t.json()}async function rr(){try{let e=await H(V+`/api/tts/status`);return e.ok?e.json():{enabled:!1}}catch{return{enabled:!1}}}async function ir(e){let t=await H(V+`/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 ar(){let e=await H(V+`/health`);if(!e.ok)throw Error(`Health API error: ${e.status}`);return e.json()}async function or(e,t,n){let r=new URLSearchParams;if(t&&r.set(`category`,t),n&&r.set(`status`,n),!e){let e=await H(`${V}/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`?`${V}/api/memory?${r}`:`${V}/api/brains/${e}/nodes?${r}`;try{let e=await H(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 sr(e,t){let n=new URLSearchParams({q:e});t&&n.set(`category`,t);let r=await H(`${V}/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 cr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await H(`${V}/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 lr(e,t=5e3){try{let n=await H(`${V}/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 ur(){let e=await H(V+`/api/tasks`);if(!e.ok)throw Error(`Tasks API error: ${e.status}`);return e.json()}async function dr(e,t,n,r){let i=await H(V+`/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 fr(){let e=await H(V+`/api/skills`);if(!e.ok)throw Error(`Skills API error: ${e.status}`);return e.json()}async function pr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await H(`${V}/api/skills/${encodeURIComponent(e)}${n}`);if(!r.ok)throw Error(`Skill fetch API error: ${r.status}`);return r.json()}async function mr(e,t,n){let r=new URLSearchParams({dir:t});n&&r.set(`repo`,n);let i=await H(`${V}/api/skills/${encodeURIComponent(e)}/files?${r}`);if(!i.ok)throw Error(`Skill files fetch API error: ${i.status}`);return i.json()}async function hr(e,t,n){let r=n?`?repo=${encodeURIComponent(n)}`:``,i=await H(`${V}/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 gr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await H(`${V}/api/skills/${encodeURIComponent(e)}${n}`,{method:`DELETE`});if(!r.ok)throw Error(`Skill delete API error: ${r.status}`)}async function _r(e){let t=new URLSearchParams({q:e}),n=await H(`${V}/api/skills/search?${t}`);if(!n.ok)throw Error(`Registry search API error: ${n.status}`);return n.json()}async function vr(e){let t=await H(`${V}/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 yr(){let e=await H(`${V}/api/usage`);if(!e.ok)throw Error(`Usage API error: ${e.status}`);return e.json()}async function br(){let e=await H(`${V}/api/config-json`);if(!e.ok)throw Error(`Config JSON API error: ${e.status}`);return e.json()}async function xr(){return(await H(`${V}/api/brains`)).json()}async function Sr(e){let t=await H(`${V}/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}`)}async function Cr(){let e=await H(`${V}/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 wr(e,t,n){let r=await H(`${V}/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 Tr(e){let t=await H(`${V}/api/keys/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Keys API error: ${t.status}`)}async function Er(){let e=await H(`${V}/api/secrets/scan-env`);if(!e.ok)throw Error(`Env scan failed: ${e.status}`);return e.json()}async function Dr(e){let t=await H(`${V}/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 Or(e){let t=await H(`${V}/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 kr(){let e=await H(`${V}/api/secrets`);if(!e.ok)throw Error(`Secrets catalog error: ${e.status}`);return e.json()}async function Ar(e,t){let n=await H(`${V}/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 jr(e,t,n={}){let r=await H(`${V}/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 Mr(e){let t=await H(`${V}/api/secrets/${encodeURIComponent(e)}`,{method:`DELETE`});if(!t.ok)throw Error(`Delete failed: ${t.status}`)}async function Nr(e){let t=await H(`${V}/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 Pr(e){let t=await H(`${V}/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 Fr(){let e=await H(`${V}/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 Ir(){let e=await H(`${V}/api/webauthn/status`);if(!e.ok)throw Error(`WebAuthn status failed: ${e.status}`);return e.json()}async function Lr(){let e=await H(`${V}/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 Rr(e,t){let n=await H(`${V}/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 zr(){let e=await H(`${V}/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 Br(e){let t=await H(`${V}/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 Vr(e){let t=await H(`${V}/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 Hr(e,t){let n=await H(`${V}/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 Ur(e,t){let n=await H(`${V}/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 Wr(){let e=await H(`${V}/api/integrations/active`,{method:`GET`});if(!e.ok)throw Error(`Integrations API error: ${e.status}`);return e.json()}async function Gr(e){let t=new URLSearchParams;e&&t.set(`status`,e);let n=await H(`${V}/api/research?${t}`);if(!n.ok)throw Error(`Research API error: ${n.status}`);return n.json()}async function Kr(e,t,n){let r=await H(`${V}/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 qr(e,t){let n=await H(`${V}/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 Jr(e){let t=await H(`${V}/api/research/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Research DELETE error: ${t.status}`)}async function Yr(e){let t=await H(`${V}/api/logs/${e}`);if(!t.ok)throw Error(`Logs API error: ${t.status}`);return t.json()}async function Xr(){let e=await H(`${V}/api/vault/compile`,{method:`POST`});if(!e.ok)throw Error(`Recompile API error: ${e.status}`);return e.json()}async function Zr(){let e=await H(`${V}/api/diagnostics/agents`,{method:`POST`});if(!e.ok)throw Error(`Diagnostics API error: ${e.status}`);return e.json()}async function Qr(){let e=await H(`${V}/api/conflicts`);if(!e.ok)throw Error(`Conflicts API error: ${e.status}`);return e.json()}async function $r(e,t,n){let r=await H(`${V}/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 ei(e,t,n){let r=new URLSearchParams;n&&r.set(`brain`,n);let i=r.toString(),a=await H(`${V}/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 ti(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await H(`${V}/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 ni(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await H(`${V}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`,{method:`DELETE`});if(!i.ok)throw Error(`Failed to delete memory: ${i.status}`)}async function ri(e=50,t=0){let n=new URLSearchParams({limit:String(e),offset:String(t)}),r=await H(`${V}/api/sessions?${n}`);if(!r.ok)throw Error(`Sessions API error: ${r.status}`);return r.json()}async function ii(e){let t=await H(`${V}/api/sessions/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete session: ${t.status}`)}async function ai(){let e=await H(`${V}/api/gemini-models?t=${Date.now()}`);if(!e.ok)throw Error(`Gemini models API error: ${e.status}`);return(await e.json()).models??[]}async function oi(){let e=await H(`${V}/api/claude-models?t=${Date.now()}`);if(!e.ok)throw Error(`Claude models API error: ${e.status}`);return(await e.json()).models??[]}async function si(){let e=await H(`${V}/api/openai-models?t=${Date.now()}`);if(!e.ok)throw Error(`OpenAI models API error: ${e.status}`);return(await e.json()).models??[]}async function ci(){let e=await H(`${V}/api/openrouter-models?t=${Date.now()}`);if(!e.ok)throw Error(`OpenRouter models API error: ${e.status}`);return(await e.json()).models??[]}async function li(e){let t=await H(`${V}/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 H(`${V}/api/extension/status`);return e.ok?e.json():{available:!1,connected:!1}}async function di(){let e=await H(`${V}/api/update/check`);if(!e.ok)throw Error(`Check update API error: ${e.status}`);return e.json()}async function fi(){let e=await H(`${V}/api/update/run`,{method:`POST`});if(!e.ok)throw Error(`Run update API error: ${e.status}`);return e.json()}async function pi(){let e=await H(`${V}/api/help`);if(!e.ok)throw Error(`Failed to load help topics`);return e.json()}async function mi(e){let t=await H(`${V}/api/help?topic=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Failed to load help content`);return t.json()}async function hi(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 H(`${V}/api/memory?${n}`);if(!e.ok)throw Error(`OpenWiki nodes error: ${e.status}`);let t=await e.json();return gi(Array.isArray(t)?t:t.nodes??[])}let i=r.map(async e=>{try{if(e===`global`){let e=await H(`${V}/api/memory?${n}`);if(!e.ok)return[];let t=await e.json();return Array.isArray(t)?t:t.nodes??[]}let t=await H(`${V}/api/brains/${encodeURIComponent(e)}/nodes`);if(!t.ok){let t=await H(`${V}/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 gi(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 gi(e))s.has(t.slug)||(s.add(t.slug),o.push(t));return o}function gi(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-`)})}var _i=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})),U=o(((e,t)=>{t.exports=_i()}))(),vi={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 yi({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,U.jsx)(`img`,{src:vi[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,U.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 bi({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=(0,v.useRef)(null);(0,v.useEffect)(()=>{async function e(){try{(await Xn()).configured||f(!0)}catch{}}e()},[]),(0,v.useEffect)(()=>{p.current?.focus()},[l,d]);async function m(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 Zn(r);if(t.ok){let t=await Jn(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 Yn(r);t.ok?e():o(t.error||`Failed to change password`)}else{let r=await Jn(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 h=s||(d||l?!r:!t);return(0,U.jsxs)(`div`,{className:`login-shell`,children:[(0,U.jsxs)(`div`,{className:`login-card`,children:[(0,U.jsxs)(`div`,{style:{textAlign:`center`,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:16},children:[l||d?(0,U.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,U.jsxs)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 24 24`,fill:`none`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,U.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}):(0,U.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,U.jsx)(yi,{variant:`lockup`,height:56,alt:`Total Recall`})}),(0,U.jsxs)(`div`,{children:[(0,U.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,U.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,U.jsxs)(`form`,{onSubmit:m,style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,U.jsx)(`input`,{type:`text`,name:`username`,autoComplete:`username`,style:{display:`none`}}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.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,U.jsx)(`input`,{id:`login-password`,ref:p,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,U.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,U.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,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,U.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]}),a]}),(0,U.jsx)(`button`,{id:`login-submit`,type:`submit`,disabled:h,className:h?void 0:`btn btn-primary`,style:{width:`100%`,justifyContent:`center`,padding:`12px 0`,fontSize:14,borderRadius:12,border:`none`,cursor:h?`not-allowed`:`pointer`,background:h?`var(--bg-tertiary)`:void 0,color:h?`var(--text-tertiary)`:void 0,display:`flex`,alignItems:`center`,gap:8},children:s?(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.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,U.jsxs)(`p`,{style:{textAlign:`center`,fontSize:11,color:`var(--text-tertiary)`,margin:0,lineHeight:1.5},children:[`Local-first vault · credentials in`,` `,(0,U.jsx)(`code`,{style:{color:`#93c5fd`,fontSize:11},children:`~/.agent/config/security.yml`})]})]}),(0,U.jsx)(`style`,{children:`
12
+ @keyframes spin { to { transform: rotate(360deg); } }
13
+ `})]})}function xi(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 Si(e){return e.split(/(\*\*.*?\*\*|`.*?`|\[\[.*?\]\])/g).map((e,t)=>{if(e.startsWith(`**`)&&e.endsWith(`**`))return(0,U.jsx)(`strong`,{style:{color:`var(--text-primary)`,fontWeight:600},children:e.slice(2,-2)},t);if(e.startsWith("`")&&e.endsWith("`"))return(0,U.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,U.jsx)(wn,{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 Ci(e){return e?e.split(`
14
+ `).map((e,t)=>{let n=e.trim();if(n.startsWith(`### `))return(0,U.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,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:8,margin:`4px 0 4px 12px`,fontSize:13,color:`var(--text-secondary)`},children:[(0,U.jsx)(`span`,{style:{color:`var(--accent)`,userSelect:`none`},children:`•`}),(0,U.jsx)(`span`,{children:Si(n.slice(2))})]},t);let r=n.match(/^(\d+)\.\s+(.*)$/);return r?(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8,margin:`4px 0 4px 12px`,fontSize:13,color:`var(--text-secondary)`},children:[(0,U.jsxs)(`span`,{style:{color:`var(--accent)`,fontWeight:600},children:[r[1],`.`]}),(0,U.jsx)(`span`,{children:Si(r[2])})]},t):n?(0,U.jsx)(`p`,{style:{margin:`6px 0`,fontSize:13,color:`var(--text-secondary)`,lineHeight:`1.6`},children:Si(e)},t):(0,U.jsx)(`div`,{style:{height:8}},t)}):null}function wi({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,U.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,U.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,U.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,U.jsxs)(`div`,{style:{position:`absolute`,top:16,left:16,zIndex:30,display:`flex`,flexDirection:`column`,gap:6,pointerEvents:`none`,maxWidth:280},children:[(0,U.jsx)(`h3`,{style:{margin:0,fontSize:18,color:`#f1f5f9`,fontWeight:700,letterSpacing:`-0.02em`},children:`Memory Constellation`}),(0,U.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,U.jsxs)(`div`,{style:{position:`absolute`,bottom:20,left:20,zIndex:40,display:`flex`,gap:8,pointerEvents:`auto`},children:[(0,U.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,U.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,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsx)(`span`,{style:{fontSize:9,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:1},children:`Constellation Filters`}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_.research,onChange:()=>y(e=>({...e,research:!e.research})),style:{accentColor:`#fbbf24`,cursor:`pointer`}}),(0,U.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,U.jsx)(`span`,{style:{flex:1},children:`Research`}),(0,U.jsxs)(`span`,{style:{fontSize:9,color:`var(--text-tertiary)`},children:[`(`,n.length,`)`]})]}),(0,U.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_.observations,onChange:()=>y(e=>({...e,observations:!e.observations})),style:{accentColor:`#60a5fa`,cursor:`pointer`}}),(0,U.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,U.jsx)(`span`,{style:{flex:1},children:`Memory`}),(0,U.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,U.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_.rules,onChange:()=>y(e=>({...e,rules:!e.rules})),style:{accentColor:`#38bdf8`,cursor:`pointer`}}),(0,U.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,U.jsx)(`span`,{style:{flex:1},children:`Rules`}),(0,U.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,U.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:11,color:`var(--text-secondary)`,cursor:`pointer`,userSelect:`none`},children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_.threads,onChange:()=>y(e=>({...e,threads:!e.threads})),style:{accentColor:`#22d3ee`,cursor:`pointer`}}),(0,U.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,U.jsx)(`span`,{style:{flex:1},children:`Sessions`}),(0,U.jsxs)(`span`,{style:{fontSize:9,color:`var(--text-tertiary)`},children:[`(`,e.length,`)`]})]})]})]}),d&&(0,U.jsxs)(`div`,{className:`node-detail-drawer animate-slide-in`,children:[(0,U.jsxs)(`div`,{className:`drawer-header`,children:[(0,U.jsx)(`span`,{className:`drawer-badge badge-${d.type}`,children:d.type===`memory`?`🧠 Knowledge`:d.type===`thread`?`💬 Thread`:`🕵️ Research`}),(0,U.jsx)(`button`,{className:`drawer-close-btn`,onClick:()=>f(null),children:`×`})]}),(0,U.jsxs)(`div`,{className:`drawer-body`,children:[(0,U.jsx)(`h4`,{className:`drawer-title`,children:d.title}),(0,U.jsx)(`span`,{className:`drawer-subtitle`,children:d.subtitle}),d.type===`memory`&&(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`},children:`Confidence:`}),` `,(0,U.jsxs)(`strong`,{style:{color:d.originalData.confidence>.7?`#22c55e`:`#f59e0b`},children:[Math.round(d.originalData.confidence*100),`%`]})]}),d.originalData.importance!==void 0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`},children:`Importance:`}),` `,(0,U.jsxs)(`strong`,{style:{color:`#a78bfa`},children:[`★ `,d.originalData.importance,`/5`]})]}),d.status&&(0,U.jsxs)(`div`,{style:{gridColumn:`span 2`},children:[(0,U.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`},children:`Status:`}),` `,(0,U.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,U.jsxs)(`div`,{className:`drawer-relations`,style:{fontSize:`11px`,margin:`12px 0`},children:[(0,U.jsx)(`span`,{style:{color:`rgba(255,255,255,0.45)`,display:`block`,marginBottom:`4px`},children:`Ontology Relations:`}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:`4px`},children:[d.originalData.related?.map(e=>(0,U.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,U.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,U.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,U.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:Ci(d.originalData.content||d.originalData.body||d.excerpt||`No content details available.`)}):(0,U.jsx)(`p`,{className:`drawer-excerpt`,style:{whiteSpace:`pre-wrap`},children:d.excerpt})]}),(0,U.jsxs)(`div`,{className:`drawer-footer`,children:[d.type===`thread`&&(0,U.jsx)(`button`,{className:`drawer-action-btn btn-cyan`,onClick:()=>{r(d.originalData.id),f(null)},children:`Open Thread`}),d.type===`memory`&&(0,U.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,U.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...`})]})]})]})}var Ti=0;function Ei(){return Date.now()}function Di(e){let t=Ei()-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 Oi({activeBrainId:e,onBrainChange:t}){let n=it(),[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,ee]=(0,v.useState)([]),[F,I]=(0,v.useState)([]),[te,ne]=(0,v.useState)([]),[re,ie]=(0,v.useState)(!1),[L,R]=(0,v.useState)(``),ae=(0,v.useRef)(null),[oe,se]=(0,v.useState)([]),[z,ce]=(0,v.useState)(()=>{let e=localStorage.getItem(`selectedModel`);return e&&e!==`gemini`?e:`antigravity`}),[le,ue]=(0,v.useState)(()=>localStorage.getItem(`selectedSubModel`)||``),[de,fe]=(0,v.useState)([]),[pe,me]=(0,v.useState)(!1),he=(0,v.useRef)(null),ge=(0,v.useCallback)(()=>{l.current?.scrollIntoView({behavior:`smooth`})},[]);(0,v.useEffect)(ge,[r,ge]);let _e=(0,v.useCallback)(()=>{tr().then(e=>{j(e)}).catch(console.error),Gr().then(e=>ne(e.items||[])).catch(console.error)},[]);(0,v.useEffect)(()=>{tr().then(e=>{j(e),e.length>0&&(N(e[0].id),e[0].brainId&&t&&t(e[0].brainId))}).catch(console.error),Gr().then(e=>ne(e.items||[])).catch(console.error),ar().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))ce(n);else{let e=t.includes(`antigravity`)?`antigravity`:t.includes(`grok`)?`grok`:t[0];ce(e),localStorage.setItem(`selectedModel`,e)}}).catch(()=>{let e=[`antigravity`,`grok`,`claude`,`codex`];se(e);let t=localStorage.getItem(`selectedModel`);t&&e.includes(t)?ce(t):(ce(`antigravity`),localStorage.setItem(`selectedModel`,`antigravity`))}),ai().then(e=>{if(fe(e),e&&e.length>0){let t=localStorage.getItem(`selectedSubModel`),n=e.some(e=>e.id===t);t&&n?ue(t):(ue(e[0].id),localStorage.setItem(`selectedSubModel`,e[0].id))}}).catch(console.error)},[]),(0,v.useEffect)(()=>{let e=!0,t=()=>{di().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=()=>{or(e).then(e=>{t&&(I(e),ee(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)&&ie(!1),he.current&&!he.current.contains(e.target)&&me(!1)}return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[ae,he]),(0,v.useEffect)(()=>{er(M).then(e=>{e?(i(e),Ti=Math.max(Ti,e.length+1)):i([])}).catch(e=>{console.error(e),i([])})},[M]),(0,v.useEffect)(()=>{!p||h!==null||rr().then(e=>g(e.enabled)).catch(()=>g(!1))},[p,h]),(0,v.useEffect)(()=>{O||ui().then(D).catch(()=>{})},[O]);let ve=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)},ye=async e=>{if(!(!p||!e.trim())){if(h===!1){ve(e);return}try{let t=await ir(e);if(!t){g(!1),ve(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(()=>ve(e))}catch{ve(e)}}},be=()=>{N(`thread-${Ei()}`),i([]),o(``),ee([]),u.current&&(u.current.style.height=`44px`)},xe=async(e,t)=>{if(e.stopPropagation(),confirm(`Are you sure you want to delete this conversation thread?`))try{if(await nr(t),M===t){let e=A.filter(e=>e.id!==t);e.length>0?N(e[0].id):(N(void 0),i([]))}_e()}catch(e){console.error(`Failed to delete thread:`,e)}},Se=async()=>{let t=a.trim();if(!t||s)return;let n=M||`thread-${Ei()}`;M||N(n);let l={id:String(++Ti),role:`user`,content:t,timestamp:Ei()};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(++Ti),role:`assistant`,content:`🕵️ **Deep Research Agents dispatched.** Gathering facts across parallel web streams...`,timestamp:Ei()}]);let{slug:e}=await dr(`proactive-research`,t,t),n=!1;for(;!n;){await new Promise(e=>setTimeout(e,2e3));let t=(await ur()).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(++Ti),role:`assistant`,content:t.body||``,timestamp:Ei()}]),ye(t.body||``))}c(!1);return}let a=[`gemini`,`antigravity`].includes(z)&&le?`${z}:${le}`:z,o=await $n([...r,l].map(e=>({role:e.role,content:e.content})),d.current.signal,n,P,a,e),s={id:String(++Ti),role:`assistant`,content:o,timestamp:Ei(),versions:[o],currentVersionIndex:0};i(e=>[...e,s]),ye(o),_e()}catch(e){if(e.name===`AbortError`)i(e=>[...e,{id:String(++Ti),role:`assistant`,content:`⛔ Generation stopped by user.`,timestamp:Ei(),versions:[`⛔ Generation stopped by user.`],currentVersionIndex:0}]);else{let t={id:String(++Ti),role:`assistant`,content:`⚠️ Error: ${e.message}`,timestamp:Ei(),versions:[`⚠️ Error: ${e.message}`],currentVersionIndex:0};i(e=>[...e,t])}}finally{c(!1),d.current=null}},Ce=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(z)&&le?`${z}:${le}`:z,a=await $n(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}),ye(a),_e()}catch(e){e.name!==`AbortError`&&console.error(e)}finally{c(!1),d.current=null}},we=e=>{navigator.clipboard.writeText(e).catch(console.error)},Te=(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})},Ee=()=>{d.current&&(d.current.abort(),d.current=null,c(!1))},De=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Se())},Oe=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)},ke=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)}},Ae=F.filter(e=>e.title.toLowerCase().includes(L.toLowerCase())||e.slug.toLowerCase().includes(L.toLowerCase())||e.category&&e.category.toLowerCase().includes(L.toLowerCase()));return(0,U.jsxs)(`div`,{className:`chat-layout`,children:[(0,U.jsxs)(`aside`,{className:`chat-threads-sidebar`,children:[(0,U.jsx)(`div`,{className:`sidebar-header`,children:(0,U.jsxs)(`button`,{className:`new-chat-btn`,onClick:be,children:[(0,U.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,U.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,U.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}),`New Chat`]})}),(0,U.jsx)(`div`,{className:`thread-list`,children:A.map(e=>(0,U.jsxs)(`div`,{className:`thread-item ${M===e.id?`active`:``}`,onClick:()=>{N(e.id),e.brainId&&t&&t(e.brainId)},children:[(0,U.jsxs)(`div`,{className:`thread-info`,children:[(0,U.jsx)(`div`,{className:`thread-title`,title:e.title,children:e.title}),(0,U.jsxs)(`div`,{className:`thread-meta`,children:[(0,U.jsxs)(`span`,{children:[e.turns,` `,e.turns===1?`turn`:`turns`]}),(0,U.jsx)(`span`,{children:`•`}),(0,U.jsx)(`span`,{children:Di(e.lastUpdated)})]})]}),(0,U.jsx)(`button`,{className:`thread-delete-btn`,onClick:t=>xe(t,e.id),title:`Delete chat thread`,children:(0,U.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,U.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,U.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,U.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,U.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]},e.id))})]}),(0,U.jsxs)(`div`,{className:`chat-container`,style:{position:`relative`,overflow:`hidden`},children:[(0,U.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,U.jsx)(wi,{threads:A,memoryNodes:F,researchItems:te,onOpenThread:()=>{},onGroundMemoryNode:()=>{},selectedGroundingNodes:P,interactive:!1})}),(0,U.jsxs)(`header`,{className:`chat-header animate-fade-in`,style:{position:`relative`,zIndex:40,overflow:`visible`},children:[(0,U.jsxs)(`div`,{className:`chat-header-title`,children:[(0,U.jsx)(`h2`,{children:`Chat Session`}),M&&(0,U.jsx)(`span`,{className:`badge badge-accent`,style:{textTransform:`none`,letterSpacing:`normal`,fontSize:`11px`,padding:`2px 8px`},children:M})]}),(0,U.jsxs)(`div`,{className:`chat-header-model-selector`,ref:he,style:{position:`relative`,zIndex:50},children:[(0,U.jsx)(`span`,{className:`selector-label`,children:`Model / provider:`}),(0,U.jsxs)(`div`,{className:`model-selector-dropdown-wrapper`,style:{position:`relative`,zIndex:50},children:[(0,U.jsxs)(`button`,{type:`button`,className:`model-selector-dropdown-btn ${pe?`active`:``}`,onClick:e=>{e.stopPropagation(),me(e=>!e)},title:`Select CLI agent / provider`,children:[(0,U.jsx)(`span`,{style:{textTransform:`capitalize`},children:z||`Select Model`}),(0,U.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,U.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),pe&&(0,U.jsx)(`div`,{className:`model-selector-menu glass`,style:{zIndex:200,pointerEvents:`auto`},role:`listbox`,children:oe.map(e=>(0,U.jsxs)(`div`,{role:`option`,"aria-selected":z===e,className:`model-selector-item ${z===e?`selected`:``}`,onClick:t=>{t.stopPropagation(),ce(e),localStorage.setItem(`selectedModel`,e),ue(``),localStorage.removeItem(`selectedSubModel`),me(!1)},children:[(0,U.jsxs)(`div`,{className:`model-selector-item-info`,children:[(0,U.jsx)(`span`,{className:`model-selector-item-name`,style:{textTransform:`capitalize`},children:e}),(0,U.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,U.jsx)(`span`,{className:`model-selector-item-badge`,children:`CLI`})]},e))})]}),[`gemini`,`antigravity`].includes(z)&&de.length>0&&(0,U.jsxs)(`div`,{className:`chat-header-submodel-selector`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,U.jsx)(`span`,{className:`selector-label`,style:{fontSize:`12px`,color:`var(--text-tertiary)`,fontWeight:500},children:`Base:`}),(0,U.jsx)(`select`,{value:le,onChange:e=>{ue(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:de.map(e=>(0,U.jsx)(`option`,{value:e.id,style:{background:`#12121a`,color:`var(--text-secondary)`},children:e.displayName},e.id))})]})]})]}),_?.updateAvailable&&(0,U.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,U.jsx)(`span`,{style:{fontSize:22,flexShrink:0},children:`🚀`}),(0,U.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,U.jsx)(`div`,{style:{fontWeight:600,fontSize:13,color:`var(--text-primary)`,marginBottom:2},children:`System Update Available`}),(0,U.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-secondary)`},children:[`Version `,_.latestVersion,` is available. Upgrade to load the latest features.`]})]}),(0,U.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,U.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,U.jsx)(`span`,{style:{fontSize:22,flexShrink:0},children:`🧩`}),(0,U.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,U.jsx)(`div`,{style:{fontWeight:600,fontSize:13,color:`var(--text-primary)`,marginBottom:2},children:`Chrome Extension Available`}),(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-secondary)`},children:`Browse with your brain — contextual memory, quick capture, and research from any page`})]}),(0,U.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,U.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,U.jsx)(`div`,{className:`chat-messages`,style:{position:`relative`,zIndex:1,pointerEvents:`auto`},children:(0,U.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,U.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,U.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e.content}),e.role===`assistant`&&(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`center`,marginRight:4},children:[(0,U.jsx)(`button`,{onClick:()=>Te(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,U.jsxs)(`span`,{children:[(e.currentVersionIndex||0)+1,` / `,e.versions.length]}),(0,U.jsx)(`button`,{onClick:()=>Te(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,U.jsx)(`button`,{onClick:()=>we(e.content),title:`Copy to clipboard`,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:4},children:(0,U.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,U.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,U.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}),(0,U.jsx)(`button`,{onClick:()=>ye(e.content),title:`Read Aloud`,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:4},children:(0,U.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,U.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,U.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,U.jsx)(`button`,{onClick:()=>Ce(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,U.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,U.jsx)(`polyline`,{points:`1 4 1 10 7 10`}),(0,U.jsx)(`polyline`,{points:`23 20 23 14 17 14`}),(0,U.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,U.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,U.jsx)(`span`,{className:`skeleton`,style:{display:`inline-block`,width:180,height:16}})}),(0,U.jsx)(`div`,{ref:l})]})}),(0,U.jsxs)(`div`,{className:`chat-input-bar`,style:{position:`relative`,zIndex:30,pointerEvents:`auto`},children:[P.length>0&&(0,U.jsx)(`div`,{className:`grounding-pills`,children:P.map(e=>{let t=F.find(t=>t.slug===e);return(0,U.jsxs)(`div`,{className:`grounding-pill animate-fade-in`,children:[(0,U.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,U.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,U.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,U.jsx)(`span`,{className:`grounding-pill-title`,children:t?.title||e}),(0,U.jsx)(`button`,{className:`grounding-pill-remove`,onClick:()=>ee(t=>t.filter(t=>t!==e)),title:`Remove grounding context`,children:`×`})]},e)})}),(0,U.jsxs)(`div`,{className:`chat-input-wrapper`,children:[(0,U.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,U.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,U.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,U.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,U.jsx)(`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}),(0,U.jsx)(`line`,{x1:`8`,x2:`16`,y1:`22`,y2:`22`})]}):(0,U.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,U.jsx)(`line`,{x1:`1`,x2:`23`,y1:`1`,y2:`23`}),(0,U.jsx)(`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.88`}),(0,U.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-1.39 4.2M5 10v2a7 7 0 0 0 1.93 4.88`}),(0,U.jsx)(`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}),(0,U.jsx)(`line`,{x1:`8`,x2:`16`,y1:`22`,y2:`22`})]})}),(0,U.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,U.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,U.jsx)(`path`,{d:`M12 2v20`}),(0,U.jsx)(`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`})]})}),(0,U.jsxs)(`div`,{style:{position:`relative`,display:`flex`},ref:ae,children:[(0,U.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:()=>ie(!re),title:`Ground with brain nodes`,children:[(0,U.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,U.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,U.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,U.jsx)(`span`,{className:`grounding-count-badge`,children:P.length})]}),re&&(0,U.jsxs)(`div`,{className:`node-selector-popover glass`,children:[(0,U.jsxs)(`div`,{className:`node-selector-header`,children:[(0,U.jsx)(`h4`,{children:`Ground with Brain Nodes`}),(0,U.jsx)(`input`,{type:`text`,placeholder:`Search nodes...`,value:L,onChange:e=>R(e.target.value),className:`node-search-input`,autoFocus:!0})]}),(0,U.jsx)(`div`,{className:`node-selector-list`,children:Ae.length===0?(0,U.jsx)(`div`,{className:`node-selector-empty`,children:`No nodes found`}):Ae.map(e=>{let t=P.includes(e.slug);return(0,U.jsxs)(`div`,{className:`node-selector-item ${t?`selected`:``}`,onClick:()=>{ee(t?t=>t.filter(t=>t!==e.slug):t=>[...t,e.slug])},children:[(0,U.jsx)(`span`,{className:`node-selector-item-checkbox`,children:t?`✓`:``}),(0,U.jsxs)(`div`,{className:`node-selector-item-info`,children:[(0,U.jsx)(`span`,{className:`node-selector-item-title`,children:e.title}),(0,U.jsxs)(`span`,{className:`node-selector-item-meta`,children:[e.category,` • `,e.status||`active`]})]})]},e.slug)})})]})]}),(0,U.jsx)(`textarea`,{ref:u,id:`chat-input`,value:a,onChange:Oe,onKeyDown:De,placeholder:`Message your brain…`,rows:1,disabled:s}),s?(0,U.jsx)(`button`,{className:`chat-send-btn`,onClick:Ee,id:`chat-stop`,style:{background:`var(--error)`,color:`#fff`},title:`Stop Generation`,children:(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,style:{width:20,height:20},children:(0,U.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`,ry:`2`})})}):(0,U.jsx)(`button`,{className:`chat-send-btn`,onClick:Se,disabled:!a.trim(),id:`chat-send`,title:`Send Message`,children:(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.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,U.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,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`🔗 URL detected`}),(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>ke(`research`),children:`🔬 Research`}),(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>ke(`remember`),children:`📌 Remember`})]}),w&&(0,U.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 ki=[`all`,`invariants`,`preferences`,`anti-patterns`,`patterns`,`decisions`,`concepts`,`facts`,`lore`];function W(e){if(!e)return``;let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);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,U.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t},className:`markdown-preview-block`})}function Ai({activeBrainId:e}){let[t,n]=Mn(),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)(``),[ee,F]=(0,v.useState)(``),[I,te]=(0,v.useState)(`invariants`),[ne,re]=(0,v.useState)(``),[ie,L]=(0,v.useState)(`active`),[R,ae]=(0,v.useState)(`low`),[oe,se]=(0,v.useState)(`should`),[z,ce]=(0,v.useState)(1),[le,ue]=(0,v.useState)(3),[de,fe]=(0,v.useState)(``),[pe,me]=(0,v.useState)(``),[he,ge]=(0,v.useState)(``),[_e,ve]=(0,v.useState)(``),ye=(0,v.useCallback)(async()=>{h(!0),_(``);try{f.trim()?s(await sr(f,u===`all`?void 0:u)):s(await or(e,u===`all`?void 0:u))}catch(e){_(e.message),s([])}finally{h(!1)}},[u,f,e]);(0,v.useEffect)(()=>{c&&(P(c.slug||``),F(c.title||``),te(c.category||`invariants`),re(c.content||c.body||``),L(c.status||`active`),ae(c.priority||`low`),se(c.modality||`should`),ce(c.confidence??1),ue(c.importance??3),fe((c.tags||[]).join(`, `)),me((c.related||[]).join(`, `)),ge((c.contradicts||[]).join(`, `)),ve((c.supersedes||[]).join(`, `)))},[c]);let be=async()=>{if(c){h(!0),_(``);try{let t=de.split(`,`).map(e=>e.trim()).filter(Boolean),n=pe.split(`,`).map(e=>e.trim()).filter(Boolean),r=he.split(`,`).map(e=>e.trim()).filter(Boolean),i=_e.split(`,`).map(e=>e.trim()).filter(Boolean);l(await ei(c.slug,{title:ee,category:I,content:ne,status:ie,priority:R,modality:oe,confidence:z,importance:le,tags:t,related:n,contradicts:r,supersedes:i},e)),A(!1),ye()}catch(e){_(e.message)}finally{h(!1)}}},xe=async()=>{if(!N.trim()||!ee.trim()||!ne.trim()){_(`Slug, Title, and Content are required fields.`);return}h(!0),_(``);try{let t=await ti({slug:N,title:ee,category:I,content:ne,status:ie,priority:R,modality:oe,confidence:z,importance:le,tags:de.split(`,`).map(e=>e.trim()).filter(Boolean),related:pe.split(`,`).map(e=>e.trim()).filter(Boolean),contradicts:he.split(`,`).map(e=>e.trim()).filter(Boolean),supersedes:_e.split(`,`).map(e=>e.trim()).filter(Boolean)},e);M(!1),l(t),n({slug:t.slug}),ye()}catch(e){_(e.message)}finally{h(!1)}},Se=async t=>{if(window.confirm(`Are you sure you want to delete memory node "${t}"?`)){h(!0),_(``);try{await ni(t,e),l(null),n({}),ye()}catch(e){_(e.message)}finally{h(!1)}}},Ce=(0,v.useCallback)(async()=>{try{E((await Qr()).conflicts||[])}catch(e){console.warn(`Conflicts API error (enhanced features might be disabled):`,e)}},[]);(0,v.useEffect)(()=>{let e=setTimeout(ye,300);return()=>clearTimeout(e)},[ye]);let we=(0,v.useCallback)(async()=>{w(!0);try{let e=await ri(100);b(e.sessions),S(e.total)}catch(e){_(e.message)}finally{w(!1)}},[]);(0,v.useEffect)(()=>{i===`conflicts`?Ce():i===`sessions`&&we()},[i,Ce,we]);let Te=async e=>{if(window.confirm(`Delete session "${e}"?`))try{await ii(e),we()}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 cr(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`)&&(ye(),Ce())}catch{}},e.onerror=()=>{e.close()},()=>{e.close()}},[ye,Ce]);let Ee=e=>{l(e),_(``),n({slug:e.slug})},De=async(e,t,n)=>{O(e),_(``);try{await $r(e,t,n),await Ce(),await ye()}catch(e){_(e.message)}finally{O(null)}},Oe=(e,t,n)=>(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:16},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Slug (kebab-case, matches filename)`}),(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Title (One-line description)`}),(0,U.jsx)(`input`,{type:`text`,placeholder:`e.g. Always write files atomically (write-then-rename)`,value:ee,onChange:e=>F(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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Category`}),(0,U.jsxs)(`select`,{value:I,onChange:e=>te(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,U.jsx)(`option`,{value:`invariants`,children:`invariants`}),(0,U.jsx)(`option`,{value:`patterns`,children:`patterns`}),(0,U.jsx)(`option`,{value:`anti-patterns`,children:`anti-patterns`}),(0,U.jsx)(`option`,{value:`preferences`,children:`preferences`}),(0,U.jsx)(`option`,{value:`decisions`,children:`decisions`}),(0,U.jsx)(`option`,{value:`concepts`,children:`concepts`}),(0,U.jsx)(`option`,{value:`facts`,children:`facts`}),(0,U.jsx)(`option`,{value:`lore`,children:`lore`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Modality`}),(0,U.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,U.jsx)(`option`,{value:`must`,children:`must`}),(0,U.jsx)(`option`,{value:`must_not`,children:`must_not`}),(0,U.jsx)(`option`,{value:`should`,children:`should`}),(0,U.jsx)(`option`,{value:`should_not`,children:`should_not`})]})]})]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Status`}),(0,U.jsxs)(`select`,{value:ie,onChange:e=>L(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,U.jsx)(`option`,{value:`active`,children:`active`}),(0,U.jsx)(`option`,{value:`draft`,children:`draft`}),(0,U.jsx)(`option`,{value:`deprecated`,children:`deprecated`}),(0,U.jsx)(`option`,{value:`superseded`,children:`superseded`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Importance (1-5 Stars)`}),(0,U.jsxs)(`select`,{value:le,onChange:e=>ue(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,U.jsx)(`option`,{value:1,children:`★ 1/5`}),(0,U.jsx)(`option`,{value:2,children:`★★ 2/5`}),(0,U.jsx)(`option`,{value:3,children:`★★★ 3/5`}),(0,U.jsx)(`option`,{value:4,children:`★★★★ 4/5`}),(0,U.jsx)(`option`,{value:5,children:`★★★★★ 5/5`})]})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:[`Confidence: `,(0,U.jsxs)(`strong`,{children:[Math.round(z*100),`%`]})]}),(0,U.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.05`,value:z,onChange:e=>ce(Number(e.target.value)),style:{width:`100%`,height:6,background:`rgba(255,255,255,0.1)`,borderRadius:3,outline:`none`}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Tags (comma separated)`}),(0,U.jsx)(`input`,{type:`text`,placeholder:`e.g. filesystem, reliability, writes`,value:de,onChange:e=>fe(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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr 1fr`,gap:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Related Nodes (comma separated slugs)`}),(0,U.jsx)(`input`,{type:`text`,placeholder:`e.g. use-atomic-writes, git-wiping`,value:pe,onChange:e=>me(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,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Contradicts Nodes (comma separated slugs)`}),(0,U.jsx)(`input`,{type:`text`,placeholder:`e.g. write-anywhere-sync`,value:he,onChange:e=>ge(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,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:12,color:`var(--text-secondary)`,marginBottom:4},children:`Supersedes Nodes (comma separated slugs)`}),(0,U.jsx)(`input`,{type:`text`,placeholder:`e.g. prefer-atomic-writes-v1`,value:_e,onChange:e=>ve(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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.jsx)(`label`,{style:{fontSize:12,color:`var(--text-secondary)`},children:`Memory Content`}),(0,U.jsx)(`textarea`,{value:ne,onChange:e=>re(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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,marginTop:12},children:[(0,U.jsx)(`button`,{className:`btn btn-ghost`,type:`button`,onClick:t,style:{fontSize:13},children:`Cancel`}),(0,U.jsx)(`button`,{className:`btn btn-purple`,type:`button`,onClick:e,style:{fontSize:13},children:n?`🚀 Create Memory Node`:`💾 Save Changes`})]})]}),ke=o.reduce((e,t)=>(e[t.category]=(e[t.category]||0)+1,e),{});return(0,U.jsxs)(`div`,{className:`page`,children:[(0,U.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-end`,marginBottom:20},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{children:`Memory Vault`}),(0,U.jsx)(`p`,{children:`Browse, audit, and resolve contradictions in your SSSS knowledge graph`})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,background:`rgba(255,255,255,0.03)`,padding:4,borderRadius:8,border:`1px solid var(--border)`},children:[(0,U.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,U.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,U.jsx)(`span`,{style:{background:`#ef4444`,color:`#fff`,fontSize:9,padding:`1px 5px`,borderRadius:10,fontWeight:700},children:T.length})]}),(0,U.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,U.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,U.jsxs)(`div`,{className:`badge badge-error`,style:{alignSelf:`flex-start`,marginBottom:15},children:[`⚠️ `,g]}),i===`vault`?(0,U.jsxs)(`div`,{className:`memory-layout`,children:[(0,U.jsxs)(`div`,{className:`memory-sidebar`,children:[(0,U.jsx)(`h3`,{style:{margin:`0 0 12px 0`},children:`Categories`}),ki.map(e=>(0,U.jsxs)(`button`,{className:`category-btn ${u===e?`active`:``}`,onClick:()=>{d(e),n({}),M(!1),A(!1)},children:[(0,U.jsx)(`span`,{children:e===`all`?`📋 All Nodes`:e}),e===`all`?(0,U.jsx)(`span`,{className:`category-count`,children:o.length}):ke[e]?(0,U.jsx)(`span`,{className:`category-count`,children:ke[e]}):null]},e)),(0,U.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(``),F(``),te(`invariants`),re(``),L(`active`),ae(`low`),se(`should`),ce(1),ue(3),fe(``),me(``),ge(``),ve(``)},children:`➕ Create New Node`})]}),(0,U.jsxs)(`div`,{className:`memory-main`,children:[(0,U.jsxs)(`div`,{className:`memory-search`,children:[(0,U.jsx)(`input`,{id:`memory-search`,type:`text`,placeholder:`Search memory nodes…`,value:f,onChange:e=>p(e.target.value)}),(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:ye,children:`Refresh`})]}),m?(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[1,2,3].map(e=>(0,U.jsx)(`div`,{className:`skeleton`,style:{height:60}},e))}):j?(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,U.jsx)(`h2`,{style:{margin:0,color:`#fff`},children:`Create New SSSS Memory Node`}),(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>M(!1),style:{fontSize:12},children:`← Back to List`})]}),Oe(xe,()=>M(!1),!0)]}):c&&k?(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,U.jsx)(`h2`,{style:{margin:0,color:`#fff`},children:`Edit Memory Node`}),(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>A(!1),style:{fontSize:12},children:`← Cancel Edit`})]}),Oe(be,()=>A(!1),!1)]}):c?(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:16},children:[(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>n({}),style:{fontSize:12},children:`← Back to List`}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>{P(c.slug||``),F(c.title||``),te(c.category||`invariants`),re(c.content||c.body||``),L(c.status||`active`),ae(c.priority||`low`),se(c.modality||`should`),ce(c.confidence??1),ue(c.importance??3),fe((c.tags||[]).join(`, `)),me((c.related||[]).join(`, `)),ge((c.contradicts||[]).join(`, `)),ve((c.supersedes||[]).join(`, `)),A(!0)},style:{fontSize:12,border:`1px solid var(--border)`},children:`✏️ Edit Node`}),(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Se(c.slug),style:{fontSize:12,borderColor:`rgba(239,68,68,0.2)`,color:`#fca5a5`},children:`🗑️ Delete`})]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,U.jsx)(`h2`,{style:{margin:0,color:`#fff`},children:c.title}),c.modality&&(0,U.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,U.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,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Slug`}),(0,U.jsx)(`dd`,{style:{margin:0},children:(0,U.jsx)(`code`,{children:c.slug})}),(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Category`}),(0,U.jsx)(`dd`,{style:{margin:0,textTransform:`capitalize`},children:c.category}),c.status&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Status`}),(0,U.jsx)(`dd`,{style:{margin:0},children:(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Confidence`}),(0,U.jsxs)(`dd`,{style:{margin:0,display:`flex`,alignItems:`center`,gap:12},children:[(0,U.jsxs)(`strong`,{style:{fontSize:13},children:[Math.round(c.confidence*100),`%`]}),(0,U.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,U.jsx)(`div`,{style:{width:`${Math.round(c.confidence*100)}%`,height:`100%`,background:`linear-gradient(90deg, #8b5cf6, #06b6d4)`,borderRadius:3}})})]})]}),c.importance!==void 0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Importance`}),(0,U.jsx)(`dd`,{style:{margin:0,color:`#fbbf24`,display:`flex`,gap:2},children:Array.from({length:5}).map((e,t)=>(0,U.jsx)(`span`,{children:t<(c.importance||0)?`★`:`☆`},t))})]}),c.tags?.length?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Tags`}),(0,U.jsx)(`dd`,{style:{margin:0,display:`flex`,gap:6,flexWrap:`wrap`},children:c.tags.map(e=>(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Related`}),(0,U.jsx)(`dd`,{style:{margin:0},children:(0,U.jsx)(`code`,{children:c.related.join(`, `)})})]}):null,c.contradicts?.length?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Contradicts`}),(0,U.jsx)(`dd`,{style:{margin:0,color:`#fca5a5`},children:(0,U.jsx)(`code`,{children:c.contradicts.join(`, `)})})]}):null,c.supersedes?.length?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{style:{color:`var(--text-tertiary)`,fontWeight:500},children:`Supersedes`}),(0,U.jsx)(`dd`,{style:{margin:0,color:`#93c5fd`},children:(0,U.jsx)(`code`,{children:c.supersedes.join(`, `)})})]}):null]}),(0,U.jsxs)(`div`,{style:{marginTop:20},children:[(0,U.jsx)(`h3`,{style:{fontSize:12,textTransform:`uppercase`,color:`var(--text-tertiary)`,letterSpacing:.5,marginBottom:12},children:`Memory Content (SSSS Body)`}),(0,U.jsx)(`div`,{style:{background:`rgba(0,0,0,0.15)`,border:`1px solid rgba(255,255,255,0.04)`,borderRadius:8,padding:20},children:W(c.body||c.content||``)})]})]}):(0,U.jsxs)(`div`,{className:`memory-list`,style:{display:`grid`,gridTemplateColumns:`1fr`,gap:12},children:[o.length===0&&!m&&(0,U.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,U.jsxs)(`div`,{className:`memory-node-card`,onClick:()=>Ee(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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:6},children:[(0,U.jsx)(`h4`,{style:{margin:0,color:`#fff`,fontSize:15},children:e.title}),e.modality&&(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:16,fontSize:11,color:`var(--text-tertiary)`,marginTop:8},children:[(0,U.jsxs)(`span`,{children:[`📂 `,e.category]}),e.importance!==void 0&&(0,U.jsxs)(`span`,{style:{color:`#fbbf24`},children:[`★ `,e.importance,`/5`]}),e.confidence!==void 0&&(0,U.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`🧠 `,Math.round(e.confidence*100),`%`]})]})]},e.slug))]})]})]}):(0,U.jsxs)(`div`,{style:{width:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,U.jsx)(`h3`,{children:`Quarantined Contradiction Records`}),(0,U.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`,display:`flex`,alignItems:`center`,gap:5},children:[(0,U.jsx)(`span`,{className:`pulse`,style:{background:`#06b6d4`}}),` SSE Real-time Agent Monitor Connected`]})]}),T.length===0?(0,U.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,U.jsx)(`span`,{style:{fontSize:32,display:`block`,marginBottom:12},children:`🛡️`}),(0,U.jsx)(`h4`,{style:{color:`#fff`,marginBottom:6},children:`All Clear!`}),"No memory conflicts enqueued or quarantined in `.agent/memory-inbox/conflicts/`."]}):(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:T.map(e=>{let t=e.status===`pending`;return(0,U.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,U.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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h4`,{style:{margin:0,fontSize:16,color:`#fff`,display:`flex`,alignItems:`center`,gap:8},children:[`Conflict: `,(0,U.jsx)(`code`,{children:e.conflict_id}),(0,U.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,U.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[`Detected at: `,new Date(e.detected_at).toLocaleString()]})]}),(0,U.jsxs)(`div`,{style:{textAlign:`right`},children:[(0,U.jsxs)(`span`,{style:{fontSize:12,color:`#ef4444`,fontWeight:700,display:`block`},children:[`Clash Similarity: `,Math.round(e.similarity*100),`%`]}),(0,U.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`Modality polarity flip`})]})]}),(0,U.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,U.jsx)(`strong`,{children:`Reason:`}),` `,e.reason]}),(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:16,marginBottom:24},children:[(0,U.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,U.jsx)(`h5`,{style:{margin:`0 0 10px 0`,color:`#a78bfa`,textTransform:`uppercase`,fontSize:11,letterSpacing:.5},children:`✓ Existing Node In Vault`}),(0,U.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:`#fff`,marginBottom:8},children:(0,U.jsx)(`code`,{children:e.existing_slug})}),(0,U.jsxs)(`dl`,{style:{display:`grid`,gridTemplateColumns:`80px 1fr`,gap:4,margin:`0 0 12px 0`,fontSize:11,color:`var(--text-secondary)`},children:[(0,U.jsx)(`dt`,{children:`Modality:`}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`code`,{children:e._existing_node?.modality||`must`})}),(0,U.jsx)(`dt`,{children:`Polarity:`}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`code`,{children:e._existing_node?.sentiment_polarity||`directive_must`})}),(0,U.jsx)(`dt`,{children:`Confidence:`}),(0,U.jsx)(`dd`,{children:e._existing_node?.confidence===void 0?`N/A`:`${Math.round(e._existing_node.confidence*100)}%`})]}),(0,U.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,U.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,U.jsx)(`h5`,{style:{margin:`0 0 10px 0`,color:`#06b6d4`,textTransform:`uppercase`,fontSize:11,letterSpacing:.5},children:`⚠ New Ingestion Candidate`}),(0,U.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:`#fff`,marginBottom:8},children:(0,U.jsx)(`code`,{children:e.new_slug})}),(0,U.jsxs)(`dl`,{style:{display:`grid`,gridTemplateColumns:`80px 1fr`,gap:4,margin:`0 0 12px 0`,fontSize:11,color:`var(--text-secondary)`},children:[(0,U.jsx)(`dt`,{children:`Modality:`}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`code`,{children:e._new_node?.modality||`must_not`})}),(0,U.jsx)(`dt`,{children:`Polarity:`}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`code`,{children:e._new_node?.sentiment_polarity||`directive_must_not`})}),(0,U.jsx)(`dt`,{children:`Confidence:`}),(0,U.jsx)(`dd`,{children:e._new_node?.confidence===void 0?`N/A`:`${Math.round(e._new_node.confidence*100)}%`})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12},children:[(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,disabled:D!==null,onClick:()=>De(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,U.jsx)(`button`,{className:`btn btn-purple btn-sm`,disabled:D!==null,onClick:()=>De(e.conflict_id,`supersede`,e.new_slug),style:{fontSize:12},children:D===e.conflict_id?`Processing...`:`Supersede with New (${e.new_slug})`})]}):(0,U.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,U.jsxs)(`span`,{children:[`✓ Resolved successfully. Choice: `,(0,U.jsx)(`strong`,{children:e.resolution})]}),(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,U.jsxs)(`h2`,{style:{margin:0,color:`#fff`,fontSize:16},children:[`📝 IDE Sessions (`,x,`)`]}),(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:we,style:{fontSize:12},children:`🔄 Refresh`})]}),C?(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[1,2,3].map(e=>(0,U.jsx)(`div`,{className:`skeleton`,style:{height:56}},e))}):y.length===0?(0,U.jsxs)(`div`,{style:{textAlign:`center`,padding:40,color:`var(--text-tertiary)`},children:[(0,U.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,U.jsxs)(`table`,{style:{width:`100%`,textAlign:`left`,borderCollapse:`collapse`},children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Title`}),(0,U.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Date`}),(0,U.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Source`}),(0,U.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600},children:`Messages`}),(0,U.jsx)(`th`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--border)`,color:`var(--text-tertiary)`,fontSize:12,fontWeight:600,width:60}})]})}),(0,U.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,U.jsxs)(`tr`,{style:{borderBottom:`1px solid rgba(255,255,255,0.04)`},children:[(0,U.jsx)(`td`,{style:{padding:`10px 12px`,color:`#fff`,fontSize:13,maxWidth:400,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.title||e.id}),(0,U.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`,fontSize:12,whiteSpace:`nowrap`},children:e.date?new Date(e.date).toLocaleString():`-`}),(0,U.jsx)(`td`,{style:{padding:`10px 12px`},children:e.source&&(0,U.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,U.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`,fontSize:12},children:e.count}),(0,U.jsx)(`td`,{style:{padding:`10px 12px`},children:(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Te(e.id),style:{fontSize:10,padding:`2px 6px`,color:`#fca5a5`,borderColor:`rgba(239,68,68,0.2)`},children:`🗑️`})})]},e.id)})})]})]})]})}function ji(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(`idle`),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)([]),x=localStorage.getItem(`total-recall-active-brain`)||``;(0,v.useEffect)(()=>{ar().then(s).catch(console.error),di().then(p).catch(console.error),xr().then(b).catch(console.error),br().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||={},t(e)}).catch(console.error)},[]);let S=[{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`}],C=async e=>{e.preventDefault(),l(!0),d(null);try{d((await Zr()).output),ar().then(s).catch(console.error)}catch(e){d(`Error: `+e.message)}finally{l(!1)}},w=async()=>{h(!0),_(null);try{let e=await fi();_(e.success?`Update complete. Restarting...`:`Update failed: `+e.message)}catch(e){_(`Update error: `+e.message)}finally{h(!1)}},T=async()=>{if(e){r(`saving`);try{await Sr(e),r(`saved`),setTimeout(()=>r(`idle`),2500)}catch(e){console.error(e),r(`error`),setTimeout(()=>r(`idle`),3e3)}}},E=async(e,t)=>{a(`[Running] ${t}...\n$ ${e}`);let n=await lr(`
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
+ `);a(`[Finished] ${t}\n\n`+n.output)},D=(e,n,r)=>{t(t=>t&&{...t,security:{...t.security,[e]:{...t.security[e]||{},[n]:r}}})},O=(e,n)=>{t(t=>t&&{...t,budget:{...t.budget,budget:{...t.budget.budget||{},[e]:n}}})},k=(e,n)=>{t(t=>t?{...t,brain:{...t.brain,[e]:n}}:null)},A=e=>Array.isArray(e)?e.join(`, `):``,j=e=>e.split(`,`).map(e=>e.trimStart());return e?(0,U.jsxs)(`div`,{className:`settings-page-wrapper`,children:[(0,U.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,U.jsxs)(`div`,{className:`settings-header-sticky`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{style:{fontSize:28,fontWeight:700,margin:0,background:`linear-gradient(to right, #fff, #a8b2d1)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`System Settings`}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[n===`saved`&&(0,U.jsx)(`span`,{style:{color:`#34d399`,fontSize:14,fontWeight:600},children:`✓ Saved successfully`}),n===`error`&&(0,U.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:`✗ Save failed`}),(0,U.jsx)(`button`,{className:`btn-primary`,onClick:T,disabled:n===`saving`,children:n===`saving`?`Saving...`:`Save Configuration`})]})]}),(0,U.jsxs)(`div`,{className:`settings-grid`,children:[(0,U.jsxs)(`div`,{className:`settings-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Network & Binding`}),(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Configure server host and ports`})]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{htmlFor:`bind_host`,className:`field-label`,children:`Bind Host`}),(0,U.jsx)(`input`,{id:`bind_host`,type:`text`,className:`settings-input`,value:e.security.bind?.host??`127.0.0.1`,onChange:e=>D(`bind`,`host`,e.target.value)})]}),(0,U.jsxs)(`div`,{className:`field-col`,style:{width:100},children:[(0,U.jsx)(`label`,{htmlFor:`bind_port`,className:`field-label`,children:`Port`}),(0,U.jsx)(`input`,{id:`bind_port`,type:`number`,className:`settings-input`,value:e.security.bind?.port??3e3,onChange:e=>D(`bind`,`port`,parseInt(e.target.value,10))})]})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Allow Public Bind`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Allow listening on 0.0.0.0 interfaces`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.security.bind?.allow_public_bind,onChange:e=>D(`bind`,`allow_public_bind`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Require HTTPS`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Reject insecure HTTP requests`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.security.network?.require_https,onChange:e=>D(`network`,`require_https`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Public Health Check`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Allow pinging /health without auth`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.security.network?.public_health,onChange:e=>D(`network`,`public_health`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Allowed Origins (CORS)`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:A(e.security.network?.allowed_origins),onChange:e=>D(`network`,`allowed_origins`,j(e.target.value)),placeholder:`e.g. https://example.com, https://app.example.com`})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Trusted Proxies`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:A(e.security.network?.trusted_proxies),onChange:e=>D(`network`,`trusted_proxies`,j(e.target.value)),placeholder:`e.g. 10.0.0.1, 192.168.1.1`})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`API Requests Per Minute (Rate Limit)`}),(0,U.jsx)(`input`,{type:`number`,className:`settings-input`,value:e.security.rate_limits?.api_requests_per_minute??1200,onChange:e=>D(`rate_limits`,`api_requests_per_minute`,parseInt(e.target.value,10))})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Sandbox Requests Per Minute`}),(0,U.jsx)(`input`,{type:`number`,className:`settings-input`,value:e.security.rate_limits?.sandbox_requests_per_minute??60,onChange:e=>D(`rate_limits`,`sandbox_requests_per_minute`,parseInt(e.target.value,10))})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Ingest Requests Per Minute`}),(0,U.jsx)(`input`,{type:`number`,className:`settings-input`,value:e.security.rate_limits?.ingest_requests_per_minute??300,onChange:e=>D(`rate_limits`,`ingest_requests_per_minute`,parseInt(e.target.value,10))})]})]}),(0,U.jsxs)(`div`,{className:`settings-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Security & Privacy`}),(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Manage access control and local sandboxing`})]})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Sandbox Enabled`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enforce strict code sandboxing`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.security.sandbox?.enabled,onChange:e=>D(`sandbox`,`enabled`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Force Password Reset`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Require password change on next login`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.security.dashboard?.force_password_reset,onChange:e=>D(`dashboard`,`force_password_reset`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Allow Static PATs`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enable Personal Access Tokens`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.security.api?.allow_static_pats,onChange:e=>D(`api`,`allow_static_pats`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{htmlFor:`session_ttl_hours`,className:`field-label`,children:`Dashboard Session TTL (Hours)`}),(0,U.jsx)(`input`,{id:`session_ttl_hours`,type:`number`,className:`settings-input`,value:e.security.dashboard?.session_ttl_hours??24,onChange:e=>D(`dashboard`,`session_ttl_hours`,parseInt(e.target.value,10))})]})]}),(0,U.jsxs)(`div`,{className:`settings-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Budget Limits`}),(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Control AI spending dynamically`})]})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Enable Budget Caps`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enforce hard limits on token spend`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.budget.budget?.enabled,onChange:e=>O(`enabled`,e.target.checked)})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{htmlFor:`daily_cap`,className:`field-label`,children:`Daily Cap ($)`}),(0,U.jsx)(`input`,{id:`daily_cap`,type:`number`,step:`0.01`,className:`settings-input`,value:e.budget.budget?.daily_cap_usd??5,onChange:e=>O(`monthly_soft_cap`,e.target.value===``?null:Number(e.target.value))})]}),(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{htmlFor:`weekly_cap`,className:`field-label`,children:`Weekly Cap ($)`}),(0,U.jsx)(`input`,{id:`weekly_cap`,type:`number`,step:`0.01`,className:`settings-input`,value:e.budget.budget?.weekly_cap_usd??20,onChange:e=>O(`weekly_cap_usd`,parseFloat(e.target.value))})]})]})]}),(0,U.jsxs)(`div`,{className:`settings-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Brain Configuration`}),(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Manage memory kernel identities`})]})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,style:{color:`var(--text-accent)`,fontWeight:600},children:`Select Active Brain`}),(0,U.jsxs)(`select`,{className:`settings-select`,style:{border:`1px solid var(--border-accent)`,background:`rgba(59, 130, 246, 0.05)`},value:x,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,U.jsx)(`option`,{value:``,children:`Global Brain (Root)`}),y.map(e=>(0,U.jsxs)(`option`,{value:e.name,children:[e.name,` (`,e.role,` - `,e.nodes,` nodes)`]},e.name))]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Brain URL`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:e.brain?.url||``,onChange:e=>k(`url`,e.target.value)})]}),(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Brain Token`}),(0,U.jsx)(`input`,{type:`password`,className:`settings-input`,placeholder:e.brain?.has_token?`•••••••••••••••• (Leave blank)`:`No token set`,value:e.brain?.token||``,onChange:e=>k(`token`,e.target.value)})]})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Brain Name`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:e.brain?.name||``,onChange:e=>k(`name`,e.target.value)})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Role`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:e.brain?.role||``,onChange:e=>k(`role`,e.target.value)})]}),(0,U.jsxs)(`div`,{className:`field-col`,style:{flex:1},children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Layer`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:e.brain?.layer||``,onChange:e=>k(`layer`,e.target.value)})]})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{className:`field-label`,children:`Tags (Comma-Separated)`}),(0,U.jsx)(`input`,{type:`text`,className:`settings-input`,value:A(e.brain?.tags),onChange:e=>k(`tags`,j(e.target.value))})]}),(0,U.jsxs)(`div`,{className:`field-row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:500},children:`Full Brain Mode`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Enable omni-directional indexing`})]}),(0,U.jsx)(`input`,{type:`checkbox`,className:`settings-checkbox`,checked:!!e.brain?.full_brain,onChange:e=>k(`full_brain`,e.target.checked)})]}),(0,U.jsxs)(`div`,{className:`field-col`,children:[(0,U.jsx)(`label`,{htmlFor:`preferred_agent`,className:`field-label`,children:`Preferred CLI Agent`}),(0,U.jsxs)(`select`,{id:`preferred_agent`,className:`settings-select`,value:e.brain?.preferred_agent||`auto`,onChange:e=>k(`preferred_agent`,e.target.value),children:[(0,U.jsx)(`option`,{value:`auto`,children:`Auto-Select (Recommended)`}),(0,U.jsx)(`option`,{value:`antigravity`,children:`Antigravity (Google Deepmind)`}),(0,U.jsx)(`option`,{value:`gemini`,children:`Gemini (Google)`}),(0,U.jsx)(`option`,{value:`claude`,children:`Claude (Anthropic)`}),(0,U.jsx)(`option`,{value:`openai`,children:`OpenAI (O-Series)`}),(0,U.jsx)(`option`,{value:`grok`,children:`Grok (xAI)`})]})]})]}),(0,U.jsxs)(`div`,{className:`settings-card`,style:{gridColumn:`1 / -1`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`Ecosystem Integrations`}),(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Chrome extensions, UCW bundles, and tools`})]})]}),(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:24,marginTop:20},children:[(0,U.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,U.jsx)(`div`,{style:{fontSize:24,marginBottom:12},children:`🦊`}),(0,U.jsx)(`h4`,{style:{margin:`0 0 8px`,fontSize:15},children:`Total Recall Browser Extension`}),(0,U.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,U.jsx)(`code`,{children:`/extension`}),` directory.`]}),(0,U.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,U.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,U.jsx)(`div`,{style:{fontSize:24,marginBottom:12},children:`🛠️`}),(0,U.jsx)(`h4`,{style:{margin:`0 0 8px`,fontSize:15},children:`Developer Utilities`}),(0,U.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,U.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,U.jsx)(`button`,{className:`btn-secondary`,style:{flex:1},onClick:()=>E(`npx total-recall compile`,`Rebuilding Search Indexes`),children:`Rebuild Index`})})]})]}),i&&(0,U.jsx)(`div`,{className:`terminal-log`,children:i})]}),(0,U.jsxs)(`div`,{className:`settings-card`,style:{gridColumn:`1 / -1`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,borderBottom:`1px solid rgba(255,255,255,0.05)`,paddingBottom:20},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0},children:`System Update`}),(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,margin:`4px 0 0`},children:`Manage Total Recall version updates`})]})]}),(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`var(--text-primary)`},children:f?.updateAvailable?`Update Available (v${f.latestVersion})`:`System is up to date`}),(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-tertiary)`,marginTop:4},children:f?.updateAvailable?`A new version of Total Recall is available for download.`:`You are running the latest version.`}),g&&(0,U.jsx)(`div`,{style:{fontSize:12,color:g.includes(`error`)||g.includes(`failed`)?`#ef4444`:`#10b981`,marginTop:8},children:g})]}),f?.updateAvailable&&(0,U.jsx)(`button`,{className:`btn-primary`,onClick:w,disabled:m,style:{background:`#3fb950`,border:`none`},children:m?`Updating...`:`Download & Restart`})]})]}),(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(360px, 1fr))`,gap:24},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid var(--border)`,paddingBottom:12},children:[(0,U.jsx)(`span`,{style:{fontSize:20},children:`🧠`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:14,fontWeight:600},children:`CLI Reasoning Agents`}),(0,U.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Headless CLI reasoning agents configured on system`})]})]}),(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:S.map(e=>{let t=o?.cli_agents?.includes(e.id);return(0,U.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,background:`var(--bg-tertiary)`,padding:12,borderRadius:8,border:`1px solid var(--border)`},children:(0,U.jsxs)(`div`,{style:{flex:1},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.name}),(0,U.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,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-secondary)`,marginTop:2},children:e.desc}),(0,U.jsxs)(`div`,{style:{fontSize:9,color:`var(--text-tertiary)`,marginTop:4},children:[`Registry ID: `,e.id]})]})},e.id)})})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid var(--border)`,paddingBottom:12},children:[(0,U.jsx)(`span`,{style:{fontSize:20},children:`📡`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:14,fontWeight:600},children:`CLI Agent Diagnostics`}),(0,U.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Trigger active paths check and verify registered agents`})]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.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,U.jsx)(`code`,{children:`npx total-recall upgrade --agents`}),` in the background) to audit paths and verify binaries.`]}),(0,U.jsx)(`button`,{onClick:C,disabled:c,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,padding:`10px`,borderRadius:6,fontWeight:500,border:`none`,marginTop:8,cursor:c?`not-allowed`:`pointer`},children:c?`⏳ Running Audit...`:`🚀 Run Diagnostics Audit`})]}),u&&(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:10},children:[(0,U.jsx)(`span`,{style:{fontSize:11,fontWeight:500,color:`var(--text-secondary)`},children:`Diagnostics Console Output:`}),(0,U.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:u})]})]})]})]})]}):(0,U.jsx)(`div`,{style:{padding:40,color:`var(--text-secondary)`},children:(0,U.jsx)(`div`,{className:`glass-card`,style:{display:`inline-block`,padding:`12px 24px`},children:`Loading Settings...`})})}function Mi(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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,U.jsx)(`h3`,{style:{margin:0},children:`Active Scheduler Tasks`}),(0,U.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>i(!r),style:{borderColor:`var(--border)`},children:r?`Cancel`:`+ Add Custom Task`})]}),r&&(0,U.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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 2fr`,gap:16},children:[(0,U.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Subsystem Category`,(0,U.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,U.jsx)(`option`,{value:`fact-seeker`,children:`Fact Seeker`}),(0,U.jsx)(`option`,{value:`post-mortem-daily`,children:`Post Mortem Daemon`}),(0,U.jsx)(`option`,{value:`clarity-rewriter`,children:`Clarity Rewriter`}),(0,U.jsx)(`option`,{value:`drift-detector`,children:`Drift Detector`}),(0,U.jsx)(`option`,{value:`dream`,children:`Dream Cycle`})]})]}),(0,U.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Target Operation / Description`,(0,U.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,U.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Verification Payload Body (Optional Markdown)`,(0,U.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,U.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:d||!s.trim(),style:{alignSelf:`flex-end`,minWidth:120},children:d?`Enqueuing...`:`Create Task`})]}),(0,U.jsx)(`div`,{className:`card-grid`,style:{display:`flex`,flexDirection:`column`,gap:12},children:n&&t.length===0?[1,2,3].map(e=>(0,U.jsx)(`div`,{className:`skeleton`,style:{height:68}},e)):t.length===0?(0,U.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,U.jsx)(`br`,{}),(0,U.jsxs)(`span`,{style:{fontSize:12},children:[`Click `,(0,U.jsx)(`strong`,{children:`Seed Gaps`}),` above to trigger autonomous background schedules.`]})]}):t.map(e=>(0,U.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,U.jsxs)(`div`,{style:{flex:1,marginRight:16},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4},children:[(0,U.jsx)(`span`,{className:`badge badge-accent`,style:{fontSize:11},children:e.category}),(0,U.jsx)(`h4`,{style:{margin:0,fontSize:14,fontWeight:600},children:e.target})]}),e.body&&(0,U.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:12,color:`var(--text-secondary)`,lineBreak:`anywhere`},children:e.body}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:16,marginTop:8,fontSize:11,color:`var(--text-tertiary)`},children:[(0,U.jsxs)(`span`,{children:[`Ref: `,(0,U.jsx)(`code`,{children:e.slug})]}),(0,U.jsxs)(`span`,{children:[`Priority Weight: `,e.priority]})]})]}),(0,U.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 Ni(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 qr(e,t),_?.()}catch(e){console.error(`Failed to update research:`,e)}},T=async e=>{if(confirm(`Cancel this research project?`))try{await Jr(e),_?.()}catch(e){console.error(`Failed to delete research:`,e)}};return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,U.jsx)(`h3`,{style:{margin:0},children:`Vector Research agenda`}),(0,U.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>i(!r),style:{borderColor:`var(--border)`},children:r?`Cancel`:`+ Queue Research Topic`})]}),r&&(0,U.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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`2fr 1fr`,gap:16},children:[(0,U.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Research Query / Topic`,(0,U.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,U.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Agenda Priority`,(0,U.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,U.jsx)(`option`,{value:`low`,children:`Low`}),(0,U.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,U.jsx)(`option`,{value:`high`,children:`High`}),(0,U.jsx)(`option`,{value:`critical`,children:`Critical`})]})]})]}),(0,U.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12,color:`var(--text-secondary)`},children:[`Target Gaps / Reference Notes`,(0,U.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,U.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,U.jsx)(`div`,{style:{overflowX:`auto`,border:`1px solid var(--border)`,borderRadius:12,background:`var(--bg-secondary)`},children:(0,U.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:13},children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border)`,color:`var(--text-secondary)`,textAlign:`left`,background:`rgba(255, 255, 255, 0.02)`},children:[(0,U.jsx)(`th`,{style:{padding:`12px 16px`,width:40,textAlign:`center`}}),(0,U.jsx)(`th`,{style:{padding:`12px 16px`},children:`Research Topic`}),(0,U.jsx)(`th`,{style:{padding:`12px 16px`,width:100},children:`Priority`}),(0,U.jsx)(`th`,{style:{padding:`12px 16px`,width:120},children:`Status`}),(0,U.jsx)(`th`,{style:{padding:`12px 16px`,width:160},children:`Updated At`})]})}),(0,U.jsx)(`tbody`,{children:n&&t.length===0?(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:5,style:{textAlign:`center`,padding:24,color:`var(--text-tertiary)`},children:`Loading agenda...`})}):t.length===0?(0,U.jsx)(`tr`,{children:(0,U.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,U.jsxs)(v.Fragment,{children:[(0,U.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,U.jsx)(`td`,{style:{padding:`14px 16px`,textAlign:`center`,color:`var(--text-tertiary)`},children:(0,U.jsx)(`span`,{style:{display:`inline-block`,transform:t?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.2s`,fontSize:10},children:`▶`})}),(0,U.jsxs)(`td`,{style:{padding:`14px 16px`},children:[(0,U.jsx)(`div`,{style:{fontWeight:600,color:`var(--text-primary)`},children:e.topic}),e.notes&&(0,U.jsx)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`,marginTop:4},children:e.notes})]}),(0,U.jsx)(`td`,{style:{padding:`14px 16px`},children:(0,U.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,U.jsx)(`td`,{style:{padding:`14px 16px`},children:(0,U.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,U.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,U.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border)`,background:`rgba(255, 255, 255, 0.015)`},children:(0,U.jsx)(`td`,{colSpan:5,style:{padding:`0 24px 20px 24px`},children:(0,U.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,U.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,U.jsxs)(`div`,{style:{marginBottom:20},children:[(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.05em`,fontWeight:600,marginBottom:12},children:`Cognitive Research Engine Progress`}),(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24,borderRadius:`50%`,background:u,fontSize:12},children:t.icon}),(0,U.jsxs)(`span`,{style:{fontSize:10,fontWeight:700,color:f,display:`inline-flex`,alignItems:`center`,gap:4},children:[p&&(0,U.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:`var(--accent)`,animation:`pulse 1.5s infinite ease-in-out`}}),d]})]}),(0,U.jsxs)(`div`,{style:{fontSize:12,fontWeight:600,color:l},children:[n+1,`. `,t.title]}),(0,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,lineHeight:1.3},children:t.desc})]},n)})})]}),(0,U.jsx)(`hr`,{style:{border:`none`,borderTop:`1px solid rgba(255, 255, 255, 0.06)`,margin:`20px 0`}}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,padding:`0 0 16px`,flexWrap:`wrap`},children:[e.status===`in_progress`&&(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`paused`})},children:`⏸ Pause`}),(e.status===`paused`||e.status===`failed`)&&(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`pending`})},children:`▶️ Resume`}),e.status===`done`&&(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`pending`,research_phase:`acquisition`})},children:`🔄 Re-run`}),(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),b(e.id)},children:`🎯 Steer`}),e.status!==`done`&&(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:t=>{t.stopPropagation(),w(e.id,{status:`done`})},children:`✅ Conclude`}),(0,U.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,U.jsx)(U.Fragment,{children:r?(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,color:`var(--text-secondary)`},children:[(0,U.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,U.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,U.jsx)(`span`,{children:`Reading memory node and cataloging discoveries...`})]}):n?(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[e.status===`in_progress`&&(0,U.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,U.jsx)(`span`,{className:`pulse`,style:{background:`var(--accent)`,width:8,height:8,borderRadius:`50%`,display:`inline-block`}}),(0,U.jsx)(`span`,{children:`Fact-seeker agents are currently updating this topic in the background. Previous discoveries are displayed below.`})]}),e.status===`pending`&&(0,U.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,U.jsx)(`span`,{children:`⏳`}),(0,U.jsx)(`span`,{children:`Scheduled for automatic refresh. Previous discoveries are displayed below.`})]}),(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`h4`,{style:{margin:0,fontSize:15,fontWeight:700,color:`#fff`},children:n.title}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8,marginTop:6,alignItems:`center`},children:[(0,U.jsx)(`span`,{className:`badge badge-accent`,style:{fontSize:10,padding:`2px 8px`},children:n.category}),n.modality&&(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`},children:[n.importance!==void 0&&(0,U.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,U.jsx)(`span`,{children:`⭐ Importance:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[n.importance,`/5`]})]}),n.confidence!==void 0&&(0,U.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,U.jsx)(`span`,{children:`✓ Confidence:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600},children:[(n.confidence*100).toFixed(0),`%`]})]})]})]}),(0,U.jsxs)(`div`,{style:{position:`relative`},children:[(0,U.jsx)(`div`,{style:{maxHeight:S[e.id]?`none`:500,overflow:`hidden`,paddingRight:8,transition:`max-height 0.3s ease`},children:(0,U.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`},children:Ci(n.content||n.body||``)})}),!S[e.id]&&(n.content||n.body||``).length>800&&(0,U.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,U.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`}),xi(n.content||n.body).length>0&&(0,U.jsxs)(`div`,{style:{borderTop:`1px solid rgba(255, 255, 255, 0.06)`,paddingTop:12},children:[(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.04em`,fontWeight:600,marginBottom:8},children:`Sources & Citations`}),(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:xi(n.content||n.body).map((e,t)=>{let n=(()=>{try{return new URL(e.url).hostname.replace(/^www\./,``)}catch{return e.url}})();return(0,U.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,U.jsx)(`img`,{src:`https://www.google.com/s2/favicons?domain=${n}&sz=16`,width:16,height:16,alt:``,style:{borderRadius:2,flexShrink:0}}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2,flex:1,minWidth:0},children:[(0,U.jsx)(`span`,{style:{fontWeight:600,color:`var(--text-primary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.text}),(0,U.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:n})]}),(0,U.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,U.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,U.jsxs)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:13},children:[`No memory synthesis node found for slug: `,(0,U.jsx)(`code`,{children:e.node_slug})]})}):(0,U.jsxs)(U.Fragment,{children:[e.status===`pending`&&(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--warning)`,fontWeight:600,fontSize:14},children:[(0,U.jsx)(`span`,{children:`⏳`}),` Queued for Ingestion`]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--accent)`,fontWeight:600,fontSize:14},children:[(0,U.jsx)(`span`,{className:`pulse`,style:{background:`var(--accent)`}}),`Synthesizing Deep Discoveries...`]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--error)`,fontWeight:600,fontSize:14},children:[(0,U.jsx)(`span`,{children:`⚠️`}),` Ingestion Boundary Encountered`]}),(0,U.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,U.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,U.jsxs)(`div`,{style:{background:`var(--bg-secondary, #1e1e2e)`,borderRadius:`12px`,padding:`24px`,maxWidth:`500px`,width:`90%`,border:`1px solid var(--border)`},children:[(0,U.jsx)(`h3`,{style:{margin:`0 0 12px`},children:`🎯 Steer Research`}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginTop:`12px`,justifyContent:`flex-end`},children:[(0,U.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>b(null),children:`Cancel`}),(0,U.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 qr(y,{notes:e}),b(null),_?.()}catch(e){console.error(`Failed to steer research:`,e)}},children:`Submit`})]})]})})]})}function Pi({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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{className:`pulse`,style:{background:`#10b981`,width:8,height:8}}),(0,U.jsx)(`h3`,{style:{margin:0},children:`Cognitive Daemon Stream`})]}),(0,U.jsx)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Auto-refreshing every 3s`})]}),(0,U.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,U.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,U.jsx)(`span`,{children:`TOTAL RECALL COGNITIVE DAEMON CONSOLE // active-tunnel-listener`}),(0,U.jsxs)(`span`,{children:[`UTC-CLOCK: `,new Date().toISOString()]})]}),e]})]})}function Fi(){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 cr(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,ee]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!1),[te,ne]=(0,v.useState)(``),[re,ie]=(0,v.useState)(`medium`),[L,R]=(0,v.useState)(``),[ae,oe]=(0,v.useState)(!1),se=(0,v.useCallback)(async()=>{try{return t(await ur()||[]),p(``),!0}catch(e){return p(e.message),!1}},[]),z=(0,v.useCallback)(async()=>{try{let e=await Gr(`all`);return r(e.items||[]),a(e.counts||{pending:0,in_progress:0,done:0,failed:0}),p(``),!0}catch(e){return p(e.message),!1}},[]),ce=(0,v.useCallback)(async()=>{try{return s((await Yr(`daemon`)).content||`(no logs streamed yet)`),!0}catch(e){return s(`Error connecting to cognitive logs: ${e.message}`),!1}},[]),le=(0,v.useCallback)(async()=>{d(!0),await Promise.all([se(),z(),ce()]),d(!1)},[se,z,ce]);return(0,v.useEffect)(()=>{let e,t=!0,n=0,r=async()=>{if(t&&((await Promise.all([se(),z(),ce()])).includes(!1)?n++:n=0,t)){let t=Math.min(3e3*2**n,6e4);e=setTimeout(r,t)}};return(async()=>{await Promise.all([se(),z(),ce()]),d(!1),t&&(e=setTimeout(r,3e3))})(),()=>{t=!1,clearTimeout(e)}},[se,z,ce]),(0,U.jsxs)(`div`,{className:`page`,children:[(0,U.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:16},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{children:`Cognitive Dashboard`}),(0,U.jsx)(`p`,{children:`Real-time background reasoning engine, autonomous research, and active schedulers`})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,U.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:async()=>{p(``),_(``);try{await dr(`fact-seeker`,`Audit latest Chrome Extension MV3 API updates`,`Verify if chrome.declarativeNetRequest rulesets have new declarative properties.`),await dr(`post-mortem-daily`,`Ingest yesterday's IDE compile session logs`,`Analyze TypeScript build latency and suggest performance optimizations.`),await dr(`clarity-rewriter`,`Harden security.yml authentication encryption`,`Enforce bcrypt rounds to 12 and verify cross-origin session domain locks.`),await Kr(`TypeScript 5.4 advanced mapped types and template literal constraints`,`high`,`Evaluate mapped type performance on large monorepos.`),await Kr(`Glassmorphism backdrop-filter performance optimizations on mobile Safari`,`medium`,`Prevent GPU compositing lag by limiting blur radius.`),await Kr(`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),le()}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,U.jsx)(`button`,{className:`btn btn-sm`,onClick:async()=>{h(!0),p(``),_(``);try{_((await Xr()).message||`Brain surface recompiled successfully!`),setTimeout(()=>_(``),4e3),le()}catch(e){p(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,U.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,U.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,U.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`Compiling...`]}):`Recompile Surface`})]})]}),f&&(0,U.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:16,display:`inline-flex`},children:[`⚠️ `,f]}),g&&(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,borderBottom:`1px solid var(--border)`,marginBottom:20,gap:20},children:[(0,U.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,U.jsx)(`span`,{className:`badge badge-accent`,style:{fontSize:10,padding:`2px 6px`},children:e.length})]}),(0,U.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,U.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,U.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,U.jsx)(`span`,{className:`pulse`,style:{background:`#10b981`,width:6,height:6,borderRadius:`50%`}})]})]}),c===`tasks`&&(0,U.jsx)(Mi,{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()){ee(!0),p(``);try{await dr(O,A.trim(),M.trim()),j(``),N(``),D(!1),_(`Task enqueued successfully!`),setTimeout(()=>_(``),3e3),se()}catch(e){p(e.message)}finally{ee(!1)}}}}),c===`research`&&(0,U.jsx)(Ni,{researchItems:n,loading:u,showResearchForm:F,setShowResearchForm:I,researchTopic:te,setResearchTopic:ne,researchPriority:re,setResearchPriority:ie,researchNotes:L,setResearchNotes:R,researchSubmitting:ae,handleCreateResearch:async e=>{if(e.preventDefault(),te.trim()){oe(!0),p(``);try{await Kr(te.trim(),re,L.trim()||void 0),ne(``),R(``),I(!1),_(`Research project enqueued successfully!`),setTimeout(()=>_(``),3e3),z()}catch(e){p(e.message)}finally{oe(!1)}}},expandedResearchId:y,handleToggleExpand:T,loadedDiscoveries:x,loadingNodeSlugs:C,refreshResearch:z}),c===`logs`&&(0,U.jsx)(Pi,{logs:o,activeTab:c})]})}function Ii(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 Li(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 Ri(){return zi.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var zi={stubThis:e=>e};function Bi(e){let{id:t}=e;return{...e,id:Li(t),transports:e.transports}}function Vi(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 Hi=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 Ui({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 Hi({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 Hi({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 Hi({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 Hi({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 Hi({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Hi({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 Hi({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Hi({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(!Vi(t))return new Hi({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Hi({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 Hi({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 Hi({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 Wi=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}}},Gi=[`cross-platform`,`platform`];function Ki(e){if(e&&!(Gi.indexOf(e)<0))return e}async function qi(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(!Ri())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:Li(t.challenge),user:{...t.user,id:Li(t.user.id)},excludeCredentials:t.excludeCredentials?.map(Bi)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=Wi.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw Ui({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){Ji(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=Ii(e))}catch(e){Ji(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=Ii(c.getAuthenticatorData())}catch(e){Ji(`getAuthenticatorData()`,e)}return{id:o,rawId:Ii(s),response:{attestationObject:Ii(c.attestationObject),clientDataJSON:Ii(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:Ki(a.authenticatorAttachment)}}function Ji(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 Yi(){if(!Ri())return Xi.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Xi.stubThis(new Promise(e=>e(!1))):Xi.stubThis(e.isConditionalMediationAvailable())}var Xi={stubThis:e=>e};function Zi({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 Hi({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Hi({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Vi(t))return new Hi({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Hi({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 Hi({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 Qi(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(!Ri())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(Bi));let a={...t,challenge:Li(t.challenge),allowCredentials:i},o={};if(n){if(!await Yi())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=Wi.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Zi({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=Ii(u.userHandle)),{id:c,rawId:Ii(l),response:{authenticatorData:Ii(u.authenticatorData),clientDataJSON:Ii(u.clientDataJSON),signature:Ii(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:Ki(s.authenticatorAttachment)}}function $i(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=$i(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ea(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=$i(e))&&(r&&(r+=` `),r+=t);return r}var ta=`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 na(e){return typeof e==`string`?ta.includes(e):!1}var ra=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 ia(e){return typeof e==`string`?ra.has(e):!1}function aa(e){return typeof e==`string`&&e.startsWith(`data-`)}function oa(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ia(n)||aa(n))&&(t[n]=e[n]);return t}function sa(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return oa(t)}return typeof e==`object`&&!Array.isArray(e)?oa(e):null}function ca(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ia(n)||aa(n)||na(n))&&(t[n]=e[n]);return t}function la(e){return e==null?null:(0,v.isValidElement)(e)?ca(e.props):typeof e==`object`&&!Array.isArray(e)?ca(e):null}var ua=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function da(){return da=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},da.apply(null,arguments)}function fa(e,t){if(e==null)return{};var n,r,i=pa(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 pa(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 ma=(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=fa(e,ua),d=a||{width:r,height:i,x:0,y:0},f=ea(`recharts-surface`,o);return v.createElement(`svg`,da({},ca(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)}),ha=[`children`,`className`];function ga(){return ga=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},ga.apply(null,arguments)}function _a(e,t){if(e==null)return{};var n,r,i=va(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 va(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 ya=v.forwardRef((e,t)=>{var n=e.children,r=e.className,i=_a(e,ha),a=ea(`recharts-layer`,r);return v.createElement(`g`,ga({className:a},ca(i),{ref:t}),n)}),ba=(0,v.createContext)(null),xa=()=>(0,v.useContext)(ba);function Sa(e){return function(){return e}}var Ca=Math.cos,wa=Math.sin,Ta=Math.sqrt,Ea=Math.PI;Ea/2;var Da=2*Ea,Oa=Math.PI,ka=2*Oa,Aa=1e-6,ja=ka-Aa;function Ma(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Na(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ma;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 Pa=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Ma:Na(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>Aa)if(!(Math.abs(u*s-c*l)>Aa)||!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((Oa-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Aa&&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)>Aa||Math.abs(this._y1-l)>Aa)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%ka+ka),d>ja?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>Aa&&this._append`A${n},${n},0,${+(d>=Oa)},${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 Fa(){return new Pa}Fa.prototype=Pa.prototype;function Ia(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 Pa(t)}Array.prototype.slice;function La(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ra(e){this._context=e}Ra.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 za(e){return new Ra(e)}function Ba(e){return e[0]}function Va(e){return e[1]}function Ha(e,t){var n=Sa(!0),r=null,i=za,a=null,o=Ia(s);e=typeof e==`function`?e:e===void 0?Ba:Sa(e),t=typeof t==`function`?t:t===void 0?Va:Sa(t);function s(s){var c,l=(s=La(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:Sa(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Sa(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Sa(!!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 Ua(e,t,n){var r=null,i=Sa(!0),a=null,o=za,s=null,c=Ia(l);e=typeof e==`function`?e:e===void 0?Ba:Sa(+e),t=typeof t==`function`?t:Sa(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Va:Sa(+n);function l(l){var u,d,f,p=(l=La(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 Ha().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Sa(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Sa(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Sa(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Sa(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Sa(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Sa(+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:Sa(!!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 Wa=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 Ga(e){return new Wa(e,!0)}function Ka(e){return new Wa(e,!1)}var qa={draw(e,t){let n=Ta(t/Ea);e.moveTo(n,0),e.arc(0,0,n,0,Da)}},Ja={draw(e,t){let n=Ta(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()}},Ya=Ta(1/3),Xa=Ya*2,Za={draw(e,t){let n=Ta(t/Xa),r=n*Ya;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Qa={draw(e,t){let n=Ta(t),r=-n/2;e.rect(r,r,n,n)}},$a=.8908130915292852,eo=wa(Ea/10)/wa(7*Ea/10),to=wa(Da/10)*eo,no=-Ca(Da/10)*eo,ro={draw(e,t){let n=Ta(t*$a),r=to*n,i=no*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Da*t/5,o=Ca(a),s=wa(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},io=Ta(3),ao={draw(e,t){let n=-Ta(t/(io*3));e.moveTo(0,n*2),e.lineTo(-io*n,-n),e.lineTo(io*n,-n),e.closePath()}},oo=-.5,so=Ta(3)/2,G=1/Ta(12),co=(G/2+1)*3,lo={draw(e,t){let n=Ta(t/co),r=n/2,i=n*G,a=r,o=n*G+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(oo*r-so*i,so*r+oo*i),e.lineTo(oo*a-so*o,so*a+oo*o),e.lineTo(oo*s-so*c,so*s+oo*c),e.lineTo(oo*r+so*i,oo*i-so*r),e.lineTo(oo*a+so*o,oo*o-so*a),e.lineTo(oo*s+so*c,oo*c-so*s),e.closePath()}};function uo(e,t){let n=null,r=Ia(i);e=typeof e==`function`?e:Sa(e||qa),t=typeof t==`function`?t:Sa(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:Sa(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:Sa(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function fo(){}function po(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 mo(e){this._context=e}mo.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:po(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:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ho(e){return new mo(e)}function go(e){this._context=e}go.prototype={areaStart:fo,areaEnd:fo,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:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _o(e){return new go(e)}function vo(e){this._context=e}vo.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:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yo(e){return new vo(e)}function bo(e){this._context=e}bo.prototype={areaStart:fo,areaEnd:fo,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 xo(e){return new bo(e)}function So(e){return e<0?-1:1}function Co(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(So(a)+So(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function wo(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function To(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 Eo(e){this._context=e}Eo.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:To(this,this._t0,wo(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,To(this,wo(this,n=Co(this,e,t)),n);break;default:To(this,this._t0,n=Co(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Do(e){this._context=new Oo(e)}(Do.prototype=Object.create(Eo.prototype)).point=function(e,t){Eo.prototype.point.call(this,t,e)};function Oo(e){this._context=e}Oo.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 ko(e){return new Eo(e)}function Ao(e){return new Do(e)}function jo(e){this._context=e}jo.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=Mo(e),i=Mo(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 Mo(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 No(e){return new jo(e)}function Po(e,t){this._context=e,this._t=t}Po.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 Fo(e){return new Po(e,.5)}function Io(e){return new Po(e,0)}function Lo(e){return new Po(e,1)}function Ro(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 zo(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Bo(e,t){return e[t]}function Vo(e){let t=[];return t.key=e,t}function Ho(){var e=Sa([]),t=zo,n=Ro,r=Bo;function i(i){var a=Array.from(e.apply(this,arguments),Vo),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=La(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:Sa(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Sa(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?zo:typeof e==`function`?e:Sa(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??Ro,i):n},i}function Uo(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}Ro(e,t)}}function Wo(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}Ro(e,t)}}function Go(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,Ro(e,t)}}function Ko(e){return e===`__proto__`}function qo(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function Jo(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function Yo(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Yo).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Xo(e){if(Array.isArray(e))return e.map(Jo);if(typeof e==`symbol`)return[e];e=Yo(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 Zo(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Ko(t))return n;let r=e[t];return r===void 0?qo(t)&&!Object.hasOwn(e,t)?Zo(e,Xo(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Jo(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Qo(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Ko(t))return n;let r=e[t];return r===void 0?n:r}}}function Qo(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Ko(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var $o=4;function es(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:$o),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function ts(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+es(i)+n},``)}var ns=e=>e===0?0:e>0?1:-1,rs=e=>typeof e==`number`&&e!=+e,is=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,K=e=>(typeof e==`number`||e instanceof Number)&&!rs(e),as=e=>K(e)||typeof e==`string`,os=0,ss=e=>{var t=++os;return`${e||``}${t}`},cs=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(!K(e)&&typeof e!=`string`)return n;var i;if(is(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return rs(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},ls=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 us(e,t,n){return K(e)&&K(t)?es(e+n*(t-e)):t}function ds(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):Zo(e,t))===n)}var fs=e=>e==null,ps=e=>fs(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function ms(e){return e!=null}function hs(){}var gs=[`type`,`size`,`sizeType`];function _s(){return _s=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},_s.apply(null,arguments)}function vs(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 ys(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vs(Object(n),!0).forEach(function(t){bs(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bs(e,t,n){return(t=xs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xs(e){var t=Ss(e,`string`);return typeof t==`symbol`?t:t+``}function Ss(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 Cs(e,t){if(e==null)return{};var n,r,i=ws(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 ws(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 Ts={symbolCircle:qa,symbolCross:Ja,symbolDiamond:Za,symbolSquare:Qa,symbolStar:ro,symbolTriangle:ao,symbolWye:lo},Es=Math.PI/180,Ds=e=>Ts[`symbol${ps(e)}`]||qa,Os=(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*Es;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}},ks=(e,t)=>{Ts[`symbol${ps(e)}`]=t},As=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=ys(ys({},Cs(e,gs)),{},{type:n,size:i,sizeType:o}),c=`circle`;typeof n==`string`&&(c=n);var l=()=>{var e=Ds(c),t=uo().type(e).size(Os(i,o,c))();if(t!==null)return t},u=s.className,d=s.cx,f=s.cy,p=ca(s);return K(d)&&K(f)&&K(i)?v.createElement(`path`,_s({},p,{className:ea(`recharts-symbols`,u),transform:`translate(${d}, ${f})`,d:l()})):null};As.registerSymbol=ks;var js=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Ms=(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=>{na(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},Ns=(e,t,n)=>r=>(e(t,n,r),null),Ps=(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];na(i)&&typeof a==`function`&&(r||={},r[i]=Ns(a,t,n))}),r};function Fs(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 Is(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fs(Object(n),!0).forEach(function(t){Ls(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ls(e,t,n){return(t=Rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rs(e){var t=zs(e,`string`);return typeof t==`symbol`?t:t+``}function zs(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 Bs(e,t){var n=Is({},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 Vs(){return Vs=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},Vs.apply(null,arguments)}function Hs(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 Us(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hs(Object(n),!0).forEach(function(t){Ws(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ws(e,t,n){return(t=Gs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gs(e){var t=Ks(e,`string`);return typeof t==`symbol`?t:t+``}function Ks(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 qs=32,Js={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Ys(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Xs(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=qs/2,a=qs/6,o=qs/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:Ys(t.payload),x1:0,y1:i,x2:qs,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${qs}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,${qs/8}h${qs}v${qs*3/4}h${-qs}z`,className:`recharts-legend-icon`});if(v.isValidElement(t.legendIcon)){var l=Us({},t);return delete l.legendIcon,v.cloneElement(t.legendIcon,l)}return v.createElement(As,{fill:s,cx:i,cy:i,size:qs,sizeType:`diameter`,type:c})}function Zs(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:qs,height:qs},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=ea({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?Us({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return v.createElement(`li`,Vs({className:f,style:l,key:`legend-item-${r}`},Ps(e,t,r)),v.createElement(ma,{width:n,height:n,viewBox:c,style:u,"aria-label":t.value==null?`legend icon`:`${t.value} legend icon`},v.createElement(Xs,{data:t,iconType:o,inactiveColor:a})),v.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var Qs=e=>{var t=Bs(e,Js),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(Zs,Vs({},t,{payload:n})))};function $s(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 ec(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function tc(e){return e}function nc(e){return function(t){return Zo(t,e)}}function rc(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ic(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ac(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function oc(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var sc=`[object RegExp]`,cc=`[object String]`,lc=`[object Number]`,uc=`[object Boolean]`,dc=`[object Arguments]`,fc=`[object Symbol]`,pc=`[object Date]`,mc=`[object Map]`,hc=`[object Set]`,gc=`[object Array]`,_c=`[object ArrayBuffer]`,vc=`[object Object]`,yc=`[object DataView]`,bc=`[object Uint8Array]`,xc=`[object Uint8ClampedArray]`,Sc=`[object Uint16Array]`,Cc=`[object Uint32Array]`,wc=`[object Int8Array]`,Tc=`[object Int16Array]`,Ec=`[object Int32Array]`,Dc=`[object Float32Array]`,Oc=`[object Float64Array]`,kc=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function Ac(e){return kc.Buffer!==void 0&&kc.Buffer.isBuffer(e)}function jc(e,t){return Mc(e,void 0,e,new Map,t)}function Mc(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(rc(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]=Mc(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,Mc(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(Mc(a,void 0,n,r,i));return t}if(Ac(e))return e.subarray();if(ic(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Mc(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),Nc(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),Nc(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),Nc(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,Nc(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),Nc(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),Nc(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),Nc(t,e,n,r,i),t}if(typeof e==`object`&&Pc(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),Nc(t,e,n,r,i),t}return e}function Nc(e,t,n=e,r,i){let a=[...Object.keys(t),...ac(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=Mc(t[s],s,n,r,i))}}function Pc(e){switch(oc(e)){case dc:case gc:case _c:case yc:case uc:case pc:case Dc:case Oc:case wc:case Tc:case Ec:case mc:case lc:case vc:case sc:case hc:case cc:case fc:case bc:case xc:case Sc:case Cc:return!0;default:return!1}}function Fc(e){return Mc(e,void 0,e,new Map,void 0)}function Ic(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Lc(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Rc(e,t,n){return typeof n==`function`?zc(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?zc(t,r,e,s,!1):!!c},new Map,!0):Rc(e,t,()=>void 0)}function zc(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return Bc(e,t,n,r);case`function`:return Object.keys(t).length>0?zc(e,{...t},n,r,i):Ic(e,t);default:return Lc(e)&&i?typeof t==`string`?t===``:!0:Ic(e,t)}}function Bc(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return Hc(e,t,n,r);if(t instanceof Map)return Vc(e,t,n,r);if(t instanceof Set)return Uc(e,t,n,r);let i=Object.keys(t);if(e==null||rc(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(!rc(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 Vc(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 Hc(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 Uc(e,t,n,r){return t.size===0?!0:e instanceof Set?Hc([...e],[...t],n,r):!1}function Wc(e,t){return Rc(e,t,()=>void 0)}function Gc(e){return e=Fc(e),t=>Wc(t,e)}function Kc(e,t){return jc(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(oc(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),Nc(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case lc:case cc:case uc:{let t=new e.constructor(e?.valueOf());return Nc(t,e),t}case dc:{let t={};return Nc(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function qc(e){return Kc(e)}var Jc=/^(?:0|[1-9]\d*)$/;function Yc(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 Jc.test(e)}}function Xc(e){return typeof e==`object`&&!!e&&oc(e)===`[object Arguments]`}function Zc(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&qo(t)&&e?.[t]==null?Xo(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)||Xc(r))&&Yc(t)&&t<r.length))return!1;r=r[t]}return!0}function Qc(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=Jo(e);break}return t=qc(t),function(n){let r=Zo(n,e);return r===void 0?Zc(n,e):t===void 0?r===void 0:Wc(r,t)}}function $c(e){if(e==null)return tc;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?Qc(e[0],e[1]):Gc(e);case`string`:case`symbol`:case`number`:return nc(e)}}function el(e){return Number.isSafeInteger(e)&&e>=0}function tl(e){return e!=null&&typeof e!=`function`&&el(e.length)}function nl(e){return typeof e==`object`&&!!e}function rl(e){return nl(e)&&tl(e)}function il(e,t=tc){return rl(e)?$s(Array.from(e),ec($c(t),1)):[]}function al(e,t,n){return t===!0?il(e,n):typeof t==`function`?il(e,t):e}var ol=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})),sl=o(((e,t)=>{t.exports=ol()})),cl=o((e=>{var t=d(),n=sl();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}})),ll=o(((e,t)=>{t.exports=cl()})),ul=(0,v.createContext)(null),dl=ll(),fl=e=>e,pl=()=>{var e=(0,v.useContext)(ul);return e?e.store.dispatch:fl},ml=()=>{},hl=()=>ml,gl=(e,t)=>e===t;function q(e){var t=(0,v.useContext)(ul),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:ml,[t,e]);return(0,dl.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:hl,t?t.store.getState:ml,t?t.store.getState:ml,n,gl)}function _l(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function vl(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 yl=e=>Array.isArray(e)?e:[e];function bl(e){let t=Array.isArray(e[0])?e[0]:e;return vl(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function xl(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Sl=class{constructor(e){this.value=e}deref(){return this.value}},Cl=typeof WeakRef>`u`?Sl:WeakRef,wl=0,Tl=1;function El(){return{s:wl,v:void 0,o:null,p:null}}function Dl(e){return e instanceof Cl?e.deref():e}function Ol(e,t={}){let n=El(),{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=El(),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=El(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Tl)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=Dl(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Cl(c):c}return s.s=Tl,s.v=c,c}return o.clearCache=()=>{n=El(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function kl(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()),_l(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Ol,argsMemoizeOptions:u=[]}={...n,...a},d=yl(c),f=yl(u),p=bl(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=xl(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 J=kl(Ol);function Al(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 jl(e,t,n){return Lc(n)&&(typeof t==`number`&&tl(n)&&Yc(t)&&t<n.length||typeof t==`string`&&t in n)?Ic(n[t],e):!1}function Ml(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var Nl=(e,t,n)=>{if(e!==t){let r=Ml(e),i=Ml(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 Pl(e){return typeof e==`symbol`||e instanceof Symbol}var Fl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Il=/^\w*$/;function Ll(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Pl(e)?!0:typeof e==`string`&&(Il.test(e)||!Fl.test(e))||t!=null&&Object.hasOwn(t,e)}function Y(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)||Ll(e)?e:{key:e,path:Xo(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=Nl(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function X(e,...t){let n=t.length;return n>1&&jl(e,t[0],t[1])?t=[]:n>2&&jl(t[0],t[1],t[2])&&(t=[t[0]]),Y(e,Al(t),[`asc`])}var Rl=e=>e.legend.settings,zl=e=>e.legend.size,Bl=J([e=>e.legend.payload,Rl],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?X(r,n):r});function Vl(){return q(Bl)}function Hl(e,t){return ql(e)||Kl(e,t)||Wl(e,t)||Ul()}function Ul(){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 Wl(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 Kl(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 ql(e){if(Array.isArray(e))return e}var Jl=1;function Yl(e,t){return Math.abs(e.height-t.height)>Jl||Math.abs(e.left-t.left)>Jl||Math.abs(e.top-t.top)>Jl||Math.abs(e.width-t.width)>Jl}function Xl(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Zl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=Hl((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=Xl(e);if(Yl(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=Xl(e);Yl(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 Ql(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 $l=typeof Symbol==`function`&&Symbol.observable||`@@observable`,eu=()=>Math.random().toString(36).substring(7).split(``).join(`.`),tu={INIT:`@@redux/INIT${eu()}`,REPLACE:`@@redux/REPLACE${eu()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${eu()}`};function nu(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 ru(e,t,n){if(typeof e!=`function`)throw Error(Ql(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Ql(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Ql(1));return n(ru)(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(Ql(3));return i}function d(e){if(typeof e!=`function`)throw Error(Ql(4));if(c)throw Error(Ql(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Ql(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!nu(e))throw Error(Ql(7));if(e.type===void 0)throw Error(Ql(8));if(typeof e.type!=`string`)throw Error(Ql(17));if(c)throw Error(Ql(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(Ql(10));r=e,f({type:tu.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Ql(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[$l](){return this}}}return f({type:tu.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[$l]:m}}function iu(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:tu.INIT})===void 0)throw Error(Ql(12));if(n(void 0,{type:tu.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Ql(13))})}function au(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{iu(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(Ql(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function ou(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function su(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Ql(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=ou(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function cu(e){return nu(e)&&`type`in e&&typeof e.type==`string`}var lu=Symbol.for(`immer-nothing`),uu=Symbol.for(`immer-draftable`),du=Symbol.for(`immer-state`);function fu(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pu=Object,mu=pu.getPrototypeOf,hu=`constructor`,gu=`prototype`,_u=`configurable`,vu=`enumerable`,yu=`writable`,bu=`value`,xu=e=>!!e&&!!e[du];function Su(e){return e?Tu(e)||Mu(e)||!!e[uu]||!!e[hu]?.[uu]||Nu(e)||Pu(e):!1}var Cu=pu[gu][hu].toString(),wu=new WeakMap;function Tu(e){if(!e||!Fu(e))return!1;let t=mu(e);if(t===null||t===pu[gu])return!0;let n=pu.hasOwnProperty.call(t,hu)&&t[hu];if(n===Object)return!0;if(!Iu(n))return!1;let r=wu.get(n);return r===void 0&&(r=Function.toString.call(n),wu.set(n,r)),r===Cu}function Eu(e,t,n=!0){Du(e)===0?(n?Reflect.ownKeys(e):pu.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Du(e){let t=e[du];return t?t.type_:Mu(e)?1:Nu(e)?2:Pu(e)?3:0}var Ou=(e,t,n=Du(e))=>n===2?e.has(t):pu[gu].hasOwnProperty.call(e,t),ku=(e,t,n=Du(e))=>n===2?e.get(t):e[t],Au=(e,t,n,r=Du(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ju(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Mu=Array.isArray,Nu=e=>e instanceof Map,Pu=e=>e instanceof Set,Fu=e=>typeof e==`object`,Iu=e=>typeof e==`function`,Lu=e=>typeof e==`boolean`;function Ru(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var zu=e=>e.copy_||e.base_,Bu=e=>e.modified_?e.copy_:e.base_;function Vu(e,t){if(Nu(e))return new Map(e);if(Pu(e))return new Set(e);if(Mu(e))return Array[gu].slice.call(e);let n=Tu(e);if(t===!0||t===`class_only`&&!n){let t=pu.getOwnPropertyDescriptors(e);delete t[du];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[_u]=!0),(a.get||a.set)&&(t[i]={[_u]:!0,[yu]:!0,[vu]:a[vu],[bu]:e[i]})}return pu.create(mu(e),t)}else{let t=mu(e);if(t!==null&&n)return{...e};let r=pu.create(t);return pu.assign(r,e)}}function Hu(e,t=!1){return Gu(e)||xu(e)||!Su(e)?e:(Du(e)>1&&pu.defineProperties(e,{set:Wu,add:Wu,clear:Wu,delete:Wu}),pu.freeze(e),t&&Eu(e,(e,t)=>{Hu(t,!0)},!1),e)}function Uu(){fu(2)}var Wu={[bu]:Uu};function Gu(e){return e===null||!Fu(e)?!0:pu.isFrozen(e)}var Ku=`MapSet`,qu=`Patches`,Ju=`ArrayMethods`,Yu={};function Xu(e){let t=Yu[e];return t||fu(0,e),t}var Zu=e=>!!Yu[e],Qu,$u=()=>Qu,ed=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Zu(Ku)?Xu(Ku):void 0,arrayMethodsPlugin_:Zu(Ju)?Xu(Ju):void 0});function td(e,t){t&&(e.patchPlugin_=Xu(qu),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nd(e){rd(e),e.drafts_.forEach(ad),e.drafts_=null}function rd(e){e===Qu&&(Qu=e.parent_)}var id=e=>Qu=ed(Qu,e);function ad(e){let t=e[du];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function od(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[du].modified_&&(nd(t),fu(4)),Su(e)&&(e=sd(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[du].base_,e,t)}else e=sd(t,n);return cd(t,e,!0),nd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===lu?void 0:e}function sd(e,t){if(Gu(t))return t;let n=t[du];if(!n)return gd(t,e.handledSet_,e);if(!ud(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);md(n,e)}return n.copy_}function cd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hu(t,n)}function ld(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ud=(e,t)=>e.scope_===t,dd=[];function fd(e,t,n,r){let i=zu(e),a=e.type_;if(r!==void 0&&ku(i,r,a)===t){Au(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Eu(i,(e,n)=>{if(xu(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??dd;for(let e of o)Au(i,e,n,a)}function pd(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!ud(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Bu(i);fd(e,i.draft_??i,a,n),md(i,r)})}function md(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)}ld(e)}}function hd(e,t,n){let{scope_:r}=e;if(xu(n)){let i=n[du];ud(i,r)&&i.callbacks_.push(function(){Cd(e),fd(e,n,Bu(i),t)})}else Su(n)&&e.callbacks_.push(function(){let i=zu(e);e.type_===3?i.has(n)&&gd(n,r.handledSet_,r):ku(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&gd(ku(e.copy_,t,e.type_),r.handledSet_,r)})}function gd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xu(e)||t.has(e)||!Su(e)||Gu(e)?e:(t.add(e),Eu(e,(r,i)=>{if(xu(i)){let t=i[du];ud(t,n)&&(Au(e,r,Bu(t),e.type_),ld(t))}else Su(i)&&gd(i,t,n)}),e)}function _d(e,t){let n=Mu(e),r={type_:+!!n,scope_:t?t.scope_:$u(),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=vd;n&&(i=[r],a=yd);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var vd={get(e,t){if(t===du)return e;if(t===`constructor`||t===`__proto__`){let n=zu(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=zu(e);if(!Ou(i,t,e.type_))return Z(e,i,t);let a=i[t];if(e.finalized_||!Su(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Ru(t))return a;if(a===bd(e.base_,t)){Cd(e);let n=e.type_===1?+t:t,r=Td(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 zu(e)},ownKeys(e){return Reflect.ownKeys(zu(e))},set(e,t,n){if(t===`constructor`||t===`__proto__`||t===`prototype`)return!0;let r=xd(zu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=bd(zu(e),t),i=r?.[du];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(ju(n,r)&&(n!==void 0||Ou(e.base_,t,e.type_)))return!0;Cd(e),Sd(e)}return e.copy_[t]===n&&(n!==void 0||Ou(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),hd(e,t,n),!0)},deleteProperty(e,t){return Cd(e),bd(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Sd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=zu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[yu]:!0,[_u]:e.type_!==1||t!==`length`,[vu]:r[vu],[bu]:n[t]}},defineProperty(){fu(11)},getPrototypeOf(e){return mu(e.base_)},setPrototypeOf(){fu(12)}},yd={};for(let e in vd){let t=vd[e];yd[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}yd.deleteProperty=function(e,t){return yd.set.call(this,e,t,void 0)},yd.set=function(e,t,n){return vd.set.call(this,e[0],t,n,e[0])};function bd(e,t){let n=e[du];return(n?zu(n):e)[t]}function Z(e,t,n){let r=xd(t,n);return r?bu in r?r[bu]:r.get?.call(e.draft_):void 0}function xd(e,t){if(!(t in e))return;let n=mu(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=mu(n)}}function Sd(e){e.modified_||(e.modified_=!0,e.parent_&&Sd(e.parent_))}function Cd(e){e.copy_||=(e.assigned_=new Map,Vu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wd=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Iu(e)&&!Iu(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Iu(t)||fu(6),n!==void 0&&!Iu(n)&&fu(7);let r;if(Su(e)){let i=id(this),a=Td(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?nd(i):rd(i)}return td(i,n),od(r,i)}else if(!e||!Fu(e)){if(r=t(e),r===void 0&&(r=e),r===lu&&(r=void 0),this.autoFreeze_&&Hu(r,!0),n){let t=[],i=[];Xu(qu).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else fu(1,e)},this.produceWithPatches=(e,t)=>{if(Iu(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]},Lu(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Lu(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Lu(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Su(e)||fu(8),xu(e)&&(e=Ed(e));let t=id(this),n=Td(t,e,void 0);return n[du].isManual_=!0,rd(t),n}finishDraft(e,t){let n=e&&e[du];(!n||!n.isManual_)&&fu(9);let{scope_:r}=n;return td(r,t),od(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=Xu(qu).applyPatches_;return xu(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Td(e,t,n,r){let[i,a]=Nu(t)?Xu(Ku).proxyMap_(t,n):Pu(t)?Xu(Ku).proxySet_(t,n):_d(t,n);return(n?.scope_??$u()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?pd(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 Ed(e){return xu(e)||fu(10,e),Dd(e)}function Dd(e){if(!Su(e)||Gu(e))return e;let t=e[du],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vu(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Vu(e,!0);return Eu(n,(e,t)=>{Au(n,e,Dd(t))},r),t&&(t.finalized_=!1),n}var Od=new wd().produce,kd=e=>e;function Ad(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var jd=Ad(),Md=Ad,Nd=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?ou:ou.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Q(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Uf(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=>cu(t)&&t.type===e,n}var Pd=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 Fd(e){return Su(e)?Od(e,()=>{}):e}function Id(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ld(e){return typeof e==`boolean`}var Rd=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Pd;return t&&(Ld(t)?a.push(jd):a.push(Md(t.extraArgument))),a},zd=`RTK_autoBatch`,Bd=()=>e=>({payload:e,meta:{[zd]:!0}}),Vd=e=>t=>{setTimeout(t,e)},Hd=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},Ud=(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?Hd(window.requestAnimationFrame,100):Vd(10):e.type===`callback`?e.queueNotification:Vd(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?.[zd],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Wd=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Pd(e);return n&&r.push(Ud(typeof n==`object`?n:void 0)),r};function Gd(e){let t=Rd(),{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(nu(n))c=au(n);else throw Error(Uf(1));let l;l=typeof r==`function`?r(t):t();let u=ou;i&&(u=Nd({trace:!1,...typeof i==`object`&&i}));let d=Wd(su(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return ru(c,o,p)}function Kd(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Uf(28));if(r in t)throw Error(Uf(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 qd(e){return typeof e==`function`}function Jd(e,t){let[n,r,i]=Kd(t),a;if(qd(e))a=()=>Fd(e());else{let t=Fd(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(xu(e)){let r=n(e,t);return r===void 0?e:r}else if(Su(e))return Od(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 Yd=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Xd=(e=21)=>{let t=``,n=e;for(;n--;)t+=Yd[Math.random()*64|0];return t},Zd=Symbol.for(`rtk-slice-createasyncthunk`);function Qd(e,t){return`${e}/${t}`}function $d({creators:e}={}){let t=e?.asyncThunk?.[Zd];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Uf(11));let i=(typeof e.reducers==`function`?e.reducers(nf()):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(Uf(12));if(n in o.sliceCaseReducersByType)throw Error(Uf(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:Qd(n,r),createNotation:typeof e.reducers==`function`};af(a)?sf(o,a,s,t):rf(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?Kd(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Jd(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=Id(d,r,m)),i}function i(t=l){return Id(Id(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=ef(a,t,()=>Id(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 ef(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 tf=$d();function nf(){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 rf({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!of(r))throw Error(Uf(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Q(e,o):Q(e))}function af(e){return e._reducerDefinitionType===`asyncThunk`}function of(e){return e._reducerDefinitionType===`reducerWithPrepare`}function sf({type:e,reducerName:t},n,r,i){if(!i)throw Error(Uf(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||cf,pending:s||cf,rejected:c||cf,settled:l||cf})}function cf(){}var lf=`task`,uf=`listener`,df=`completed`,ff=`cancelled`,pf=`task-${ff}`,mf=`task-${df}`,hf=`${uf}-${ff}`,gf=`${uf}-${df}`,_f=class{constructor(e){this.code=e,this.message=`${lf} ${ff} (reason: ${e})`}code;name=`TaskAbortError`;message},vf=(e,t)=>{if(typeof e!=`function`)throw TypeError(Uf(32))},yf=()=>{},bf=(e,t=yf)=>(e.catch(t),e),xf=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),Sf=e=>{if(e.aborted)throw new _f(e.reason)};function Cf(e,t){let n=yf;return new Promise((r,i)=>{let a=()=>i(new _f(e.reason));if(e.aborted){a();return}n=xf(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=yf})}var wf=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof _f?`cancelled`:`rejected`,error:e}}finally{t?.()}},Tf=e=>t=>bf(Cf(e,t).then(t=>(Sf(e),t))),Ef=e=>{let t=Tf(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:Df}=Object,Of={},kf=`listenerMiddleware`,Af=(e,t)=>{let n=t=>xf(e,()=>t.abort(e.reason));return(r,i)=>{vf(r,`taskExecutor`);let a=new AbortController;n(a);let o=wf(async()=>{Sf(e),Sf(a.signal);let t=await r({pause:Tf(a.signal),delay:Ef(a.signal),signal:a.signal});return Sf(a.signal),t},()=>a.abort(mf));return i?.autoJoin&&t.push(o.catch(yf)),{result:Tf(e)(o),cancel(){a.abort(pf)}}}},jf=(e,t)=>{let n=async(n,r)=>{Sf(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 Cf(t,Promise.race(a));return Sf(t),e}finally{i()}};return((e,t)=>bf(n(e,t)))},Mf=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Q(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Uf(21));return vf(a,`options.listener`),{predicate:i,type:t,effect:a}},Nf=Df(e=>{let{type:t,predicate:n,effect:r}=Mf(e);return{id:Xd(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Uf(22))}}},{withTypes:()=>Nf}),Pf=(e,t)=>{let{type:n,effect:r,predicate:i}=Mf(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},Ff=e=>{e.pending.forEach(e=>{e.abort(hf)})},If=(e,t)=>()=>{for(let e of t.keys())Ff(e);e.clear()},Lf=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},Rf=Df(Q(`${kf}/add`),{withTypes:()=>Rf}),zf=Q(`${kf}/removeAll`),Bf=Df(Q(`${kf}/remove`),{withTypes:()=>Bf}),Vf=(...e)=>{console.error(`${kf}/error`,...e)},Hf=(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=Vf}=e;vf(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Ff(e)}),c=(e=>s(Pf(t,e)??Nf(e)));Df(c,{withTypes:()=>c});let l=e=>{let n=Pf(t,e);return n&&(n.unsubscribe(),e.cancelActive&&Ff(n)),!!n};Df(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=jf(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,Df({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:Ef(u.signal),pause:Tf(u.signal),extra:a,signal:u.signal,fork:Af(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(hf),n.delete(e))})},cancel:()=>{u.abort(hf),e.pending.delete(u)},throwIfCancelled:()=>{Sf(u.signal)}})))}catch(e){e instanceof _f||Lf(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(gf),i(e),e.pending.delete(u)}},d=If(t,n);return{middleware:e=>n=>r=>{if(!cu(r))return n(r);if(Rf.match(r))return c(r.payload);if(zf.match(r)){d();return}if(Bf.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===Of)throw Error(Uf(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,Lf(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=Of}return s},startListening:c,stopListening:l,clearListeners:d}};function Uf(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 Wf=tf({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}}}),Gf=Wf.actions,Kf=Gf.setMargin,qf=Gf.setLayout,Jf=Gf.setChartSize,Yf=Gf.setScale,Xf=Wf.reducer;function Zf(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function $(e){return Number.isFinite(e)}function Qf(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function $f(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 ep(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$f(Object(n),!0).forEach(function(t){tp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tp(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=rp(e,`string`);return typeof t==`symbol`?t:t+``}function rp(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 ip(e,t,n){return fs(e)||fs(t)?n:as(t)?Zo(e,t,n):typeof t==`function`?t(e):n}var ap=(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`&&K(e[a]))return ep(ep({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&K(e[o]))return ep(ep({},e),{},{[o]:e[o]+(i||0)})}return e},op=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,sp=(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},cp=(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 $(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(ms):c&&l?l.map((e,t)=>{var n=o.map(e);return $(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ms):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return $(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ms):o.domain().map((e,t)=>{var n=o.map(e);return $(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(ms)},lp={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=rs(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Uo,none:Ro,silhouette:Wo,wiggle:Go,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=rs(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},up=(e,t,n)=>{var r=lp[n]??Ro,i=Ho().keys(t).value((e,t)=>Number(ip(e,t,0))).order(zo).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=ip(e[i],t[r],0);Array.isArray(a)&&a.length===2&&K(a[0])&&K(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function dp(e){return e==null?void 0:String(e)}function fp(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&&!fs(i[t.dataKey])){var s=ds(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=ip(i,fs(o)?t.dataKey:o),l=t.scale.map(c);return K(l)?l:null}var pp=e=>{var t=e.flat(2).filter(K);return[Math.min(...t),Math.max(...t)]},mp=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],hp=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return mp(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=pp(Zf(r,t,n));return!$(i[0])||!$(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]))},gp=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_p=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vp=(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=X(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 yp(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return ep(ep({},t),{},{dataKey:n,payload:r,value:i,name:a})}function bp(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var xp=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},Sp=(e,t)=>t===`centric`?e.angle:e.radius,Cp=e=>e.layout.width,wp=e=>e.layout.height,Tp=e=>e.layout.scale,Ep=e=>e.layout.margin,Dp=J(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Op=J(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),kp=`data-recharts-item-index`;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)}var Fp=e=>e.brush.height;function Ip(e){return Op(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Lp(e){return Op(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Rp(e){return Dp(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function zp(e){return Dp(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var Bp=J([Cp,wp,Ep,Fp,Ip,Lp,Rp,zp,Rl,zl],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=jp(jp({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=ap(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return jp(jp({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Vp=J(Bp,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Hp=J(Cp,wp,(e,t)=>({x:0,y:0,width:e,height:t})),Up=(0,v.createContext)(null),Wp=()=>(0,v.useContext)(Up)!=null,Gp=e=>e.brush,Kp=J([Gp,Bp,Ep],(e,t,n)=>({height:e.height,x:K(e.x)?e.x:t.left,y:K(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:K(e.width)?e.width:t.width}));function qp(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 Jp(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=qp(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 Yp(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Jp(e,t,{leading:r,maxWait:t,trailing:i})}var Xp=!0,Zp=function(e,t){var n=[...arguments].slice(2);if(Xp&&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++]))}},Qp={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},$p=(e,t,n)=>{var r=n.width,i=r===void 0?Qp.width:r,a=n.height,o=a===void 0?Qp.height:a,s=n.aspect,c=n.maxHeight,l=is(i)?e:Number(i),u=is(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}},em={width:0,height:0,overflow:`visible`},tm={width:0,overflowX:`visible`},nm={height:0,overflowY:`visible`},rm={},im=e=>{var t=e.width,n=e.height,r=is(t),i=is(n);return r&&i?em:r?tm:i?nm:rm};function am(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Qp.width,a=Qp.height):i===void 0?i=r&&r>0?void 0:Qp.width:a===void 0&&(a=r&&r>0?void 0:Qp.height),{width:i,height:a}}var om=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function sm(){return sm=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},sm.apply(null,arguments)}function cm(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 lm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cm(Object(n),!0).forEach(function(t){um(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function um(e,t,n){return(t=dm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dm(e){var t=fm(e,`string`);return typeof t==`symbol`?t:t+``}function fm(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 pm(e,t){return vm(e)||_m(e,t)||hm(e,t)||mm()}function mm(){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 hm(e,t){if(e){if(typeof e==`string`)return gm(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)?gm(e,t):void 0}}function gm(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 _m(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 vm(e){if(Array.isArray(e))return e}function ym(e,t){if(e==null)return{};var n,r,i=bm(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 bm(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 xm=(0,v.createContext)(Qp.initialDimension);function Sm(e){return Qf(e.width)&&Qf(e.height)}function Cm(e){var t=e.children,n=e.width,r=e.height,i=(0,v.useMemo)(()=>({width:n,height:r}),[n,r]);return Sm(i)?v.createElement(xm.Provider,{value:i},t):null}var wm=()=>(0,v.useContext)(xm),Tm=(0,v.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Qp.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?Qp.minWidth:s,l=e.minHeight,u=e.maxHeight,d=e.children,f=e.debounce,p=f===void 0?Qp.debounce:f,m=e.id,h=e.className,g=e.onResize,_=e.style,y=_===void 0?{}:_,b=ym(e,om),x=(0,v.useRef)(null),S=(0,v.useRef)();S.current=g,(0,v.useImperativeHandle)(t,()=>x.current);var C=pm((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 hs;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=Yp(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;Zp(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var k=$p(D,O,{width:a,height:o,aspect:n,maxHeight:u}),A=k.calculatedWidth,j=k.calculatedHeight;return Zp(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`,sm({id:m?`${m}`:void 0,className:ea(`recharts-responsive-container`,h),style:lm(lm({},y),{},{width:a,height:o,minWidth:c,minHeight:l,maxHeight:u}),ref:x},b),v.createElement(`div`,{style:im({width:a,height:o})},v.createElement(Cm,{width:A,height:j},d)))}),Em=(0,v.forwardRef)((e,t)=>{var n=wm();if(Qf(n.width)&&Qf(n.height))return e.children;var r=am({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=$p(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return K(s)&&K(c)?v.createElement(Cm,{width:s,height:c},e.children):v.createElement(Tm,sm({},e,{width:i,height:a,ref:t}))});function Dm(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 Om=()=>{var e=Wp(),t=q(Vp),n=q(Kp),r=q(Gp)?.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}},km={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Am=()=>q(Bp)??km,jm=()=>q(Cp),Mm=()=>q(wp),Nm=()=>q(e=>e.layout.margin),Pm=e=>e.layout.layoutType,Fm=()=>q(Pm),Im=()=>{var e=Fm();if(e===`horizontal`||e===`vertical`)return e},Lm=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},Rm=()=>Fm()!==void 0,zm=e=>{var t=pl(),n=Wp(),r=e.width,i=e.height,a=wm(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&Qf(o)&&Qf(s)&&t(Jf({width:o,height:s}))},[t,n,o,s]),null},Bm=tf({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(kd(t.payload))},prepare:Bd()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ed(e).payload.indexOf(kd(r));a>-1&&(e.payload[a]=kd(i))},prepare:Bd()},removeLegendPayload:{reducer(e,t){var n=Ed(e).payload.indexOf(kd(t.payload));n>-1&&e.payload.splice(n,1)},prepare:Bd()}}}),Vm=Bm.actions,Hm=Vm.setLegendSize,Um=Vm.setLegendSettings,Wm=Vm.addLegendPayload,Gm=Vm.replaceLegendPayload,Km=Vm.removeLegendPayload,qm=Bm.reducer,Jm=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=Jm()}))();function Ym(e){e()}function Xm(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Ym(()=>{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 Zm={notify(){},get:()=>[]};function Qm(e,t){let n,r=Zm,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=Xm())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Zm)}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 $m=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,eh=typeof navigator<`u`&&navigator.product===`ReactNative`,th=$m||eh?v.useLayoutEffect:v.useEffect;function nh(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function rh(e,t){if(nh(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])||!nh(e[n[r]],t[n[r]]))return!1;return!0}var ih=Symbol.for(`react-redux-context`),ah=typeof globalThis<`u`?globalThis:{};function oh(){if(!v.createContext)return{};let e=ah[ih]??=new Map,t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var sh=oh();function ch(e){let{children:t,context:n,serverState:r,store:i}=e,a=v.useMemo(()=>({store:i,subscription:Qm(i),getServerState:r?()=>r:void 0}),[i,r]),o=v.useMemo(()=>i.getState(),[i]);th(()=>{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||sh;return v.createElement(s.Provider,{value:a},t)}var lh=ch,uh=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function dh(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function fh(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(uh.has(n)){if(e[n]==null&&t[n]==null)continue;if(!rh(e[n],t[n]))return!1}else if(!dh(e[n],t[n]))return!1;return!0}var ph=l(h()),mh=[`contextPayload`];function hh(){return hh=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},hh.apply(null,arguments)}function gh(e,t){return xh(e)||bh(e,t)||vh(e,t)||_h()}function _h(){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 vh(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 bh(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 xh(e){if(Array.isArray(e))return e}function Sh(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 Ch(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Sh(Object(n),!0).forEach(function(t){wh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wh(e,t,n){return(t=Th(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Th(e){var t=Eh(e,`string`);return typeof t==`symbol`?t:t+``}function Eh(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 Dh(e,t){if(e==null)return{};var n,r,i=Oh(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 Oh(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 kh(e){return e.value}function Ah(e){var t=e.contextPayload,n=Dh(e,mh),r=al(t,e.payloadUniqBy,kh),i=Ch(Ch({},n),{},{payload:r});return v.isValidElement(e.content)?v.cloneElement(e.content,i):typeof e.content==`function`?v.createElement(e.content,i):v.createElement(Qs,i)}function jh(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}),Ch(Ch({},l),u)}function Mh(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=pl();return(0,v.useLayoutEffect)(()=>{a(Um({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function Nh(e){var t=e.width,n=e.height,r=pl();return(0,v.useLayoutEffect)(()=>{r(Hm({width:t,height:n}))},[r,t,n]),(0,v.useLayoutEffect)(()=>()=>{r(Hm({width:0,height:0}))},[r]),null}function Ph(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var Fh={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,labelStyle:{},layout:`horizontal`,verticalAlign:`bottom`};function Ih(e){var t=Bs(e,Fh),n=Vl(),r=xa(),i=Nm(),a=t.width,o=t.height,s=t.wrapperStyle,c=t.portal,l=gh(Zl([n]),2),u=l[0],d=l[1],f=jm(),p=Mm();if(f==null||p==null)return null;var m=f-(i?.left||0)-(i?.right||0),h=Ph(t.layout,o,a,m),g=c?s:Ch(Ch({position:`absolute`,width:h?.width||a||`auto`,height:h?.height||o||`auto`},jh(s,t,i,f,p,u)),s),_=c??r;return _==null||n==null?null:(0,ph.createPortal)(v.createElement(`div`,{className:`recharts-legend-wrapper`,style:g,ref:d},v.createElement(Mh,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&v.createElement(Nh,{width:u.width,height:u.height}),v.createElement(Ah,hh({},t,h,{margin:i,chartWidth:f,chartHeight:p,contextPayload:n}))),_)}var Lh=v.memo(Ih,fh);Lh.displayName=`Legend`;function Rh(){return Rh=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},Rh.apply(null,arguments)}function zh(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 Bh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zh(Object(n),!0).forEach(function(t){Vh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vh(e,t,n){return(t=Hh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hh(e){var t=Uh(e,`string`);return typeof t==`symbol`?t:t+``}function Uh(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 Wh(e,t){return Yh(e)||Jh(e,t)||Kh(e,t)||Gh()}function Gh(){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 Kh(e,t){if(e){if(typeof e==`string`)return qh(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)?qh(e,t):void 0}}function qh(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 Jh(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 Yh(e){if(Array.isArray(e))return e}function Xh(e){return Array.isArray(e)&&as(e[0])&&as(e[1])?e.join(` ~ `):e}var Zh={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 Qh(e,t){return t==null?e:X(e,t)}var $h=e=>{var t=e.separator,n=t===void 0?Zh.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?Zh.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?Zh.accessibilityLayer:m,g=()=>{if(s&&s.length){var e={padding:0,margin:0},t=Qh(s,l).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||Xh,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=Wh(d,2);l=f[0],u=f[1]}else if(d!=null)l=d;else return null}var p=Bh(Bh({},Zh.itemStyle),{},{color:e.color||Zh.itemStyle.color},i);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},as(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,as(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},_=Bh(Bh({},Zh.contentStyle),r),y=Bh({margin:0},o),b=!fs(f),x=b?f:``,S=ea(`recharts-default-tooltip`,u),C=ea(`recharts-tooltip-label`,d);b&&p&&s!=null&&(x=p(f,s));var w=h?{role:`status`,"aria-live":`assertive`}:{};return v.createElement(`div`,Rh({className:S,style:_},w),v.createElement(`p`,{className:C,style:y},v.isValidElement(x)?x:`${x}`),g())},eg=`recharts-tooltip-wrapper`,tg={visibility:`hidden`};function ng(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return ea(eg,{[`${eg}-right`]:K(n)&&t&&K(t.x)&&n>=t.x,[`${eg}-left`]:K(n)&&t&&K(t.x)&&n<t.x,[`${eg}-bottom`]:K(r)&&t&&K(t.y)&&r>=t.y,[`${eg}-top`]:K(r)&&t&&K(t.y)&&r<t.y})}function rg(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&&K(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 ig(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function ag(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=rg({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=rg({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=ig({translateX:d,translateY:f,useTranslate3d:c})):u=tg,{cssProperties:u,cssClasses:ng({translateX:d,translateY:f,coordinate:n})}}var og={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function sg(e,t){return fg(e)||dg(e,t)||lg(e,t)||cg()}function cg(){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 lg(e,t){if(e){if(typeof e==`string`)return ug(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)?ug(e,t):void 0}}function ug(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 dg(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 fg(e){if(Array.isArray(e))return e}function pg(){var e=sg((0,v.useState)(()=>og.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 mg(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 hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mg(Object(n),!0).forEach(function(t){gg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gg(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=vg(e,`string`);return typeof t==`symbol`?t:t+``}function vg(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 wg(e)||Cg(e,t)||xg(e,t)||bg()}function bg(){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 xg(e,t){if(e){if(typeof e==`string`)return Sg(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)?Sg(e,t):void 0}}function Sg(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 Cg(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 wg(e){if(Array.isArray(e))return e}function Tg(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 Eg(e){var t=pg(),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(hg(hg({},r),{},{dismissed:!1}));var a=ag({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=hg(hg({},e.hasPortalFromProps?{}:hg(hg({transition:Tg({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 Dg=v.memo(Eg),Og=()=>q(e=>e.rootProps.accessibilityLayer)??!0;function kg(){return kg=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},kg.apply(null,arguments)}function Ag(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 jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ag(Object(n),!0).forEach(function(t){Mg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ag(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mg(e,t,n){return(t=Ng(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ng(e){var t=Pg(e,`string`);return typeof t==`symbol`?t:t+``}function Pg(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 Fg={curveBasisClosed:_o,curveBasisOpen:yo,curveBasis:ho,curveBumpX:Ga,curveBumpY:Ka,curveLinearClosed:xo,curveLinear:za,curveMonotoneX:ko,curveMonotoneY:Ao,curveNatural:No,curveStep:Fo,curveStepAfter:Lo,curveStepBefore:Io},Ig=e=>$(e.x)&&$(e.y),Lg=e=>e.base!=null&&Ig(e.base)&&Ig(e),Rg=e=>e.x,zg=e=>e.y,Bg=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${ps(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=Fg[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return Fg[n]||za},Vg={connectNulls:!1,type:`linear`},Hg=e=>{var t=e.type,n=t===void 0?Vg.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?Vg.connectNulls:s,l=Bg(n,o),u=c?i.filter(Ig):i;if(Array.isArray(a)){var d,f=i.map((e,t)=>jg(jg({},e),{},{base:a[t]}));return d=o===`vertical`?Ua().y(zg).x1(Rg).x0(e=>e.base.x):Ua().x(Rg).y1(zg).y0(e=>e.base.y),d.defined(Lg).curve(l)(c?f.filter(Lg):f)}return(o===`vertical`&&K(a)?Ua().y(zg).x1(Rg).x0(a):K(a)?Ua().x(Rg).y1(zg).y0(a):Ha().x(Rg).y(zg)).defined(Ig).curve(l)(u)},Ug=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=Fm();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?Hg(o):r;return v.createElement(`path`,kg({},oa(e),Ms(e),{className:ea(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},Wg=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Gg(){return Gg=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},Gg.apply(null,arguments)}function Kg(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 qg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kg(Object(n),!0).forEach(function(t){Jg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jg(e,t,n){return(t=Yg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yg(e){var t=Xg(e,`string`);return typeof t==`symbol`?t:t+``}function Xg(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 Zg(e,t){if(e==null)return{};var n,r,i=Qg(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 Qg(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 $g=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,e_=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=Zg(e,Wg),h=qg({x:n,y:i,top:o,left:c,width:u,height:f},m);return!K(n)||!K(i)||!K(u)||!K(f)||!K(o)||!K(c)?null:v.createElement(`path`,Gg({},ca(h),{className:ea(`recharts-cross`,p),d:$g(n,i,u,f,o,c)}))};function t_(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 n_=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],r_=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),i_=(e,t)=>n=>r_(n_(e,t),n),a_=(e,t)=>n=>r_([...n_(e,t).map((e,t)=>e*t).slice(1),0],n),o_=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]]},s_=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=o_(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},c_=(e,t,n,r)=>{var i=i_(e,n),a=i_(t,r),o=a_(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},l_=function(){return c_(...s_(...arguments))},u_=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}},d_=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return l_(e);case`spring`:return u_();default:if(e.split(`(`)[0]===`cubic-bezier`)return l_(e)}return typeof e==`function`?e:null},f_=(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?.()});f_.Provider;function p_(e){var t=(0,v.useContext)(f_);return(0,v.useMemo)(()=>e??t,[e,t])}function m_(e,t,n){return(t=h_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h_(e){var t=g_(e,`string`);return typeof t==`symbol`?t:t+``}function g_(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 __=`init`,v_=`pending`,y_=`active`,b_=`completed`;function x_(e){return Math.max(0,e)}var S_=class{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;m_(this,`state`,__),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=x_(e.animationDuration),this.animationBegin=x_(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()===__)return this.state=v_,this.beginStartedTime=e,this.animationBegin;if(this.getState()===v_){if(this.beginStartedTime==null)throw Error();var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=y_,this.animationStartedTime=e,this.nextAnimationUpdate(0)):x_(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=b_}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}},C_=class extends S_{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(us(this.getFrom(),this.getTo(),this.getProgress()))}},w_=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 T_(e,t){return A_(e)||k_(e,t)||D_(e,t)||E_()}function E_(){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 D_(e,t){if(e){if(typeof e==`string`)return O_(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)?O_(e,t):void 0}}function O_(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 k_(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 A_(e){if(Array.isArray(e))return e}var j_={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},M_=0,N_=1;function P_(e){var t=Bs(e,j_),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=pg(),f=r===`auto`?!og.isSsr&&!d:r,p=p_(t.animationController),m=T_((0,v.useState)(f?M_:N_),2),h=m[0],g=m[1];return(0,v.useEffect)(()=>{f||g(N_)},[f]),(0,v.useEffect)(()=>{var e=d_(o);return!f||!i||e==null?hs:p(new w_,new C_({animationId:n,easing:e,animationDuration:a,animationBegin:s,onAnimationStart:l,onAnimationEnd:c,from:M_,to:N_}),g)},[p,n,f,i,a,o,s,l,c]),u(Number(h))}function F_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,v.useRef)(ss(t)),r=(0,v.useRef)(e);return r.current!==e&&(n.current=ss(t),r.current=e),n.current}var I_=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),L_=(e,t,n)=>e.map(e=>`${I_(e)} ${t}ms ${n}`).join(`,`),R_=[`radius`],z_=[`radius`],B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_;function X_(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 Z_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X_(Object(n),!0).forEach(function(t){Q_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q_(e,t,n){return(t=$_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $_(e){var t=ev(e,`string`);return typeof t==`symbol`?t:t+``}function ev(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 tv(){return tv=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},tv.apply(null,arguments)}function nv(e,t){if(e==null)return{};var n,r,i=rv(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 rv(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 iv(e,t){return lv(e)||cv(e,t)||ov(e,t)||av()}function av(){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 ov(e,t){if(e){if(typeof e==`string`)return sv(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)?sv(e,t):void 0}}function sv(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 cv(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 lv(e){if(Array.isArray(e))return e}function uv(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var dv=(e,t,n,r,i)=>{var a=es(n),o=es(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=ts(B_||=uv([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=ts(V_||=uv([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=ts(H_||=uv([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=ts(U_||=uv([`A `,`,`,`,0,0,`,`,
254
+ `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=ts(W_||=uv([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=ts(G_||=uv([`A `,`,`,`,0,0,`,`,
255
+ `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=ts(K_||=uv([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=ts(q_||=uv([`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=ts(J_||=uv(`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=ts(Y_||=uv([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},fv={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},pv=e=>{var t=Bs(e,fv),n=(0,v.useRef)(null),r=iv((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=F_((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=ea(`recharts-rectangle`,d);if(!g){var w=ca(t);w.radius;var T=nv(w,R_);return v.createElement(`path`,tv({},T,{x:es(o),y:es(s),width:es(c),height:es(l),radius:typeof u==`number`?u:void 0,className:C,d:dv(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=L_([`strokeDasharray`],p,typeof f==`string`?f:fv.animationEasing);return v.createElement(P_,{animationId:S,key:S,canBegin:i>0,duration:p,easing:f,isActive:g,begin:m},e=>{var r=us(E,c,e),i=us(D,l,e),a=us(O,o,e),d=us(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=ca(t);p.radius;var m=nv(p,z_);return v.createElement(`path`,tv({},m,{radius:typeof u==`number`?u:void 0,className:C,d:dv(a,d,r,i,u),ref:n,style:Z_(Z_({},f),t.style)}))})};function mv(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 hv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mv(Object(n),!0).forEach(function(t){gv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gv(e,t,n){return(t=_v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _v(e){var t=vv(e,`string`);return typeof t==`symbol`?t:t+``}function vv(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,bv=e=>e*180/Math.PI,xv=(e,t,n,r)=>({x:e+Math.cos(-yv*r)*n,y:t+Math.sin(-yv*r)*n}),Sv=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},Cv=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},wv=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,o=Cv({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:bv(c),angleInRadian:c}},Tv=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}},Ev=(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},Dv=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=wv({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=Tv(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?hv(hv({},t),{},{radius:a,angle:Ev(f,t)}):null};function Ov(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[xv(t,n,r,i),xv(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var kv,Av,jv,Mv,Nv,Pv,Fv;function Iv(){return Iv=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},Iv.apply(null,arguments)}function Lv(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rv=(e,t)=>ns(t-e)*Math.min(Math.abs(t-e),359.999),zv=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=xv(t,n,l,d),p=xv(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:xv(t,n,l*Math.cos(u*yv),m),theta:u}},Bv=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=Rv(a,o),c=a+s,l=xv(t,n,i,a),u=xv(t,n,i,c),d=ts(kv||=Lv([`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=xv(t,n,r,a),p=xv(t,n,r,c);d+=ts(Av||=Lv([`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+=ts(jv||=Lv([`L `,`,`,` Z`]),t,n);return d},Vv=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=zv({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=zv({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?ts(Mv||=Lv([`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):Bv({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=ts(Nv||=Lv([`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=zv({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=zv({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+=ts(Pv||=Lv([`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+=ts(Fv||=Lv([`L`,`,`,`Z`]),t,n);return b},Hv={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Uv=e=>{var t=Bs(e,Hv),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=ea(`recharts-sector`,d),p=a-i,m=cs(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?Vv({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):Bv({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return v.createElement(`path`,Iv({},ca(t),{className:f,d:h}))};function Wv(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(js(t)){if(e===`centric`){var r=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,s=t.angle,c=xv(r,i,a,s),l=xv(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return Ov(t)}}function Gv(e){return Pl(e)?NaN:Number(e)}function Kv(e){return e?(e=Gv(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function qv(e,t,n){n&&typeof n!=`number`&&jl(e,t,n)&&(t=n=void 0),e=Kv(e),t===void 0?(t=e,e=0):t=Kv(t),n=n===void 0?e<t?1:-1:Kv(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 Jv=e=>e.chartData,Yv=J([Jv],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Xv=(e,t,n,r)=>r?Yv(e):Jv(e),Zv=(e,t,n)=>n?Yv(e):Jv(e),Qv=J([Xv],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});J([Yv],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});var $v=J([Jv],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});function ey(e,t){return ay(e)||iy(e,t)||ny(e,t)||ty()}function ty(){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 ny(e,t){if(e){if(typeof e==`string`)return ry(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)?ry(e,t):void 0}}function ry(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 iy(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 ay(e){if(Array.isArray(e))return e}function oy(e){if(Array.isArray(e)&&e.length===2){var t=ey(e,2),n=t[0],r=t[1];if($(n)&&$(r))return!0}return!1}function sy(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function cy(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var n=ey(e,2),r=n[0],i=n[1],a,o;if($(r))a=r;else if(typeof r==`function`)return;if($(i))o=i;else if(typeof i==`function`)return;var s=[a,o];if(oy(s))return s}}function ly(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(oy(r))return sy(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=ey(e,2),a=i[0],o=i[1],s,c;if(a===`auto`)t!=null&&(s=Math.min(...t));else if(K(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[0]))}catch{}else if(typeof a==`string`&&gp.test(a)){var l=gp.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(K(o))c=o;else if(typeof o==`function`)try{t!=null&&(c=o(t?.[1]))}catch{}else if(typeof o==`string`&&_p.test(o)){var d=_p.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(oy(p))return t==null?p:sy(p,t,n)}}}var uy=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 dy(e){return e===0?1:Math.floor(new uy.default(e).abs().log(10).toNumber())+1}function fy(e,t,n){for(var r=new uy.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function py(e,t){return vy(e)||_y(e,t)||hy(e,t)||my()}function my(){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 hy(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 _y(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 vy(e){if(Array.isArray(e))return e}var yy=e=>{var t=py(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},by=(e,t,n)=>{if(e.lte(0))return new uy.default(0);var r=dy(e.toNumber()),i=new uy.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new uy.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new uy.default(s.toNumber()):new uy.default(Math.ceil(s.toNumber()))},xy=(e,t,n)=>{if(e.lte(0))return new uy.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new uy.default(i).abs().log(10).toNumber()),o=new uy.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 uy.default(10).pow(l))}var u=new uy.default(r[c]??1).mul(o);return t?u:new uy.default(Math.ceil(u.toNumber()))},Sy=(e,t,n)=>{var r=new uy.default(1),i=new uy.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new uy.default(10).pow(dy(e)-1),i=new uy.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new uy.default(Math.floor(e)))}else e===0?i=new uy.default(Math.floor((t-1)/2)):n||(i=new uy.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new uy.default(c-o).mul(r)).toNumber());return s},Cy=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]:by;if(!Number.isFinite((t-e)/(n-1)))return{step:new uy.default(0),tickMin:new uy.default(0),tickMax:new uy.default(0)};var o=a(new uy.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new uy.default(0):(s=new uy.default(e).add(t).div(2),s=s.sub(new uy.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new uy.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?Cy(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 uy.default(c).mul(o)),tickMax:s.add(new uy.default(l).mul(o))})},wy=function(e){var t=py(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=py(yy([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 Sy(l,i,a);var f=Cy(l,u,s,a,0,o===`snap125`?xy:by),p=f.step,m=f.tickMin,h=f.tickMax,g=fy(m,h.add(new uy.default(.1).mul(p)),p);return n>r?g.reverse():g},Ty=function(e,t){var n=py(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=py(yy([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:by,d=Math.max(t,2),f=u(new uy.default(l).sub(c).div(d-1),a,0),p=[...fy(new uy.default(c),new uy.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},Ey=e=>e.rootProps.barCategoryGap,Dy=e=>e.rootProps.stackOffset,Oy=e=>e.rootProps.reverseStackOrder,ky=e=>e.options.chartName,Ay=e=>e.rootProps.syncId,jy=e=>e.rootProps.syncMethod,My=e=>e.options.eventEmitter,Ny=e=>e.rootProps.baseValue,Py={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Fy={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:Py.axis},Iy={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:Py.axis},Ly=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ry(e,t,n){if(n!==`auto`)return n;if(e!=null)return op(e,t)?`category`:`number`}function zy(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 By(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zy(Object(n),!0).forEach(function(t){Vy(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vy(e,t,n){return(t=Hy(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hy(e){var t=Uy(e,`string`);return typeof t==`symbol`?t:t+``}function Uy(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 Wy={allowDataOverflow:Fy.allowDataOverflow,allowDecimals:Fy.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Fy.angleAxisId,includeHidden:!1,name:void 0,reversed:Fy.reversed,scale:Fy.scale,tick:Fy.tick,tickCount:void 0,ticks:void 0,type:Fy.type,unit:void 0,niceTicks:`auto`},Gy={allowDataOverflow:Iy.allowDataOverflow,allowDecimals:Iy.allowDecimals,allowDuplicatedCategory:Iy.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Iy.radiusAxisId,includeHidden:Iy.includeHidden,name:void 0,reversed:Iy.reversed,scale:Iy.scale,tick:Iy.tick,tickCount:Iy.tickCount,ticks:void 0,type:Iy.type,unit:void 0,niceTicks:`auto`},Ky=J([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Lm],(e,t)=>{if(e!=null)return e;var n=Ry(t,`angleAxis`,Wy.type)??`category`;return By(By({},Wy),{},{type:n})}),qy=J([(e,t)=>e.polarAxis.radiusAxis[t],Lm],(e,t)=>{if(e!=null)return e;var n=Ry(t,`radiusAxis`,Gy.type)??`category`;return By(By({},Gy),{},{type:n})}),Jy=e=>e.polarOptions,Yy=J([Cp,wp,Bp],Sv),Xy=J([Jy,Yy],(e,t)=>{if(e!=null)return cs(e.innerRadius,t,0)}),Zy=J([Jy,Yy],(e,t)=>{if(e!=null)return cs(e.outerRadius,t,t*.8)}),Qy=J([Jy],e=>e==null?[0,0]:[e.startAngle,e.endAngle]);J([Ky,Qy],Ly);var $y=J([Yy,Xy,Zy],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});J([qy,$y],Ly);var eb=J([Pm,Jy,Xy,Zy,Cp,wp],(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:cs(o,i,i/2),cy:cs(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),tb=(e,t)=>t,nb=(e,t,n)=>n;function rb(e){return e?.id}function ib(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=rb(e);t.forEach((t,r)=>{var i=o==null||a?r:String(ip(t,o,null)),c=ip(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 ab(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var ob=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function sb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function cb(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 lb=e=>{var t=Pm(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},ub=e=>e.tooltip.settings.axisId;function db(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 fb=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!oy(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];$(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 pb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mb(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hb(e){let t,n,r;e.length===2?(t=e===pb||e===mb?e:gb,n=e,r=e):(t=pb,n=(t,n)=>pb(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 _b(e){return e===null?NaN:+e}function*vb(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 yb=hb(pb),bb=yb.right;yb.left,hb(_b).center;var xb=class extends Map{constructor(e,t=Tb){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(Sb(this,e))}has(e){return super.has(Sb(this,e))}set(e,t){return super.set(Cb(this,e),t)}delete(e){return super.delete(wb(this,e))}};function Sb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function Cb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function wb({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Tb(e){return typeof e==`object`&&e?e.valueOf():e}function Eb(e=pb){if(e===pb)return Db;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 Db(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var Ob=Math.sqrt(50),kb=Math.sqrt(10),Ab=Math.sqrt(2);function jb(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Ob?10:a>=kb?5:a>=Ab?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?jb(e,t,n*2):[s,c,l]}function Mb(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?jb(t,e,n):jb(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 Nb(e,t,n){return t=+t,e=+e,n=+n,jb(e,t,n)[2]}function Pb(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Nb(t,e,n):Nb(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Fb(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 Ib(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 Lb(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?Db:Eb(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));Lb(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Rb(e,n,t),i(e[r],a)>0&&Rb(e,n,r);o<s;){for(Rb(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?Rb(e,n,s):(++s,Rb(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Rb(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function zb(e,t,n){if(e=Float64Array.from(vb(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Ib(e);if(t>=1)return Fb(e);var r,i=(r-1)*t,a=Math.floor(i),o=Fb(Lb(e,a).subarray(0,a+1));return o+(Ib(e.subarray(a+1))-o)*(i-a)}}function Bb(e,t,n=_b){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 Vb(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}function Hb(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ub(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 Wb=Symbol(`implicit`);function Gb(){var e=new xb,t=[],n=[],r=Wb;function i(i){let a=e.get(i);if(a===void 0){if(r!==Wb)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 xb;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 Gb(t,n).unknown(r)},Hb.apply(i,arguments),i}function Kb(){var e=Gb().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=Vb(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 Kb(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},Hb.apply(d(),arguments)}function qb(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return qb(t())},e}function Jb(){return qb(Kb.apply(null,arguments).paddingInner(1))}function Yb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zb(){}var Qb=.7,$b=1/Qb,ex=`\\s*([+-]?\\d+)\\s*`,tx=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,nx=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,rx=/^#([0-9a-f]{3,8})$/,ix=RegExp(`^rgb\\(${ex},${ex},${ex}\\)$`),ax=RegExp(`^rgb\\(${nx},${nx},${nx}\\)$`),ox=RegExp(`^rgba\\(${ex},${ex},${ex},${tx}\\)$`),sx=RegExp(`^rgba\\(${nx},${nx},${nx},${tx}\\)$`),cx=RegExp(`^hsl\\(${tx},${nx},${nx}\\)$`),lx=RegExp(`^hsla\\(${tx},${nx},${nx},${tx}\\)$`),ux={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};Yb(Zb,hx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dx,formatHex:dx,formatHex8:fx,formatHsl:px,formatRgb:mx,toString:mx});function dx(){return this.rgb().formatHex()}function fx(){return this.rgb().formatHex8()}function px(){return Ox(this).formatHsl()}function mx(){return this.rgb().formatRgb()}function hx(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=rx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gx(t):n===3?new bx(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_x(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_x(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=ix.exec(e))?new bx(t[1],t[2],t[3],1):(t=ax.exec(e))?new bx(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ox.exec(e))?_x(t[1],t[2],t[3],t[4]):(t=sx.exec(e))?_x(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cx.exec(e))?Dx(t[1],t[2]/100,t[3]/100,1):(t=lx.exec(e))?Dx(t[1],t[2]/100,t[3]/100,t[4]):ux.hasOwnProperty(e)?gx(ux[e]):e===`transparent`?new bx(NaN,NaN,NaN,0):null}function gx(e){return new bx(e>>16&255,e>>8&255,e&255,1)}function _x(e,t,n,r){return r<=0&&(e=t=n=NaN),new bx(e,t,n,r)}function vx(e){return e instanceof Zb||(e=hx(e)),e?(e=e.rgb(),new bx(e.r,e.g,e.b,e.opacity)):new bx}function yx(e,t,n,r){return arguments.length===1?vx(e):new bx(e,t,n,r??1)}function bx(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Yb(bx,yx,Xb(Zb,{brighter(e){return e=e==null?$b:$b**+e,new bx(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qb:Qb**+e,new bx(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bx(Tx(this.r),Tx(this.g),Tx(this.b),wx(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:Sx,formatRgb:Cx,toString:Cx}));function xx(){return`#${Ex(this.r)}${Ex(this.g)}${Ex(this.b)}`}function Sx(){return`#${Ex(this.r)}${Ex(this.g)}${Ex(this.b)}${Ex((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cx(){let e=wx(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Tx(this.r)}, ${Tx(this.g)}, ${Tx(this.b)}${e===1?`)`:`, ${e})`}`}function wx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tx(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ex(e){return e=Tx(e),(e<16?`0`:``)+e.toString(16)}function Dx(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ax(e,t,n,r)}function Ox(e){if(e instanceof Ax)return new Ax(e.h,e.s,e.l,e.opacity);if(e instanceof Zb||(e=hx(e)),!e)return new Ax;if(e instanceof Ax)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 Ax(o,s,c,e.opacity)}function kx(e,t,n,r){return arguments.length===1?Ox(e):new Ax(e,t,n,r??1)}function Ax(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Yb(Ax,kx,Xb(Zb,{brighter(e){return e=e==null?$b:$b**+e,new Ax(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qb:Qb**+e,new Ax(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 bx(Nx(e>=240?e-240:e+120,i,r),Nx(e,i,r),Nx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ax(jx(this.h),Mx(this.s),Mx(this.l),wx(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=wx(this.opacity);return`${e===1?`hsl(`:`hsla(`}${jx(this.h)}, ${Mx(this.s)*100}%, ${Mx(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function jx(e){return e=(e||0)%360,e<0?e+360:e}function Mx(e){return Math.max(0,Math.min(1,e||0))}function Nx(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 Px=e=>()=>e;function Fx(e,t){return function(n){return e+n*t}}function Ix(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Lx(e){return(e=+e)==1?Rx:function(t,n){return n-t?Ix(t,n,e):Px(isNaN(t)?n:t)}}function Rx(e,t){var n=t-e;return n?Fx(e,n):Px(isNaN(e)?t:e)}var zx=(function e(t){var n=Lx(t);function r(e,t){var r=n((e=yx(e)).r,(t=yx(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Rx(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 Bx(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 Vx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hx(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]=Zx(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 Ux(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wx(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gx(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]=Zx(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Kx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qx=new RegExp(Kx.source,`g`);function Jx(e){return function(){return e}}function Yx(e){return function(t){return e(t)+``}}function Xx(e,t){var n=Kx.lastIndex=qx.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Kx.exec(e))&&(i=qx.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:Wx(r,i)})),n=qx.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Yx(c[0].x):Jx(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 Zx(e,t){var n=typeof t,r;return t==null||n===`boolean`?Px(t):(n===`number`?Wx:n===`string`?(r=hx(t))?(t=r,zx):Xx:t instanceof hx?zx:t instanceof Date?Ux:Vx(t)?Bx:Array.isArray(t)?Hx:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Gx:Wx)(e,t)}function Qx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function $x(e,t){t===void 0&&(t=e,e=Zx);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 eS(e){return function(){return e}}function tS(e){return+e}var nS=[0,1];function rS(e){return e}function iS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:eS(isNaN(t)?NaN:.5)}function aS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function oS(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=iS(i,r),a=n(o,a)):(r=iS(r,i),a=n(a,o)),function(e){return a(r(e))}}function sS(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]=iS(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=bb(e,t,1,r)-1;return a[n](i[n](t))}}function cS(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lS(){var e=nS,t=nS,n=Zx,r,i,a,o=rS,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==rS&&(o=aS(e[0],e[n-1])),s=n>2?sS:oS,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),Wx))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,tS),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=Qx,u()},d.clamp=function(e){return arguments.length?(o=e?!0:rS,u()):o!==rS},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 uS(){return lS()(rS,rS)}function dS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function fS(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 pS(e){return e=fS(Math.abs(e)),e?e[1]:NaN}function mS(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 hS(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var gS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _S(e){if(!(t=gS.exec(e)))throw Error(`invalid format: `+e);var t;return new vS({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]})}_S.prototype=vS.prototype;function vS(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+``}vS.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 yS(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 bS;function xS(e,t){var n=fS(e,t);if(!n)return bS=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(bS=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`)+fS(e,Math.max(0,t+a-1))[0]}function SS(e,t){var n=fS(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 CS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:dS,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)=>SS(e*100,t),r:SS,s:xS,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function wS(e){return e}var TS=Array.prototype.map,ES=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function DS(e){var t=e.grouping===void 0||e.thousands===void 0?wS:mS(TS.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?wS:hS(TS.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=_S(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`):CS[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=CS[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=yS(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&bS!==void 0?ES[8+bS/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(pS(t)/3)))*3,r=10**-n,i=l((e=_S(e),e.type=`f`,e),{suffix:ES[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var OS,kS,AS;jS({thousands:`,`,grouping:[3],currency:[`$`,``]});function jS(e){return OS=DS(e),kS=OS.format,AS=OS.formatPrefix,OS}function MS(e){return Math.max(0,-pS(Math.abs(e)))}function NS(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pS(t)/3)))*3-pS(Math.abs(e)))}function PS(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pS(t)-pS(e))+1}function FS(e,t,n,r){var i=Pb(e,t,n),a;switch(r=_S(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=NS(i,o))&&(r.precision=a),AS(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=PS(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=MS(i))&&(r.precision=a-(r.type===`%`)*2);break}return kS(r)}function IS(e){var t=e.domain;return e.ticks=function(e){var n=t();return Mb(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return FS(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=Nb(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 LS(){var e=uS();return e.copy=function(){return cS(e,LS())},Hb.apply(e,arguments),IS(e)}function RS(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,tS),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return RS(e).unknown(t)},e=arguments.length?Array.from(e,tS):[0,1],IS(n)}function zS(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 BS(e){return Math.log(e)}function VS(e){return Math.exp(e)}function HS(e){return-Math.log(-e)}function US(e){return-Math.exp(-e)}function WS(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function GS(e){return e===10?WS:e===Math.E?Math.exp:t=>e**+t}function KS(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 qS(e){return(t,n)=>-e(-t,n)}function JS(e){let t=e(BS,VS),n=t.domain,r=10,i,a;function o(){return i=KS(r),a=GS(r),n()[0]<0?(i=qS(i),a=qS(a),e(HS,US)):e(BS,VS),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=Mb(o,s,p))}else m=Mb(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=_S(n)).precision==null&&(n.trim=!0),n=kS(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(zS(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function YS(){let e=JS(lS()).domain([1,10]);return e.copy=()=>cS(e,YS()).base(e.base()),Hb.apply(e,arguments),e}function XS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ZS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function QS(e){var t=1,n=e(XS(t),ZS(t));return n.constant=function(n){return arguments.length?e(XS(t=+n),ZS(t)):t},IS(n)}function $S(){var e=QS(lS());return e.copy=function(){return cS(e,$S()).constant(e.constant())},Hb.apply(e,arguments)}function eC(e){return function(t){return t<0?-((-t)**+e):t**+e}}function tC(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function nC(e){return e<0?-e*e:e*e}function rC(e){var t=e(rS,rS),n=1;function r(){return n===1?e(rS,rS):n===.5?e(tC,nC):e(eC(n),eC(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},IS(t)}function iC(){var e=rC(lS());return e.copy=function(){return cS(e,iC()).exponent(e.exponent())},Hb.apply(e,arguments),e}function aC(){return iC.apply(null,arguments).exponent(.5)}function oC(e){return Math.sign(e)*e*e}function sC(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cC(){var e=uS(),t=[0,1],n=!1,r;function i(t){var i=sC(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(oC(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,tS)).map(oC)),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 cC(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Hb.apply(i,arguments),IS(i)}function lC(){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]=Bb(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[bb(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(pb),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 lC().domain(e).range(t).unknown(r)},Hb.apply(a,arguments)}function uC(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[bb(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 uC().domain([e,t]).range(i).unknown(a)},Hb.apply(IS(o),arguments)}function dC(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[bb(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 dC().domain(e).range(t).unknown(n)},Hb.apply(i,arguments)}var fC=new Date,pC=new Date;function mC(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=>mC(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)=>(fC.setTime(+t),pC.setTime(+r),e(fC),e(pC),Math.floor(n(fC,pC))),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 hC=mC(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);hC.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?mC(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):hC),hC.range;var gC=1e3,_C=gC*60,vC=_C*60,yC=vC*24,bC=yC*7,xC=yC*30,SC=yC*365,CC=mC(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*gC)},(e,t)=>(t-e)/gC,e=>e.getUTCSeconds());CC.range;var wC=mC(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*gC)},(e,t)=>{e.setTime(+e+t*_C)},(e,t)=>(t-e)/_C,e=>e.getMinutes());wC.range;var TC=mC(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*_C)},(e,t)=>(t-e)/_C,e=>e.getUTCMinutes());TC.range;var EC=mC(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*gC-e.getMinutes()*_C)},(e,t)=>{e.setTime(+e+t*vC)},(e,t)=>(t-e)/vC,e=>e.getHours());EC.range;var DC=mC(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vC)},(e,t)=>(t-e)/vC,e=>e.getUTCHours());DC.range;var OC=mC(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_C)/yC,e=>e.getDate()-1);OC.range;var kC=mC(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yC,e=>e.getUTCDate()-1);kC.range;var AC=mC(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yC,e=>Math.floor(e/yC));AC.range;function jC(e){return mC(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())*_C)/bC)}var MC=jC(0),NC=jC(1),PC=jC(2),FC=jC(3),IC=jC(4),LC=jC(5),RC=jC(6);MC.range,NC.range,PC.range,FC.range,IC.range,LC.range,RC.range;function zC(e){return mC(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)/bC)}var BC=zC(0),VC=zC(1),HC=zC(2),UC=zC(3),WC=zC(4),GC=zC(5),KC=zC(6);BC.range,VC.range,HC.range,UC.range,WC.range,GC.range,KC.range;var qC=mC(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());qC.range;var JC=mC(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());JC.range;var YC=mC(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());YC.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mC(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)}),YC.range;var XC=mC(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());XC.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mC(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)}),XC.range;function ZC(e,t,n,r,i,a){let o=[[CC,1,gC],[CC,5,5*gC],[CC,15,15*gC],[CC,30,30*gC],[a,1,_C],[a,5,5*_C],[a,15,15*_C],[a,30,30*_C],[i,1,vC],[i,3,3*vC],[i,6,6*vC],[i,12,12*vC],[r,1,yC],[r,2,2*yC],[n,1,bC],[t,1,xC],[t,3,3*xC],[e,1,SC]];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=hb(([,,e])=>e).right(o,i);if(a===o.length)return e.every(Pb(t/SC,n/SC,r));if(a===0)return hC.every(Math.max(Pb(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[QC,$C]=ZC(XC,JC,BC,AC,DC,TC),[ew,tw]=ZC(YC,qC,MC,OC,EC,wC);function nw(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 rw(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 iw(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function aw(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=fw(i),u=pw(i),d=fw(a),f=pw(a),p=fw(o),m=pw(o),h=fw(s),g=pw(s),_=fw(c),v=pw(c),y={a:N,A:P,b:ee,B:F,c:null,d:Pw,e:Pw,f:zw,g:Xw,G:Qw,H:Fw,I:Iw,j:Lw,L:Rw,m:Bw,M:Vw,p:I,q:te,Q:xT,s:ST,S:Hw,u:Uw,U:Ww,V:Kw,w:qw,W:Jw,x:null,X:null,y:Yw,Y:Zw,Z:$w,"%":bT},b={a:ne,A:re,b:ie,B:L,c:null,d:eT,e:eT,f:aT,g:gT,G:vT,H:tT,I:nT,j:rT,L:iT,m:oT,M:sT,p:R,q:ae,Q:xT,s:ST,S:cT,u:lT,U:uT,V:fT,w:pT,W:mT,x:null,X:null,y:hT,Y:_T,Z:yT,"%":bT},x={a:E,A:D,b:O,B:k,c:A,d:ww,e:ww,f:Aw,g:bw,G:yw,H:Ew,I:Ew,j:Tw,L:kw,m:Cw,M:Dw,p:T,q:Sw,Q:Mw,s:Nw,S:Ow,u:hw,U:gw,V:_w,w:mw,W:vw,x:j,X:M,y:bw,Y:yw,Z:xw,"%":jw};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=ow[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=iw(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=rw(iw(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?VC.ceil(a):VC(a),a=kC.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=nw(iw(r.y,0,1)),o=a.getDay(),a=o>4||o===0?NC.ceil(a):NC(a),a=OC.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?rw(iw(r.y,0,1)).getUTCDay():nw(iw(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,rw(r)):nw(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 ow?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 ee(e){return c[e.getMonth()]}function F(e){return s[e.getMonth()]}function I(e){return i[+(e.getHours()>=12)]}function te(e){return 1+~~(e.getMonth()/3)}function ne(e){return o[e.getUTCDay()]}function re(e){return a[e.getUTCDay()]}function ie(e){return c[e.getUTCMonth()]}function L(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 ow={"-":``,_:` `,0:`0`},sw=/^\s*\d+/,cw=/^%/,lw=/[\\^$*+?|[\]().{}]/g;function uw(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 dw(e){return e.replace(lw,`\\$&`)}function fw(e){return RegExp(`^(?:`+e.map(dw).join(`|`)+`)`,`i`)}function pw(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function mw(e,t,n){var r=sw.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function hw(e,t,n){var r=sw.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gw(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _w(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function vw(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yw(e,t,n){var r=sw.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function bw(e,t,n){var r=sw.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 Sw(e,t,n){var r=sw.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Cw(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ww(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Tw(e,t,n){var r=sw.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ew(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Dw(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ow(e,t,n){var r=sw.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function kw(e,t,n){var r=sw.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Aw(e,t,n){var r=sw.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function jw(e,t,n){var r=cw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Mw(e,t,n){var r=sw.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Nw(e,t,n){var r=sw.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Pw(e,t){return uw(e.getDate(),t,2)}function Fw(e,t){return uw(e.getHours(),t,2)}function Iw(e,t){return uw(e.getHours()%12||12,t,2)}function Lw(e,t){return uw(1+OC.count(YC(e),e),t,3)}function Rw(e,t){return uw(e.getMilliseconds(),t,3)}function zw(e,t){return Rw(e,t)+`000`}function Bw(e,t){return uw(e.getMonth()+1,t,2)}function Vw(e,t){return uw(e.getMinutes(),t,2)}function Hw(e,t){return uw(e.getSeconds(),t,2)}function Uw(e){var t=e.getDay();return t===0?7:t}function Ww(e,t){return uw(MC.count(YC(e)-1,e),t,2)}function Gw(e){var t=e.getDay();return t>=4||t===0?IC(e):IC.ceil(e)}function Kw(e,t){return e=Gw(e),uw(IC.count(YC(e),e)+(YC(e).getDay()===4),t,2)}function qw(e){return e.getDay()}function Jw(e,t){return uw(NC.count(YC(e)-1,e),t,2)}function Yw(e,t){return uw(e.getFullYear()%100,t,2)}function Xw(e,t){return e=Gw(e),uw(e.getFullYear()%100,t,2)}function Zw(e,t){return uw(e.getFullYear()%1e4,t,4)}function Qw(e,t){var n=e.getDay();return e=n>=4||n===0?IC(e):IC.ceil(e),uw(e.getFullYear()%1e4,t,4)}function $w(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+uw(t/60|0,`0`,2)+uw(t%60,`0`,2)}function eT(e,t){return uw(e.getUTCDate(),t,2)}function tT(e,t){return uw(e.getUTCHours(),t,2)}function nT(e,t){return uw(e.getUTCHours()%12||12,t,2)}function rT(e,t){return uw(1+kC.count(XC(e),e),t,3)}function iT(e,t){return uw(e.getUTCMilliseconds(),t,3)}function aT(e,t){return iT(e,t)+`000`}function oT(e,t){return uw(e.getUTCMonth()+1,t,2)}function sT(e,t){return uw(e.getUTCMinutes(),t,2)}function cT(e,t){return uw(e.getUTCSeconds(),t,2)}function lT(e){var t=e.getUTCDay();return t===0?7:t}function uT(e,t){return uw(BC.count(XC(e)-1,e),t,2)}function dT(e){var t=e.getUTCDay();return t>=4||t===0?WC(e):WC.ceil(e)}function fT(e,t){return e=dT(e),uw(WC.count(XC(e),e)+(XC(e).getUTCDay()===4),t,2)}function pT(e){return e.getUTCDay()}function mT(e,t){return uw(VC.count(XC(e)-1,e),t,2)}function hT(e,t){return uw(e.getUTCFullYear()%100,t,2)}function gT(e,t){return e=dT(e),uw(e.getUTCFullYear()%100,t,2)}function _T(e,t){return uw(e.getUTCFullYear()%1e4,t,4)}function vT(e,t){var n=e.getUTCDay();return e=n>=4||n===0?WC(e):WC.ceil(e),uw(e.getUTCFullYear()%1e4,t,4)}function yT(){return`+0000`}function bT(){return`%`}function xT(e){return+e}function ST(e){return Math.floor(e/1e3)}var CT,wT,TT;ET({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 ET(e){return CT=aw(e),wT=CT.format,CT.parse,TT=CT.utcFormat,CT.utcParse,CT}function DT(e){return new Date(e)}function OT(e){return e instanceof Date?+e:+new Date(+e)}function kT(e,t,n,r,i,a,o,s,c,l){var u=uS(),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,OT)):f().map(DT)},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(zS(n,e)):u},u.copy=function(){return cS(u,kT(e,t,n,r,i,a,o,s,c,l))},u}function AT(){return Hb.apply(kT(ew,tw,YC,qC,MC,OC,EC,wC,CC,wT).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jT(){return Hb.apply(kT(QC,$C,XC,JC,BC,kC,DC,TC,CC,TT).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function MT(){var e=0,t=1,n,r,i,a,o=rS,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(Zx),l.rangeRound=u(Qx),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 NT(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function PT(){var e=IS(MT()(rS));return e.copy=function(){return NT(e,PT())},Ub.apply(e,arguments)}function FT(){var e=JS(MT()).domain([1,10]);return e.copy=function(){return NT(e,FT()).base(e.base())},Ub.apply(e,arguments)}function IT(){var e=QS(MT());return e.copy=function(){return NT(e,IT()).constant(e.constant())},Ub.apply(e,arguments)}function LT(){var e=rC(MT());return e.copy=function(){return NT(e,LT()).exponent(e.exponent())},Ub.apply(e,arguments)}function RT(){return LT.apply(null,arguments).exponent(.5)}function zT(){var e=[],t=rS;function n(n){if(n!=null&&!isNaN(n=+n))return t((bb(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(pb),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)=>zb(e,r/t))},n.copy=function(){return zT(t).domain(e)},Ub.apply(n,arguments)}function BT(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=rS,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=$x(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(Zx),p.rangeRound=m(Qx),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 VT(){var e=IS(BT()(rS));return e.copy=function(){return NT(e,VT())},Ub.apply(e,arguments)}function HT(){var e=JS(BT()).domain([.1,1,10]);return e.copy=function(){return NT(e,HT()).base(e.base())},Ub.apply(e,arguments)}function UT(){var e=QS(BT());return e.copy=function(){return NT(e,UT()).constant(e.constant())},Ub.apply(e,arguments)}function WT(){var e=rC(BT());return e.copy=function(){return NT(e,WT()).exponent(e.exponent())},Ub.apply(e,arguments)}function GT(){return WT.apply(null,arguments).exponent(.5)}var KT=s({scaleBand:()=>Kb,scaleDiverging:()=>VT,scaleDivergingLog:()=>HT,scaleDivergingPow:()=>WT,scaleDivergingSqrt:()=>GT,scaleDivergingSymlog:()=>UT,scaleIdentity:()=>RS,scaleImplicit:()=>Wb,scaleLinear:()=>LS,scaleLog:()=>YS,scaleOrdinal:()=>Gb,scalePoint:()=>Jb,scalePow:()=>iC,scaleQuantile:()=>lC,scaleQuantize:()=>uC,scaleRadial:()=>cC,scaleSequential:()=>PT,scaleSequentialLog:()=>FT,scaleSequentialPow:()=>LT,scaleSequentialQuantile:()=>zT,scaleSequentialSqrt:()=>RT,scaleSequentialSymlog:()=>IT,scaleSqrt:()=>aC,scaleSymlog:()=>$S,scaleThreshold:()=>dC,scaleTime:()=>AT,scaleUtc:()=>jT,tickFormat:()=>FS});function qT(e){var t=KT;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${ps(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function JT(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=qT(e);if(r!=null)return r.domain(t).range(n),r}}function YT(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?JT(e.scale,n,r):JT(t,n,r)}function XT(e){return`scale${ps(e)}`}function ZT(e){return XT(e)in KT}var QT=(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 ZT(r)?r:`point`}};function $T(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 eE(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=$T(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 tE(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):eE(e,void 0)}function nE(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 rE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nE(Object(n),!0).forEach(function(t){iE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iE(e,t,n){return(t=aE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aE(e){var t=oE(e,`string`);return typeof t==`symbol`?t:t+``}function oE(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 sE(e,t){return fE(e)||dE(e,t)||lE(e,t)||cE()}function cE(){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 lE(e,t){if(e){if(typeof e==`string`)return uE(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)?uE(e,t):void 0}}function uE(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 dE(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 fE(e){if(Array.isArray(e))return e}var pE=[0,`auto`],mE={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`},hE=(e,t)=>e.cartesianAxis.xAxis[t],gE=(e,t)=>hE(e,t)??mE,_E={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:pE,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},vE=(e,t)=>e.cartesianAxis.yAxis[t],yE=(e,t)=>vE(e,t)??_E,bE={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]??bE,SE=(e,t,n)=>{switch(t){case`xAxis`:return gE(e,n);case`yAxis`:return yE(e,n);case`zAxis`:return xE(e,n);case`angleAxis`:return Ky(e,n);case`radiusAxis`:return qy(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},CE=(e,t,n)=>{switch(t){case`xAxis`:return gE(e,n);case`yAxis`:return yE(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},wE=(e,t,n)=>{switch(t){case`xAxis`:return gE(e,n);case`yAxis`:return yE(e,n);case`angleAxis`:return Ky(e,n);case`radiusAxis`:return qy(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},TE=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function EE(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 DE=e=>e.graphicalItems.cartesianItems,OE=J([tb,nb],EE),kE=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),AE=J([DE,SE,OE],kE,{memoizeOptions:{resultEqualityCheck:sb}}),jE=J([AE],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(ab)),ME=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),NE=J([AE],ME),PE=e=>e.map(e=>e.data).filter(Boolean).flat(1),FE=J([AE],e=>e.some(e=>!e.data)),IE=J([AE],PE,{memoizeOptions:{resultEqualityCheck:sb}}),LE=(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)},RE=J([IE,Xv],LE),zE=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:ip(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:ip(e,t.dataKey)})),BE=(e,t,n,r,i,a)=>{var o=r.chartData,s=o===void 0?[]:o,c=r.dataStartIndex,l=r.dataEndIndex,u=zE(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...s.slice(c,l+1).map(e=>({value:ip(e,t.dataKey)})).filter(e=>e.value!=null),...u]:u},VE=J([RE,SE,AE,Xv,FE,IE],BE);function HE(e){if(as(e)||e instanceof Date){var t=Number(e);if($(t))return t}}function UE(e){if(Array.isArray(e)){var t=[HE(e[0]),HE(e[1])];return oy(t)?t:void 0}var n=HE(e);if(n!=null)return[n,n]}function WE(e){return e.map(HE).filter(ms)}function GE(e,t){var n=HE(e),r=HE(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var KE=J([VE],e=>e?.map(e=>e.value).sort(GE));function qE(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function JE(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!rs(t))r=t;else if(Array.isArray(t)){var i=WE(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:WE(n.flatMap(t=>{var n=ip(e,t.dataKey),i,a;if(Array.isArray(n)){var o=sE(n,2);i=o[0],a=o[1]}else i=a=n;if(!(!$(i)||!$(a)))return[r-i,r+a]}))}var YE=e=>wE(e,lb(e),ub(e)),XE=J([YE],e=>e?.dataKey),ZE=J([jE,Xv,YE],ib),QE=(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=sE(t,2),a=i[0],o=i[1],s=r?[...o].reverse():o;return[a,{stackedData:up(e,s.map(rb),n),graphicalItems:s}]}))},$E=J([ZE,jE,Dy,Oy],QE),eD=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!==`zAxis`)return hp(e,i,a)},tD=J([SE],e=>e.allowDataOverflow),nD=e=>{if(e==null||!(`domain`in e))return pE;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=WE(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??pE},rD=J([SE],nD),iD=J([rD,tD],cy),aD=J([$E,Jv,tb,iD],eD,{memoizeOptions:{resultEqualityCheck:ob}}),oD=e=>e.errorBars,sD=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>qE(n,e)),cD=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},lD=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=>qE(i,e));n.forEach(n=>{var r=ip(n,t.dataKey??e.dataKey),i=JE(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=UE(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=UE(ip(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]))}),$(o)&&$(s))return[o,s]},uD=J([RE,SE,NE,oD,tb,Qv],lD,{memoizeOptions:{resultEqualityCheck:ob}});function dD(e){var t=e.value;if(as(t)||t instanceof Date)return t}var fD=(e,t,n)=>{var r=e.map(dD).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&ls(r))?qv(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},pD=e=>e.referenceElements.dots,mD=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),hD=J([pD,tb,nb],mD),gD=e=>e.referenceElements.areas,_D=J([gD,tb,nb],mD),vD=e=>e.referenceElements.lines,yD=J([vD,tb,nb],mD),bD=(e,t)=>{if(e!=null){var n=WE(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},xD=J(hD,tb,bD),SD=(e,t)=>{if(e!=null){var n=WE(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)]}},CD=J([_D,tb],SD);function wD(e){if(e.x!=null)return WE([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:WE(t)}function TD(e){if(e.y!=null)return WE([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:WE(t)}var ED=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?wD(e):TD(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},DD=J(xD,J([yD,tb],ED),CD,(e,t,n)=>cD(e,n,t)),OD=(e,t,n,r,i,a,o,s,c)=>{if(n!=null)return n;var l=o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?cD(r,a,i):cD(a,i),u=ly(t,l,e.allowDataOverflow);return u==null&&e.allowDataOverflow&&l==null&&c!=null?c:u},kD=J([SE,rD,iD,aD,uD,DD,Pm,tb,J([SE],e=>{if(!(e==null||e.type!==`number`||!(`ticks`in e)||e.ticks==null)){var t=WE(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},{memoizeOptions:{resultEqualityCheck:ob}})],OD,{memoizeOptions:{resultEqualityCheck:ob}}),AD=[0,1],jD=(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=op(t,a);return l&&s==null?qv(0,n?.length??0):c===`category`?fD(r,e,l):i===`expand`&&!l?AD:o}},MD=J([SE,Pm,RE,VE,Dy,tb,kD],jD),ND=J([SE,TE,ky],QT),PD=(e,t,n)=>{var r=t.niceTicks;if(r!==`none`){var i=nD(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&oy(e)){if(a)return wy(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return Ty(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&oy(e))return wy(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&oy(e))return Ty(e,t.tickCount,t.allowDecimals,`adaptive`)}}},FD=J([MD,wE,ND],PD),ID=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&oy(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},LD=J([SE,MD,FD,tb],ID),RD=J(J(VE,SE,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(WE(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}}),Pm,Ey,Bp,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!$(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=cs(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),zD=(e,t,n)=>{var r=gE(e,t);return r==null||typeof r.padding!=`string`?0:RD(e,`xAxis`,t,n,r.padding)},BD=(e,t,n)=>{var r=yE(e,t);return r==null||typeof r.padding!=`string`?0:RD(e,`yAxis`,t,n,r.padding)},VD=J(gE,zD,(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}}),HD=J(yE,BD,(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}}),UD=J([Bp,VD,Kp,Gp,(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]}),WD=J([Bp,Pm,HD,Kp,Gp,(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]}),GD=(e,t,n,r)=>{switch(t){case`xAxis`:return UD(e,n,r);case`yAxis`:return WD(e,n,r);case`zAxis`:return xE(e,n)?.range;case`angleAxis`:return Qy(e);case`radiusAxis`:return $y(e,n);default:return}},KD=J([SE,GD],Ly),qD=J([SE,ND,J([ND,LD],fb),KD],YT),JD=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale;if(op(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},YD=J([Pm,VE,wE,tb],JD),XD=J([qD],db);J([qD],tE),J([qD,KE],eE),J([AE,oD,tb],sD);function ZD(e,t){return e.id<t.id?-1:+(e.id>t.id)}var QD=(e,t)=>t,$D=(e,t,n)=>n,eO=J(Dp,QD,$D,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(ZD)),tO=J(Op,QD,$D,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(ZD)),nO=(e,t)=>({width:e.width,height:t.height}),rO=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),iO=J(Bp,gE,nO),aO=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},oO=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},sO=J(wp,Bp,eO,QD,$D,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=nO(t,n);o??=aO(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}),cO=J(Cp,Bp,tO,QD,$D,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=rO(t,n);o??=oO(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}),lO=J([Bp,gE,(e,t)=>{var n=gE(e,t);if(n!=null)return sO(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}}}),uO=J([Bp,yE,(e,t)=>{var n=yE(e,t);if(n!=null)return cO(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}}}),dO=J(Bp,yE,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),fO=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,o=n.dataKey,s=op(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&ls(l))return c}},pO=J([Pm,VE,SE,tb],fO),mO=J([Pm,CE,ND,XD,pO,YD,GD,FD,tb],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=op(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}}}),hO=J([Pm,wE,ND,XD,FD,GD,pO,YD,tb],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=op(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 $(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(ms):l&&s?s.map((e,t)=>{var n=r.map(e);return $(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(ms):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return $(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(ms):r.domain().map((e,t)=>{var n=r.map(e);return $(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(ms)}}),gO=J([Pm,wE,XD,GD,pO,YD,tb],(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=op(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 $(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(ms):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return $(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(ms):n.domain().map((e,t)=>{var r=n.map(e);return $(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(ms)}}),_O=J(SE,XD,(e,t)=>{if(!(e==null||t==null))return rE(rE({},e),{},{scale:t})});J((e,t,n)=>xE(e,n),J([J([SE,ND,MD,KD],YT)],db),(e,t)=>{if(!(e==null||t==null))return rE(rE({},e),{},{scale:t})});var vO=J([Pm,Dp,Op],(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}});J([(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 yO=e=>e.options.defaultTooltipEventType,bO=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 SO(e,t){return xO(t,yO(e),bO(e))}function CO(e){return q(t=>SO(t,e))}var wO=(e,t)=>{var n,r=Number(t);if(!(rs(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},TO=e=>e.tooltip.settings,EO={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},DO=tf({name:`tooltip`,initialState:{itemInteraction:{click:EO,hover:EO},axisInteraction:{click:EO,hover:EO},keyboardInteraction:EO,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(kd(t.payload))},prepare:Bd()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ed(e).tooltipItemPayloads.indexOf(kd(r));a>-1&&(e.tooltipItemPayloads[a]=kd(i))},prepare:Bd()},removeTooltipEntrySettings:{reducer(e,t){var n=Ed(e).tooltipItemPayloads.indexOf(kd(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Bd()},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}}}),OO=DO.actions,kO=OO.addTooltipEntrySettings,AO=OO.replaceTooltipEntrySettings,jO=OO.removeTooltipEntrySettings,MO=OO.setTooltipSettingsState,NO=OO.setActiveMouseOverItemIndex;OO.mouseLeaveItem;var PO=OO.mouseLeaveChart;OO.setActiveClickItemIndex;var FO=OO.setMouseOverAxisIndex,IO=OO.setMouseClickAxisIndex,LO=OO.setSyncInteraction,RO=OO.setKeyboardInteraction,zO=DO.reducer;function BO(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 VO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?BO(Object(n),!0).forEach(function(t){HO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function HO(e,t,n){return(t=UO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UO(e){var t=WO(e,`string`);return typeof t==`symbol`?t:t+``}function WO(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 GO(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function KO(e){return e.index!=null}var qO=(e,t,n,r)=>{if(t==null)return EO;var i=GO(e,t,n);if(i==null)return EO;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(KO(i)){if(a)return VO(VO({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return VO(VO({},EO),{},{coordinate:i.coordinate})};function JO(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 YO(e,t){var n=JO(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function XO(e,t,n){if(n==null||t==null)return!0;var r=ip(e,t);return r==null||!oy(n)?!0:YO(r,n)}var ZO=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!$(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||XO(l,n,r)?String(c):null},QO=(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}}}},$O=(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)},ek=e=>e.options.tooltipPayloadSearcher,tk=e=>e.tooltip;function nk(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 rk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nk(Object(n),!0).forEach(function(t){ik(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ik(e,t,n){return(t=ak(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ak(e){var t=ok(e,`string`);return typeof t==`symbol`?t:t+``}function ok(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 sk(e){if(typeof e==`string`||typeof e==`number`)return e}function ck(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function lk(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function uk(e){if(typeof e==`string`)return e}function dk(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?sk(e.name):void 0,unit:`unit`in e?ck(e.unit):void 0,dataKey:`dataKey`in e?lk(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?uk(e.color):void 0,fill:`fill`in e?uk(e.fill):void 0}}function fk(e,t){return e??t}var pk=(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=fk(d,s),m=Array.isArray(p)?Zf(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?ds(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=dk(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=rk(rk({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(yp({tooltipEntrySettings:o,dataKey:i,payload:a,value:ip(a,i),name:r==null?void 0:String(r)}))}):e.push(yp({tooltipEntrySettings:f,dataKey:h,payload:_,value:ip(_,h),name:ip(_,g)??f?.name})),e},[])}},mk=J([YE,TE,ky],QT),hk=J([J([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),YE,J([lb,ub],EE)],kE,{memoizeOptions:{resultEqualityCheck:sb}}),gk=J([hk],e=>e.filter(ab)),_k=J([hk],PE,{memoizeOptions:{resultEqualityCheck:sb}}),vk=J([hk],e=>e.some(e=>!e.data)),yk=J([_k,Jv],LE),bk=J([gk,Jv,YE],ib),xk=J([yk,YE,hk,Jv,vk,_k],BE),Sk=J([YE],nD),Ck=J([Sk,J([YE],e=>e.allowDataOverflow)],cy),wk=J([J([bk,J([hk],e=>e.filter(ab)),Dy,Oy],QE),Jv,lb,Ck],eD),Tk=J([yk,YE,J([hk],ME),oD,lb,$v],lD,{memoizeOptions:{resultEqualityCheck:ob}}),Ek=J([J([pD,lb,ub],mD),lb],bD),Dk=J([J([gD,lb,ub],mD),lb],SD),Ok=J([YE,Pm,yk,xk,Dy,lb,J([YE,Sk,Ck,wk,Tk,J([Ek,J([J([vD,lb,ub],mD),lb],ED),Dk],cD),Pm,lb],OD)],jD),kk=J([YE,Ok,J([Ok,YE,mk],PD),lb],ID),Ak=e=>GD(e,lb(e),ub(e),!1),jk=J([YE,Ak],Ly),Mk=J([J([YE,mk,kk,jk],YT)],db),Nk=J([Pm,YE,mk,Mk,Ak,J([Pm,xk,YE,lb],fO),J([Pm,xk,YE,lb],JD),lb],(e,t,n,r,i,a,o,s)=>{if(t){var c=t.type,l=op(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 $(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(ms):r.domain().map((e,t)=>{var n=r.map(e);return $(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(ms)}}}),Pk=J([yO,bO,TO],(e,t,n)=>xO(n.shared,e,t)),Fk=e=>e.tooltip.settings.trigger,Ik=e=>e.tooltip.settings.defaultIndex,Lk=J([tk,Pk,Fk,Ik],qO),Rk=J([Lk,yk,XE,Ok],ZO),zk=J([Nk,Rk],wO),Bk=J([Lk],e=>{if(e)return e.dataKey}),Vk=J([Lk],e=>{if(e)return e.graphicalItemId}),Hk=J([tk,Pk,Fk,Ik],$O),Uk=J([Lk,J([Cp,wp,Pm,Bp,Nk,Ik,Hk],QO)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Wk=J([Lk],e=>e?.active??!1),Gk=J([J([Hk,Rk,Jv,XE,zk,ek,Pk],pk)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function Kk(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 qk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kk(Object(n),!0).forEach(function(t){Jk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jk(e,t,n){return(t=Yk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yk(e){var t=Xk(e,`string`);return typeof t==`symbol`?t:t+``}function Xk(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 Zk=()=>q(YE),Qk=()=>{var e=Zk(),t=q(Nk),n=q(Mk);return vp(!e||!n?void 0:qk(qk({},e),{},{scale:n}),t)};function $k(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 eA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$k(Object(n),!0).forEach(function(t){tA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tA(e,t,n){return(t=nA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nA(e){var t=rA(e,`string`);return typeof t==`symbol`?t:t+``}function rA(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 iA=(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}},aA=(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 eA(eA(eA({},r),xv(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return eA(eA(eA({},r),xv(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 oA(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 sA=(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},cA=()=>q(ky),lA=(e,t)=>t,uA=(e,t,n)=>n,dA=(e,t,n,r)=>r,fA=J(Nk,e=>X(e,e=>e.coordinate)),pA=J([tk,lA,uA,dA],qO),mA=J([pA,yk,XE,Ok],ZO),hA=(e,t,n)=>{if(t!=null){var r=tk(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=J([tk,lA,uA,dA],$O),_A=J([Cp,wp,Pm,Bp,Nk,dA,gA],QO),vA=J([pA,_A],(e,t)=>e.coordinate??t),yA=J([Nk,mA],wO),bA=J([gA,mA,Jv,XE,yA,ek,lA],pk),xA=J([pA,mA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),SA=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&oA(e,o)){var s=sA(xp(e,t),a,i,n,r),c=iA(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},CA=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=Dv(e,n);if(s){var c=sA(Sp(s,t),o,a,r,i),l=aA(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},wA=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?SA(e,t,r,i,a,o,s):CA(e,t,n,r,i,a,o)},TA=J(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}}),EA=J(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(Py));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:cb}});function DA(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 OA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?DA(Object(n),!0).forEach(function(t){kA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kA(e,t,n){return(t=AA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AA(e){var t=jA(e,`string`);return typeof t==`symbol`?t:t+``}function jA(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 MA={zIndexMap:Object.values(Py).reduce((e,t)=>OA(OA({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},NA=new Set(Object.values(Py));function PA(e){return NA.has(e)}var FA=tf({name:`zIndex`,initialState:MA,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:Bd()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!PA(n)&&delete e.zIndexMap[n])},prepare:Bd()},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=kd(i):e.zIndexMap[r].element=kd(i):e.zIndexMap[r]={consumers:0,element:a?void 0:kd(i),panoramaElement:a?kd(i):void 0}},prepare:Bd()},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:Bd()}}}),IA=FA.actions,LA=IA.registerZIndexPortal,RA=IA.unregisterZIndexPortal,zA=IA.registerZIndexPortalElement,BA=IA.unregisterZIndexPortalElement,VA=FA.reducer;function HA(e){var t=e.zIndex,n=e.children,r=Rm()&&t!==void 0&&t!==0,i=Wp(),a=(0,v.useRef)(void 0),o=(0,v.useRef)(new Set),s=pl(),c=q(e=>TA(e,t,i));if((0,v.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(RA({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(LA({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(RA({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,v.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(RA({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,ph.createPortal)(n,l):null}function UA(){return UA=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},UA.apply(null,arguments)}function WA(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 GA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WA(Object(n),!0).forEach(function(t){KA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KA(e,t,n){return(t=qA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qA(e){var t=JA(e,`string`);return typeof t==`symbol`?t:t+``}function JA(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 YA(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 XA(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=e_,h=Py.cursorLine;else if(l===`BarChart`)p=t_(o,u,i,a),m=pv,h=Py.cursorRectangle;else if(o===`radial`&&js(u)){var g=Ov(u),_=g.cx,y=g.cy,b=g.radius;p={cx:_,cy:y,startAngle:g.startAngle,endAngle:g.endAngle,innerRadius:b,outerRadius:b},m=Uv,h=Py.cursorLine}else p={points:Wv(o,u,i)},m=Ug,h=Py.cursorLine;var x=typeof s==`object`&&`className`in s?s.className:void 0,S=GA(GA(GA(GA({stroke:`#ccc`,pointerEvents:`none`},i),p),sa(s)),{},{payload:d,payloadIndex:f,className:ea(`recharts-tooltip-cursor`,x)});return v.createElement(HA,{zIndex:e.zIndex??h},v.createElement(YA,{cursor:s,cursorComp:m,cursorProps:S}))}function ZA(e){var t=Qk(),n=Am(),r=Fm(),i=cA();return t==null||n==null||r==null||i==null?null:v.createElement(XA,UA({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var QA=(0,v.createContext)(null),$A=()=>(0,v.useContext)(QA),ej=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,tj=new ej,nj=`recharts.syncEvent.tooltip`,rj=`recharts.syncEvent.brush`,ij=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!rs(n))return e[n]}},aj=tf({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),oj=aj.reducer,sj=aj.actions.createEventEmitter;function cj(e){return e.tooltip.syncInteraction}var lj=tf({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=kd(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)}}}),uj=lj.actions,dj=uj.setChartData,fj=uj.setDataStartEndIndexes;uj.setComputedData;var pj=lj.reducer,mj=[`x`,`y`];function hj(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?hj(Object(n),!0).forEach(function(t){_j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _j(e,t,n){return(t=vj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vj(e){var t=yj(e,`string`);return typeof t==`symbol`?t:t+``}function yj(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 bj(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 Sj(){var e=q(Ay),t=q(My),n=pl(),r=q(jy),i=q(Nk),a=Fm(),o=Om();(0,v.useEffect)(()=>{if(e==null)return hs;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(LO({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=bj(d,mj),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(LO({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(x==null){n(LO({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(LO({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 tj.on(nj,s),()=>{tj.off(nj,s)}},[q(e=>e.rootProps.className),n,t,e,r,i,a,o])}function Cj(){var e=q(Ay),t=q(My),n=pl();(0,v.useEffect)(()=>{if(e==null)return hs;var r=(r,i,a)=>{t!==a&&e===r&&n(fj(i))};return tj.on(rj,r),()=>{tj.off(rj,r)}},[n,t,e])}function wj(){var e=pl();(0,v.useEffect)(()=>{e(sj())},[e]),Sj(),Cj()}function Tj(e,t,n,r,i,a){var o=q(n=>hA(n,e,t)),s=q(Vk),c=q(My),l=q(Ay),u=q(jy),d=q(cj)?.sourceViewBox!=null,f=Om();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=LO({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});tj.emit(nj,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function Ej(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 Dj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ej(Object(n),!0).forEach(function(t){Oj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ej(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oj(e,t,n){return(t=kj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kj(e){var t=Aj(e,`string`);return typeof t==`symbol`?t:t+``}function Aj(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 jj(e,t){return Ij(e)||Fj(e,t)||Nj(e,t)||Mj()}function Mj(){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 Nj(e,t){if(e){if(typeof e==`string`)return Pj(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)?Pj(e,t):void 0}}function Pj(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 Fj(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 Ij(e){if(Array.isArray(e))return e}function Lj(e){return e.dataKey}function Rj(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e==`function`?v.createElement(e,t):v.createElement($h,t)}var zj=[],Bj={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 Vj(e){var t=Bs(e,Bj),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=pl(),C=typeof y==`number`?String(y):y;(0,v.useEffect)(()=>{S(MO({shared:g,trigger:_,axisId:x,active:n,defaultIndex:C}))},[S,g,_,x,n,C]);var w=Om(),T=Og(),E=CO(g),D=q(e=>xA(e,E,_,C))??{},O=D.activeIndex,k=D.isActive,A=q(e=>bA(e,E,_,C)),j=q(e=>yA(e,E,_,C)),M=q(e=>vA(e,E,_,C)),N=A,P=$A(),ee=n??k??!1,F=jj(Zl([N,ee]),2),I=F[0],te=F[1],ne=E===`axis`?j:void 0;Tj(E,_,M,ne,O,ee);var re=b??P;if(re==null||w==null||E==null)return null;var ie=N??zj;ee||(ie=zj),s&&ie.length&&(ie=al(ie.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,Lj));var L=ie.length>0,R=Dj(Dj({},t),{},{payload:ie,label:ne,active:ee,activeIndex:O,coordinate:M,accessibilityLayer:T}),ae=v.createElement(Dg,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:ee,coordinate:M,hasPayload:L,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:w,wrapperStyle:m,lastBoundingBox:I,innerRef:te,hasPortalFromProps:!!b},Rj(o,R));return v.createElement(v.Fragment,null,(0,ph.createPortal)(ae,re),ee&&v.createElement(ZA,{cursor:h,tooltipEventType:E,coordinate:M,payload:ie,index:O}))}function Hj(e,t,n){return(t=Uj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uj(e){var t=Wj(e,`string`);return typeof t==`symbol`?t:t+``}function Wj(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 Gj=class{constructor(e){Hj(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 Kj(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 qj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kj(Object(n),!0).forEach(function(t){Jj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jj(e,t,n){return(t=Yj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yj(e){var t=Xj(e,`string`);return typeof t==`symbol`?t:t+``}function Xj(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 Zj=qj({},{cacheSize:2e3,enableCache:!0}),Qj=new Gj(Zj.cacheSize),$j={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},eM=`recharts_measurement_span`;function tM(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var nM=(e,t)=>{try{var n=document.getElementById(eM);n||(n=document.createElement(`span`),n.setAttribute(`id`,eM),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,$j,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},rM=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||og.isSsr)return{width:0,height:0};if(!Zj.enableCache)return nM(e,t);var n=tM(e,t),r=Qj.get(n);if(r)return r;var i=nM(e,t);return Qj.set(n,i),i},iM;function aM(e,t){return uM(e)||lM(e,t)||sM(e,t)||oM()}function oM(){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 sM(e,t){if(e){if(typeof e==`string`)return cM(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)?cM(e,t):void 0}}function cM(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 lM(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 uM(e){if(Array.isArray(e))return e}function dM(e,t,n){return(t=fM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fM(e){var t=pM(e,`string`);return typeof t==`symbol`?t:t+``}function pM(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 mM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,hM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gM=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,_M=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,vM={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},yM=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function bM(e){return yM.includes(e)}var xM=`NaN`;function SM(e,t){return e*vM[t]}var CM=class e{static parse(t){var n=aM(_M.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,rs(e)&&(this.unit=``),t!==``&&!gM.test(t)&&(this.num=NaN,this.unit=``),bM(t)&&(this.num=SM(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 rs(this.num)}};iM=CM,dM(CM,`NaN`,new iM(NaN,``));function wM(e){if(e==null||e.includes(xM))return xM;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=aM(mM.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=CM.parse(r??``),s=CM.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return xM;t=t.replace(mM,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=aM(hM.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=CM.parse(u??``),m=CM.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return xM;t=t.replace(hM,h.toString())}return t}var TM=/\(([^()]*)\)/;function EM(e){for(var t=e,n;(n=TM.exec(t))!=null;){var r=aM(n,2)[1];t=t.replace(TM,wM(r))}return t}function DM(e){var t=e.replace(/\s+/g,``);return t=EM(t),t=wM(t),t}function OM(e){try{return DM(e)}catch{return xM}}function kM(e){var t=OM(e.slice(5,-1));return t===xM?``:t}var AM=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],jM=[`dx`,`dy`,`angle`,`className`,`breakAll`];function MM(){return MM=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},MM.apply(null,arguments)}function NM(e,t){if(e==null)return{};var n,r,i=PM(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 PM(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 FM(e,t){return BM(e)||zM(e,t)||LM(e,t)||IM()}function IM(){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 LM(e,t){if(e){if(typeof e==`string`)return RM(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)?RM(e,t):void 0}}function RM(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 zM(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 BM(e){if(Array.isArray(e))return e}var VM=/[ \f\n\r\t\v\u2028\u2029]+/,HM=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return fs(t)||(i=n?t.toString().split(``):t.toString().split(VM)),{wordsWithComputedWidth:i.map(e=>({word:e,width:rM(e,r).width})),spaceWidth:n?0:rM(`\xA0`,r).width}}catch{return null}};function UM(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function WM(e){return fs(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var GM=(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},[]),KM=e=>e.reduce((e,t)=>e.width>t.width?e:t),qM=`…`,JM=(e,t,n,r,i,a,o,s)=>{var c=HM({breakAll:n,style:r,children:e.slice(0,t)+qM});if(!c)return[!1,[]];var l=GM(c.wordsWithComputedWidth,a,o,s);return[l.length>i||KM(l).width>Number(a),l]},YM=(e,t,n,r,i)=>{var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=K(a),u=String(o),d=GM(t,r,n,i);if(!l||i||!(d.length>a||KM(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),_=FM(JM(u,g-1,c,s,a,r,n,i),2),v=_[0],y=_[1],b=FM(JM(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},XM=e=>[{words:fs(e)?[]:e.toString().split(VM),width:void 0}],ZM=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!og.isSsr){var s,c,l=HM({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return XM(r);return YM({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return XM(r)},QM=`#808080`,$M={angle:0,breakAll:!1,capHeight:`0.71em`,fill:QM,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},eN=(0,v.forwardRef)((e,t)=>{var n=Bs(e,$M),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=NM(n,AM),f=(0,v.useMemo)(()=>ZM({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=NM(d,jM);if(!as(r)||!as(i)||f.length===0)return null;var b=Number(r)+(K(p)?p:0),x=Number(i)+(K(m)?m:0);if(!$(b)||!$(x))return null;var S;switch(u){case`start`:S=kM(`calc(${o})`);break;case`middle`:S=kM(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=kM(`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(${K(E)&&K(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,MM({},ca(y),{ref:t,x:b,y:x,className:ea(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?QM: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)}))});eN.displayName=`Text`;function tN(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 nN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tN(Object(n),!0).forEach(function(t){rN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rN(e,t,n){return(t=iN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iN(e){var t=aN(e,`string`);return typeof t==`symbol`?t:t+``}function aN(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 oN=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=Dm(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`?nN({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?nN({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?nN({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?nN({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?nN({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?nN({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?nN({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?nN({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(K(n.x)||is(n.x))&&(K(n.y)||is(n.y))?nN({x:c+cs(n.x,g),y:l+cs(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):nN({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},sN=[`labelRef`],cN=[`content`];function lN(e,t){if(e==null)return{};var n,r,i=uN(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 uN(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 dN(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 fN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dN(Object(n),!0).forEach(function(t){pN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pN(e,t,n){return(t=mN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mN(e){var t=hN(e,`string`);return typeof t==`symbol`?t:t+``}function hN(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 gN(){return gN=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},gN.apply(null,arguments)}var _N=(0,v.createContext)(null),vN=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(_N.Provider,{value:c},s)},yN=()=>{var e=(0,v.useContext)(_N),t=Om();return e||(t?Dm(t):void 0)},bN=(0,v.createContext)(null),xN=()=>{var e=(0,v.useContext)(bN),t=q(eb);return e||t},SN=e=>{var t=e.value,n=e.formatter,r=fs(e.children)?t:e.children;return typeof n==`function`?n(r):r},CN=e=>e!=null&&typeof e==`function`,wN=(e,t)=>ns(t-e)*Math.min(Math.abs(t-e),360),TN=(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=wN(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=xv(s,c,m,_),x=xv(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=fs(e.id)?ss(`recharts-radial-line-`):e.id;return v.createElement(`text`,gN({},r,{dominantBaseline:`central`,className:ea(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},EN=(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=xv(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=xv(r,i,(a+o)/2,s);return{x:u.x,y:u.y,textAnchor:`middle`,verticalAnchor:`middle`}},DN=e=>e!=null&&`cx`in e&&K(e.cx),ON={angle:0,offset:5,zIndex:Py.label,position:`middle`,textBreakAll:!1};function kN(e){if(!DN(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 AN(e){var t=Bs(e,ON),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=xN(),p=yN(),m=n==null?i===`center`?p:f??p:DN(n)?n:Dm(n),h,g,_=kN(m);if(!m||fs(a)&&fs(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var y=fN(fN({},t),{},{viewBox:m});if((0,v.isValidElement)(s))return y.labelRef,(0,v.cloneElement)(s,lN(y,sN));if(typeof s==`function`){if(y.content,h=(0,v.createElement)(s,lN(y,cN)),(0,v.isValidElement)(h))return h}else h=SN(t);var b=ca(t);if(DN(m)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return TN(t,i,h,b,m);g=EN(m,t.offset,t.position)}else{if(!_)return null;var x=oN({viewBox:_,position:i,offset:t.offset,parentViewBox:DN(r)?void 0:r,clamp:!0});g=fN(fN({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(HA,{zIndex:t.zIndex},v.createElement(eN,gN({ref:d,className:ea(`recharts-label`,l)},b,g,{textAnchor:UM(b.textAnchor)?b.textAnchor:g.textAnchor,breakAll:u}),h))}AN.displayName=`Label`;var jN=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(AN,gN({key:`label-implicit`},r)):as(e)?v.createElement(AN,gN({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===AN?(0,v.cloneElement)(e,fN({key:`label-implicit`},r)):v.createElement(AN,gN({key:`label-implicit`,content:e},r)):CN(e)?v.createElement(AN,gN({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(AN,gN({},e,{key:`label-implicit`},r)):null};function MN(e){var t=e.label,n=e.labelRef;return jN(t,yN(),n)||null}var NN=[`valueAccessor`],PN=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function FN(){return FN=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},FN.apply(null,arguments)}function IN(e,t){if(e==null)return{};var n,r,i=LN(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 LN(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 RN=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(WM(t))return t},zN=(0,v.createContext)(void 0),BN=zN.Provider,VN=(0,v.createContext)(void 0);VN.Provider;function HN(){return(0,v.useContext)(zN)}function UN(){return(0,v.useContext)(VN)}function WN(e){var t=e.valueAccessor,n=t===void 0?RN:t,r=IN(e,NN),i=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,s=r.zIndex,c=IN(r,PN),l=HN(),u=UN(),d=l||u;return!d||!d.length?null:v.createElement(HA,{zIndex:s??Py.label},v.createElement(ya,{className:`recharts-label-list`},d.map((e,t)=>{var s=fs(i)?n(e,t):ip(e.payload,i),l=fs(a)?{}:{id:`${a}-${t}`};return v.createElement(AN,FN({key:`label-${t}`},ca(e),c,l,{fill:r.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:t,zIndex:0}))})))}WN.displayName=`LabelList`;function GN(e){var t=e.label;return t?t===!0?v.createElement(WN,{key:`labelList-implicit`}):v.isValidElement(t)||CN(t)?v.createElement(WN,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(WN,FN({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}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)}var qN=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=ea(`recharts-dot`,i);return K(t)&&K(n)&&K(r)?v.createElement(`circle`,KN({},oa(e),Ms(e),{className:a,cx:t,cy:n,r})):null},JN=tf({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=kd(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=kd(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),YN=JN.actions;YN.addRadiusAxis,YN.removeRadiusAxis,YN.addAngleAxis,YN.removeAngleAxis;var XN=JN.reducer;function ZN(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var QN=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0;function $N(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 eP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$N(Object(n),!0).forEach(function(t){tP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tP(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=rP(e,`string`);return typeof t==`symbol`?t:t+``}function rP(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 iP(e,t){return eP(eP({},t),e)}function aP(e){return(0,v.isValidElement)(e)?e.props:e}function oP(e,t){return(0,v.cloneElement)(e,iP(aP(e),t))}function sP(e){if(`index`in e){var t=e.index;return typeof t==`number`||typeof t==`string`?t:void 0}}function cP(e){return`isActive`in e&&e.isActive===!0}function lP(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=sP(r),l=(0,v.isValidElement)(t)?oP(t,r):t===n?v.createElement(n,r):typeof t==`function`?t(r,c):typeof t==`object`?v.createElement(n,iP(t,r)):v.createElement(n,r);return cP(r)?v.createElement(ya,{className:a},l):v.createElement(ya,{className:s},l)}function uP(e){var t=e.tooltipEntrySettings,n=pl(),r=Wp(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(kO(t)):i.current!==t&&n(AO({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(jO(i.current)),null)},[n]),null}function dP(e){var t=e.legendPayload,n=pl(),r=Wp(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(Wm(t)):i.current!==t&&n(Gm({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(Km(i.current)),null)},[n]),null}function fP(e,t){return _P(e)||gP(e,t)||mP(e,t)||pP()}function pP(){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 mP(e,t){if(e){if(typeof e==`string`)return hP(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)?hP(e,t):void 0}}function hP(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 gP(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 _P(e){if(Array.isArray(e))return e}var vP=`index`;function yP(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 bP(e,t){var n=e.length/t.length;return yP(t.map((t,r)=>e[Math.floor(r*n)]),t)}function xP(e,t){return yP(t.map((t,n)=>e[n]),t)}function SP(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 CP(e,t,n){var r=SP(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=fP(s,2),l=c[0],u=c[1];i.has(l)||o.push(u)}return yP(a,t,o)}function wP(e,t,n){return t==null?null:e==null?t.map(e=>({status:`added`,next:e})):n===`index`?bP(e,t):n===`append`?xP(e,t):CP(e,t,n)}function TP(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 EP(e,t){return jP(e)||AP(e,t)||OP(e,t)||DP()}function DP(){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 OP(e,t){if(e){if(typeof e==`string`)return kP(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)?kP(e,t):void 0}}function kP(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 AP(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 jP(e){if(Array.isArray(e))return e}function MP(e,t){var n=EP((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 NP(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=F_(t,n),_=TP(g,i),y=_.startValue??null,b=wP(y,r,f??vP);return v.createElement(P_,{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 PP(e,t){return zP(e)||RP(e,t)||IP(e,t)||FP()}function FP(){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 IP(e,t){if(e){if(typeof e==`string`)return LP(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)?LP(e,t):void 0}}function LP(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 RP(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 zP(e){if(Array.isArray(e))return e}var BP=v.useId??(()=>PP(v.useState(()=>ss(`uid-`)),1)[0]);function VP(e,t){var n=BP();return t||(e?`${e}-${n}`:n)}var HP=(0,v.createContext)(void 0),UP=e=>{var t=e.id,n=e.type,r=e.children,i=VP(`recharts-${n}`,t);return v.createElement(HP.Provider,{value:i},r(i))},WP=tf({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(kd(t.payload))},prepare:Bd()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ed(e).cartesianItems.indexOf(kd(r));a>-1&&(e.cartesianItems[a]=kd(i))},prepare:Bd()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ed(e).cartesianItems.indexOf(kd(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:Bd()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(kd(t.payload))},prepare:Bd()},removePolarGraphicalItem:{reducer(e,t){var n=Ed(e).polarItems.indexOf(kd(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:Bd()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ed(e).polarItems.indexOf(kd(r));a>-1&&(e.polarItems[a]=kd(i))},prepare:Bd()}}}),GP=WP.actions,KP=GP.addCartesianGraphicalItem,qP=GP.replaceCartesianGraphicalItem,JP=GP.removeCartesianGraphicalItem;GP.addPolarGraphicalItem,GP.removePolarGraphicalItem,GP.replacePolarGraphicalItem;var YP=WP.reducer,XP=(0,v.memo)(e=>{var t=pl(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(KP(e)):n.current!==e&&t(qP({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(JP(n.current)),null)},[t]),null}),ZP=[`points`];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 $P(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){eF(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 eF(e,t,n){return(t=tF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tF(e){var t=nF(e,`string`);return typeof t==`symbol`?t:t+``}function nF(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 rF(){return rF=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},rF.apply(null,arguments)}function iF(e,t){if(e==null)return{};var n,r,i=aF(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 aF(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 oF(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=ea(r,typeof t==`boolean`?``:t.className),a=n??{};a.points;var o=iF(a,ZP);return v.createElement(qN,rF({},o,{className:i}))}function sF(e,t){return e==null?!1:t?!0:e.length===1}function cF(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?Py.scatter:l;if(!sF(t,n))return null;var d=QN(n),f=la(n),p=t.map((e,r)=>{var s=$P($P($P({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(oF,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),m={};return s&&c!=null&&(m.clipPath=`url(#clipPath-${d?``:`dots-`}${c})`),v.createElement(HA,{zIndex:u},v.createElement(ya,rF({className:r},m),p))}function lF(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 uF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lF(Object(n),!0).forEach(function(t){dF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dF(e,t,n){return(t=fF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fF(e){var t=pF(e,`string`);return typeof t==`symbol`?t:t+``}function pF(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 mF=tf({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=kd(t.payload)},prepare:Bd()},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]=kd(i))},prepare:Bd()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Bd()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=kd(t.payload)},prepare:Bd()},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]=kd(i))},prepare:Bd()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Bd()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=kd(t.payload)},prepare:Bd()},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]=kd(i))},prepare:Bd()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Bd()},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]=uF(uF({},a),{},{width:i,widthHistory:s})}}}}),hF=mF.actions,gF=hF.addXAxis,_F=hF.replaceXAxis,vF=hF.removeXAxis,yF=hF.addYAxis,bF=hF.replaceYAxis,xF=hF.removeYAxis;hF.addZAxis,hF.replaceZAxis,hF.removeZAxis;var SF=hF.updateYAxisWidth,CF=mF.reducer,wF=J([J([Bp],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Cp,wp],(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)}}),TF=()=>q(wF),EF=()=>q(Gk);function DF(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 OF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?DF(Object(n),!0).forEach(function(t){kF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kF(e,t,n){return(t=AF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AF(e){var t=jF(e,`string`);return typeof t==`symbol`?t:t+``}function jF(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 MF=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=OF(OF(OF({},{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}),sa(i)),Ms(i)),c=(0,v.isValidElement)(i)?(0,v.cloneElement)(i,s):typeof i==`function`?i(s):v.createElement(qN,s);return v.createElement(ya,{className:`recharts-active-dot`,clipPath:o},c)};function NF(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,s=o===void 0?Py.activeDot:o,c=q(Rk),l=EF();if(t==null||l==null)return null;var u=t.find(e=>l.includes(e.payload));return fs(u)?null:v.createElement(HA,{zIndex:s},v.createElement(MF,{point:u,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var PF=e=>{var t=e.chartData,n=pl(),r=Wp();return(0,v.useEffect)(()=>r?()=>{}:(n(dj(t)),()=>{n(dj(void 0))}),[t,n,r]),null},FF={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},IF=tf({name:`brush`,initialState:FF,reducers:{setBrushSettings(e,t){return t.payload==null?FF:t.payload}}});IF.actions.setBrushSettings;var LF=IF.reducer;function RF(e){return(e%180+180)%180}var zF=function(e){var t=e.width,n=e.height,r=RF(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)},BF=tf({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ed(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=Ed(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(kd(t.payload))},removeLine:(e,t)=>{var n=Ed(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),VF=BF.actions;VF.addDot,VF.removeDot,VF.addArea,VF.removeArea,VF.addLine,VF.removeLine;var HF=BF.reducer;function UF(e,t){return JF(e)||qF(e,t)||GF(e,t)||WF()}function WF(){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 GF(e,t){if(e){if(typeof e==`string`)return KF(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)?KF(e,t):void 0}}function KF(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 qF(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 JF(e){if(Array.isArray(e))return e}var YF=(0,v.createContext)(void 0),XF=e=>{var t=e.children,n=UF((0,v.useState)(`${ss(`recharts`)}-clip`),1)[0],r=TF();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return v.createElement(YF.Provider,{value:n},v.createElement(`defs`,null,v.createElement(`clipPath`,{id:n},v.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function ZF(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 QF(e,t,n){return zF({width:e.width+t.width,height:e.height+t.height},n)}function $F(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 eI(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 tI(e,t){return ZF(e,t+1)}function nI(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:ZF(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||eI(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 rI(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||eI(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 iI(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 aI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?iI(Object(n),!0).forEach(function(t){oI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oI(e,t,n){return(t=sI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sI(e){var t=cI(e,`string`);return typeof t==`symbol`?t:t+``}function cI(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 lI(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=aI(aI({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=aI(aI({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&eI(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=aI(aI({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function uI(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=aI(aI({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&eI(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=aI(aI({},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=aI(aI({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=aI(aI({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&eI(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=aI(aI({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function dI(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(K(c)||og.isSsr)return tI(i,K(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?rM(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`?QF(rM(i,{fontSize:t,letterSpacing:n}),m,d):rM(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?ns(_.coordinate-g.coordinate):1,y=$F(a,v,p);return c===`equidistantPreserveStart`?nI(v,y,h,i,o):c===`equidistantPreserveEnd`?rI(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?uI(v,y,h,i,o,c===`preserveStartEnd`):lI(v,y,h,i,o),f.filter(e=>e.isShow))}var fI=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},pI=tf({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]=kd(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),mI=pI.actions,hI=mI.setRenderedTicks,gI=mI.removeRenderedTicks,_I=pI.reducer,vI=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function yI(e,t){return wI(e)||CI(e,t)||xI(e,t)||bI()}function bI(){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 xI(e,t){if(e){if(typeof e==`string`)return SI(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)?SI(e,t):void 0}}function SI(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 CI(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 wI(e){if(Array.isArray(e))return e}function TI(e,t){if(e==null)return{};var n,r,i=EI(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 EI(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 DI(){return DI=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},DI.apply(null,arguments)}function OI(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 kI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OI(Object(n),!0).forEach(function(t){AI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AI(e,t,n){return(t=jI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jI(e){var t=MI(e,`string`);return typeof t==`symbol`?t:t+``}function MI(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 NI={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:Py.axis};function PI(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=kI(kI(kI({},c),oa(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=kI(kI({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=kI(kI({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return v.createElement(`line`,DI({},l,{className:ea(`recharts-cartesian-axis-line`,Zo(s,`className`))}))}function FI(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=K(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 II(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function LI(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function RI(e){var t=e.option,n=e.tickProps,r=e.value,i,a=ea(n.className,`recharts-cartesian-axis-tick-value`);if(v.isValidElement(t))i=v.cloneElement(t,kI(kI({},n),{},{className:a}));else if(typeof t==`function`)i=t(kI(kI({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=ea(o,ZN(t))),i=v.createElement(eN,DI({},n,{className:o}),r)}return i}function zI(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=pl();return(0,v.useEffect)(()=>r==null||n==null?hs:(i(hI({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(gI({axisId:r,axisType:n}))}),[i,t,r,n]),null}var BI=(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=dI(kI(kI({},S),{},{ticks:r}),b,x),D=oa(S),O=sa(i),k=UM(D.textAnchor)?D.textAnchor:II(d,f),A=LI(d,f),j={};typeof a==`object`&&(j=a);var M=kI(kI({},D),{},{fill:`none`},j),N=E.map(e=>kI({entry:e},FI(e,p,m,h,g,d,_,f,y))),P=N.map(e=>{var t=e.entry,n=e.line;return v.createElement(ya,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},a&&v.createElement(`line`,DI({},M,n,{className:ea(`recharts-cartesian-axis-tick-line`,Zo(a,`className`))})))}),ee=N.map((e,t)=>{var n=e.entry,r=e.tick,a=kI(kI({},kI(kI(kI(kI({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(ya,DI({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},Ps(C,n,t)),i&&v.createElement(RI,{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(zI,{ticks:E,axisId:T,axisType:w}),ee.length>0&&v.createElement(HA,{zIndex:Py.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${w}-tick-labels`,ref:t},ee)),P.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${w}-tick-lines`},P))}),VI=(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=TI(e,vI),d=yI((0,v.useState)(``),2),f=d[0],p=d[1],m=yI((0,v.useState)(``),2),h=m[0],g=m[1],_=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>fI({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(HA,{zIndex:e.zIndex},v.createElement(ya,{className:ea(`recharts-cartesian-axis`,a)},v.createElement(PI,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:oa(e)}),v.createElement(BI,{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(vN,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(MN,{label:e.label,labelRef:e.labelRef}),e.children)))}),HI=v.forwardRef((e,t)=>{var n=Bs(e,NI);return v.createElement(VI,DI({},n,{ref:t}))});HI.displayName=`CartesianAxis`;var UI=[`x1`,`y1`,`x2`,`y2`,`key`],WI=[`offset`],GI=[`xAxisId`,`yAxisId`],KI=[`xAxisId`,`yAxisId`];function qI(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 JI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qI(Object(n),!0).forEach(function(t){YI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YI(e,t,n){return(t=XI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XI(e){var t=ZI(e,`string`);return typeof t==`symbol`?t:t+``}function ZI(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 QI(){return QI=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},QI.apply(null,arguments)}function $I(e,t){if(e==null)return{};var n,r,i=eL(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 eL(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 tL=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 nL(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=oa($I(n,UI))??{};l.offset;var u=$I(l,WI);r=v.createElement(`line`,QI({},u,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function rL(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=$I(e,GI),s=a.map((e,r)=>{var a=JI(JI({},o),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${r}`,index:r});return v.createElement(nL,{key:`line-${r}`,option:i,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},s)}function iL(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=$I(e,KI),s=a.map((e,r)=>{var a=JI(JI({},o),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${r}`,index:r});return v.createElement(nL,{option:i,lineItemProps:a,key:`line-${r}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},s)}function aL(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 oL(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 sL=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return sp(dI(JI(JI(JI({},NI),n),{},{ticks:cp(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},cL=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return sp(dI(JI(JI(JI({},NI),n),{},{ticks:cp(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},lL={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Py.grid};function uL(e){var t=jm(),n=Mm(),r=Am(),i=JI(JI({},Bs(e,lL)),{},{x:K(e.x)?e.x:r.left,y:K(e.y)?e.y:r.top,width:K(e.width)?e.width:r.width,height:K(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=Wp(),h=q(e=>mO(e,`xAxis`,a,m)),g=q(e=>mO(e,`yAxis`,o,m));if(!Qf(l)||!Qf(u)||!K(s)||!K(c))return null;var _=i.verticalCoordinatesGenerator||sL,y=i.horizontalCoordinatesGenerator||cL,b=i.horizontalPoints,x=i.verticalPoints;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?JI(JI({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);Zp(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?JI(JI({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);Zp(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(HA,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(tL,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(aL,QI({},i,{horizontalPoints:b})),v.createElement(oL,QI({},i,{verticalPoints:x})),v.createElement(rL,QI({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(iL,QI({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}uL.displayName=`CartesianGrid`;var dL=tf({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))}}}),fL=dL.actions;fL.addErrorBar,fL.replaceErrorBar,fL.removeErrorBar;var pL=dL.reducer;function mL(e,t){var n=q(t=>gE(t,e)),r=q(e=>yE(e,t)),i=n?.allowDataOverflow??mE.allowDataOverflow,a=r?.allowDataOverflow??_E.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function hL(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=TF(),a=mL(t,n),o=a.needClipX,s=a.needClipY,c=a.needClip,l=q(e=>UD(e,t,!1)),u=q(e=>WD(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 gL(e){var t=sa(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 _L(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function vL(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var yL=(e,t,n)=>_O(e,`xAxis`,_L(e,t),n),bL=(e,t,n)=>gO(e,`xAxis`,_L(e,t),n),xL=(e,t,n)=>_O(e,`yAxis`,vL(e,t),n),SL=(e,t,n)=>gO(e,`yAxis`,vL(e,t),n),CL=J([Pm,yL,xL,bL,SL],(e,t,n,r,i)=>op(e,`xAxis`)?vp(t,r,!1):vp(n,i,!1)),wL=J([DE,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),TL=e=>op(Pm(e),`xAxis`)?`yAxis`:`xAxis`,EL=(e,t)=>TL(e)===`yAxis`?vL(e,t):_L(e,t),DL=J([Pm,yL,xL,bL,SL,J([wL,(e,t,n)=>$E(e,TL(e),EL(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var n=e.stackId,r=rb(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]])}}}),Zv,CL,wL,Ny],(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 oR({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),OL=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],kL=[`id`,`baseLine`];function AL(){return AL=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},AL.apply(null,arguments)}function jL(e,t){if(e==null)return{};var n,r,i=ML(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 ML(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 NL(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(!$(a)||!$(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return K(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),K(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 PL(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(!$(a)||!$(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return K(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),K(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 FL(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?v.createElement(PL,{alpha:t,points:r,baseLine:i,strokeWidth:a}):v.createElement(NL,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function IL(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=jL(e,OL),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=BP(),h=d.id,g=d.baseLine,_=oa(jL(d,kL)),y=v.createElement(Ug,AL({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&v.createElement(Ug,AL({},_,{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(Ug,AL({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?v.createElement(ya,null,v.createElement(`defs`,null,v.createElement(`clipPath`,{id:m},v.createElement(FL,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),v.createElement(ya,{clipPath:`url(#${m})`},y,b,x)):v.createElement(v.Fragment,null,y,b,x)}var LL=[`id`],RL=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function zL(){return zL=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},zL.apply(null,arguments)}function BL(e,t){if(e==null)return{};var n,r,i=VL(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 VL(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 HL(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 UL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HL(Object(n),!0).forEach(function(t){WL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WL(e,t,n){return(t=GL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GL(e){var t=KL(e,`string`);return typeof t==`symbol`?t:t+``}function KL(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 qL={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:vP,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[UL(UL({},e.next),{},{x:us(e.prev.x,e.next.x,t),y:us(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:IL,xAxisId:0,yAxisId:0,zIndex:Py.area};function JL(e,t){return e&&e!==`none`?e:t}var YL=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:JL(r,i),value:bp(n,t),payload:e}]},XL=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:hs,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:bp(o,t),hide:s,type:u,color:JL(r,a),unit:c,formatter:l,graphicalItemId:d}};return v.createElement(uP,{tooltipEntrySettings:f})});function ZL(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=oa(r);return v.createElement(cF,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function QL(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 UL(UL({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return v.createElement(BN,{value:t?r:void 0},n)}function $L(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=BL(a,LL),_=UL(UL({},ca(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(ya,{clipPath:r?`url(#clipPath-${i})`:void 0},v.createElement(lP,{option:m,DefaultShape:qL.shape,shapeProps:_})),v.createElement(ZL,{points:t,props:g,clipPathId:i}))}function eR(e,t,n){return K(e)?us(K(t)?t:void 0,e,n):fs(e)||rs(e)?us(K(t)?t:void 0,0,n):e}function tR(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=TP(m,a),g=Im(),_=MP(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)?wP(S,s,f):Array.isArray(s)?wP(null,s,f):null;return v.createElement(NP,{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:eR(s,S,i);return h.syncStepValue(c,i),v.createElement(QL,{showLabels:!y,points:o},r.children,v.createElement($L,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:y||i<1,isEntrance:a}),v.createElement(GN,{label:r.label}))})}function nR(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,v.useRef)(null),a=(0,v.useRef)();return v.createElement(tR,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var rR=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=ea(`recharts-area`,i),g=f,_=gL(n),y=_.r,b=_.strokeWidth,x=QN(n),S=y*2+b,C=s?`url(#clipPath-${x?``:`dots-`}${g})`:void 0;return v.createElement(HA,{zIndex:m},v.createElement(ya,{className:h},s&&v.createElement(`defs`,null,v.createElement(hL,{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(nR,{needClip:s,clipPathId:g,props:this.props})),v.createElement(NF,{points:r,mainColor:JL(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(p)&&v.createElement(NF,{points:p,mainColor:JL(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}};function iR(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=BL(e,RL),g=Fm(),_=cA(),y=mL(p,m).needClip,b=Wp(),x=q(t=>DL(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=TF();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(rR,zL({},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 aR=(e,t,n,r,i)=>{var a=n??t;if(K(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 oR(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=aR(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=ip(e,i);Array.isArray(o)?(r=o,v=!0):r=[g,o]}var s=r?.[1]??null,u=s==null||h&&!n&&ip(e,i)==null;return _?{x:fp({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:fp({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 sR(e){var t=Bs(e,qL),n=Wp();return v.createElement(UP,{id:t.id,type:`area`},e=>v.createElement(v.Fragment,null,v.createElement(dP,{legendPayload:YL(t)}),v.createElement(XL,{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(XP,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:dp(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),v.createElement(iR,zL({},t,{id:e}))))}var cR=v.memo(sR,fh);cR.displayName=`Area`;var lR=[`domain`,`range`],uR=[`domain`,`range`];function dR(e,t){if(e==null)return{};var n,r,i=fR(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 fR(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 pR(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 mR(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=dR(e,lR),a=t.domain,o=t.range,s=dR(t,uR);return!pR(n,a)||!pR(r,o)?!1:fh(i,s)}var hR=[`type`],gR=[`dangerouslySetInnerHTML`,`ticks`,`scale`],_R=[`id`,`scale`];function vR(){return vR=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},vR.apply(null,arguments)}function yR(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 bR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yR(Object(n),!0).forEach(function(t){xR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xR(e,t,n){return(t=SR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SR(e){var t=CR(e,`string`);return typeof t==`symbol`?t:t+``}function CR(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 wR(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 ER(e){var t=pl(),n=(0,v.useRef)(null),r=Im(),i=e.type,a=wR(e,hR),o=Ry(r,`xAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return bR(bR({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(gF(s)):n.current!==s&&t(_F({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(vF(n.current)),null)},[t]),null}var DR=e=>{var t=e.xAxisId,n=e.className,r=q(Hp),i=Wp(),a=`xAxis`,o=q(e=>hO(e,a,t,i)),s=q(e=>iO(e,t)),c=q(e=>lO(e,t)),l=q(e=>hE(e,t));if(s==null||c==null||l==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var u=wR(e,gR);l.id,l.scale;var d=wR(l,_R);return v.createElement(HI,vR({},u,d,{x:c.x,y:c.y,width:s.width,height:s.height,className:ea(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},OR={allowDataOverflow:mE.allowDataOverflow,allowDecimals:mE.allowDecimals,allowDuplicatedCategory:mE.allowDuplicatedCategory,angle:mE.angle,axisLine:NI.axisLine,height:mE.height,hide:!1,includeHidden:mE.includeHidden,interval:mE.interval,label:!1,minTickGap:mE.minTickGap,mirror:mE.mirror,orientation:mE.orientation,padding:mE.padding,reversed:mE.reversed,scale:mE.scale,tick:mE.tick,tickCount:mE.tickCount,tickLine:NI.tickLine,tickSize:NI.tickSize,type:mE.type,niceTicks:mE.niceTicks,xAxisId:0},kR=v.memo(e=>{var t=Bs(e,OR);return v.createElement(v.Fragment,null,v.createElement(ER,{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(DR,t))},mR);kR.displayName=`XAxis`;var AR=[`type`],jR=[`dangerouslySetInnerHTML`,`ticks`,`scale`],MR=[`id`,`scale`];function NR(){return NR=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},NR.apply(null,arguments)}function PR(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 FR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PR(Object(n),!0).forEach(function(t){IR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IR(e,t,n){return(t=LR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LR(e){var t=RR(e,`string`);return typeof t==`symbol`?t:t+``}function RR(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 zR(e,t){if(e==null)return{};var n,r,i=BR(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 BR(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 VR(e){var t=pl(),n=(0,v.useRef)(null),r=Im(),i=e.type,a=zR(e,AR),o=Ry(r,`yAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return FR(FR({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(yF(s)):n.current!==s&&t(bF({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(xF(n.current)),null)},[t]),null}function HR(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=q(Hp),c=Wp(),l=pl(),u=`yAxis`,d=q(e=>dO(e,t)),f=q(e=>uO(e,t)),p=q(e=>hO(e,u,t,c)),m=q(e=>vE(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||CN(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(SF({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=zR(e,jR);m.id,m.scale;var g=zR(m,MR);return v.createElement(HI,NR({},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:ea(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var UR={allowDataOverflow:_E.allowDataOverflow,allowDecimals:_E.allowDecimals,allowDuplicatedCategory:_E.allowDuplicatedCategory,angle:_E.angle,axisLine:NI.axisLine,hide:!1,includeHidden:_E.includeHidden,interval:_E.interval,label:!1,minTickGap:_E.minTickGap,mirror:_E.mirror,orientation:_E.orientation,padding:_E.padding,reversed:_E.reversed,scale:_E.scale,tick:_E.tick,tickCount:_E.tickCount,tickLine:NI.tickLine,tickSize:NI.tickSize,type:_E.type,niceTicks:_E.niceTicks,width:_E.width,yAxisId:0},WR=v.memo(e=>{var t=Bs(e,UR);return v.createElement(v.Fragment,null,v.createElement(VR,{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(HR,t))},mR);WR.displayName=`YAxis`;var GR=J([(e,t)=>t,Pm,eb,lb,jk,Nk,fA,Bp],wA);function KR(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function qR(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(KR(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 JR=Q(`mouseClick`),YR=Hf();YR.startListening({actionCreator:JR,effect:(e,t)=>{var n=e.payload,r=GR(t.getState(),qR(n));r?.activeIndex!=null&&t.dispatch(IO({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var XR=Q(`mouseMove`),ZR=Hf(),QR=null,$R=null,ez=null;ZR.startListening({actionCreator:XR,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);QR!==null&&(cancelAnimationFrame(QR),QR=null),$R!==null&&(typeof i!=`number`||!o)&&(clearTimeout($R),$R=null),ez=qR(n);var s=()=>{var e=t.getState(),n=SO(e,e.tooltip.settings.shared);if(!ez){QR=null,$R=null;return}if(n===`axis`){var r=GR(e,ez);r?.activeIndex==null?t.dispatch(PO()):t.dispatch(FO({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}QR=null,$R=null};if(!o){s();return}i===`raf`?QR=requestAnimationFrame(s):typeof i==`number`&&$R===null&&($R=setTimeout(s,i))}});function tz(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 nz={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},rz=tf({name:`rootProps`,initialState:nz,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??nz.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}}}),iz=rz.reducer,az=rz.actions.updateOptions,oz=tf({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)}});oz.actions.updatePolarOptions;var sz=oz.reducer,cz=Q(`keyDown`),lz=Q(`focus`),uz=Q(`blur`),dz=Hf(),fz=null,pz=null,mz=null;dz.startListening({actionCreator:cz,effect:(e,t)=>{mz=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`);pz!==null&&(typeof r!=`number`||!a)&&(clearTimeout(pz),pz=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=mz;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=ZO(n,yk(e),XE(e),Ok(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=Nk(e),c=yk(e),l=SO(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=_A(e,l,`hover`,String(n.index));t.dispatch(RO({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=vO(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=XE(e),h=Ok(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(ZO(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(ZO(_(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=_A(e,l,`hover`,String(p));t.dispatch(RO({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{fz=null,pz=null}};if(!a){o();return}r===`raf`?fz=requestAnimationFrame(o):typeof r==`number`&&pz===null&&(o(),mz=null,pz=setTimeout(()=>{mz?o():(pz=null,fz=null)},r))}}),dz.startListening({actionCreator:lz,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=_A(n,SO(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(RO({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),dz.startListening({actionCreator:uz,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(RO({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function hz(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 gz=Q(`externalEvent`),_z=Hf(),vz=new Map,yz=new Map,bz=new Map;_z.startListening({actionCreator:gz,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=hz(i);bz.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=yz.get(a);f!==void 0&&(typeof l!=`number`||!d)&&(clearTimeout(f),yz.delete(a));var p=()=>{var e=bz.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:Uk(i),activeDataKey:Bk(i),activeIndex:Rk(i),activeLabel:zk(i),activeTooltipIndex:Rk(i),isTooltipActive:Wk(i)};n&&n(o,r)}finally{vz.delete(a),yz.delete(a),bz.delete(a)}};if(!d){p();return}if(l===`raf`){var m=requestAnimationFrame(p);vz.set(a,m)}else if(typeof l==`number`){if(!yz.has(a)){p();var h=setTimeout(p,l);yz.set(a,h)}}else p()}}});var xz=J([J([tk],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)}}}),Sz=Q(`touchMove`),Cz=Hf(),wz=null,Tz=null,Ez=null,Dz=null;Cz.startListening({actionCreator:Sz,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Dz=hz(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);wz!==null&&(cancelAnimationFrame(wz),wz=null),Tz!==null&&(typeof i!=`number`||!o)&&(clearTimeout(Tz),Tz=null),Ez=Array.from(n.touches).map(e=>qR({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(Dz!=null){var e=t.getState(),n=SO(e,e.tooltip.settings.shared);if(n===`axis`){var r=Ez?.[0];if(r==null){wz=null,Tz=null;return}var i=GR(e,r);i?.activeIndex!=null&&t.dispatch(FO({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=Dz.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(kp),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=hk(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=xz(e,s,c);t.dispatch(NO({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}wz=null,Tz=null}};if(!o){s();return}i===`raf`?wz=requestAnimationFrame(s):typeof i==`number`&&Tz===null&&(s(),Dz=null,Tz=setTimeout(()=>{Dz?s():(Tz=null,wz=null)},i))}}});var Oz={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},kz=tf({name:`eventSettings`,initialState:Oz,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=kd(t.payload.throttledEvents))}}}),Az=kz.actions.setEventSettings,jz=kz.reducer,Mz=au({brush:LF,cartesianAxis:CF,chartData:pj,errorBars:pL,eventSettings:jz,graphicalItems:YP,layout:Xf,legend:qm,options:oj,polarAxis:XN,polarOptions:sz,referenceElements:HF,renderedTicks:_I,rootProps:iz,tooltip:zO,zIndex:VA}),Nz=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Gd({reducer:Mz,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([YR.middleware,ZR.middleware,dz.middleware,_z.middleware,Cz.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(Ud({type:`raf`}))},devTools:og.devToolsEnabled&&{serialize:{replacer:tz},name:`recharts-${t}`}})};function Pz(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Wp(),a=(0,v.useRef)(null);if(i)return n;a.current??=Nz(t,r);var o=ul;return v.createElement(lh,{context:o,store:a.current},n)}function Fz(e){var t=e.layout,n=e.margin,r=pl(),i=Wp();return(0,v.useEffect)(()=>{i||(r(qf(t)),r(Kf(n)))},[r,i,t,n]),null}var Iz=(0,v.memo)(Fz,fh);function Lz(e){var t=pl();return(0,v.useEffect)(()=>{t(az(e))},[t,e]),null}var Rz=(0,v.memo)(e=>{var t=pl();return(0,v.useEffect)(()=>{t(Az(e))},[t,e]),null},fh);function zz(e){var t=e.zIndex,n=e.isPanorama,r=(0,v.useRef)(null),i=pl();return(0,v.useLayoutEffect)(()=>(r.current&&i(zA({zIndex:t,element:r.current,isPanorama:n})),()=>{i(BA({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function Bz(e){var t=e.children,n=e.isPanorama,r=q(EA);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(zz,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(zz,{key:e,zIndex:e,isPanorama:n})))}var Vz=[`children`];function Hz(e,t){if(e==null)return{};var n,r,i=Uz(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 Uz(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 Wz(){return Wz=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},Wz.apply(null,arguments)}var Gz={width:`100%`,height:`100%`,display:`block`},Kz=(0,v.forwardRef)((e,t)=>{var n=jm(),r=Mm(),i=Og();if(!Qf(n)||!Qf(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(ma,Wz({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:Gz,ref:t}),a)}),qz=e=>{var t=e.children,n=q(Kp);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return v.createElement(ma,{width:r,height:i,x:o,y:a},t)},Jz=(0,v.forwardRef)((e,t)=>{var n=e.children,r=Hz(e,Vz);return Wp()?v.createElement(qz,null,v.createElement(Bz,{isPanorama:!0},n)):v.createElement(Kz,Wz({ref:t},r),v.createElement(Bz,{isPanorama:!1},n))});function Yz(e,t){return eB(e)||$z(e,t)||Zz(e,t)||Xz()}function Xz(){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 Zz(e,t){if(e){if(typeof e==`string`)return Qz(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)?Qz(e,t):void 0}}function Qz(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 $z(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 eB(e){if(Array.isArray(e))return e}function tB(){var e=pl(),t=Yz((0,v.useState)(null),2),n=t[0],r=t[1],i=q(Tp);return(0,v.useEffect)(()=>{if(n!=null){var t=n.getBoundingClientRect().width/n.offsetWidth;$(t)&&t!==i&&e(Yf(t))}},[n,e,i]),r}function nB(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 rB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nB(Object(n),!0).forEach(function(t){iB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iB(e,t,n){return(t=aB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aB(e){var t=oB(e,`string`);return typeof t==`symbol`?t:t+``}function oB(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 sB(){return sB=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},sB.apply(null,arguments)}function cB(e,t){return pB(e)||fB(e,t)||uB(e,t)||lB()}function lB(){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 uB(e,t){if(e){if(typeof e==`string`)return dB(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)?dB(e,t):void 0}}function dB(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 fB(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 pB(e){if(Array.isArray(e))return e}var mB=()=>(wj(),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 gB=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),r=cB((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(zm,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,sB({ref:s},e)))}),_B=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=cB((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(zm,{width:a.containerWidth,height:a.containerHeight}),v.createElement(`div`,sB({ref:c},e)))}),vB=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return v.createElement(v.Fragment,null,v.createElement(zm,{width:n,height:r}),v.createElement(`div`,sB({ref:t},e)))}),yB=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?v.createElement(_B,sB({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(vB,sB({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(zm,{width:n,height:r}),v.createElement(`div`,sB({ref:t},e)))});function bB(e){return e?gB:yB}var xB=(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=pl(),w=cB((0,v.useState)(null),2),T=w[0],E=w[1],D=cB((0,v.useState)(null),2),O=D[0],k=D[1],A=tB(),j=wm(),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]),ee=(0,v.useCallback)(e=>{C(JR(e)),C(gz({handler:a,reactEvent:e}))},[C,a]),F=(0,v.useCallback)(e=>{C(XR(e)),C(gz({handler:l,reactEvent:e}))},[C,l]),I=(0,v.useCallback)(e=>{C(PO()),C(gz({handler:u,reactEvent:e}))},[C,u]),te=(0,v.useCallback)(e=>{C(XR(e)),C(gz({handler:d,reactEvent:e}))},[C,d]),ne=(0,v.useCallback)(()=>{C(lz())},[C]),re=(0,v.useCallback)(()=>{C(uz())},[C]),ie=(0,v.useCallback)(e=>{C(cz(e.key))},[C]),L=(0,v.useCallback)(e=>{C(gz({handler:o,reactEvent:e}))},[C,o]),R=(0,v.useCallback)(e=>{C(gz({handler:s,reactEvent:e}))},[C,s]),ae=(0,v.useCallback)(e=>{C(gz({handler:c,reactEvent:e}))},[C,c]),oe=(0,v.useCallback)(e=>{C(gz({handler:f,reactEvent:e}))},[C,f]),se=(0,v.useCallback)(e=>{C(gz({handler:h,reactEvent:e}))},[C,h]),z=(0,v.useCallback)(e=>{x&&C(Sz(e)),C(gz({handler:m,reactEvent:e}))},[C,x,m]),ce=(0,v.useCallback)(e=>{C(gz({handler:p,reactEvent:e}))},[C,p]),le=bB(y);return v.createElement(QA.Provider,{value:T},v.createElement(ba.Provider,{value:O},v.createElement(le,{width:M??g?.width,height:N??g?.height,className:ea(`recharts-wrapper`,r),style:rB({position:`relative`,cursor:`default`,width:M,height:N},g),onClick:ee,onContextMenu:L,onDoubleClick:R,onFocus:ne,onBlur:re,onKeyDown:ie,onMouseDown:ae,onMouseEnter:F,onMouseLeave:I,onMouseMove:te,onMouseUp:oe,onTouchEnd:ce,onTouchMove:z,onTouchStart:se,ref:P},v.createElement(mB,null),n)))}),SB=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function CB(e,t){if(e==null)return{};var n,r,i=wB(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 wB(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 TB=(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=oa(CB(e,SB));return c?v.createElement(v.Fragment,null,v.createElement(zm,{width:n,height:r}),v.createElement(Jz,{otherAttributes:d,title:l,desc:u},a)):v.createElement(xB,{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(Jz,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(XF,null,a)))});function EB(){return EB=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},EB.apply(null,arguments)}function DB(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 OB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?DB(Object(n),!0).forEach(function(t){kB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kB(e,t,n){return(t=AB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AB(e){var t=jB(e,`string`);return typeof t==`symbol`?t:t+``}function jB(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 MB=OB({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`},Oz),NB=(0,v.forwardRef)(function(e,t){var n=Bs(e.categoricalChartProps,MB),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(Pz,{preloadedState:{options:c},reduxStoreName:s.id??r},v.createElement(PF,{chartData:s.data}),v.createElement(Iz,{layout:n.layout,margin:n.margin}),v.createElement(Rz,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(Lz,{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(TB,EB({},n,{ref:t})))}),PB=[`axis`],FB=(0,v.forwardRef)((e,t)=>v.createElement(NB,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:PB,tooltipPayloadSearcher:ij,categoricalChartProps:e,ref:t}));function IB(){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 yr()),r(await br()),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,U.jsxs)(`div`,{className:`page`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:[(0,U.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,U.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,U.jsx)(`div`,{style:{color:`var(--text-secondary)`},children:`Aggregating token expenditures...`})]}):(0,U.jsxs)(`div`,{className:`page`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflowY:`auto`},children:[(0,U.jsxs)(`div`,{className:`page-header`,style:{marginBottom:24},children:[(0,U.jsx)(`h1`,{children:`Token & Budget Statistics`}),(0,U.jsx)(`p`,{children:`Monitor your token cost expenditure in real time against safety budget limits`})]}),(0,U.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,U.jsx)(`span`,{style:{fontSize:24},children:`🛡️`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:700,color:`#fff`,letterSpacing:.3},children:`Local-first · Self-hosted`}),(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(340px, 1fr))`,gap:24,marginBottom:24},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:13,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:`Daily Expenditure`}),(0,U.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,marginTop:4,color:`#fff`},children:[`$`,e?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:8},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:11,color:`var(--text-secondary)`},children:[(0,U.jsx)(`span`,{children:`Consumption Ratio`}),(0,U.jsxs)(`span`,{children:[f.toFixed(1),`%`]})]}),(0,U.jsx)(`div`,{style:{height:6,background:`var(--bg-elevated)`,borderRadius:3,overflow:`hidden`},children:(0,U.jsx)(`div`,{style:{height:`100%`,width:`${f}%`,background:m(f),boxShadow:`0 0 8px ${m(f)}`,transition:`width 0.4s ease`}})})]}),(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:13,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:`Weekly Expenditure`}),(0,U.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,marginTop:4,color:`#fff`},children:[`$`,e?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:8},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:11,color:`var(--text-secondary)`},children:[(0,U.jsx)(`span`,{children:`Consumption Ratio`}),(0,U.jsxs)(`span`,{children:[p.toFixed(1),`%`]})]}),(0,U.jsx)(`div`,{style:{height:6,background:`var(--bg-elevated)`,borderRadius:3,overflow:`hidden`},children:(0,U.jsx)(`div`,{style:{height:`100%`,width:`${p}%`,background:m(p),boxShadow:`0 0 8px ${m(p)}`,transition:`width 0.4s ease`}})})]}),(0,U.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,U.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.6)`,border:`1px solid var(--border)`},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(280px, 1fr))`,gap:20},children:[(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`♊`}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Gemini CLI`}),(0,U.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`~/.gemini/tmp`})]})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.gemini?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.gemini?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.gemini?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`🍊`}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Claude Code CLI`}),(0,U.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`~/.claude`})]})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.claude?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.claude?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.claude?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`💻`}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Codex CLI`}),(0,U.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:`~/.codex/sessions`})]})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.codex?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.codex?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.codex?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`🌐`}),(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`OpenRouter`})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.openrouter?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.openrouter?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.openrouter?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`🔎`}),(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Tavily Search`})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.tavily?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.tavily?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.tavily?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`🦁`}),(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Brave Search`})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.brave?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.brave?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.brave?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`✨`}),(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Exa Search`})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.exa?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.exa?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.exa?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]}),(0,U.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,border:`1px solid var(--border)`,padding:16,borderRadius:10,display:`flex`,flexDirection:`column`,gap:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:18},children:`🔍`}),(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`#fff`},children:`Serper Search`})]}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.serper?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly Spend:`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:`#fff`},children:[`$`,e?.breakdown?.serper?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.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,U.jsx)(`span`,{children:`Rolling Tokens:`}),(0,U.jsxs)(`span`,{children:[e?.breakdown?.serper?.dailyTokens?.toLocaleString()||0,` (24h)`]})]})]})]})]})]}),(0,U.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,U.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,U.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,U.jsx)(Em,{width:`100%`,height:300,children:(0,U.jsxs)(FB,{data:h,margin:{top:5,right:20,left:0,bottom:5},children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`gradGemini`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.4}),(0,U.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]}),(0,U.jsxs)(`linearGradient`,{id:`gradClaude`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`5%`,stopColor:`#e17055`,stopOpacity:.4}),(0,U.jsx)(`stop`,{offset:`95%`,stopColor:`#e17055`,stopOpacity:0})]}),(0,U.jsxs)(`linearGradient`,{id:`gradOpenRouter`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`5%`,stopColor:`#74b9ff`,stopOpacity:.4}),(0,U.jsx)(`stop`,{offset:`95%`,stopColor:`#74b9ff`,stopOpacity:0})]}),(0,U.jsxs)(`linearGradient`,{id:`gradCodex`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`5%`,stopColor:`#00cec9`,stopOpacity:.4}),(0,U.jsx)(`stop`,{offset:`95%`,stopColor:`#00cec9`,stopOpacity:0})]})]}),(0,U.jsx)(uL,{strokeDasharray:`3 3`,stroke:`rgba(255,255,255,0.04)`}),(0,U.jsx)(kR,{dataKey:`date`,tick:{fontSize:11,fill:`var(--text-secondary)`},axisLine:{stroke:`var(--border)`},tickLine:!1}),(0,U.jsx)(WR,{tick:{fontSize:11,fill:`var(--text-secondary)`},axisLine:{stroke:`var(--border)`},tickLine:!1,tickFormatter:e=>`$${e.toFixed(2)}`}),(0,U.jsx)(Vj,{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,U.jsx)(Lh,{wrapperStyle:{fontSize:12,color:`var(--text-secondary)`}}),(0,U.jsx)(cR,{type:`monotone`,dataKey:`gemini`,stackId:`1`,stroke:`#3b82f6`,fill:`url(#gradGemini)`,strokeWidth:2}),(0,U.jsx)(cR,{type:`monotone`,dataKey:`claude`,stackId:`1`,stroke:`#e17055`,fill:`url(#gradClaude)`,strokeWidth:2}),(0,U.jsx)(cR,{type:`monotone`,dataKey:`openrouter`,stackId:`1`,stroke:`#74b9ff`,fill:`url(#gradOpenRouter)`,strokeWidth:2}),(0,U.jsx)(cR,{type:`monotone`,dataKey:`codex`,stackId:`1`,stroke:`#00cec9`,fill:`url(#gradCodex)`,strokeWidth:2})]})})]}),(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`span`,{style:{fontSize:20},children:t.emoji}),(0,U.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#fff`},children:t.name})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,fontSize:12},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Daily`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:t.color},children:[`$`,n?.dailyUsd?.toFixed(4)??`0.0000`]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,U.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Weekly`}),(0,U.jsxs)(`span`,{style:{fontWeight:600,color:t.color},children:[`$`,n?.weeklyUsd?.toFixed(4)??`0.0000`]})]}),n?.dailyTokens!=null&&(0,U.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,U.jsx)(`span`,{children:`Tokens (24h)`}),(0,U.jsx)(`span`,{children:n.dailyTokens.toLocaleString()})]})]})]},t.key)})}),(0,U.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,U.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,U.jsx)(`div`,{style:{overflowX:`auto`},children:(0,U.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12},children:[(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border)`},children:[`Provider`,`Daily ($)`,`Weekly ($)`,`Daily Tokens`,`Weekly Tokens`].map(e=>(0,U.jsx)(`th`,{style:{textAlign:`left`,padding:`10px 12px`,fontSize:11,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5},children:e},e))})}),(0,U.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,U.jsxs)(`tr`,{style:{background:n%2==1?`rgba(255,255,255,0.02)`:`transparent`,borderBottom:`1px solid var(--border)`},children:[(0,U.jsx)(`td`,{style:{padding:`10px 12px`,fontWeight:600,color:t.color},children:t.name}),(0,U.jsxs)(`td`,{style:{padding:`10px 12px`,color:`#fff`},children:[`$`,r?.dailyUsd?.toFixed(4)??`0.0000`]}),(0,U.jsxs)(`td`,{style:{padding:`10px 12px`,color:`#fff`},children:[`$`,r?.weeklyUsd?.toFixed(4)??`0.0000`]}),(0,U.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`},children:r?.dailyTokens?.toLocaleString()||`—`}),(0,U.jsx)(`td`,{style:{padding:`10px 12px`,color:`var(--text-secondary)`},children:r?.weeklyTokens?.toLocaleString()||`—`})]},t.key)}),(0,U.jsxs)(`tr`,{style:{borderTop:`2px solid var(--border)`,background:`rgba(108, 92, 231, 0.05)`},children:[(0,U.jsx)(`td`,{style:{padding:`10px 12px`,fontWeight:700,color:`#fff`},children:`Total`}),(0,U.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,U.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,U.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,U.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 LB(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 RB(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 zB({provider:e}){if(!e)return null;let t=e.toLowerCase();return t===`openai`?(0,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.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,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.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,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.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,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.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 BB(){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)(``),[ee,F]=(0,v.useState)(new Set),[I,te]=(0,v.useState)(!1),[ne,re]=(0,v.useState)(!1),[ie,L]=(0,v.useState)(!1),[R,ae]=(0,v.useState)(null),[oe,se]=(0,v.useState)(null),[z,ce]=(0,v.useState)(``),[le,ue]=(0,v.useState)(!1),[de,fe]=(0,v.useState)([]),[pe,me]=(0,v.useState)(``),[he,ge]=(0,v.useState)(null),[_e,ve]=(0,v.useState)(!1),[ye,be]=(0,v.useState)([]),[xe,Se]=(0,v.useState)(new Set),Ce=(0,v.useCallback)(async()=>{_(!0),b(null);try{try{let e=await br();e.secrets||={},e.brain||={},r(e),a(await ai().catch(()=>[])),s(await oi().catch(()=>[])),l(await si().catch(()=>[])),d(await ci().catch(()=>[]))}catch{}let e=await kr();if(h(e),T){let t=e.keys.find(e=>e.key===T.key);E(t||null),t&&O(LB(t))}}catch(e){b(e.message)}finally{_(!1)}},[T?.key]),we=(0,v.useCallback)(async()=>{try{fe((await Cr()).keys||[])}catch{}},[]),Te=(0,v.useCallback)(async()=>{try{ae(await Ir())}catch{ae(null)}},[]);(0,v.useEffect)(()=>{Ce(),we(),Te()},[Ce,we,Te]);let Ee=(e,t)=>{n&&r({...n,secrets:{...n.secrets,[e]:t}})},De=(e,t)=>{n&&r({...n,brain:{...n.brain,[e]:t}})},Oe=async()=>{if(n){M(!0),b(null),p(null);try{await Sr(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 ke(e,t){E(e),O(LB(e)),A(``),P(``),se(null),ce(``),t&&F(e=>{let n=new Set(e);return n.add(t),n})}async function Ae(){if(!Ri()){b(`This browser does not support passkeys / WebAuthn`);return}ue(!0),b(null);try{await Rr(await qi({optionsJSON:await Lr()}),`Touch ID / platform`),await Te(),P(`Passkey registered — use it to reveal secret values`)}catch(e){b(e.message||`Passkey registration cancelled`)}finally{ue(!1)}}async function je(){return(await Br(await Qi({optionsJSON:await zr()}))).step_up_token}async function Me(){if(!z.trim())throw Error(`Enter dashboard password`);let e=await Vr(z);return ce(``),e.step_up_token}async function Ne(e){if(T){ue(!0),b(null),se(null);try{let t=e===`passkey`?await je():await Me();se((await Hr(T.key,t)).value),P(`Revealed ${T.key} (auto-hides in 30s)`),window.setTimeout(()=>se(null),3e4)}catch(e){b(e.message)}finally{ue(!1)}}}async function Pe(){if(oe)try{await navigator.clipboard.writeText(oe),P(`Copied to clipboard`)}catch{b(`Clipboard copy failed`)}}function Fe(e){F(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function Ie(e){F(new Set([e]))}function Le(e){F(new Set(e))}function Re(){F(new Set)}async function ze(){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 Ar(T.key,t),P(`Metadata saved`),await Ce()}catch(e){b(e.message)}finally{M(!1)}}}async function Be(){if(!(!T||!k)){M(!0);try{let e=await jr(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 Ce()}catch(e){b(e.message)}finally{M(!1)}}}async function Ve(){if(T&&confirm(`Delete secret ${T.key}?`))try{await Mr(T.key),E(null),await Ce()}catch(e){b(e.message)}}async function He(){if(T)try{await Nr({key_ref:T.key,provider:T.provider||`unknown`,cost_usd:.01,model:`manual-sample`,source:`dashboard`}),P(`Sample usage event recorded ($0.01)`),await Ce()}catch(e){b(e.message)}}async function Ue(){try{let e=await Er();be(e.candidates||[]),Se(new Set((e.candidates||[]).filter(e=>!e.already_set).map(e=>e.key))),t(`import`)}catch(e){b(e.message)}}async function We(){try{let e=await Or({keys:[...xe]});P(`Imported ${e.imported_count}, skipped ${e.skipped_count}`),await Ce(),t(`catalog`)}catch(e){b(e.message)}}let Ge=(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)}),Ke=(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`?RB(t):UB(t)},[m,x,C]);(0,v.useEffect)(()=>{if(I||!Ke.length)return;let e=new Set;for(let t of Ke)t.kind===`error`&&e.add(t.id);let t=Ke.find(e=>e.kind!==`error`);t&&e.add(t.id),F(e),te(!0)},[Ke,I]);let qe=m?.summary;return(0,U.jsxs)(`div`,{className:`page`,style:{maxWidth:T?1400:1100},children:[(0,U.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-end`,flexWrap:`wrap`,gap:12,marginBottom:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{style:{marginBottom:4},children:`Secrets & Access`}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:async()=>{try{let e=await Pr({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,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:async()=>{try{let e=await Fr(),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 Ce()}catch(e){b(e.message)}},children:`Enqueue rotations`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void Ue(),children:`Migrate import`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void Ce(),children:`Refresh`})]})]}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginBottom:10,fontSize:11},onClick:()=>re(e=>!e),children:ne?`▾ Hide model notes`:`▸ How secrets work`}),ne&&(0,U.jsx)(`div`,{className:`card`,style:{padding:12,marginBottom:12,fontSize:12,color:`var(--text-secondary)`,lineHeight:1.5,borderColor:`var(--border-accent)`},children:(0,U.jsxs)(`ul`,{style:{margin:0,paddingLeft:18},children:[(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`strong`,{children:`SSOT`}),` — keys in TR store; `,(0,U.jsx)(`strong`,{children:`export-env`}),` writes repo `,(0,U.jsx)(`code`,{children:`.env`}),`.`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`strong`,{children:`One key → one product repo`}),`; multi-repo is an error. Empty = Developer secrets (tooling).`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`strong`,{children:`import-env`}),` = one-time migrate. `,(0,U.jsx)(`strong`,{children:`PATs`}),` = brain API tokens only.`]})]})}),y&&(0,U.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:16,display:`block`,padding:12},children:[y,(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginLeft:12},onClick:()=>b(null),children:`Dismiss`})]}),N&&(0,U.jsx)(`div`,{style:{marginBottom:12,fontSize:13,color:`#34d399`},children:N}),m?.store&&(0,U.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`:``]}),qe&&(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:12,marginBottom:20},children:[(0,U.jsx)(GB,{label:`Keys`,value:String(qe.total_keys),accent:`#60a5fa`}),(0,U.jsx)(GB,{label:`Providers`,value:String(qe.providers_active),accent:`#a78bfa`}),(0,U.jsx)(GB,{label:`Planned / mo`,value:`$${(qe.monthly_subscription_usd||0).toFixed(0)}`,accent:`#fbbf24`}),(0,U.jsx)(GB,{label:`Usage 30d`,value:`$${(qe.usage_30d?.cost_usd||0).toFixed(2)}`,accent:`#34d399`}),(0,U.jsx)(GB,{label:`Usage 7d`,value:`$${(qe.usage_7d?.cost_usd||0).toFixed(2)}`,accent:`#22d3ee`}),(0,U.jsx)(GB,{label:`Rotate due`,value:String(qe.rotation_overdue||0),accent:qe.rotation_overdue?`#f87171`:`#64748b`}),(0,U.jsx)(GB,{label:`Multi-repo errors`,value:String(qe.multi_repo_violations||0),accent:qe.multi_repo_violations?`#f87171`:`#64748b`}),(0,U.jsx)(GB,{label:`Developer`,value:String(qe.developer_keys||0),accent:`#a78bfa`})]}),(qe?.multi_repo_violations||0)>0&&(0,U.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,U.jsx)(`strong`,{style:{color:`#f87171`},children:`Multi-repo binding error`}),(0,U.jsxs)(`p`,{style:{margin:`6px 0 0`,color:`var(--text-secondary)`},children:[qe?.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,U.jsx)(`strong`,{children:`Developer secret`}),` `,`(tooling / personal). Fix in the red “Needs fix” section below — set `,(0,U.jsx)(`em`,{children:`one`}),` repo or clear the field.`]})]}),m?.by_provider&&m.by_provider.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginBottom:8,fontSize:11},onClick:()=>L(e=>!e),children:ie?`▾ Hide cost chart`:`▸ Cost by provider`}),ie&&(0,U.jsx)(`div`,{className:`card`,style:{marginBottom:12,padding:12},children:(0,U.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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`100px 1fr 80px`,gap:10,alignItems:`center`},children:[(0,U.jsx)(`span`,{style:{fontSize:12,fontWeight:600},children:e.provider}),(0,U.jsx)(`div`,{style:{height:6,background:`rgba(148,163,184,0.12)`,borderRadius:99,overflow:`hidden`},children:(0,U.jsx)(`div`,{style:{width:`${r}%`,height:`100%`,background:`linear-gradient(90deg, #3b82f6, #22d3ee)`,borderRadius:99}})}),(0,U.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,textAlign:`right`},children:[`$`,n.toFixed(2),` · `,e.keys,`k`]})]},e.provider)})})})]}),(0,U.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,U.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,U.jsx)(`div`,{style:{height:`calc(100vh - 280px)`,minHeight:420,position:`relative`,overflowY:`auto`},children:(0,U.jsx)(IB,{})}),e===`catalog`&&(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`calc(100vh - 280px)`,minHeight:420,marginRight:T?440:0,transition:`margin 0.15s ease`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`,marginBottom:16,flexWrap:`wrap`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,background:`var(--bg-tertiary)`,borderRadius:6,padding:2},children:[(0,U.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,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`,marginBottom:8,flexShrink:0},children:[(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{fontSize:11},onClick:()=>Le(Ke.map(e=>e.id)),children:`Expand all`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{fontSize:11},onClick:Re,children:`Collapse all`}),(0,U.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[Ge.length,` shown`,T?` · editing ${T.key}`:``]})]}),Ke.length>0&&(0,U.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6,marginBottom:8,flexShrink:0,maxHeight:72,overflowY:`auto`},children:Ke.map(e=>{let t=ee.has(e.id);return(0,U.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:()=>Ie(e.id),title:t?`Currently expanded`:`Expand this repo only`,children:[t?`▾ `:`▸ `,C===`api`&&(0,U.jsx)(zB,{provider:e.id}),e.label,(0,U.jsx)(`span`,{style:{marginLeft:6,opacity:.7},children:e.keys.length})]},`chip-${e.id}`)})}),g&&!m?(0,U.jsx)(`p`,{style:{color:`var(--text-tertiary)`},children:`Loading catalog…`}):Ge.length===0?(0,U.jsxs)(`div`,{className:`card`,style:{padding:24,textAlign:`center`,color:`var(--text-secondary)`},children:[(0,U.jsxs)(`p`,{style:{marginBottom:12},children:[`No provider secrets in the global store`,x?` matching “${x}”`:``,`.`]}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>void Ue(),children:`Scan / migrate import`})]}):(0,U.jsx)(`div`,{className:`card`,style:{flex:1,minHeight:0,overflowY:`auto`,padding:0,display:`flex`,flexDirection:`column`},children:Ke.map(e=>{let t=ee.has(e.id);return(0,U.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,U.jsxs)(`button`,{type:`button`,onClick:()=>Fe(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,U.jsxs)(`div`,{style:{minWidth:0},children:[(0,U.jsxs)(`div`,{style:{fontSize:13,fontWeight:700,color:e.kind===`error`?`#f87171`:`var(--text-primary)`},children:[t?`▾`:`▸`,` `,C===`api`&&(0,U.jsx)(zB,{provider:e.id}),` `,e.label]}),(0,U.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,U.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,U.jsx)(`div`,{style:{padding:`0 8px 8px`},children:e.keys.map(t=>(0,U.jsx)(WB,{k:t,selected:T?.key===t.key,onOpen:()=>ke(t,e.id)},`${e.id}::${t.key}`))})]},e.id)})}),T&&(0,U.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,U.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,U.jsxs)(`div`,{style:{minWidth:0},children:[(0,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.06em`},children:`Edit secret`}),(0,U.jsx)(`strong`,{style:{fontFamily:`ui-monospace, monospace`,fontSize:13,wordBreak:`break-all`,display:`block`,marginTop:2},children:T.key}),(0,U.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,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>E(null),children:`✕`})]}),(0,U.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,padding:16},children:[(0,U.jsxs)(qB,{title:`Reveal value (passkey)`,hint:`Full secret values require step-up auth — passkey preferred, password fallback`,children:[(0,U.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:8},children:[`Passkeys: `,R?.count??0,!Ri()&&` · browser unsupported`]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,marginBottom:10},children:[(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:le||!Ri(),onClick:()=>void Ae(),children:R?.has_passkeys?`Add another passkey`:`Register passkey (Touch ID)`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:le||!R?.has_passkeys,onClick:()=>void Ne(`passkey`),children:`Reveal with passkey`}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,U.jsx)(`input`,{type:`password`,value:z,onChange:e=>ce(e.target.value),placeholder:`Or re-enter dashboard password`,style:{...YB,flex:1,marginTop:0},onKeyDown:e=>{e.key===`Enter`&&Ne(`password`)}}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:le||!z,onClick:()=>void Ne(`password`),children:`Reveal`})]})]}),oe!=null&&(0,U.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,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginBottom:4},children:`PLAINTEXT (hides in 30s) — never paste into chat/vault`}),(0,U.jsx)(`code`,{style:{fontSize:11,wordBreak:`break-all`,display:`block`,color:`var(--text-primary)`},children:oe}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8,marginTop:8},children:[(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>void Pe(),children:`Copy`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>se(null),children:`Hide now`})]})]})]}),T.schema&&(0,U.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,U.jsx)(`div`,{style:{fontWeight:700,marginBottom:4},children:`Schema`}),(0,U.jsxs)(`div`,{children:[`auth: `,T.schema.auth]}),T.schema.header&&(0,U.jsx)(`div`,{style:{fontFamily:`monospace`},children:T.schema.header}),T.schema_notes&&(0,U.jsx)(`div`,{style:{marginTop:4,color:`var(--text-tertiary)`},children:T.schema_notes})]}),(0,U.jsxs)(qB,{title:`Identity`,children:[(0,U.jsx)(JB,{label:`Label`,value:D.label,onChange:e=>O({...D,label:e})}),(0,U.jsx)(JB,{label:`Provider`,value:D.provider,onChange:e=>O({...D,provider:e})})]}),(0,U.jsxs)(qB,{title:`Binding (one repo max)`,children:[(0,U.jsx)(JB,{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,U.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,U.jsx)(`div`,{style:{fontSize:11,color:`#f87171`,marginBottom:10},children:T.binding_error}),(0,U.jsx)(JB,{label:`Project path (optional)`,value:D.project_path,onChange:e=>O({...D,project_path:e})})]}),(0,U.jsxs)(qB,{title:`Subscription & cost`,hint:`Plan level + what you pay monthly for this key/provider`,children:[(0,U.jsx)(JB,{label:`Subscription level / tier`,value:D.subscription_tier,onChange:e=>O({...D,subscription_tier:e}),placeholder:`e.g. free, pro, team, enterprise, payg`}),(0,U.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4,marginBottom:10},children:(T.tiers?.length?T.tiers:KB).map(e=>(0,U.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,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:10,marginBottom:4},children:[(0,U.jsx)(JB,{label:`Monthly cost $`,value:D.monthly_cost_usd,onChange:e=>O({...D,monthly_cost_usd:e}),placeholder:`20`}),(0,U.jsx)(JB,{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,U.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,U.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,U.jsxs)(qB,{title:`Docs & rotation`,children:[(0,U.jsx)(JB,{label:`API docs URL`,value:D.api_docs_url,onChange:e=>O({...D,api_docs_url:e})}),(0,U.jsx)(JB,{label:`Rotate every (days)`,value:D.rotate_every_days,onChange:e=>O({...D,rotate_every_days:e})}),(0,U.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12,marginBottom:10},children:[(0,U.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,U.jsx)(JB,{label:`Notes`,value:D.notes,onChange:e=>O({...D,notes:e})})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,marginTop:8},children:[(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:j,onClick:()=>void ze(),children:`Save metadata`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void He(),children:`Record sample usage $0.01`})]}),(0,U.jsxs)(`div`,{style:{marginTop:16,borderTop:`1px solid var(--border)`,paddingTop:12},children:[(0,U.jsx)(`div`,{style:{fontSize:11,fontWeight:700,marginBottom:8},children:`Rotate value`}),(0,U.jsx)(`input`,{type:`password`,value:k,onChange:e=>A(e.target.value),placeholder:`New secret value`,style:YB}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,style:{marginTop:8,width:`100%`},disabled:!k||j,onClick:()=>void Be(),children:`Rotate + export .env`}),(0,U.jsxs)(`p`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:8},children:[`Browser assist CLI: `,(0,U.jsxs)(`code`,{children:[`npx total-recall secret rotate-browser `,T.key]})]}),T.next_rotate_due&&(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:8,marginTop:12},children:[T.console_url&&(0,U.jsx)(`a`,{href:T.console_url,target:`_blank`,rel:`noreferrer`,className:`btn btn-ghost btn-sm`,children:`Console`}),T.pricing_url&&(0,U.jsx)(`a`,{href:T.pricing_url,target:`_blank`,rel:`noreferrer`,className:`btn btn-ghost btn-sm`,children:`Pricing`}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{color:`#f87171`,marginLeft:`auto`},onClick:()=>void Ve(),children:`Delete`})]}),(0,U.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,U.jsxs)(`div`,{className:`card`,style:{padding:20},children:[(0,U.jsx)(`h3`,{style:{marginBottom:8},children:`One-time migrate (import-env)`}),(0,U.jsxs)(`p`,{style:{fontSize:12,color:`var(--text-secondary)`,marginBottom:12,lineHeight:1.45},children:[`Pull legacy keys from local `,(0,U.jsx)(`code`,{children:`.env`}),` files into the TR store. Steady-state path is the opposite:`,` `,(0,U.jsx)(`strong`,{children:`export-env`}),` writes projections out from the store.`]}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void Ue(),style:{marginBottom:12},children:`Re-scan`}),ye.length===0?(0,U.jsx)(`p`,{style:{color:`var(--text-tertiary)`,fontSize:13},children:`No candidates — click Re-scan or use onboarding paste.`}):(0,U.jsxs)(U.Fragment,{children:[ye.map(e=>(0,U.jsxs)(`label`,{style:{display:`flex`,gap:10,padding:`8px 0`,borderBottom:`1px solid var(--border)`,opacity:e.already_set?.5:1},children:[(0,U.jsx)(`input`,{type:`checkbox`,disabled:!!e.already_set,checked:xe.has(e.key),onChange:()=>{Se(t=>{let n=new Set(t);return n.has(e.key)?n.delete(e.key):n.add(e.key),n})}}),(0,U.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:12},children:e.key}),(0,U.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[e.masked,` · `,e.source_label]})]},e.key)),(0,U.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,style:{marginTop:14},onClick:()=>void We(),children:[`Import `,xe.size,` key(s)`]})]})]}),e===`pats`&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`p`,{style:{fontSize:13,color:`var(--text-secondary)`,marginBottom:16},children:[(0,U.jsx)(`strong`,{children:`Original Total Recall feature:`}),` issue Personal Access Tokens that authenticate to`,` `,(0,U.jsx)(`code`,{children:`this`}),` brain (`,(0,U.jsx)(`code`,{children:`Authorization: Bearer …`}),` on `,(0,U.jsx)(`code`,{children:`/api/*`}),`). These are`,` `,(0,U.jsx)(`em`,{children:`not`}),` OpenAI/Anthropic keys — they only unlock your TR API.`]}),(0,U.jsxs)(`div`,{className:`card`,style:{padding:16,marginBottom:16,display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,U.jsx)(`input`,{value:pe,onChange:e=>me(e.target.value),placeholder:`PAT name`,style:{...YB,flex:1,minWidth:160}}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:!pe.trim(),onClick:async()=>{try{ge(await wr(pe.trim(),[`*`])),me(``),await we()}catch(e){b(e.message)}},children:`Issue PAT`})]}),he&&(0,U.jsxs)(`div`,{className:`card`,style:{padding:16,marginBottom:16,borderColor:`rgba(52,211,153,0.4)`},children:[(0,U.jsx)(`strong`,{children:`Copy now — shown once`}),(0,U.jsx)(`div`,{style:{fontFamily:`monospace`,fontSize:12,marginTop:8,wordBreak:`break-all`},children:he.token}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,style:{marginTop:8},onClick:()=>{navigator.clipboard.writeText(he.token),ve(!0),setTimeout(()=>ve(!1),2e3)},children:_e?`Copied`:`Copy`})]}),de.filter(e=>!e.revoked).map(e=>(0,U.jsxs)(`div`,{className:`card`,style:{padding:12,marginBottom:8,display:`flex`,justifyContent:`space-between`},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontWeight:600},children:e.name}),(0,U.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[e.token_preview,`… · `,e.scopes?.join(`, `)]})]}),(0,U.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{color:`#f87171`},onClick:()=>void Tr(e.id).then(we),children:`Revoke`})]},e.id))]}),e===`cloud`&&(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,U.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:8},children:(0,U.jsx)(`button`,{onClick:Oe,disabled:j,className:`btn btn-primary`,style:{minWidth:120},children:j?`Saving...`:`Save Configuration`})}),f&&(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid var(--border)`,paddingBottom:12},children:[(0,U.jsx)(`span`,{style:{fontSize:20},children:`🔑`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{fontSize:14,fontWeight:600},children:`Cloud & Search APIs`}),(0,U.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Bring your own cloud models`})]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.05)`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,U.jsx)(`label`,{htmlFor:`google_api_key`,style:{fontSize:13,fontWeight:500},children:`Google Gemini API Key`}),(0,U.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,U.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`gemini`,onChange:()=>De(`preferred_agent`,`gemini`)}),`Set Active`]})]}),(0,U.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,U.jsx)(`input`,{id:`google_api_key`,type:`password`,placeholder:`AIzaSy...`,value:n?.secrets?.google_api_key||``,onChange:e=>Ee(`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,U.jsxs)(`select`,{disabled:!n?.secrets?.google_api_key,value:n?.brain?.gemini_model||``,onChange:e=>De(`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,U.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,U.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})]}),!n?.secrets?.google_api_key&&(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-error, #f44336)`,marginTop:8},children:`⚠ API Key required to unlock model selection`})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.05)`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,U.jsx)(`label`,{htmlFor:`anthropic_api_key`,style:{fontSize:13,fontWeight:500},children:`Anthropic API Key (Claude)`}),(0,U.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,U.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`claude`,onChange:()=>De(`preferred_agent`,`claude`)}),`Set Active`]})]}),(0,U.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,U.jsx)(`input`,{id:`anthropic_api_key`,type:`password`,placeholder:`sk-ant-...`,value:n?.secrets?.anthropic_api_key||``,onChange:e=>Ee(`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,U.jsxs)(`select`,{disabled:!n?.secrets?.anthropic_api_key,value:n?.brain?.claude_model||``,onChange:e=>De(`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,U.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,U.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})]}),!n?.secrets?.anthropic_api_key&&(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-error, #f44336)`,marginTop:8},children:`⚠ API Key required to unlock model selection`})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:16,borderBottom:`1px solid rgba(255,255,255,0.05)`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,U.jsx)(`label`,{htmlFor:`openai_api_key`,style:{fontSize:13,fontWeight:500},children:`OpenAI API Key (Codex)`}),(0,U.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,U.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`codex`,onChange:()=>De(`preferred_agent`,`codex`)}),`Set Active`]})]}),(0,U.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,U.jsx)(`input`,{id:`openai_api_key`,type:`password`,placeholder:`sk-proj-...`,value:n?.secrets?.openai_api_key||``,onChange:e=>Ee(`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,U.jsxs)(`select`,{disabled:!n?.secrets?.openai_api_key,value:n?.brain?.openai_model||``,onChange:e=>De(`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,U.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,U.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})]}),!n?.secrets?.openai_api_key&&(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-error, #f44336)`,marginTop:8},children:`⚠ API Key required to unlock model selection`})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingBottom:8},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,U.jsx)(`label`,{htmlFor:`openrouter_api_key`,style:{fontSize:13,fontWeight:500},children:`OpenRouter API Key`}),(0,U.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,U.jsx)(`input`,{type:`radio`,name:`preferred_agent`,checked:n?.brain?.preferred_agent===`openrouter`,onChange:()=>De(`preferred_agent`,`openrouter`)}),`Set Active`]})]}),(0,U.jsx)(`form`,{onSubmit:e=>e.preventDefault(),style:{display:`inline`,margin:0,padding:0,width:`100%`},children:(0,U.jsx)(`input`,{id:`openrouter_api_key`,type:`password`,placeholder:`sk-or-...`,value:n?.secrets?.openrouter_api_key||``,onChange:e=>Ee(`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,U.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,U.jsx)(`div`,{style:{fontSize:11,color:`var(--accent-red)`,padding:`0 4px`},children:`Failed to fetch OpenRouter models.`}),!g&&u.length>0&&(0,U.jsxs)(`select`,{id:`openrouter_model`,value:n?.brain?.openrouter_model||``,onChange:e=>De(`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,U.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,U.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,U.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`)`,t]},e.id)})},t))})()]})]}),(0,U.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,U.jsxs)(`p`,{style:{marginTop:24,fontSize:11,color:`var(--text-tertiary)`},children:[`CLI: `,(0,U.jsx)(`code`,{children:`secret catalog`}),` · `,(0,U.jsx)(`code`,{children:`secret meta KEY --repo app --tier pro --monthly-cost 25 --rotate-days 90`}),` ·`,` `,(0,U.jsx)(`code`,{children:`secret rotation-due`}),` · `,(0,U.jsx)(`code`,{children:`secret usage`}),` · `,(0,U.jsx)(`code`,{children:`secret providers`})]})]})}var VB=`__developer__`,HB=`__multi_repo_error__`;function UB(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:HB,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:VB,label:`Developer secrets`,keys:n.slice().sort((e,t)=>e.key.localeCompare(t.key)),kind:`developer`}),i}function WB({k:e,selected:t,onOpen:n}){return(0,U.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,U.jsxs)(`div`,{style:{minWidth:0},children:[(0,U.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,U.jsx)(`span`,{style:{marginLeft:6,fontSize:9,color:`#f87171`},children:`MULTI`}),e.rotation_overdue&&(0,U.jsx)(`span`,{style:{marginLeft:6,fontSize:9,color:`#f87171`},children:`DUE`})]}),(0,U.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,U.jsxs)(`div`,{style:{fontSize:10,color:`var(--text-secondary)`,minWidth:0},children:[(0,U.jsx)(`span`,{style:{color:e.subscription_tier?`#fbbf24`:`var(--text-tertiary)`},children:e.subscription_tier||`no tier`}),` · `,(0,U.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,U.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,flexShrink:0},children:`›`})]})}function GB({label:e,value:t,accent:n}){return(0,U.jsxs)(`div`,{className:`card`,style:{padding:`14px 16px`,borderLeft:`3px solid ${n}`},children:[(0,U.jsx)(`div`,{style:{fontSize:20,fontWeight:700,letterSpacing:`-0.02em`},children:t}),(0,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.06em`,marginTop:2},children:e})]})}var KB=[{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 qB({title:e,hint:t,children:n}){return(0,U.jsxs)(`div`,{style:{marginBottom:14,paddingBottom:12,borderBottom:`1px solid var(--border)`},children:[(0,U.jsx)(`div`,{style:{fontSize:11,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`,color:`var(--text-secondary)`,marginBottom:4},children:e}),t&&(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:8,lineHeight:1.4},children:t}),n]})}function JB({label:e,value:t,onChange:n,placeholder:r}){return(0,U.jsxs)(`label`,{style:{display:`block`,marginBottom:10},children:[(0,U.jsx)(`span`,{style:{fontSize:10,fontWeight:600,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:e}),(0,U.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),placeholder:r,style:{...YB,marginTop:4}})]})}var YB={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},XB=[{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 ZB(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(null),f=(0,v.useMemo)(()=>{let e=Un();return e?e.replace(/\/$/,``):window.location.origin},[]);(0,v.useEffect)(()=>{let e=!0;return Cr().then(t=>{e&&s(t.keys||[])}).catch(t=>{e&&a({type:`error`,text:`Failed to list API keys: ${t.message||`Unknown error`}`})}),Wr().then(t=>{e&&t.success&&Array.isArray(t.active)&&l(t.active)}).catch(t=>{e&&a({type:`error`,text:`Failed to fetch active integrations: ${t.message||`Unknown error`}`})}),ui().then(t=>{e&&d(t)}).catch(t=>{e&&a({type:`error`,text:`Failed to fetch extension status: ${t.message||`Unknown error`}`})}),()=>{e=!1}},[]);let p=(0,v.useMemo)(()=>c.length===0?XB:XB.filter(e=>[`http-api`,`generic`].includes(e.id)?!0:c.includes(e.id)),[c]),m=async(e,n)=>{await navigator.clipboard.writeText(n),t(e),setTimeout(()=>t(null),1800)},h=async e=>{r(e),a(null);try{let t=await Ur(e,f);t.success?(a({type:`success`,text:`Successfully connected ${e}! All config files have been automatically updated.`}),s((await Cr()).keys||[])):a({type:`error`,text:`Failed to connect: ${t.message}`})}catch(e){a({type:`error`,text:e.message||`Failed to connect.`})}finally{r(null)}};return(0,U.jsxs)(`div`,{className:`page`,children:[(0,U.jsxs)(`div`,{className:`page-header`,children:[(0,U.jsx)(`h1`,{children:`Integrations`}),(0,U.jsx)(`p`,{children:`Connect IDEs, UltraChat, and scripts to this Total Recall brain`})]}),i&&(0,U.jsxs)(`div`,{style:{padding:`12px 16px`,borderRadius:8,marginBottom:16,fontSize:14,fontWeight:500,background:i.type===`success`?`rgba(16, 185, 129, 0.15)`:`rgba(239, 68, 68, 0.15)`,border:i.type===`success`?`1px solid rgba(16, 185, 129, 0.3)`:`1px solid rgba(239, 68, 68, 0.3)`,color:i.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,U.jsx)(`span`,{children:i.text}),(0,U.jsx)(`button`,{onClick:()=>a(null),style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`,fontSize:18,padding:`0 4px`,lineHeight:`1`},children:`×`})]}),(0,U.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,U.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,U.jsx)(`br`,{}),(0,U.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,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{color:`var(--text-tertiary)`,marginBottom:4},children:`Discovery`}),(0,U.jsxs)(`code`,{children:[f,`/.well-known/total-recall.json`]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{color:`var(--text-tertiary)`,marginBottom:4},children:`Chat API`}),(0,U.jsxs)(`code`,{children:[f,`/v1/chat/completions`]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{color:`var(--text-tertiary)`,marginBottom:4},children:`Model`}),(0,U.jsx)(`code`,{children:`total-recall/gemma4`})]})]}),(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(300px, 1fr))`,gap:16},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{margin:`0 0 4px`},children:`Chrome Extension`}),(0,U.jsx)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:12},children:`Browser Overlay Panel & Capture`})]}),u?u.connected?(0,U.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,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#10b981`,boxShadow:`0 0 8px #10b981`}}),`Connected`]}):(0,U.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,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#f59e0b`}}),`Not Connected`]}):(0,U.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,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#94a3b8`}}),`Checking...`]})]}),(0,U.jsxs)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`},children:[`Scopes utilized: `,(0,U.jsx)(`code`,{children:`chat:write, memory:read, memory:write`})]}),(0,U.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,U.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,U.jsx)(`div`,{style:{display:`flex`,gap:10,marginTop:`auto`,paddingTop:8},children:(0,U.jsx)(`a`,{href:`${f}/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`})})]}),p.map(t=>{let r=t.snippet(f),i=o.find(e=>{let n=e?.name,r=typeof n==`string`?n:n&&typeof n==`object`&&typeof n.name==`string`?String(n.name):``;if(!r||e.revoked)return!1;let i=r.toLowerCase();return t.id===`cursor`?i.includes(`cursor`):t.id===`claude-code`?i.includes(`claude`):t.id===`codex`?i.includes(`codex`)||i.includes(`agents`):t.id===`antigravity`?i.includes(`antigravity`):t.id===`grok`?i.includes(`grok`)||i.includes(`xai`):t.id===`http-api`?i.includes(`http`)||i.includes(`host`):!1}),a=(0,U.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,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#94a3b8`}}),`Not Connected`]});if(i)if(i.hit_count>0||t.id===`antigravity`){let e=i.last_used_at?` (Active ${new Date(i.last_used_at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})`:t.id===`antigravity`?` (Active Now)`:``;a=(0,U.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,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#10b981`,boxShadow:`0 0 8px #10b981`}}),`Connected`,e]})}else a=(0,U.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,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:`#f59e0b`}}),`Registered (Pending Activity)`]});return(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:12},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{style:{margin:`0 0 4px`},children:t.name}),(0,U.jsx)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:12},children:t.surface})]}),a]}),(0,U.jsxs)(`div`,{style:{fontSize:12,color:`var(--text-secondary)`},children:[`Recommended scopes: `,(0,U.jsx)(`code`,{children:t.scopes})]}),(0,U.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:t.command}),(0,U.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:r}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:4},children:[(0,U.jsx)(`button`,{className:`btn btn-sm btn-primary`,onClick:()=>h(t.id),disabled:n!==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:n===t.id?`Connecting...`:`Connect`}),(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>m(t.id,`${t.command}\n\n${r}`),style:{background:`rgba(255, 255, 255, 0.05)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`,cursor:`pointer`},children:e===t.id?`Copied!`:`Copy Config`})]})]},t.id)})]})]})}function QB(e,t=!1){return t?`linear-gradient(135deg, #60a5fa, #34d399)`:e===`global`?`linear-gradient(135deg, #60a5fa, #2563eb)`:`linear-gradient(135deg, #34d399, #059669)`}function $B({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=Un();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,U.jsx)(`div`,{className:`brain-selector-trigger`,style:{opacity:.6},children:(0,U.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Brains…`})}):n.length===0?null:(0,U.jsxs)(`div`,{ref:c,className:`brain-selector`,style:{position:`relative`},children:[(0,U.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,U.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:QB(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,U.jsx)(`span`,{style:{flex:1,minWidth:0,fontSize:11,fontWeight:600,letterSpacing:`-0.01em`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:m}),(0,U.jsx)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`,flexShrink:0},children:p}),(0,U.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,U.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),i&&(0,U.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,U.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,U.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,U.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,U.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:QB(e.layer),flexShrink:0}}),(0,U.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,U.jsx)(`div`,{style:{fontSize:11,fontWeight:600,color:`var(--text-primary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name}),(0,U.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,U.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 eV(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 tV(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 nV(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(e){let t=[];return e.forEach(e=>{let n=(e.subSkills||[]).map(e=>e.toLowerCase());n.includes(`evals`)||t.push({skillName:e.name,type:`eval_gap`,description:`Add evals directory with assertion tests for "${e.name}"`}),n.includes(`references`)||t.push({skillName:e.name,type:`missing_reference`,description:`Add reference documentation for "${e.name}"`}),n.includes(`scripts`)||t.push({skillName:e.name,type:`stale_script`,description:`Add automation scripts for "${e.name}"`})}),t.slice(0,15)}function iV(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(new Set),[u,d]=(0,v.useState)(`active`),[,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)([]),[M,N]=(0,v.useState)(!1),[P,ee]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),te=(0,v.useMemo)(()=>i&&o?eV(o):`0.0.0`,[i,o]),ne=(0,v.useMemo)(()=>i&&o?tV(o):[],[i,o]),re=(0,v.useMemo)(()=>i&&o?nV(i,o):[],[i,o]),[ie,L]=(0,v.useState)({}),[R,ae]=(0,v.useState)({}),[oe,se]=(0,v.useState)(null),[z,ce]=(0,v.useState)(!1),[le,ue]=(0,v.useState)(null),[de,fe]=(0,v.useState)([]),[pe,me]=(0,v.useState)(!1),[he,ge]=(0,v.useState)(!1),_e=(0,v.useMemo)(()=>e.length>0?rV(e):[],[e]),ve=async(e,n)=>{f(!0),y(null);try{let i=await fr(),o=[],c=[];if(Array.isArray(i)){o=i;let e=new Map;for(let t of o){let n=t.repo||`unknown`;e.has(n)||e.set(n,[]),e.get(n).push(t)}c=[...e.entries()].map(([e,t])=>({repo:e,path:t[0]?.project_path||null,skills:t,count:t.length,ok:!0}))}else o=i.skills||[],c=i.repos||[];let u=localStorage.getItem(`total-recall-active-brain`);u&&(c=c.filter(e=>e.repo===`Global`||e.repo===u),o=c.flatMap(e=>e.skills||[])),t(o),r(c);let d=c.filter(e=>(e.skills?.length||0)>0).map(e=>e.repo);if(l(new Set(d.slice(0,6))),o.length>0){let t=e?o.find(t=>t.name===e&&(!n||t.repo===n)):o[0];t&&(a(t),s((await pr(t.name,t.repo)).content||``))}else a(null),s(``)}catch(e){y(e.message||`Failed to fetch skills by repo.`)}finally{f(!1)}};(0,v.useEffect)(()=>{ve()},[]);let ye=async e=>{a(e),f(!0),y(null),x(null),se(null),L({});try{s((await pr(e.name,e.repo)).content||``)}catch(t){y(t.message||`Failed to fetch rules for skill "${e.name}".`)}finally{f(!1)}},be=async()=>{if(i){m(!0),y(null),x(null);try{await hr(i.name,o,i.repo),x(`Skill "${i.name}"${i.repo?` (${i.repo})`:``} saved successfully!`),setTimeout(()=>x(null),5e3)}catch(e){y(e.message||`Failed to save skill changes.`)}finally{m(!1)}}},xe=async()=>{g(!0),y(null),x(null);try{x((await Xr()).message||`Brain surfaces and shims recompiled successfully!`),setTimeout(()=>x(null),5e3)}catch(e){y(e.message||`Recompilation failed.`)}finally{g(!1)}},Se=async e=>{if(window.confirm(`Delete skill "${e.name}"${e.repo?` from ${e.repo}`:``} permanently?`)){y(null),x(null);try{await gr(e.name,e.repo),x(`Skill "${e.name}" successfully deleted.`),setTimeout(()=>x(null),5e3),ve()}catch(e){y(e.message||`Failed to delete skill.`)}}},Ce=async e=>{if(e.preventDefault(),!w.trim())return;y(null),x(null);let t=i?.repo||n.find(e=>e.ok&&e.path)?.repo||``;if(!t){y(`No project repo available to create a skill in. Register a project first.`);return}let r=w.toLowerCase().replace(/[^a-z0-9-]/g,`-`);if(r.startsWith(`tr-`)||r===`total-recall`){y(`Cannot create Total Recall system skills here.`);return}let a=`---
300
+ type: skill
301
+ name: ${r}
302
+ description: "${E.trim()||`Custom system skill capability`}"
303
+ ---
304
+
305
+ # ${r.charAt(0).toUpperCase()+r.slice(1)} — custom system skill
306
+
307
+ Configure triggers, options, and prompts inside this rules sheet to hot-recompile IDE capabilities.
308
+ `;try{await hr(r,a,t),T(``),D(``),C(!1),x(`Skill "${r}" successfully created!`),setTimeout(()=>x(null),5e3),ve(r)}catch(e){y(e.message||`Failed to create new skill.`)}},we=async e=>{if(e.preventDefault(),O.trim()){N(!0),y(null),I(null);try{j(await _r(O.trim())||[])}catch(e){y(e.message||`Registry query failed. Is the server connected?`)}finally{N(!1)}}},Te=async e=>{ee(e),y(null),x(null),I(null);try{let t=await vr(e);t.success?(x(`✓ Skill "${t.skillName||e}" successfully installed, security audited, and compiled!`),setTimeout(()=>x(null),7e3),ve(t.skillName)):t.reason&&t.reason.includes(`quarantined`)?I({pkg:e,reason:t.reason||`Static security audit scanned critical dynamic string evaluations or commands injection vectors.`}):y(`❌ Installation failed: ${t.reason||`Unknown error`}`)}catch(e){y(e.message||`Dynamic installation handler failed.`)}finally{ee(null)}},Ee=async e=>{if(L(t=>({...t,[e]:!t[e]})),!R[e]&&i)try{let t=await mr(i.name,e,i.repo);ae(n=>({...n,[e]:t}))}catch(t){console.error(`Failed to fetch skill files`,t),y(t.message||`Failed to fetch skill files.`),ae(t=>({...t,[e]:[]}))}},De=async()=>{ce(!0),ue(null);try{let e=await lr(`node .agent/skills/tr-skill/scripts/enforce-skill-optimization.mjs`,15e3);ue(e.output),e.success&&(x(`Enforcement scan completed.`),setTimeout(()=>x(null),5e3))}catch(e){ue(e.message)}finally{ce(!1)}},Oe=(0,v.useCallback)(async()=>{me(!0);try{fe((await Gr()).items||[])}catch(e){y(e.message||`Failed to fetch research items.`)}finally{me(!1)}},[]);(0,v.useEffect)(()=>{u===`automation`&&Oe()},[u,Oe]);let ke=async()=>{ge(!0),await new Promise(e=>setTimeout(e,1500)),ge(!1),x(`All skills are up to date.`),setTimeout(()=>x(null),5e3)},Ae=async()=>{y(null);try{await Kr(`Skill reference material update cycle`,`medium`,`Auto-triggered by Skills Manager to refresh outdated skill references and evals`),x(`Research cycle queued successfully.`),setTimeout(()=>x(null),5e3),Oe()}catch(e){y(e.message||`Failed to queue research cycle.`)}},je=[{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:`⚡`}],Me=e=>e.id||`${e.repo||`_`}::${e.name}`,Ne=e=>i?.name===e.name&&(i?.repo||``)===(e.repo||``),Pe=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Fe=e=>(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,flex:1,overflowY:`auto`},children:[n.length===0&&(0,U.jsx)(`p`,{style:{fontSize:12,color:`var(--text-tertiary)`,padding:8},children:`No project repos with skills found.`}),n.map(t=>{let n=c.has(t.repo),r=t.skills?.length||0;return(0,U.jsxs)(`div`,{style:{borderBottom:`1px solid var(--border)`},children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>Pe(t.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,U.jsxs)(`span`,{style:{fontSize:12,fontWeight:700},children:[n?`▾`:`▸`,` `,t.repo]}),(0,U.jsx)(`span`,{style:{fontSize:10,fontWeight:600,padding:`2px 8px`,borderRadius:99,background:r?`rgba(59,130,246,0.15)`:`rgba(148,163,184,0.1)`,color:r?`#93c5fd`:`var(--text-tertiary)`},children:r})]}),n&&(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,padding:`0 4px 10px`},children:r===0?(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,padding:`4px 8px`},children:t.error||`No app skills (TR skills hidden)`}):t.skills.map(t=>{let n=Ne(t);return(0,U.jsxs)(`div`,{id:`${e}-skill-${t.repo}-${t.name}`,onClick:()=>void ye(t),style:{background:n?`var(--accent-muted)`:`var(--bg-tertiary)`,border:n?`1px solid var(--accent)`:`1px solid var(--border)`,padding:`10px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.15s ease`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:n?600:500,color:n?`var(--accent)`:`var(--text-primary)`},children:t.name}),(0,U.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Se(t)},style:{background:`none`,border:`none`,color:`var(--text-tertiary)`,fontSize:12,cursor:`pointer`,padding:`2px 6px`},title:`Delete skill`,children:`✖`})]}),t.source&&(0,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:4},children:t.source}),t.subSkills&&t.subSkills.length>0&&(0,U.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4,marginTop:6},children:t.subSkills.slice(0,6).map(e=>(0,U.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))})]},Me(t))})})]},t.repo)})]});return(0,U.jsxs)(`div`,{className:`page`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,U.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:16},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{children:`Skills Manager`}),(0,U.jsx)(`p`,{children:`Track, edit, and deploy agent skills across any repo — registry-based, no hardcoded hosts`})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,U.jsx)(`button`,{className:`btn btn-sm btn-ghost`,onClick:()=>C(!S),style:{border:`1px solid var(--border)`,background:`var(--bg-secondary)`},children:S?`✖ Cancel`:`➕ Create Custom Skill`}),(0,U.jsx)(`button`,{className:`btn btn-sm`,onClick:xe,disabled:h,style:{background:h?`var(--bg-secondary)`:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,border:`none`,fontWeight:500},children:h?`⏳ Compiling shims...`:`🔄 Hot-Recompile Shims`})]})]}),_&&(0,U.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:[`⚠️ `,_]}),b&&(0,U.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:[`✓ `,b]}),F&&(0,U.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,U.jsx)(`div`,{style:{fontWeight:700,fontSize:13},children:`🚨 SECURITY QUARANTINE PURGE ACTIVE!`}),(0,U.jsxs)(`div`,{style:{fontSize:12},children:[`Installation of package `,(0,U.jsx)(`strong`,{children:F.pkg}),` was blocked and files were hard purged.`]}),(0,U.jsxs)(`div`,{style:{fontSize:11,opacity:.85},children:[`Reason: `,F.reason]})]}),S&&(0,U.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,U.jsx)(`h3`,{style:{fontSize:14,fontWeight:600,borderBottom:`1px solid var(--border)`,paddingBottom:10,marginBottom:14},children:`➕ Create New Skill`}),(0,U.jsxs)(`form`,{onSubmit:Ce,style:{display:`flex`,gap:16,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,U.jsxs)(`div`,{style:{flex:`1 1 200px`,display:`flex`,flexDirection:`column`,gap:6},children:[(0,U.jsx)(`label`,{htmlFor:`new_name`,style:{fontSize:11,fontWeight:500,color:`var(--text-secondary)`},children:`Skill Name (kebab-case)`}),(0,U.jsx)(`input`,{id:`new_name`,type:`text`,placeholder:`e.g. security-audit`,value:w,onChange:e=>T(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,U.jsxs)(`div`,{style:{flex:`2 1 300px`,display:`flex`,flexDirection:`column`,gap:6},children:[(0,U.jsx)(`label`,{htmlFor:`new_desc`,style:{fontSize:11,fontWeight:500,color:`var(--text-secondary)`},children:`Brief Description / System Triggers`}),(0,U.jsx)(`input`,{id:`new_desc`,type:`text`,placeholder:`e.g. Audits security parameters, encryption costs, and Caddy forward gates`,value:E,onChange:e=>D(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,U.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,U.jsx)(`div`,{style:{display:`flex`,gap:6,marginBottom:20,borderBottom:`1px solid var(--border)`,paddingBottom:10,flexWrap:`wrap`},children:je.map(e=>(0,U.jsxs)(`button`,{id:`tab-${e.id}`,onClick:()=>d(e.id),style:{padding:`8px 14px`,borderRadius:8,border:`none`,background:u===e.id?`var(--accent)`:`var(--bg-tertiary)`,color:u===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))}),u===`active`?(0,U.jsxs)(`div`,{style:{display:`flex`,flex:1,gap:24,minHeight:0,overflow:`hidden`,paddingBottom:16},children:[(0,U.jsx)(`div`,{style:{width:300,display:`flex`,flexDirection:`column`,gap:16,flexShrink:0,overflowY:`auto`},children:(0,U.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,U.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,U.jsxs)(`p`,{style:{fontSize:10,color:`var(--text-tertiary)`,margin:`0 0 10px`,lineHeight:1.4},children:[`Project skills only · total-recall / tr-* hidden · `,e.length,` skill`,e.length===1?``:`s`]}),Fe(`active`)]})}),(0,U.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:i?(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,borderBottom:`1px solid var(--border)`,paddingBottom:12,marginBottom:16,flexShrink:0},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h3`,{style:{fontSize:16,fontWeight:600,color:`var(--text-primary)`},children:[`📝 Editing Capability rules: `,i.name,`/SKILL.md`]}),(0,U.jsx)(`p`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:`Hot-recompiled rules preserve immutable instructions and custom shims`})]}),(0,U.jsx)(`button`,{className:`btn btn-primary`,onClick:be,disabled:p,style:{background:`linear-gradient(135deg, var(--accent), var(--accent-hover))`,color:`#fff`,fontWeight:500,borderRadius:6,padding:`8px 18px`,fontSize:12},children:p?`⏳ Saving...`:`💾 Save rules`})]}),(0,U.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:(0,U.jsx)(`textarea`,{value:o,onChange:e=>s(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,U.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.`})})]}):u===`registry`?(0,U.jsxs)(`div`,{style:{display:`flex`,flex:1,flexDirection:`column`,minHeight:0,overflowY:`auto`,paddingBottom:16},children:[(0,U.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,marginBottom:20},children:[(0,U.jsx)(`h3`,{style:{fontSize:15,fontWeight:600,color:`var(--text-primary)`,marginBottom:8},children:`🔍 Discover AI Agent Skills from skills.sh`}),(0,U.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,U.jsxs)(`form`,{onSubmit:we,style:{display:`flex`,gap:12},children:[(0,U.jsx)(`input`,{type:`text`,placeholder:`Search skills (e.g. git, typescript, prd...)`,value:O,onChange:e=>k(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,U.jsx)(`button`,{type:`submit`,disabled:M,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:M?`⏳ Sifting...`:`🔎 Query Registry`})]})]}),(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:M?(0,U.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:40,color:`var(--text-secondary)`},children:[(0,U.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,U.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,U.jsx)(`span`,{children:`Searching packages in registry catalog...`})]}):A.length>0?(0,U.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(320px, 1fr))`,gap:16},children:A.map(e=>{let t=P===e.name;return(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,flexWrap:`wrap`,gap:8,marginBottom:8},children:[(0,U.jsx)(`span`,{style:{fontWeight:700,fontSize:14,color:`#fff`,wordBreak:`break-all`},children:e.name}),(0,U.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,U.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,U.jsx)(`button`,{onClick:()=>void Te(e.name),disabled:!!P,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:P?`not-allowed`:`pointer`,transition:`all 0.15s ease`},children:t?`🛡️ Auditing & Installing...`:`➕ Install Capability`})]},e.name)})}):O.trim()?(0,U.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,U.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.`})})]}):u===`lifecycle`?(0,U.jsxs)(`div`,{style:{display:`flex`,flex:1,gap:24,minHeight:0,overflow:`hidden`,paddingBottom:16},children:[(0,U.jsx)(`div`,{style:{width:280,display:`flex`,flexDirection:`column`,gap:16,flexShrink:0,overflowY:`auto`},children:(0,U.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,U.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`}),Fe(`lifecycle`)]})}),(0,U.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:20,overflowY:`auto`,minHeight:0},children:i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,flexWrap:`wrap`},children:[(0,U.jsxs)(`h3`,{id:`lifecycle-version-title`,style:{fontSize:16,fontWeight:600,color:`var(--text-primary)`,margin:0},children:[i.name,i.repo?(0,U.jsxs)(`span`,{style:{fontSize:12,fontWeight:500,color:`var(--text-tertiary)`,marginLeft:8},children:[`· `,i.repo]}):null]}),(0,U.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,U.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:[`Modified: `,new Date(i.modified).toLocaleDateString()]})]})}),(0,U.jsxs)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,U.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,U.jsxs)(`div`,{style:{position:`relative`,paddingLeft:28},children:[(0,U.jsx)(`div`,{style:{position:`absolute`,left:5,top:6,bottom:6,width:2,background:`var(--border)`}}),ne.map((e,t)=>(0,U.jsxs)(`div`,{style:{marginBottom:20,position:`relative`},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`baseline`,marginBottom:6},children:[(0,U.jsxs)(`span`,{style:{fontSize:13,fontWeight:700,color:t===0?`var(--accent)`:`var(--text-primary)`},children:[`v`,e.version]}),e.date&&(0,U.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`},children:e.date})]}),(0,U.jsx)(`ul`,{style:{margin:0,paddingLeft:16,listStyle:`disc`},children:e.changes.map((e,t)=>(0,U.jsx)(`li`,{style:{fontSize:12,color:`var(--text-secondary)`,lineHeight:1.7},children:e},t))})]},`${e.version}-${t}`))]}):(0,U.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,U.jsx)(`code`,{children:`## v1.0.0 — 2025-01-01`}),` sections to enable version tracking.`]})]}),(0,U.jsxs)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:8},children:[(0,U.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,U.jsx)(`button`,{id:`lifecycle-run-enforcement-btn`,onClick:()=>void De(),disabled:z,style:{background:z?`var(--bg-tertiary)`:`linear-gradient(135deg, #f59e0b, #d97706)`,color:`#fff`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:z?`not-allowed`:`pointer`},children:z?`⏳ Running...`:`🛡️ Run Enforcement`})]}),(0,U.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(260px, 1fr))`,gap:10},children:re.map((e,t)=>(0,U.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,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.label}),(0,U.jsx)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`},children:e.detail})]})]},t))}),le&&(0,U.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:le})]}),(0,U.jsxs)(`div`,{className:`card`,style:{padding:20,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:16,flexWrap:`wrap`},children:[(0,U.jsx)(`div`,{style:{flex:`1 1 300px`,display:`flex`,flexDirection:`column`,gap:8},children:[`scripts`,`references`,`evals`,`subagents`].map(e=>{let t=(i.subSkills||[]).map(e=>e.toLowerCase()).includes(e),n=ie[e];return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`button`,{id:`lifecycle-subdir-${e}`,onClick:()=>Ee(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,U.jsxs)(`span`,{children:[n?`▼`:`▶`,` `,e,`/`]}),(0,U.jsx)(`span`,{style:{width:8,height:8,borderRadius:`50%`,background:t?`#10b981`:`#ef4444`}})]}),n&&R[e]&&(0,U.jsx)(`div`,{style:{paddingLeft:20,paddingTop:6,display:`flex`,flexDirection:`column`,gap:4},children:R[e].length>0?R[e].map(t=>(0,U.jsxs)(`div`,{onClick:()=>se({name:`${e}/${t.name}`,content:`// Contents of ${i.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,U.jsxs)(`span`,{children:[`📄 `,t.name]}),(0,U.jsx)(`span`,{style:{color:`var(--text-tertiary)`},children:t.size})]},t.name)):(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,padding:`4px 10px`},children:`Empty directory`})})]},e)})}),oe&&(0,U.jsx)(`div`,{style:{flex:`1 1 300px`},children:(0,U.jsxs)(`div`,{style:{background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:8,overflow:`hidden`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 14px`,background:`var(--bg-tertiary)`,borderBottom:`1px solid var(--border)`},children:[(0,U.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:oe.name}),(0,U.jsx)(`button`,{id:`lifecycle-close-preview-btn`,onClick:()=>se(null),style:{background:`none`,border:`none`,color:`var(--text-tertiary)`,cursor:`pointer`,fontSize:14},children:`✖`})]}),(0,U.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:oe.content})]})})]})]})]}):(0,U.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.`})})]}):u===`network`?(0,U.jsxs)(`div`,{style:{display:`flex`,flex:1,flexDirection:`column`,minHeight:0,overflowY:`auto`,paddingBottom:16},children:[(0,U.jsx)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`,marginBottom:20},children:(0,U.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,U.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,U.jsx)(`div`,{style:{fontSize:22,marginBottom:4},children:e.icon}),(0,U.jsx)(`div`,{style:{fontSize:20,fontWeight:700,color:`var(--text-primary)`},children:e.value}),(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:2},children:e.label})]},e.label))})}),(0,U.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,U.jsxs)(`div`,{style:{padding:40,filter:`blur(3px)`,opacity:.35,pointerEvents:`none`,userSelect:`none`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,gap:24,alignItems:`center`,marginBottom:30,flexWrap:`wrap`},children:[(0,U.jsxs)(`div`,{style:{padding:`20px 30px`,background:`var(--bg-tertiary)`,borderRadius:12,border:`2px solid var(--accent)`,textAlign:`center`},children:[(0,U.jsx)(`div`,{style:{fontSize:28},children:`📂`}),(0,U.jsx)(`div`,{style:{fontSize:13,fontWeight:700,marginTop:6,color:`var(--text-primary)`},children:`Local Skills`})]}),(0,U.jsx)(`div`,{style:{fontSize:28,color:`var(--accent)`},children:`⇄`}),(0,U.jsxs)(`div`,{style:{padding:`20px 30px`,background:`var(--bg-tertiary)`,borderRadius:12,border:`2px solid var(--accent)`,textAlign:`center`},children:[(0,U.jsx)(`div`,{style:{fontSize:28},children:`🌐`}),(0,U.jsx)(`div`,{style:{fontSize:13,fontWeight:700,marginTop:6,color:`var(--text-primary)`},children:`P2P Network`})]}),(0,U.jsx)(`div`,{style:{fontSize:28,color:`var(--accent)`},children:`⇄`}),(0,U.jsxs)(`div`,{style:{padding:`20px 30px`,background:`var(--bg-tertiary)`,borderRadius:12,border:`2px solid var(--accent)`,textAlign:`center`},children:[(0,U.jsx)(`div`,{style:{fontSize:28},children:`👥`}),(0,U.jsx)(`div`,{style:{fontSize:13,fontWeight:700,marginTop:6,color:`var(--text-primary)`},children:`Remote Peers`})]})]}),(0,U.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:16},children:[`Auto-discovery`,`Version Negotiation`,`Conflict Resolution`,`Security Quarantine`].map(e=>(0,U.jsx)(`div`,{style:{background:`var(--bg-tertiary)`,padding:16,borderRadius:8,border:`1px solid var(--border)`},children:(0,U.jsx)(`div`,{style:{fontSize:13,fontWeight:600,color:`var(--text-primary)`},children:e})},e))})]}),(0,U.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,U.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,U.jsx)(`div`,{style:{fontSize:48,marginBottom:16},children:`🚀`}),(0,U.jsx)(`h2`,{id:`network-coming-soon-title`,style:{fontSize:22,fontWeight:700,color:`var(--text-primary)`,marginBottom:12},children:`Coming Soon`}),(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,gap:12,marginBottom:24,flexWrap:`wrap`},children:[(0,U.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,U.jsx)(`span`,{style:{color:`var(--accent)`,fontSize:18,fontWeight:700},children:`↔`}),(0,U.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,U.jsx)(`span`,{style:{color:`var(--accent)`,fontSize:18,fontWeight:700},children:`↔`}),(0,U.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,U.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,U.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,U.jsx)(`span`,{children:e.icon}),` `,e.label]},e.label))})]})})]})]}):(0,U.jsxs)(`div`,{style:{display:`flex`,flex:1,flexDirection:`column`,minHeight:0,overflowY:`auto`,paddingBottom:16,gap:20},children:[(0,U.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,U.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,U.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,U.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,U.jsx)(`button`,{id:`automation-check-updates-btn`,onClick:()=>void ke(),disabled:he,style:{background:he?`var(--bg-tertiary)`:`var(--bg-elevated)`,color:he?`var(--text-tertiary)`:`var(--text-primary)`,border:`1px solid var(--border)`,borderRadius:6,padding:`6px 14px`,fontSize:11,fontWeight:600,cursor:he?`not-allowed`:`pointer`},children:he?`⏳ Checking...`:`🔎 Check All Updates`}),(0,U.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,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:e.map(e=>(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,U.jsx)(`span`,{style:{fontSize:13,fontWeight:600,color:`var(--text-primary)`},children:e.name}),(0,U.jsxs)(`span`,{style:{fontSize:10,color:`var(--text-tertiary)`,fontFamily:`var(--font-mono)`},children:[`v`,eV(``)]})]}),(0,U.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,U.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.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,U.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,U.jsx)(`button`,{id:`automation-trigger-research-btn`,onClick:()=>void Ae(),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`})]}),pe?(0,U.jsx)(`div`,{style:{textAlign:`center`,padding:20,color:`var(--text-tertiary)`,fontSize:12},children:`Loading research items...`}):de.length>0?(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:de.slice(0,8).map(e=>(0,U.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,U.jsxs)(`div`,{style:{flex:1},children:[(0,U.jsx)(`div`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.topic}),(0,U.jsxs)(`div`,{style:{fontSize:10,color:`var(--text-tertiary)`,marginTop:2},children:[e.priority,` priority · `,new Date(e.created_at).toLocaleDateString()]})]}),(0,U.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,U.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,U.jsxs)(`div`,{className:`card`,style:{padding:24,background:`rgba(18, 18, 26, 0.5)`,border:`1px solid var(--border)`},children:[(0,U.jsx)(`h3`,{id:`automation-improvements-heading`,style:{fontSize:14,fontWeight:700,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:.5,marginBottom:16,borderBottom:`1px solid var(--border)`,paddingBottom:8},children:`💡 Skill Improvement Queue`}),_e.length>0?(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:_e.map((e,t)=>(0,U.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,U.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:2,flexWrap:`wrap`},children:[(0,U.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-primary)`},children:e.skillName}),(0,U.jsx)(`span`,{style:{fontSize:9,fontWeight:700,padding:`2px 8px`,borderRadius:10,textTransform:`uppercase`,letterSpacing:.3,background:e.type===`eval_gap`?`rgba(245, 158, 11, 0.1)`:e.type===`missing_reference`?`rgba(59, 130, 246, 0.1)`:`rgba(139, 92, 246, 0.1)`,color:e.type===`eval_gap`?`#f59e0b`:e.type===`missing_reference`?`#60a5fa`:`#8b5cf6`,border:`1px solid ${e.type===`eval_gap`?`rgba(245, 158, 11, 0.2)`:e.type===`missing_reference`?`rgba(59, 130, 246, 0.2)`:`rgba(139, 92, 246, 0.2)`}`},children:e.type.replace(/_/g,` `)})]}),(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-secondary)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.description})]}),(0,U.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,U.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 aV(e){if(!e)return``;let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);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,U.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t},className:`markdown-preview-block`})}function oV(){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 pi();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 mi(n)).content)}catch(e){l(e.message||`Failed to load help details`)}finally{s(!1)}}e()},[n]),(0,U.jsxs)(`div`,{className:`page`,style:{padding:`24px`,maxWidth:`1100px`,margin:`0 auto`},children:[(0,U.jsxs)(`div`,{className:`page-header`,style:{marginBottom:`24px`},children:[(0,U.jsx)(`h1`,{children:`Help & CLI Reference`}),(0,U.jsx)(`p`,{children:`Offline docs for portable memory: CLI commands, vault layout, dream, tasks, and IDE connect.`})]}),c&&(0,U.jsxs)(`div`,{className:`badge badge-error`,style:{marginBottom:`16px`},children:[`⚠️ `,c]}),(0,U.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`260px 1fr`,gap:`30px`,minHeight:`500px`},children:[(0,U.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`10px`},children:e.map(e=>(0,U.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,U.jsx)(`div`,{style:{fontWeight:`bold`,fontSize:`14px`},children:e.title}),(0,U.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,U.jsx)(`div`,{style:{background:`var(--surface-bg)`,border:`1px solid var(--border)`,borderRadius:`12px`,padding:`30px`,overflowY:`auto`,maxHeight:`75vh`},children:o?(0,U.jsx)(`div`,{className:`skeleton`,style:{height:`400px`}}):(0,U.jsx)(`div`,{className:`markdown-body`,style:{color:`var(--text-primary)`,lineHeight:`1.7`,fontSize:`14px`},children:aV(i)})})]})]})}function sV({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([or(e).catch(()=>[]),Gr().catch(()=>({items:[]})),tr().catch(()=>[])]);n(t),i(r.items||[]),o(a)}catch(e){console.error(`Failed to load graph data`,e)}finally{c(!1)}}t()},[e]),(0,U.jsxs)(`div`,{className:`page`,style:{padding:0,height:`calc(100vh - 1px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,U.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,U.jsx)(`h1`,{style:{fontSize:`18px`,fontWeight:700,letterSpacing:`-0.02em`},children:`Memory Graph`}),(0,U.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,U.jsx)(`div`,{style:{flex:1,position:`relative`,overflow:`hidden`},children:s?(0,U.jsx)(`div`,{className:`skeleton`,style:{width:`100%`,height:`100%`}}):t.length===0&&r.length===0&&a.length===0?(0,U.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`var(--text-secondary)`},children:`No nodes found for graph`}):(0,U.jsx)(wi,{threads:a,memoryNodes:t,researchItems:r,onOpenThread:()=>{},onGroundMemoryNode:e=>{u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},selectedGroundingNodes:l})})]})}function cV(e,t=140){let n=e.body||e.content||e.excerpt||``;return n.length<=t?n:n.slice(0,t).trimEnd()+`…`}function lV(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 uV(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 dV({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 hi(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 ar())}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 lr(`
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,U.jsxs)(`div`,{className:`dashboard-wrapper`,children:[(0,U.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,U.jsxs)(`div`,{className:`dashboard-header-sticky`,children:[(0,U.jsxs)(`div`,{children:[(0,U.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,U.jsxs)(`p`,{style:{margin:`6px 0 0`,color:`var(--text-secondary)`,fontSize:15},children:[`Overview for `,(0,U.jsx)(`strong`,{style:{color:`var(--text-primary)`,fontWeight:600},children:uV(e)})]})]}),(0,U.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,U.jsx)(`button`,{className:`btn-ghost`,onClick:()=>y(!_),children:_?`Hide Operations`:`⚙️ Operations`})})]}),(0,U.jsxs)(`div`,{className:`stat-grid`,children:[(0,U.jsxs)(`div`,{className:`stat-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,U.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,U.jsx)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`},children:`Syncing...`}):(0,U.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,U.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`,fontWeight:500,textTransform:`uppercase`,letterSpacing:.5,marginBottom:4},children:`OpenWiki Nodes`}),(0,U.jsx)(`div`,{style:{fontSize:36,fontWeight:700,color:`var(--text-primary)`,lineHeight:1},children:r})]}),(0,U.jsxs)(`div`,{className:`stat-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,U.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,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[s?.status!==`unreachable`&&(0,U.jsx)(`div`,{className:`pulse-dot`}),(0,U.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:s?.status===`unreachable`?`#ef4444`:`#10b981`},children:s?.status===`unreachable`?`Offline`:`Online`})]})]}),(0,U.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`,fontWeight:500,textTransform:`uppercase`,letterSpacing:.5,marginBottom:4},children:`Server Status`}),(0,U.jsx)(`div`,{style:{fontSize:28,fontWeight:600,color:`var(--text-primary)`,lineHeight:1.2},children:s?.version?`v${s.version}`:`Unknown`})]}),(0,U.jsxs)(`div`,{className:`stat-card`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,U.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,U.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,U.jsx)(`div`,{style:{fontSize:13,color:`var(--text-secondary)`,fontWeight:500,textTransform:`uppercase`,letterSpacing:.5,marginBottom:4},children:`Daemon Process`}),(0,U.jsx)(`div`,{style:{fontSize:28,fontWeight:600,color:`var(--text-primary)`,lineHeight:1.2,textTransform:`capitalize`},children:s?.daemon||`Offline`})]})]}),_&&(0,U.jsxs)(`div`,{className:`stat-card`,style:{marginBottom:32,padding:32,animation:`fade-in 0.3s ease-out`},children:[(0,U.jsx)(`h2`,{style:{fontSize:18,fontWeight:600,margin:`0 0 20px`},children:`Repository Operations`}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:16,alignItems:`flex-end`,flexWrap:`wrap`},children:[(0,U.jsxs)(`div`,{style:{flex:1,minWidth:280},children:[(0,U.jsx)(`label`,{style:{display:`block`,fontSize:13,color:`var(--text-secondary)`,marginBottom:8,fontWeight:500},children:`Target Directory`}),(0,U.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,U.jsx)(`button`,{className:`btn-ghost`,onClick:()=>k(`npx -y openwiki --init`),disabled:p,children:p?`⏳ Working...`:`Initialize OpenWiki`}),(0,U.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,U.jsx)(`div`,{className:`terminal-log`,style:{borderColor:h?`rgba(239, 68, 68, 0.4)`:`rgba(255,255,255,0.08)`},children:d})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20},children:[(0,U.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,margin:0},children:`Knowledge Graph`}),(0,U.jsxs)(`span`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:[b.length,` nodes loaded`]})]}),S?(0,U.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 20px`,color:`var(--text-secondary)`,fontSize:15},children:[(0,U.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,U.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`}),(0,U.jsx)(`div`,{children:`Syncing nodes...`})]}):b.length===0?(0,U.jsxs)(`div`,{className:`stat-card`,style:{textAlign:`center`,padding:`64px 24px`},children:[(0,U.jsx)(`div`,{style:{fontSize:48,marginBottom:16,opacity:.8},children:`📭`}),(0,U.jsx)(`h3`,{style:{fontSize:18,margin:`0 0 8px`},children:`No Knowledge Nodes Found`}),(0,U.jsxs)(`p`,{style:{color:`var(--text-secondary)`,fontSize:14,maxWidth:440,margin:`0 auto 24px`,lineHeight:1.6},children:[`The vault for `,(0,U.jsx)(`strong`,{children:uV(e)}),` is empty. Use the operations panel to ingest a repository or change your active brain.`]}),(0,U.jsx)(`button`,{className:`btn-primary`,onClick:()=>y(!0),children:`Open Operations`})]}):(0,U.jsx)(`div`,{className:`node-grid`,children:b.map(e=>{let t=lV(e.category);return(0,U.jsxs)(`div`,{className:`node-card`,onClick:()=>T(e),children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,marginBottom:12},children:[(0,U.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,margin:0,lineHeight:1.3,color:`#f8fafc`},children:e.title}),(0,U.jsxs)(`div`,{className:`node-badge`,style:{background:t.bg,color:t.fg},children:[t.icon,` `,e.category]})]}),(0,U.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:13,lineHeight:1.6,margin:`0 0 16px`,flex:1},children:cV(e)}),e.tags&&e.tags.length>0&&(0,U.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:[e.tags.slice(0,4).map(e=>(0,U.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,U.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,U.jsx)(`div`,{className:`drawer-overlay`,onClick:e=>{E.current&&!E.current.contains(e.target)&&T(null)},children:(0,U.jsxs)(`div`,{className:`drawer-panel`,ref:E,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:32},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:12},children:[(()=>{let e=lV(w.category);return(0,U.jsxs)(`span`,{className:`node-badge`,style:{background:e.bg,color:e.fg},children:[e.icon,` `,w.category]})})(),(0,U.jsx)(`span`,{style:{fontSize:13,color:`var(--text-tertiary)`,fontFamily:`var(--font-mono)`},children:w.slug})]}),(0,U.jsx)(`h2`,{style:{fontSize:28,fontWeight:700,margin:0,lineHeight:1.2},children:w.title})]}),(0,U.jsx)(`button`,{className:`btn-ghost`,onClick:()=>T(null),style:{padding:`8px 12px`,fontSize:16},children:`✕`})]}),(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,marginBottom:4},children:`Importance`}),(0,U.jsxs)(`div`,{style:{fontSize:14,fontWeight:600},children:[w.importance,`/5`]})]}),w.modality&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,marginBottom:4},children:`Modality`}),(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:600,textTransform:`capitalize`},children:w.modality})]}),w.priority&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,marginBottom:4},children:`Priority`}),(0,U.jsx)(`div`,{style:{fontSize:14,fontWeight:600,textTransform:`capitalize`},children:w.priority})]})]}),(0,U.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,U.jsxs)(`div`,{style:{marginTop:24},children:[(0,U.jsx)(`div`,{style:{fontSize:13,color:`var(--text-tertiary)`,marginBottom:8,fontWeight:500},children:`TAGS`}),(0,U.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:w.tags.map(e=>(0,U.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,U.jsxs)(`div`,{style:{marginTop:24},children:[(0,U.jsx)(`div`,{style:{fontSize:13,color:`var(--text-tertiary)`,marginBottom:8,fontWeight:500},children:`RELATED NODES`}),(0,U.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:w.related.map(e=>(0,U.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))})]})]})})]})}var fV=`tr-onboarding-v1`,pV=[{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 mV(){try{return JSON.parse(localStorage.getItem(fV)||`{}`)}catch{return{step:0}}}function hV(e){localStorage.setItem(fV,JSON.stringify(e)),e.complete&&localStorage.setItem(`tr-onboarding-complete`,`1`)}function gV(){return localStorage.getItem(`tr-onboarding-complete`)===`1`}function _V(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 vV(){let e=it(),t=mV(),[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=pV[Math.min(n,pV.length-1)];(0,v.useEffect)(()=>{or().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&&!gV()&&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(``)}),Er().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,pV.length-1);r(e),hV({step:e,fact:i}),s(``)}function k(){let e=Math.max(n-1,0);r(e),hV({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(_V(g));let e=await Dr(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 Or({keys:e,pairs:y,overwrite:!1}):await Or({keys:e,overwrite:!1});s(`Imported ${t.imported_count} secret(s)`+(t.skipped_count?`, skipped ${t.skipped_count} already set`:``)+`.`),T===`scan`?(p((await Er()).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 ee(){if(!i.trim()){s(`Write a short fact or preference first.`);return}l(!0),s(``);try{await ti({slug:`onboarding-first-memory`,category:`preferences`,title:`Onboarding first memory`,content:i.trim(),tags:[`onboarding`],importance:4});try{await Xr()}catch{}s(`Saved and queued surface compile.`),hV({step:n,fact:i}),O()}catch(e){s(e instanceof Error?e.message:`Failed to save memory`)}finally{l(!1)}}function F(){hV({step:pV.length-1,fact:i,complete:!0}),e(`/memory`)}let I=Math.round((n+1)/pV.length*100);return(0,U.jsxs)(`div`,{className:`onboarding-shell`,children:[D.id===`welcome`&&(0,U.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,U.jsx)(yi,{variant:`lockup`,height:64,alt:`Total Recall`})}),(0,U.jsxs)(`div`,{style:{marginBottom:28},children:[(0,U.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:10,letterSpacing:`0.08em`,textTransform:`uppercase`,fontWeight:600},children:[`Onboarding · `,n+1,`/`,pV.length]}),(0,U.jsx)(`div`,{className:`onboarding-progress`,children:(0,U.jsx)(`div`,{style:{width:`${I}%`}})})]}),(0,U.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,U.jsx)(`p`,{style:{fontSize:15.5,lineHeight:1.6,color:`var(--text-secondary)`,margin:`0 0 28px`},children:D.body}),D.id===`welcome`&&(0,U.jsxs)(`div`,{className:`loop-card`,style:{marginBottom:24},children:[`write\xA0\xA0→ remember / session ingest`,(0,U.jsx)(`br`,{}),`sleep\xA0\xA0→ dream (consolidate, conflict, compile)`,(0,U.jsx)(`br`,{}),`read\xA0\xA0\xA0→ recall + compiled surfaces`,(0,U.jsx)(`br`,{}),`async\xA0\xA0→ daemon tasks (any intent under policy)`]}),D.id===`import-env`&&(0,U.jsxs)(`div`,{style:{marginBottom:24},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:14},children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>E(`scan`),style:T===`scan`?wV:TV,children:`Scan machine`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{E(`paste`),p([]),h(new Set)},style:T===`paste`?wV:TV,children:`Paste .env`})]}),T===`paste`&&(0,U.jsxs)(`div`,{style:{marginBottom:14},children:[(0,U.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,U.jsx)(`button`,{type:`button`,disabled:c,onClick:N,style:{...xV,marginTop:8},children:`Preview keys in paste`})]}),C&&(0,U.jsx)(`p`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:`Scanning env sources…`}),x&&(0,U.jsx)(`p`,{style:{fontSize:13,color:`#f87171`,marginBottom:12},children:x}),!C&&f.length===0&&!x&&(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:10,flexWrap:`wrap`},children:[(0,U.jsx)(`button`,{type:`button`,onClick:j,style:CV,children:`Select new`}),(0,U.jsx)(`button`,{type:`button`,onClick:M,style:CV,children:`Clear`}),(0,U.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`,alignSelf:`center`},children:[m.size,` selected · values never shown raw`]})]}),(0,U.jsx)(`div`,{style:{maxHeight:280,overflowY:`auto`,border:`1px solid var(--border)`,borderRadius:12,marginBottom:12},children:f.map(e=>(0,U.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,U.jsx)(`input`,{type:`checkbox`,checked:m.has(e.key),disabled:!!e.already_set,onChange:()=>A(e.key),style:{accentColor:`#3b82f6`}}),(0,U.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,U.jsxs)(`div`,{style:{fontSize:12,fontWeight:600,fontFamily:`ui-monospace, monospace`},children:[e.key,e.provider&&(0,U.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#93c5fd`,fontWeight:500},children:e.provider}),e.already_set&&(0,U.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#34d399`},children:`already set`})]}),(0,U.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:2},children:[e.masked,` · `,e.source_label]})]})]},e.key+e.source_label))}),(0,U.jsx)(`button`,{type:`button`,disabled:c||m.size===0,onClick:P,style:{...bV,opacity:c||m.size===0?.5:1,cursor:c||m.size===0?`not-allowed`:`pointer`},children:c?`Importing…`:`Import ${m.size} secret(s)`})]}),(0,U.jsxs)(`p`,{style:{marginTop:14,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI: `,(0,U.jsx)(`code`,{children:`npx total-recall secret import-env --all`}),` · `,(0,U.jsx)(wn,{to:`/keys`,style:{color:`var(--accent)`},children:`Secrets page`})]})]}),D.id===`remember`&&(0,U.jsxs)(`div`,{style:{marginBottom:24},children:[(0,U.jsx)(`label`,{style:{fontSize:12,fontWeight:600,color:`var(--text-tertiary)`,display:`block`,marginBottom:8},children:`First memory (fact or preference)`}),(0,U.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,U.jsx)(`button`,{type:`button`,disabled:c,onClick:ee,style:{...bV,marginTop:12},children:c?`Saving…`:`Save to vault & continue`})]}),D.id===`connect`&&(0,U.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,U.jsx)(`code`,{style:yV,children:`npx total-recall connect claude-code`}),(0,U.jsx)(`code`,{style:yV,children:`npx total-recall connect cursor`}),(0,U.jsx)(`code`,{style:yV,children:`npx total-recall connect http-api --brain http://localhost:3000`}),(0,U.jsx)(wn,{to:`/integrations`,style:{fontSize:13,color:`var(--accent)`},children:`Open Integrations page →`})]}),D.id===`dream`&&(0,U.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,U.jsx)(`code`,{style:yV,children:`npx total-recall dream`}),(0,U.jsx)(`code`,{style:yV,children:`npx total-recall daemon start # optional background worker`}),(0,U.jsx)(`code`,{style:yV,children:`npx total-recall task add "Extract decisions from last session" --cap vault:write`}),(0,U.jsx)(wn,{to:`/tasks`,style:{fontSize:13,color:`var(--accent)`},children:`Open Tasks page →`})]}),D.id===`done`&&(0,U.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,U.jsxs)(`div`,{style:{marginTop:12,display:`flex`,gap:12,flexWrap:`wrap`},children:[(0,U.jsx)(wn,{to:`/`,style:SV,children:`Open Chat`}),(0,U.jsx)(wn,{to:`/memory`,style:SV,children:`Open Vault`}),(0,U.jsx)(wn,{to:`/integrations`,style:SV,children:`Connect IDE`})]})]}),o&&(0,U.jsx)(`p`,{style:{fontSize:13,color:o.startsWith(`Saved`)||o.startsWith(`Imported`)||o.startsWith(`Found`)?`#22c55e`:`#f59e0b`,marginBottom:16},children:o}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:10,justifyContent:`space-between`},children:[(0,U.jsx)(`button`,{type:`button`,onClick:k,disabled:n===0,style:xV,children:`Back`}),(0,U.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[D.id!==`done`&&D.id!==`remember`&&(0,U.jsx)(`button`,{type:`button`,onClick:O,style:bV,children:(D.id,`Continue`)}),D.id===`import-env`&&(0,U.jsx)(`button`,{type:`button`,onClick:O,style:xV,children:`Skip for now`}),D.id===`remember`&&(0,U.jsx)(`button`,{type:`button`,onClick:O,style:xV,children:`Skip for now`}),D.id===`done`&&(0,U.jsx)(`button`,{type:`button`,onClick:F,style:bV,children:`Go to Memory`})]})]}),(0,U.jsxs)(`p`,{style:{marginTop:32,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI-first: `,(0,U.jsx)(`code`,{children:`init → secret import-env --all → connect → remember → dream`})]}),n<pV.length-1&&(0,U.jsx)(`button`,{type:`button`,onClick:F,style:{...xV,marginTop:16,width:`100%`},children:`Skip onboarding → Memory`})]})}var yV={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`},bV={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)`},xV={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},SV={...xV,textDecoration:`none`,display:`inline-block`},CV={...xV,padding:`5px 10px`,fontSize:11},wV={...bV,padding:`8px 14px`,fontSize:12},TV={...xV,padding:`8px 14px`,fontSize:12};function EV({ok:e,label:t}){return(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,U.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 DV({onLogout:e,health:t,activeBrainId:n,onBrainChange:r}){return(0,U.jsxs)(`aside`,{className:`sidebar`,children:[(0,U.jsxs)(`div`,{className:`sidebar-brand`,children:[(0,U.jsx)(`div`,{className:`sidebar-brand-lockup`,title:`Total Recall`,children:(0,U.jsx)(yi,{variant:`lockup`,height:48,alt:`Total Recall`})}),(0,U.jsx)(`span`,{style:{paddingLeft:2},children:`Portable memory · any IDE`})]}),(0,U.jsxs)(`nav`,{className:`sidebar-nav`,children:[(0,U.jsx)(`div`,{className:`nav-section-label`,children:`Memory`}),!gV()&&(0,U.jsxs)(Tn,{to:`/onboarding`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-onboarding`,children:[(0,U.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,U.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,U.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,U.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup`]}),(0,U.jsxs)(Tn,{to:`/`,end:!0,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-chat`,children:[(0,U.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,U.jsx)(`path`,{d:`M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z`})}),`Chat`]}),(0,U.jsxs)(Tn,{to:`/memory`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-memory`,children:[(0,U.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,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`path`,{d:`M12 16v-4M12 8h.01`})]}),`Vault`]}),(0,U.jsxs)(Tn,{to:`/graph`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-graph`,children:[(0,U.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,U.jsx)(`circle`,{cx:`5`,cy:`6`,r:`2`}),(0,U.jsx)(`circle`,{cx:`19`,cy:`6`,r:`2`}),(0,U.jsx)(`circle`,{cx:`12`,cy:`18`,r:`2`}),(0,U.jsx)(`path`,{d:`M7 7l4 9M17 7l-4 9`})]}),`Graph`]}),(0,U.jsxs)(Tn,{to:`/tasks`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-tasks`,children:[(0,U.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,U.jsx)(`path`,{d:`M9 11l3 3L22 4`}),(0,U.jsx)(`path`,{d:`M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11`})]}),`Tasks`]}),(0,U.jsx)(`div`,{className:`nav-section-label`,children:`Connect`}),(0,U.jsxs)(Tn,{to:`/integrations`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-integrations`,children:[(0,U.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,U.jsx)(`path`,{d:`M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71`}),(0,U.jsx)(`path`,{d:`M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71`})]}),`IDEs`]}),(0,U.jsxs)(Tn,{to:`/skills`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-skills`,children:[(0,U.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,U.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5`})}),`Skills`]}),(0,U.jsxs)(Tn,{to:`/openwiki`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-openwiki`,children:[(0,U.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,U.jsx)(`path`,{d:`M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2z`}),(0,U.jsx)(`path`,{d:`M22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7z`})]}),`OpenWiki`]}),(0,U.jsx)(`div`,{className:`nav-section-label`,children:`Account`}),(0,U.jsxs)(Tn,{to:`/keys`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-keys`,children:[(0,U.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,U.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,U.jsxs)(Tn,{to:`/settings`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-settings`,children:[(0,U.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,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,U.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,U.jsxs)(Tn,{to:`/help`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-help`,children:[(0,U.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,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`path`,{d:`M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3`}),(0,U.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),`Help`]}),gV()&&(0,U.jsxs)(Tn,{to:`/onboarding`,className:({isActive:e})=>`nav-link ${e?`active`:``}`,id:`nav-onboarding-replay`,style:{opacity:.75},children:[(0,U.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,U.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,U.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,U.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup guide`]})]}),(0,U.jsxs)(`div`,{className:`sidebar-footer`,style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,U.jsx)($B,{activeBrainId:n,onBrainChange:r}),(0,U.jsxs)(`select`,{value:Un(),onChange:e=>Wn(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,U.jsx)(`option`,{value:``,children:`Local API`}),void 0]}),(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`style`,{children:`@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }`}),r?(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,U.jsx)(`span`,{className:`pulse`}),` All Systems Go`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(EV,{ok:!!n,label:n?`Server online`:`Server offline`}),(0,U.jsx)(EV,{ok:e,label:e?`Daemon`:`Daemon `+(t?.daemon??`unknown`)})]})]}):(0,U.jsx)(`div`,{style:{color:`var(--text-tertiary)`},children:`Checking…`})})()}),(0,U.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,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`path`,{d:`M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4`}),(0,U.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,U.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]}),`Sign out`]})]})]})]})}function OV(){let e=tt();return!gV()&&e.pathname!==`/onboarding`?(0,U.jsx)(kt,{to:`/onboarding`,replace:!0}):null}function kV({activeBrainId:e,onBrainChange:t}){let n=tt(),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,U.jsxs)(`main`,{className:`main-content`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,position:`relative`},children:[(0,U.jsx)(OV,{}),(0,U.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,U.jsxs)(`div`,{style:{padding:`8px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,U.jsxs)(`span`,{style:{fontSize:12,fontWeight:600,display:`flex`,alignItems:`center`,gap:8},children:[(0,U.jsx)(`img`,{src:`/brand/total-recall-icon.svg`,alt:``,width:18,height:18,style:{borderRadius:4}}),`Total Recall`]}),(0,U.jsx)(`button`,{onClick:()=>a(!1),style:{background:`none`,border:`none`,cursor:`pointer`,color:`var(--text-tertiary)`},children:`✖`})]}),(0,U.jsx)(Oi,{activeBrainId:e,onBrainChange:t})]}),(!r||i)&&(0,U.jsx)(`div`,{style:{flex:1,overflow:`auto`},children:(0,U.jsxs)(jt,{children:[(0,U.jsx)(B,{path:`/`,element:(0,U.jsx)(kt,{to:gV()?`/openwiki`:`/onboarding`,replace:!0})}),(0,U.jsx)(B,{path:`/chat`,element:(0,U.jsx)(Oi,{activeBrainId:e})}),(0,U.jsx)(B,{path:`/onboarding`,element:(0,U.jsx)(vV,{})}),(0,U.jsx)(B,{path:`/memory`,element:(0,U.jsx)(Ai,{activeBrainId:e})}),(0,U.jsx)(B,{path:`/graph`,element:(0,U.jsx)(sV,{activeBrainId:e})}),(0,U.jsx)(B,{path:`/tasks`,element:(0,U.jsx)(Fi,{})}),(0,U.jsx)(B,{path:`/skills`,element:(0,U.jsx)(iV,{})}),(0,U.jsx)(B,{path:`/openwiki`,element:(0,U.jsx)(dV,{activeBrainId:e})}),(0,U.jsx)(B,{path:`/integrations`,element:(0,U.jsx)(ZB,{})}),(0,U.jsx)(B,{path:`/keys`,element:(0,U.jsx)(BB,{})}),(0,U.jsx)(B,{path:`/settings`,element:(0,U.jsx)(ji,{})}),(0,U.jsx)(B,{path:`/help`,element:(0,U.jsx)(oV,{})}),(0,U.jsx)(B,{path:`/vault`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`/inbox`,element:(0,U.jsx)(kt,{to:`/tasks`,replace:!0})}),(0,U.jsx)(B,{path:`/automations`,element:(0,U.jsx)(kt,{to:`/tasks`,replace:!0})}),(0,U.jsx)(B,{path:`/files`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`/sandbox`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`/models`,element:(0,U.jsx)(kt,{to:`/settings`,replace:!0})}),(0,U.jsx)(B,{path:`/health`,element:(0,U.jsx)(kt,{to:`/settings`,replace:!0})}),(0,U.jsx)(B,{path:`/usage`,element:(0,U.jsx)(kt,{to:`/settings`,replace:!0})}),(0,U.jsx)(B,{path:`/collab`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`/instructions`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`/design`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`/okf`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})}),(0,U.jsx)(B,{path:`*`,element:(0,U.jsx)(kt,{to:`/memory`,replace:!0})})]})})]})}var AV=`total-recall-active-brain`;function jV(){let[e,t]=(0,v.useState)(`loading`),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(()=>localStorage.getItem(AV)||`global`);(0,v.useEffect)(()=>{localStorage.setItem(AV,i)},[i]),(0,v.useEffect)(()=>(Kn(()=>t(`unauthed`)),()=>{}),[]),(0,v.useEffect)(()=>{qn().then(e=>t(e?`authed`:`unauthed`))},[]),(0,v.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await ar();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 Qn(),t(`unauthed`)}function s(){t(`authed`)}return e===`loading`?(0,U.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,U.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,U.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,U.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):e===`unauthed`?(0,U.jsx)(bi,{onAuthenticated:s}):(0,U.jsx)(xn,{children:(0,U.jsxs)(`div`,{className:`app-layout`,children:[(0,U.jsx)(DV,{onLogout:o,health:n,activeBrainId:i,onBrainChange:a}),(0,U.jsx)(kV,{activeBrainId:i,onBrainChange:a})]})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(v.StrictMode,{children:(0,U.jsx)(jV,{})}));